diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 76c414f..0000000 --- a/.gitignore +++ /dev/null @@ -1,40 +0,0 @@ -# -# Untracked directories -# -src/AddressBook/bin -src/AddressBook/obj -src/ProtocolBuffers/bin/ -src/ProtocolBuffers/obj/ -src/ProtocolBuffers/objCF -src/ProtocolBuffers.Test/bin/ -src/ProtocolBuffers.Test/obj/ -src/ProtocolBuffersLite.Test/bin/ -src/ProtocolBuffersLite.Test/obj/ -src/ProtoBench/bin/ -src/ProtoBench/obj/ -src/ProtoDump/bin/ -src/ProtoDump/obj/ -src/ProtoGen/bin/ -src/ProtoGen/obj/ -src/ProtoGen.Test/bin/ -src/ProtoGen.Test/obj/ -src/ProtoMunge/bin/ -src/ProtoMunge/obj/ -mono/bin -mono/tmp -mono/protoc -build_output -build_temp -build/msbuild*.log - -# -# Untracked files -# -*.user -*.suo -_ReSharper.* -*.sln.cache -mono/TestResult.xml -mono/.libs -mono/*.exe -mono/*.dll diff --git a/.hgignore b/.hgignore deleted file mode 100644 index 998d183..0000000 --- a/.hgignore +++ /dev/null @@ -1,23 +0,0 @@ -syntax: glob - -build_output/ -build_temp/ -bin/ -obj/ -*.cache -_ReSharper.* -*.user -*.suo -*.bat -*.zip -*.DotSettings -build/*.log -BenchmarkResults.txt - -lib/NUnit/tools/nunit-console.exe.config - -syntax: regexp -build/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,5}/ - -# Ignore Roslyn files -^src/.*\.sln\.ide/ \ No newline at end of file diff --git a/CHANGES.txt b/CHANGES.txt deleted file mode 100644 index 90e9d77..0000000 --- a/CHANGES.txt +++ /dev/null @@ -1,144 +0,0 @@ -=============================================================================== -Welcome to the C# port of Google Protocol Buffers, written by Jon Skeet -(skeet@pobox.com) based on the work of many talented people. - -For more information about this port, visit its homepage: -http://protobuf-csharp-port.googlecode.com - -For more information about Protocol Buffers in general, visit the project page -for the C++, Java and Python project: -http://protobuf.googlecode.com -=============================================================================== -RELEASE NOTES - Version 2.4.1.555 -=============================================================================== - -Changes: -- Upgrade solution format to Visual Studio 2012. -- Add the ability to print a builder (not just a message) -- TextGenerator introduces a new overload of PrintTo -- Munge protoc's error format into a VS-C#-compatible output format. -- Work to make ProtoGen clone that acts as a protoc.exe plugin. -- Added the AllowPartiallyTrustedCallers attribute -- Optimized enum parsing. - -Fixes: -- Fix for bug in limited input stream's Position, Introduced Position on - output stream -- Fix for writing a character to a JSON output overflows allocated buffer -- Optimize FromBase64String to return Empty when presented with empty string. -- Use string.Concat instead of operator to avoid potential import problems -- Issue 81: quoting for NUnit parameters. -- Issue 56: NuGet package is noisy -- Issue 70: Portable library project has some invalid Nunit-based code. -- Issue 71: CodedInputStream.ReadBytes go to slow path unnecessarily -- Issue 84: warning CS0219: The variable `size' is assigned but never used - -=============================================================================== -RELEASE NOTES - Version 2.4.1.521 -=============================================================================== - -Changes: -- Add generated_code_attributes option, defaulted to false -- Added support for Portable library -- Added 'Unsafe' static type in ByteString to allow direct buffer access - -Fixes: -- Issue 50: The XML serializer will fail to deserialize a message with empty - child message -- Issue 45: Use of 'item' as a field name causes AmbiguousMatchException -- Issue 49: Generated nested static Types class should be partial -- Issue 38: Disable CLSCompliant warnings (3021) -- Issue 40: proto_path does not work for command-line file names -- Issue 54: should retire all bytes in buffer (bufferSize) -- Issue 43: Fix to correct identical 'umbrella_classname' options from trying - to write to the same filename. - -=============================================================================== -RELEASE NOTES - Version 2.4.1.473 -=============================================================================== - -Features: -- Added option service_generator_type to control service generation with - NONE, GENERIC, INTERFACE, or IRPCDISPATCH -- Added interfaces IRpcDispatch and IRpcServerStub to provide for blocking - services and implementations. -- Added ProtoGen.exe command-line argument "--protoc_dir=" to specify the - location of protoc.exe. -- Extracted interfaces for ICodedInputStream and ICodedOutputStream to allow - custom implementation of writers with both speed and size optimizations. -- Addition of the "Google.ProtoBuffers.Serialization" assembly to support - reading and writing messages to/from XML, JSON, IDictionary<,> and others. -- Several performance related fixes and tweeks -- Issue 3: Add option to mark generated code with attribute -- Issue 20: Support for decorating classes [Serializable] -- Issue 21: Decorate fields with [deprecated=true] as [System.Obsolete] -- Issue 22: Reusable Builder classes -- Issue 24: Support for using Json/Xml formats with ICodedInputStream -- Issue 25: Added support for NuGet packages -- Issue 31: Upgraded protoc.exe and descriptor to 2.4.1 - -Fixes: -- Issue 13: Message with Field same name as message causes uncompilable .cs -- Issue 16: Does not integrate well with other tooling -- Issue 19: Support for negative enum values -- Issue 26: AddRange in GeneratedBuilder iterates twice. -- Issue 27: Remove XML documentation output from test projects to clear - warnings/errors. -- Issue 28: Circular message dependencies result in null default values for - Message fields. -- Issue 29: Message classes generated have a public default constructor. You - can disable private ctor generation with the option generate_private_ctor. -- Issue 35: Fixed a bug in ProtoGen handling of arguments with trailing \ -- Big-endian support for float, and double on Silverlight -- Packed and Unpacked parsing allow for all repeated, as per version 2.3 -- Fix for leaving Builder a public ctor on internal classes for use with - generic "where T: new()" constraints. - -Other: -- Changed the code signing key to a privately held key -- Reformatted all code and line-endings to C# defaults -- Reworking of performance benchmarks to produce reliable results, option /v2 -- Issue 34: Silverlight assemblies are now unit tested - -=============================================================================== -RELEASE NOTES - Version 2.3.0.277 -=============================================================================== - -Features: -- Added cls_compliance option to generate attributes indicating - non-CLS-compliance. -- Added file_extension option to control the generated output file's extension. -- Added umbrella_namespace option to place the umbrella class into a nested - namespace to address issues with proto files having the same name as a - message it contains. -- Added output_directory option to set the output path for the source file(s). -- Added ignore_google_protobuf option to avoid generating code for includes - from the google.protobuf package. -- Added the LITE framework (Google.ProtoBuffersLite.dll) and the ability to - generate code with "option optimize_for = LITE_RUNTIME;". -- Added ability to invoke protoc.exe from within ProtoGen.exe. -- Upgraded to protoc.exe (2.3) compiler. - -Fixes: -- Issue 9: Class cannot be static and sealed error -- Issue 12: default value for enumerate fields must be filled out - -Other: -- Rewrite of build using MSBbuild instead of NAnt -- Moved to NUnit Version 2.2.8.0 -- Changed to using secure .snk for releases - -=============================================================================== -RELEASE NOTES - Version 0.9.1 -=============================================================================== - -Fixes: -- issue 10: Incorrect encoding of packed fields when serialized - -=============================================================================== -RELEASE NOTES - Version 0.9.0 -=============================================================================== - -- Initial release - -=============================================================================== \ No newline at end of file diff --git a/DescriptorOptions.md b/DescriptorOptions.md new file mode 100644 index 0000000..45da584 --- /dev/null +++ b/DescriptorOptions.md @@ -0,0 +1,69 @@ +# Introduction # + +When generating C# source code from a `.proto` file, there are a number of options available. While the options for Java are built into protoc, those for ProtoGen are specified as extensions to the core descriptors. (Internally Protocol Buffers represents each of the elements of a .proto file - the messages, services, fields, enums etc - as Protocol Buffer messages. It's all very recursive.) The C# options are specified in http://code.google.com/p/protobuf-csharp-port/source/browse/protos/google/protobuf/csharp_options.proto csharp\_options.proto] which is in the `protos/google/protobuf` directory in the source distribution. + +# Importing csharp\_options.proto # + +To use the options, you have to have an appropriate import line in your `.proto` file. Currently you have to import the core `descriptor.proto` file as well, but this restriction will go away when the main project's release 2.0.3 comes out. So currently you need something like this: + +``` +import "google/protobuf/csharp_options.proto"; +import "google/protobuf/descriptor.proto"; +``` + +**Note**: For protoc.exe to find these files the path to the parent directory of 'google' above must be specified with the "--proto\_path=" option. + +There are currently two types of options: top-level ones which apply to the whole file (file descriptor options), and ones which apply to fields within a message (field descriptor options). + +# Top-level options # + +Top-level options are specified outside any messages, just like the options understood by protoc. The format is a little more cumbersome though: + +``` +option (google.protobuf.csharp_file_options).option_name = value; +``` + +Only one option can be set per line, even though they are both parts of the `csharp_file_options` message. For example, it's common to set the umbrella class name and the namespace, which takes two lines like this: + +``` +option (google.protobuf.csharp_file_options).namespace = "MyCompany.MyProject"; +option (google.protobuf.csharp_file_options).umbrella_classname = "ProjectProtos"; +``` + +The following top-level options are supported: + +| **Option** | **Type** | **Description** | +|:-----------|:---------|:----------------| +| **namespace** | String | Namespace for generated classes; defaults to the package. | +| **umbrella\_classname** | String | Name of the "umbrella" class used for metadata about all the messages within this file. Default is based on the name of the file. | +| **public\_classes** | Bool | Whether classes should be public (true) or internal (false). | +| **nest\_classes** | Bool | Whether to nest messages within a single umbrella class (true) or create the umbrella class as a peer, with messages as top-level classes in the namespace (false). | +| **code\_contracts** | Bool | Generate appropriate support for Code Contracts (Ongoing; support should improve over time) | +| **expand\_namespace\_directories** | Bool | Create subdirectories for namespaces, e.g. namespace "Foo.Bar" would generate files within {output directory}/Foo/Bar. | +| **cls\_compliance** | Bool | Generate attributes indicating non-CLS-compliance. | +| **file\_extension** | String | The extension that should be appended to the umbrella\_classname when creating files. | +| **umbrella\_namespace** | String | A nested namespace for the umbrella class. Helpful for name collisions caused by umbrella\_classname conflicting with an existing type. This will be automatically set to 'Proto' if a collision is detected with types being generated. This value is ignored when nest\_classes is true. | +| **output\_directory** | String | The output path for the source file(s) generated, default is the current directory. | +| **ignore\_google\_protobuf** | Bool | Will ignore the type generations and remove dependencies for the descriptor proto files that declare their package to be "google.protobuf". This is useful to disable the generation of CsharpOptions.cs. | + +# Field options # + +Field-level options are specified within a field definition, like this: + +``` +optional string some_field = 10 [(google.protobuf.csharp_field_options).option_name = value]; +``` + +For example, to specify the property name explicitly you might have something like: + +``` +message Example { + optional int32 delay = 10 [(google.protobuf.csharp_field_options).property_name = "DelayMs"]; +} +``` + +The following field options are supported: + +| **Option** | **Type** | **Description** | +|:-----------|:---------|:----------------| +| **property\_name** | String | Provides the ability to override the name of the property generated for this field. This is applied to all properties and methods to do with this field, including HasFoo, FooCount, FooList etc. | \ No newline at end of file diff --git a/DifferencesToJava.md b/DifferencesToJava.md new file mode 100644 index 0000000..56dc7e4 --- /dev/null +++ b/DifferencesToJava.md @@ -0,0 +1,11 @@ +This C# port was designed from the outset to be like the Java code, but with a familiar C# feel to it. There are alternative projects which build more code dynamically at execution time, etc. Some of that may become part of this project eventually, but at the moment the core looks quite like the Java code. Most of the natural differences between Java and C# are hidden under the covers, but some differences are user-visible. Of course, this in no way reduces the portability between the two - anything data serialized by the C# code should be able to be deserialized by the Java code, and vice versa. + +Currently this list is just a brain dump. Eventually it may be more usefully categorised. + + * C#-style properties instead of getter and setter methods. This is pretty much a given, but it's worth noting that the builders still have `SetXXX` methods which return `this` at the end to allow fluent building in C# 2 code. + * More complicated generic interfaces. The core Java interfaces (`Message` and `Builder`) are non-generic. In C#, there are up to three levels of genericity: `IMessage` extends `IMessage` which extends `IMessage`, and `IBuilder` extends `IBuilder`. Most of the time the caller doesn't need to care about this, but it can get quite confusing if you're dabbling in the core. I've tried multiple solutions, and this appears to be the neatest balance of type safety and flexibility. + * Public constructors for builder types. C# 3 object initializers allow a fairly concise syntax for building messages - but this is **only** available when directly calling a constructor (instead of a factory method). For example: + +``` +Person jon = new Person.Builder { Name="Jon", Company="Google" }.Build(); +``` diff --git a/GettingStarted.md b/GettingStarted.md new file mode 100644 index 0000000..f840560 --- /dev/null +++ b/GettingStarted.md @@ -0,0 +1,150 @@ +# Pre-requisites # + +Rather than reproduce all the documentation of the main [Google Protocol Buffers project page](http://code.google.com/p/protobuf/), I'll just reference it - so please read at least [the language guide](http://code.google.com/apis/protocolbuffers/docs/proto.html) before going any further. The rest of the wiki assumes you already know the basics of Protocol Buffers. Likewise, currently the project only works on Windows and .NET; when support is provided for Mono on other platforms, the documentation will be updated. + +First, either grab the [source](http://code.google.com/p/protobuf-csharp-port/source/checkout) or a [distribution](http://code.google.com/p/protobuf-csharp-port/downloads/list). All new development is now done in Mercurial on Google Code; the previous github repository is obsolete. + +If you fetched the source version, build the code. From the `build` directory, run (for a Release build for .NET 3.5): + + * `build NET35 Rebuild Release` + * `build NET35 BuildPackage Release` + +This will create a directory `build_output\Package` containing: + + * A `protos` directory with reference messages + * A `Protoc` directory containing `protoc.exe`. This is the native executable from the [main Protocol Buffers project](http://protobuf.googlecode.com). It's always possible that other versions of `protoc.exe` will work with this project (it's just a stock build) but obviously I'm more confident in the particular version supplied, simply because I know more about it. + * A `Release` directory containing all the release binaries: + * `Google.ProtocolBuffers.dll` - the main library + * `Google.ProtocolBuffersList.dll` - a lightweight version of the library with slightly less functionality, designed for constrained environments. + * [ProtoGen.exe](ProtoGen.md) - the source code generator + * [ProtoMunge.exe](ProtoMunge.md) - tool to remove sensitive data from binary messages + * [ProtoDump.exe](ProtoDump.md) - tool to dump a binary message as text + * [ProtoBench.exe](ProtoBench.md) - tool to run performance benchmarks on binary messages + +# Sample application: an address book # + +In-keeping with the sample provided in the main project, the C# port comes with an address book application so you can see the basics of how to get going with Protocol Buffers. The code is built as part of the normal build in the source distribution, but we'll take it step by step here. + +## The .proto file ## + +Let's start off with the `addressbook.proto` file which describes the messages. This lives in `protos/tutorial` in the source distribution. + +``` +package tutorial; + +import "google/protobuf/csharp_options.proto"; + +option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.Examples.AddressBook"; +option (google.protobuf.csharp_file_options).umbrella_classname = "AddressBookProtos"; + +option optimize_for = SPEED; + +message Person { + required string name = 1; + required int32 id = 2; // Unique ID number for this person. + optional string email = 3; + + enum PhoneType { + MOBILE = 0; + HOME = 1; + WORK = 2; + } + + message PhoneNumber { + required string number = 1; + optional PhoneType type = 2 [default = HOME]; + } + + repeated PhoneNumber phone = 4; +} + +// Our address book file is just one of these. +message AddressBook { + repeated Person person = 1; +} +``` + +This is mostly just the same as the file in the main Protocol Buffers project, but there are a few tweaks: + + * The Java options have been removed, just for simplicity. (If you want a single .proto file which can generate Java code and C# code, you just need the Java options _and_ the C# options. They don't conflict at all.) + * There's an import of `google/protobuf/csharp_options.proto` in order to use the C#-specific option extensions. + * There are two C#-specific options specified: + * The name of the class containing the descriptor representing the overall `.proto` file. (This is called the "umbrella" class.) The generated source file is also named after this class. In this case we're using `AddressBookProtos`. + * The namespace to use for all the generated classes. For the address book application we're using Google.ProtocolBuffers.Examples.AddressBook. + * The optimization flag is set to optimize for speed instead of code size. This does generate quite a lot more code, but it's a _lot_ faster. + +Other options are available - see DescriptorOptions for details. + +## Generating the source code ## + +For simplicity, I would recommend copying protoc.exe from the Protoc directory into the Release directory; ProtoGen.exe can spot the existence of protoc.exe in the current directory (or in the path) and run it automatically. This is simpler than the old "two step" approach. + +``` +protogen ..\protos\tutorial\addressbook.proto + ..\protos\google\protobuf\csharp_options.proto + ..\protos\google\protobuf\descriptor.proto + --proto_path=..\protos +``` + +That will create a collection of `.cs` files in the current directory. We only actually need `AddressBookProtos.cs` - the others are the dependencies (the core Protocol Buffers descriptors and the C# options). You can optionally ignore dependencies, and also specify the output directory as of version 2.3. + +We'll look into ways of making this slightly simpler... in particular, protogen now allows you to specify C# options on the command line, rather than in the proto file. + +**A few words of advice** + 1. Make sure that you do not use a non-ASCII encoding with your text file. The protoc.exe compiler will complain with the following message: +``` + tutorial/addressbook.proto:1:1: Expected top-level statement (e.g. "message"). +``` +> > The best way to fix this is with Visual Studio. Open the proto file and select "File" -> "Save as...". From the save dialog click the down arrow next to the save button and select "Save with Encoding". Select the "US-ASCII" codepage (near the bottom) and click save. + 1. It's often easiest keep all your proto files in a single directory tree. This allows to omit the --proto\_path option by running protoc.exe from the top of the this directory tree. Always keep the 'google/protobuf/`*`.proto' files available so that you can import them to specify options, or use the options through protogen. + 1. Unlike a programming language like `C#` it is usually expected that your proto file will specify numerous messages, not one. Name your proto files based on the namespace, not the message. Create proto files only as often as you would create a new namespace to organize those classes. + +# Example Usage # + +The following example uses the classes generated by the above proto file to perform these operations: + 1. Create a builder to construct a `Person` message + 1. Sets the field values of the builder + 1. Creates the `Person` immutable message class + 1. Writes the `Person` to a stream + 1. Creates a new `Person` from the bytes written + 1. Adds the `Person` to a new `AddressBook` + 1. Saves the `AddressBook` to bytes and recreates it + 1. Verifies the `AddressBook` contents + +``` + static void Sample() + { + byte[] bytes; + //Create a builder to start building a message + Person.Builder newContact = Person.CreateBuilder(); + //Set the primitive properties + newContact.SetId(1) + .SetName("Foo") + .SetEmail("foo@bar"); + //Now add an item to a list (repeating) field + newContact.AddPhone( + //Create the child message inline + Person.Types.PhoneNumber.CreateBuilder().SetNumber("555-1212").Build() + ); + //Now build the final message: + Person person = newContact.Build(); + //The builder is no longer valid (at least not now, scheduled for 2.4): + newContact = null; + using(MemoryStream stream = new MemoryStream()) + { + //Save the person to a stream + person.WriteTo(stream); + bytes = stream.ToArray(); + } + //Create another builder, merge the byte[], and build the message: + Person copy = Person.CreateBuilder().MergeFrom(bytes).Build(); + + //A more streamlined approach might look like this: + bytes = AddressBook.CreateBuilder().AddPerson(copy).Build().ToByteArray(); + //And read the address book back again + AddressBook restored = AddressBook.CreateBuilder().MergeFrom(bytes).Build(); + //The message performs a deep-comparison on equality: + if(restored.PersonCount != 1 || !person.Equals(restored.PersonList[0])) + throw new ApplicationException("There is a bad person in here!"); + } +``` \ No newline at end of file diff --git a/ProjectHome.md b/ProjectHome.md new file mode 100644 index 0000000..e9a04ed --- /dev/null +++ b/ProjectHome.md @@ -0,0 +1,13 @@ +"Protocol Buffers" is a binary serialization format and technology, released to the open source community by Google in 2008. + +There are various implementations of Protocol Buffers in .NET. This project is a fairly close port of the Google Java implementation. + +There are two main parts: + +`ProtoGen.exe`, which takes binary representations of protocol buffer descriptors (as generated by the "stock" protoc binary supplied by Google) and creates C# source code. This is only required at build time. + +`Google.ProtocolBuffers.dll`, which is a supporting library. This is required at execution time. + +As of April 2011, all development for this project will be performed in the [Google Code Mercurial repository](http://code.google.com/p/protobuf-csharp-port/source/checkout); the old [GitHub project](http://github.com/jskeet/dotnet-protobufs/tree/master) is obsolete. + +There is API documentation available [here](http://help.protobuffers.net/), which can also be downloaded as a [CHM file](http://help.protobuffers.net/protobuf-csharp-port.chm). \ No newline at end of file diff --git a/ProtoBench.md b/ProtoBench.md new file mode 100644 index 0000000..6bc6e06 --- /dev/null +++ b/ProtoBench.md @@ -0,0 +1,118 @@ +# Command line syntax # + +ProtoBench takes pairs of command line parameters - the first parameter describes the .NET type, including assembly name, to benchmark; the second parameter is a path to the file to benchmark against. + +So to benchmark `Project1.Type1` in `Assembly1.dll` against `message1.dat` and `Project2.Type2` in `Assembly2.dll` against `message2.dat` you'd use: + +``` +ProtoBench.exe Project1.Type1,Assembly1 message1.dat Project2.Type2,Assembly2 message2.dat +``` + +Note that you don't specify the file extension in the assembly name. Nested classes are indicated with "+" so you might have `Project3.ProtoWrapper+Message3,Assembly3` if you have nesting turned on. + +For further details on assembly-qualified type names, see [MSDN](http://msdn.microsoft.com/en-us/library/system.type.assemblyqualifiedname.aspx). + +Currently you must have the assembly containing the message type in the same directory as `ProtoBench.exe` due to the way the type is loaded - this restriction will be removed at a later date. + +_New feature under development:_ ProtoBench will soon support "benchmark scripts" - an easier way of configuring a sequence of tests. See below. + +# Results # + +Each type/message pair goes through the following steps: + + * Create the default message for the type + * Load the file (so we can deserialize) + * Build a sample message (so we can serialize) + +Then six benchmarks are run: + + * Serialize to `ByteString` + * Serialize to `byte[]` + * Serialize to `MemoryStream` + * Deserialize from `ByteString` + * Deserialize from `byte[]` + * Deserialize from `MemoryStream` + +For each benchmark, the action is run a few times so we can see how long it takes, and then run for a large number of iterations (without checking the time in between) where the number is chosen such that each benchmark lasts _roughly_ the same amount of time (30 seconds so far). + +The results are given in terms of number of iterations and time, as well as (most importantly) the serialization/deserialization speed in terms of megabytes per second. + +# Example # + + * From the root directory, build the release version of everything + * Go into the address book demo directory + * Run the address book demo and create a couple of entries + * Copy `ProtoBench.exe` to the same directory + * Run `ProtoBench.exe` + +``` +> nant -D:build-configuration=Release build +(build output) +> cd src\AddressBook\bin\Release +> AddressBook.exe +(add a couple of people) +> copy ..\..\..\..\dist\ProtoBench.exe . +> ProtoBench.exe Google.ProtocolBuffers.Examples.AddressBook.AddressBook,AddressBook addressbook.data + +Benchmarking Google.ProtocolBuffers.Examples.AddressBook.AddressBook,AddressBook with file addressbook.data +Serialize to byte string: 1842428 iterations in 5.479s; 40.410MB/s +Serialize to byte array: 1874759 iterations in 4.868s; 46.280MB/s +Serialize to memory stream: 1354615 iterations in 4.613s; 35.284MB/s +Deserialize from byte string: 785653 iterations in 5.110s; 18.474MB/s +Deserialize from byte array: 822291 iterations in 5.010s; 19.723MB/s +Deserialize from memory stream: 691115 iterations in 5.040s; 16.479MB/s +``` + +(The first command line argument to ProtoBench is slightly confusing, it's a class called `AddressBook` in the `Google.ProtocolBuffers.Examples.AddressBook` namespace, in an assembly called `AddressBook` - hence the repetition of `AddressBook` so many times!) + +# Current limitations # + + * The assembly containing the message type must be in the same directory as `ProtoBench.exe` + +# Benchmark scripts # + +_Feature under development_ + +Instead of only being able to specify options on the command line, you will soon be able to pass a command line argument specifying a script. A script contains a sequence of "test configurations" where each test configuration has default values from the previous one so only changes need to be specified. The final part of each configuration is a `run` command. It's probably easiest to demonstrate this with an example: + +``` +# Comments start with a hash + +# Empty lines are ignored +# Property names and values are trimmed + + +# Types are specified as namespace-qualified type names. Nested types +# still need to be specified with a + though: +type = Namespace.OuterType+NestedType + +# The assembly containing the message type is specified as a file relative to +# the working directory +assembly = ../bin/Assembly2.dll + +# The message file is specified as a file relative to the working directory +message = testdata/message1.dat + +# The number of iterations can be specified directly, or left at 0 to +# mean "auto-detect". Auto-detect mode uses two other properties: +# the time to try to run the main test for, and the sampling time +# used to guess at the number of iterations for the main test. +# Both are expressed in seconds +# These properties are ignored when the number of iterations is non-zero. +iterations = 10000 +# auto-detect-sample = 3 +# auto-detect-target = 30 + +# This runs the tests. There are currently 6 tests: +# from_byte_array, from_byte_string, from_stream +# to_byte_array, to_byte_string, to_stream +# These are grouped as "deserialization" and "serialization", and "all" +# runs everything. We may introduce more tests at a later date. +run all + +# Change to use a different data file - all the other settings stay the same +message = testdata/message2.dat + +# Just run the serialization tests +run serialization +``` \ No newline at end of file diff --git a/ProtoDump.md b/ProtoDump.md new file mode 100644 index 0000000..0f83c58 --- /dev/null +++ b/ProtoDump.md @@ -0,0 +1,63 @@ +# Command line syntax # + +ProtoDump takes two command line parameters - the first parameter describes the .NET type for the message, including assembly name; the second parameter is a path to the binary file to load and then convert to text. + +So to convert a message with a .NET type of `Project1.Type1` in `Assembly1.dll` against `message1.dat` and `Project2.Type2` in `Assembly2.dll` against `message2.dat` you'd use: + +``` +ProtoDump.exe Project1.Type1,Assembly1 message1.dat Project2.Type2,Assembly2 message2.dat +``` + +Note that you don't specify the file extension in the assembly name. Nested classes are indicated with "+" so you might have `Project3.ProtoWrapper+Message3,Assembly3` if you have nesting turned on. + +For further details on assembly-qualified type names, see [MSDN](http://msdn.microsoft.com/en-us/library/system.type.assemblyqualifiedname.aspx). + +Currently you must have the assembly containing the message type in the same directory as `ProtoDump.exe` due to the way the type is loaded - this restriction will be removed at a later date. + +# Example # + + * From the root directory, build everything + * Go into the address book demo directory + * Run the address book demo and create a couple of entries + * Copy `ProtoDump.exe` to the same directory (so it can load types from this directory) + * Run `ProtoDump.exe` + +``` +> nant build +(build output) +> cd src\AddressBook\bin\Debug +> AddressBook.exe +(add a couple of people) +> copy ..\..\..\..\dist\ProtoDump.exe . +> ProtoDump.exe Google.ProtocolBuffers.Examples.AddressBook.AddressBook,AddressBook addressbook.data +person { + name: "John Smith" + id: 1 + email: "johnsmith@protocolbufferdemo.org" + phone { + number: "555 12345678" + type: HOME + } + phone { + number: "555 87654321" + type: MOBILE + } +} +person { + name: "Jane Smith" + id: 2 + email: "janesmith@protocolbufferdemo.org" + phone { + number: "555 00000000" + type: WORK + } + phone { + number: "555 99999999" + type: HOME + } +} +``` + +# Current limitations # + + * The assembly containing the message type must be in the same directory as `ProtoDump.exe` \ No newline at end of file diff --git a/ProtoGen.md b/ProtoGen.md new file mode 100644 index 0000000..09aa568 --- /dev/null +++ b/ProtoGen.md @@ -0,0 +1,79 @@ +# Command line syntax # + +Versions prior to 2.3 just take a list of binary protocol message description files, as generated by `protoc` with the `--descriptor_set_out` command line parameter. You need to include imports in the generated file (with the `--include_imports`) parameter, and **all** messages will be generated. For example: + +``` +protogen addressbook.protobin +``` + +The address book example in the [getting started guide](GettingStarted.md) walks you through this. + +# Command line arguments # + +As of version 2.3 and later you can now specify any of the CSharp file descriptor options (see [CSharpFileOptions](http://code.google.com/p/protobuf-csharp-port/source/browse/protos/google/protobuf/csharp_options.proto#7)). To specify these options from the command line use the following syntax: +``` +ProtoGen.exe -{OPTION}={VALUE} +``` + +The following options are available: +| **Option** | **Type** | **Description** | +|:-----------|:---------|:----------------| +| **namespace** | String | Namespace for generated classes; defaults to the package. | +| **umbrella\_classname** | String | Name of the "umbrella" class used for metadata about all the messages within this file. Default is based on the name of the file. | +| **public\_classes** | Bool | Whether classes should be public (true) or internal (false). | +| **nest\_classes** | Bool | Whether to nest messages within a single umbrella class (true) or create the umbrella class as a peer, with messages as top-level classes in the namespace (false). | +| **code\_contracts** | Bool | Generate appropriate support for Code Contracts (Ongoing; support should improve over time) | +| **expand\_namespace\_directories** | Bool | Create subdirectories for namespaces, e.g. namespace "Foo.Bar" would generate files within {output directory}/Foo/Bar. | +| **cls\_compliance** | Bool | Generate attributes indicating non-CLS-compliance. | +| **file\_extension** | String | The extension that should be appended to the umbrella\_classname when creating files. | +| **umbrella\_namespace** | String | A nested namespace for the umbrella class. Helpful for name collisions caused by umbrella\_classname conflicting with an existing type. This will be automatically set to 'Proto' if a collision is detected with types being generated. This value is ignored when nest\_classes is true. | +| **output\_directory** | String | The output path for the source file(s) generated, default is the current directory. | +| **ignore\_google\_protobuf** | Bool | Will ignore the type generations and remove dependencies for the descriptor proto files that declare their package to be "google.protobuf". This is useful to disable the generation of CsharpOptions.cs. | + +In addition to the descriptor options, the following options are also available: +| **Option** | **Type** | **Description** | +|:-----------|:---------|:----------------| +| **line\_break** | Windows|Unix|Default | Configures the generator to use a specific type of line ending in the source files created. | + +# Running ProtoGen.exe with .proto files # + +For ease of use ProtoGen can now invoke protoc.exe for you simply by providing the proto files and optionally protoc.exe arguments on the command line. To specify options for protoc.exe use the following format only: +``` +ProtoGen.exe --{PROTOC-OPTION}={VALUE} +``` + +**Note:** You MUST use two dashes '-' for protoc options. To allow ProtoGen to call protoc.exe, protoc.exe must be located in the system PATH, or in the same directory. + +The following arguments are generally used with protoc.exe: +| **Option** | **Type** | **Description** | +|:-----------|:---------|:----------------| +| **proto\_path** | PATH | Specify the directory in which to search for imports. May be specified multiple times; directories will be searched in order. If not given, the current working directory is used. | +| **descriptor\_set\_out** | PATH | Writes a FileDescriptorSet (a protocol buffer, defined in descriptor.proto) containing all of the input files to FILE. If not specified the buffer will be removed after code generation. | +| **include\_imports** | n/a | When using --descriptor\_set\_out, also include all dependencies of the input files in the set, so that the set is self-contained. | +| **error\_format** | gcc|msvs | Set the format in which to print errors. FORMAT may be 'gcc' (the default) or 'msvs' (Microsoft Visual Studio format). | + +# Examples # + +For this example we will be building the protos\tutorial\addressbook.proto file located in the project. + +**Manually run both protoc.exe and protogen.exe** +``` +lib\protoc.exe --proto_path=./protos protos/tutorial/addressbook.proto --include_imports --descriptor_set_out=addressbook.pb +src\ProtoGen\bin\Debug\ProtoGen.exe addressbook.pb -output_directory=protos\tutorial +``` + +**Run both protoc.exe and protogen.exe with a single line** +``` +src\ProtoGen\bin\Debug\ProtoGen.exe --proto_path=./protos protos/tutorial/addressbook.proto --include_imports -output_directory=protos\tutorial +``` + +# Integration with Visual Studio # + +While neither ProtoGen nor protoc.exe directly support Visual Studio integration it is possible with 3rd-party tools. So here is a quick run-down on integration with my own tool: + + 1. Start by downloading one of the binary packages from the [csharptest-net](http://code.google.com/p/csharptest-net/downloads/list). + 1. Extract the "CmdTool.exe" file to a location on your hard drive. + 1. Follow the [Visual Studio Registration](http://help.csharptest.net/?CmdToolVisualStudio.html) steps by running "CmdTool.exe REGISTER". + 1. Copy one of the [ProtoGen Sample Configurations](http://help.csharptest.net/?CmdToolIntegrateProtoGen.html) to a file called "CmdTool.config" and place in the root directory containing your .proto files. + 1. Open Visual Studio and add the .proto files to your project. + 1. Right-click the .proto file and select Properties, then enter "CmdTool" under the "Custom Tool" property. \ No newline at end of file diff --git a/ProtoMunge.md b/ProtoMunge.md new file mode 100644 index 0000000..fa4a2fd --- /dev/null +++ b/ProtoMunge.md @@ -0,0 +1,65 @@ +# Command line syntax # + +` ProtoMunge ` + +ProtoMunge takes three command line parameters - the first parameter describes the .NET type for the message, including assembly name; the second parameter is the binary file to load and the third parameter is the path to file to save the result to. + +So to "munge" a message with a .NET type of `Project1.Type1` in `Assembly1.dll` against `message1.dat` and `Project2.Type2` in `Assembly2.dll` against `message2.dat` you'd use: + +``` +ProtoDump.exe Project1.Type1,Assembly1 message1.dat Project2.Type2,Assembly2 message2.dat +``` + +Note that you don't specify the file extension in the assembly name. Nested classes are indicated with "+" so you might have `Project3.ProtoWrapper+Message3,Assembly3` if you have nesting turned on. + +For further details on assembly-qualified type names, see [MSDN](http://msdn.microsoft.com/en-us/library/system.type.assemblyqualifiedname.aspx). + +Currently you must have the assembly containing the message type in the same directory as `ProtoMunge.exe` due to the way the type is loaded - this restriction will be removed at a later date. + +# What does it do? # + +I used ProtoMunge to generate the benchmark data that comes with the project. Originally the message format and data contained sensitive information. The message formats were easy enough to desensitise, just changing real field names into "field1" etc by hand. However, doing this to the sample messages themselves is much harder - in order to keep the data realistic, I wanted to make sure that the desensitised data had the same size for each field as the original. (As well as keeping the data realistic, this also means that benchmarks should be comparable between sensitive and munged data.) + +# Example # + + * Follow the ProtoDump tutorial first, to get a small address book to munge + * Copy `ProtoMunge.exe` into the current directory + * Run `ProtoMunge.exe` + * Run `ProtoDump.exe` to see the results + +``` +> copy ..\..\..\dist\ProtoMunge.exe . +> ProtoMunge.exe Google.ProtocolBuffers.Examples.AddressBook.AddressBook,AddressBook addressbook.data addressbook.munged +> ProtoDump.exe Google.ProtocolBuffers.Examples.AddressBook.AddressBook,AddressBook addressbook.munged +person { + name: "tIcI#E=;:G" + id: 87 + email: "F&Xaj*uN@7(o>!Tv>_\'K]C%yRZWDe\\}4" + phone { + number: "?x7:>bBd?jPQ" + type: WORK + } + phone { + number: "YEGMN~Z2z#\"!" + type: HOME + } +} +person { + name: "./QPhc8rPD" + id: 98 + email: ":WZ=B,qrS-x50u6]B!Cu59^S22n\"l8x(" + phone { + number: " \\3vD=on1.LP" + type: MOBILE + } + phone { + number: "y@YR%up-NT!w" + type: MOBILE + } +} +``` + +# Current limitations # + + * ProtoMunge doesn't support non-ASCII text. + * The assembly containing the message type must be in the same directory as `ProtoMunge.exe` \ No newline at end of file diff --git a/build/BuildAll.bat b/build/BuildAll.bat deleted file mode 100644 index 9bee73c..0000000 --- a/build/BuildAll.bat +++ /dev/null @@ -1,8 +0,0 @@ -@echo off -SET BUILD_TARGET=%~1 -SET BUILD_CONFIG=%~2 - -IF "%BUILD_TARGET%"=="" SET BUILD_TARGET=Rebuild -IF "%BUILD_CONFIG%"=="" SET BUILD_CONFIG=Debug - -CMD.exe /Q /C "CD %~dp0 && %WINDIR%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /nologo build.csproj /t:%BUILD_TARGET% /toolsversion:4.0 "/p:Configuration=%BUILD_CONFIG%" %3 %4 %5 %6 diff --git a/build/Common.targets b/build/Common.targets deleted file mode 100644 index 2aa74df..0000000 --- a/build/Common.targets +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/build/Google.ProtocolBuffers.nuspec b/build/Google.ProtocolBuffers.nuspec deleted file mode 100644 index c355cd4..0000000 --- a/build/Google.ProtocolBuffers.nuspec +++ /dev/null @@ -1,59 +0,0 @@ - - - - Google.ProtocolBuffers - $version$ - Jon Skeet - Jon Skeet - http://code.google.com/p/protobuf-csharp-port/source/browse/license.txt - http://code.google.com/p/protobuf-csharp-port/ - false - Copyright 2008 Google Inc. All rights reserved. - Protocol Buffers Binary Serialization Format Google - - Google.ProtocolBuffers - A managed code generator and library for Google's data interchange format. - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/Google.ProtocolBuffersLite.nuspec b/build/Google.ProtocolBuffersLite.nuspec deleted file mode 100644 index 8b9107f..0000000 --- a/build/Google.ProtocolBuffersLite.nuspec +++ /dev/null @@ -1,60 +0,0 @@ - - - - Google.ProtocolBuffersLite - $version$ - Jon Skeet - Jon Skeet - http://code.google.com/p/protobuf-csharp-port/source/browse/license.txt - http://code.google.com/p/protobuf-csharp-port/ - false - Copyright 2008 Google Inc. All rights reserved. - Protocol Buffers Binary Serialization Format Google - - Google.ProtocolBuffersLite - A managed code generator and library for Google's data interchange format. - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/RunBenchmarks.bat b/build/RunBenchmarks.bat deleted file mode 100644 index d0e6501..0000000 --- a/build/RunBenchmarks.bat +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -CMD.exe /Q /C "CD %~dp0 && %WINDIR%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /nologo build.csproj /toolsversion:4.0 /t:RunBenchmarks %1 %2 %3 %4 diff --git a/build/build.bat b/build/build.bat deleted file mode 100644 index bd7bd2a..0000000 --- a/build/build.bat +++ /dev/null @@ -1,20 +0,0 @@ -@echo off -SET BUILD_VERSION=%~1 -SET BUILD_TARGET=%~2 -SET BUILD_CONFIG=%~3 - -IF NOT "%BUILD_VERSION%"=="" GOTO RUN -ECHO. -ECHO Usage: build.bat platform [target] [config] [msbuild arguments] -ECHO. -ECHO - platform: CF20, CF35, NET20, NET35, NET40, PL40, SL20, SL30, or SL40 -ECHO - [target]: Rebuild, Clean, Build, Test, or Publish -ECHO - [config]: Debug or Release -ECHO. -EXIT /B 1 - -:RUN -IF "%BUILD_TARGET%"=="" SET BUILD_TARGET=Rebuild -IF "%BUILD_CONFIG%"=="" SET BUILD_CONFIG=Debug - -CMD.exe /Q /C "CD %~dp0 && %WINDIR%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /nologo target.csproj /toolsversion:4.0 %4 %5 %6 "/t:%BUILD_TARGET%" "/p:Configuration=%BUILD_CONFIG%;TargetVersion=%BUILD_VERSION%" diff --git a/build/build.csproj b/build/build.csproj deleted file mode 100644 index e78b2ef..0000000 --- a/build/build.csproj +++ /dev/null @@ -1,241 +0,0 @@ - - - - - - - - - - - - - - - - - - Protocol Buffers - Release - Any CPU - - - $(MSBuildProjectDirectory)\.. - $(ProjectDirectory)\src - $(ProjectDirectory)\lib - $(ProjectDirectory)\protos - - $(ProjectDirectory)\build_temp\GeneratedSource - $(ProjectDirectory)\build_temp - $(ProjectDirectory)\build_output - $(BuildOutputDirectory) - - /v2 /fast /formats - $(BuildTempDirectory)\..\BenchmarkResults.txt - $(ProjectDirectory)\benchmarks - - $(Configuration) - - - $(BuildOutputDirectory)\tools\protoc.exe - $(BuildOutputDirectory)\tools\protogen.exe - $(LibDirectory)\NUnit\tools\nunit-console.exe - $(LibDirectory)\CsProjectProjector\CsProjectProjector.exe - $(LibDirectory)\7-Zip 9.20\7za.exe - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(SourceDirectory)\ProtocolBuffers\DescriptorProtos - - - $(SourceDirectory)\ProtocolBuffers\DescriptorProtos - - - - - $(SourceDirectory)\AddressBook - - - - $(SourceDirectory)\ProtocolBuffers.Test\TestProtos - - - $(SourceDirectory)\ProtocolBuffers.Test\TestProtos - - - $(SourceDirectory)\ProtocolBuffers.Test\TestProtos - - - $(SourceDirectory)\ProtocolBuffers.Test\TestProtos - - - $(SourceDirectory)\ProtocolBuffers.Test\TestProtos - - - $(SourceDirectory)\ProtocolBuffers.Test\TestProtos - - - $(SourceDirectory)\ProtocolBuffers.Test\TestProtos - - - $(SourceDirectory)\ProtocolBuffers.Test\TestProtos - - - $(SourceDirectory)\ProtocolBuffers.Test\TestProtos - - - $(SourceDirectory)\ProtocolBuffers.Test\TestProtos - - - $(SourceDirectory)\ProtocolBuffers.Test\TestProtos - - - $(SourceDirectory)\ProtocolBuffers.Test\TestProtos - - - $(SourceDirectory)\ProtocolBuffers.Test\TestProtos - - - $(SourceDirectory)\ProtocolBuffers.Test\TestProtos - - - $(SourceDirectory)\ProtocolBuffersLite.Test\TestProtos - - - $(SourceDirectory)\ProtocolBuffers.Test\TestProtos - - - - $(SourceDirectory)\ProtocolBuffersLite.Test\TestProtos - - - $(SourceDirectory)\ProtocolBuffersLite.Test\TestProtos - - - $(SourceDirectory)\ProtocolBuffersLite.Test\TestProtos - - - $(SourceDirectory)\ProtocolBuffersLite.Test\TestProtos - - - $(SourceDirectory)\ProtocolBuffersLite.Test\TestProtos - - - $(SourceDirectory)\ProtocolBuffersLite.Test\TestProtos - - - $(SourceDirectory)\ProtocolBuffersLite.Test\TestProtos - - - $(SourceDirectory)\ProtocolBuffers.Test\TestProtos - - - $(SourceDirectory)\ProtocolBuffers.Test\TestProtos - - - $(SourceDirectory)\ProtoBench\TestProtos - - - $(SourceDirectory)\ProtoBench\TestProtos - - - $(SourceDirectory)\ProtoBench\TestProtos - - - $(SourceDirectory)\ProtoBench\TestProtos - - - - - - - - \protos\google\protobuf - - - \protos\google\protobuf\compiler - - - \protos\google\protobuf - - - \protos\tutorial - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/googlecode_upload.py b/build/googlecode_upload.py deleted file mode 100644 index d2d5f97..0000000 --- a/build/googlecode_upload.py +++ /dev/null @@ -1,248 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2006, 2007 Google Inc. All Rights Reserved. -# Author: danderson@google.com (David Anderson) -# -# Script for uploading files to a Google Code project. -# -# This is intended to be both a useful script for people who want to -# streamline project uploads and a reference implementation for -# uploading files to Google Code projects. -# -# To upload a file to Google Code, you need to provide a path to the -# file on your local machine, a small summary of what the file is, a -# project name, and a valid account that is a member or owner of that -# project. You can optionally provide a list of labels that apply to -# the file. The file will be uploaded under the same name that it has -# in your local filesystem (that is, the "basename" or last path -# component). Run the script with '--help' to get the exact syntax -# and available options. -# -# Note that the upload script requests that you enter your -# googlecode.com password. This is NOT your Gmail account password! -# This is the password you use on googlecode.com for committing to -# Subversion and uploading files. You can find your password by going -# to http://code.google.com/hosting/settings when logged in with your -# Gmail account. If you have already committed to your project's -# Subversion repository, the script will automatically retrieve your -# credentials from there (unless disabled, see the output of '--help' -# for details). -# -# If you are looking at this script as a reference for implementing -# your own Google Code file uploader, then you should take a look at -# the upload() function, which is the meat of the uploader. You -# basically need to build a multipart/form-data POST request with the -# right fields and send it to https://PROJECT.googlecode.com/files . -# Authenticate the request using HTTP Basic authentication, as is -# shown below. -# -# Licensed under the terms of the Apache Software License 2.0: -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Questions, comments, feature requests and patches are most welcome. -# Please direct all of these to the Google Code users group: -# http://groups.google.com/group/google-code-hosting - -"""Google Code file uploader script. -""" - -__author__ = 'danderson@google.com (David Anderson)' - -import httplib -import os.path -import optparse -import getpass -import base64 -import sys - - -def upload(file, project_name, user_name, password, summary, labels=None): - """Upload a file to a Google Code project's file server. - - Args: - file: The local path to the file. - project_name: The name of your project on Google Code. - user_name: Your Google account name. - password: The googlecode.com password for your account. - Note that this is NOT your global Google Account password! - summary: A small description for the file. - labels: an optional list of label strings with which to tag the file. - - Returns: a tuple: - http_status: 201 if the upload succeeded, something else if an - error occured. - http_reason: The human-readable string associated with http_status - file_url: If the upload succeeded, the URL of the file on Google - Code, None otherwise. - """ - # The login is the user part of user@gmail.com. If the login provided - # is in the full user@domain form, strip it down. - if user_name.endswith('@gmail.com'): - user_name = user_name[:user_name.index('@gmail.com')] - - form_fields = [('summary', summary)] - if labels is not None: - form_fields.extend([('label', l.strip()) for l in labels]) - - content_type, body = encode_upload_request(form_fields, file) - - upload_host = '%s.googlecode.com' % project_name - upload_uri = '/files' - auth_token = base64.b64encode('%s:%s'% (user_name, password)) - headers = { - 'Authorization': 'Basic %s' % auth_token, - 'User-Agent': 'Googlecode.com uploader v0.9.4', - 'Content-Type': content_type, - } - - server = httplib.HTTPSConnection(upload_host) - server.request('POST', upload_uri, body, headers) - resp = server.getresponse() - server.close() - - if resp.status == 201: - location = resp.getheader('Location', None) - else: - location = None - return resp.status, resp.reason, location - - -def encode_upload_request(fields, file_path): - """Encode the given fields and file into a multipart form body. - - fields is a sequence of (name, value) pairs. file is the path of - the file to upload. The file will be uploaded to Google Code with - the same file name. - - Returns: (content_type, body) ready for httplib.HTTP instance - """ - BOUNDARY = '----------Googlecode_boundary_reindeer_flotilla' - CRLF = '\r\n' - - body = [] - - # Add the metadata about the upload first - for key, value in fields: - body.extend( - ['--' + BOUNDARY, - 'Content-Disposition: form-data; name="%s"' % key, - '', - value, - ]) - - # Now add the file itself - file_name = os.path.basename(file_path) - f = open(file_path, 'rb') - file_content = f.read() - f.close() - - body.extend( - ['--' + BOUNDARY, - 'Content-Disposition: form-data; name="filename"; filename="%s"' - % file_name, - # The upload server determines the mime-type, no need to set it. - 'Content-Type: application/octet-stream', - '', - file_content, - ]) - - # Finalize the form body - body.extend(['--' + BOUNDARY + '--', '']) - - return 'multipart/form-data; boundary=%s' % BOUNDARY, CRLF.join(body) - - -def upload_find_auth(file_path, project_name, summary, labels=None, - user_name=None, password=None, tries=3): - """Find credentials and upload a file to a Google Code project's file server. - - file_path, project_name, summary, and labels are passed as-is to upload. - - Args: - file_path: The local path to the file. - project_name: The name of your project on Google Code. - summary: A small description for the file. - labels: an optional list of label strings with which to tag the file. - config_dir: Path to Subversion configuration directory, 'none', or None. - user_name: Your Google account name. - tries: How many attempts to make. - """ - - while tries > 0: - if user_name is None: - # Read username if not specified or loaded from svn config, or on - # subsequent tries. - sys.stdout.write('Please enter your googlecode.com username: ') - sys.stdout.flush() - user_name = sys.stdin.readline().rstrip() - if password is None: - # Read password if not loaded from svn config, or on subsequent tries. - print 'Please enter your googlecode.com password.' - print '** Note that this is NOT your Gmail account password! **' - print 'It is the password you use to access Subversion repositories,' - print 'and can be found here: http://code.google.com/hosting/settings' - password = getpass.getpass() - - status, reason, url = upload(file_path, project_name, user_name, password, - summary, labels) - # Returns 403 Forbidden instead of 401 Unauthorized for bad - # credentials as of 2007-07-17. - if status in [httplib.FORBIDDEN, httplib.UNAUTHORIZED]: - # Rest for another try. - user_name = password = None - tries = tries - 1 - else: - # We're done. - break - - return status, reason, url - - -def main(): - parser = optparse.OptionParser(usage='googlecode-upload.py -s SUMMARY ' - '-p PROJECT [options] FILE') - parser.add_option('-s', '--summary', dest='summary', - help='Short description of the file') - parser.add_option('-p', '--project', dest='project', - help='Google Code project name') - parser.add_option('-u', '--user', dest='user', - help='Your Google Code username') - parser.add_option('-w', '--password', dest='password', - help='Your Google Code password') - parser.add_option('-l', '--labels', dest='labels', - help='An optional list of comma-separated labels to attach ' - 'to the file') - - options, args = parser.parse_args() - - if not options.summary: - parser.error('File summary is missing.') - elif not options.project: - parser.error('Project name is missing.') - elif len(args) < 1: - parser.error('File to upload not provided.') - elif len(args) > 1: - parser.error('Only one file may be specified.') - - file_path = args[0] - - if options.labels: - labels = options.labels.split(',') - else: - labels = None - - status, reason, url = upload_find_auth(file_path, options.project, - options.summary, labels, - options.user, options.password) - if url: - print 'The file was uploaded successfully.' - print 'URL: %s' % url - return 0 - else: - print 'An error occurred. Your file was not uploaded.' - print 'Google Code upload server said: %s (%s)' % (reason, status) - return 1 - - -if __name__ == '__main__': - sys.exit(main()) diff --git a/build/nuspec.xsd b/build/nuspec.xsd deleted file mode 100644 index db744d1..0000000 --- a/build/nuspec.xsd +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/publish.csproj b/build/publish.csproj deleted file mode 100644 index bbe71df..0000000 --- a/build/publish.csproj +++ /dev/null @@ -1,186 +0,0 @@ - - - - - - - - - - - - - - Protocol Buffers - 2 - 4 - 1 - - - - protobuf-csharp-port- - false - - - - - - $(MSBuildProjectDirectory)\.. - $(ProjectDirectory)\build_temp - $(ProjectDirectory)\build_output - $(ProjectDirectory)\src - $(ProjectDirectory)\lib - - - $(ProjectDirectory)\release-key\Google.ProtocolBuffers.snk - - - hg.exe - C:\Python25\python.exe - $(registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A@InstallationFolder)Bin\sn.exe - $(LibDirectory)\StampVersion.exe - $(LibDirectory)\7-Zip 9.20\7za.exe - $(LibDirectory)\NuGet.exe - $(BuildOutputDirectory)\tools\protogen.exe - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(VersionMajor).$(VersionMinor).$(VersionBuild).$(VersionRevision) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(Python) "$(MSBuildProjectDirectory)\googlecode_upload.py" --project protobuf-csharp-port --user "$(GoogleUsername)" --password "$(GooglePassword)" - - $(BuildTempDirectory)\$(PackagePrefix)$(VersionLabel)-source.zip - $(BuildTempDirectory)\$(PackagePrefix)$(VersionLabel)-release-binaries.zip - $(BuildTempDirectory)\$(PackagePrefix)$(VersionLabel)-release-symbols.zip - $(BuildTempDirectory)\$(PackagePrefix)$(VersionLabel)-full-binaries.zip - $(BuildTempDirectory)\$(PackagePrefix)$(VersionLabel)-full-symbols.zip - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/target.csproj b/build/target.csproj deleted file mode 100644 index 09a9d50..0000000 --- a/build/target.csproj +++ /dev/null @@ -1,167 +0,0 @@ - - - - - - - - - - - - - - - Debug - Any CPU - NET20 - - - - $(MSBuildProjectDirectory)\.. - $(ProjectDirectory)\src - $(ProjectDirectory)\lib - - - $(ProjectDirectory)\build_temp\$(Configuration)\$(TargetVersion) - $(ProjectDirectory)\build_output\$(Configuration)\$(TargetVersion) - $(SourceDirectory)\ProtocolBuffersLibrary.$(TargetVersion).sln - - - $(LibDirectory)\NUnit\tools\nunit-console.exe - $(LibDirectory)\StatLight\tools\StatLight.exe - - - - - - 3.5 - NUNIT - v2.0 - - - 3.5 - NUNIT - v3.5 - - - 4.0 - NUNIT - v4.0 - - - 3.5 - NONE - v2.0 - - - 3.5 - NONE - v3.5 - - - 3.5 - SILVERLIGHT - v2.0 - - - 3.5 - SILVERLIGHT - v3.5 - - - 4.0 - SILVERLIGHT - v4.0 - - - 4.0 - SILVERLIGHT - v4.0 - $(ProjectDirectory)\build_output\$(Configuration)\portable-net40+sl4+sl5+wp7+wp8+win8 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/csproj_templates/CF20.csproj b/csproj_templates/CF20.csproj deleted file mode 100644 index 2968412..0000000 --- a/csproj_templates/CF20.csproj +++ /dev/null @@ -1,41 +0,0 @@ - - - COMPACT_FRAMEWORK - CF20 - {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - v2.0 - Smartphone - f27da329-3269-4191-98e0-c87d3d7f1db9 - - - - - - - bin\CF20\Debug - obj\CF20\Debug\ - $(DefineConstants);NOSERIALIZABLE;NOFILEVERSION;NOEXTENSIONS - true - - - bin\CF20\Release - obj\CF20\Release\ - $(DefineConstants);NOSERIALIZABLE;NOFILEVERSION;NOEXTENSIONS - true - - - - - - - - - - - \ No newline at end of file diff --git a/csproj_templates/CF35.csproj b/csproj_templates/CF35.csproj deleted file mode 100644 index eae866f..0000000 --- a/csproj_templates/CF35.csproj +++ /dev/null @@ -1,44 +0,0 @@ - - - COMPACT_FRAMEWORK - CF35 - {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - v3.5 - Smartphone - f27da329-3269-4191-98e0-c87d3d7f1db9 - - - - - - - bin\CF35\Debug - obj\CF35\Debug\ - $(DefineConstants);NOSERIALIZABLE;NOFILEVERSION - true - - - bin\CF35\Release - obj\CF35\Release\ - $(DefineConstants);NOSERIALIZABLE;NOFILEVERSION - true - - - - - - - - - - - - - - \ No newline at end of file diff --git a/csproj_templates/NET20.csproj b/csproj_templates/NET20.csproj deleted file mode 100644 index f9e9392..0000000 --- a/csproj_templates/NET20.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - CLIENTPROFILE - NET20 - v2.0 - - - bin\NET20\Debug - obj\NET20\Debug\ - $(DefineConstants);NOEXTENSIONS - - - bin\NET20\Release - obj\NET20\Release\ - $(DefineConstants);NOEXTENSIONS - - \ No newline at end of file diff --git a/csproj_templates/NET35.csproj b/csproj_templates/NET35.csproj deleted file mode 100644 index 80ef69a..0000000 --- a/csproj_templates/NET35.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - CLIENTPROFILE - NET35 - v3.5 - - - bin\NET35\Debug - obj\NET35\Debug\ - $(DefineConstants) - - - bin\NET35\Release - obj\NET35\Release\ - $(DefineConstants) - - - - - \ No newline at end of file diff --git a/csproj_templates/NET40.csproj b/csproj_templates/NET40.csproj deleted file mode 100644 index 691845a..0000000 --- a/csproj_templates/NET40.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - CLIENTPROFILE - NET40 - v4.0 - - - bin\NET40\Debug - obj\NET40\Debug\ - $(DefineConstants) - - - bin\NET40\Release - obj\NET40\Release\ - $(DefineConstants) - - - - - \ No newline at end of file diff --git a/csproj_templates/PL40.csproj b/csproj_templates/PL40.csproj deleted file mode 100644 index 2618a79..0000000 --- a/csproj_templates/PL40.csproj +++ /dev/null @@ -1,51 +0,0 @@ - - - 10.0 - PORTABLE_LIBRARY - PL40 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - v4.0 - Profile1 - - - bin\PL40\Debug - obj\PL40\Debug\ - $(DefineConstants);NOSERIALIZABLE;NOSORTEDLIST - - - bin\PL40\Release - obj\PL40\Release\ - $(DefineConstants);NOSERIALIZABLE;NOSORTEDLIST - - - - - - - - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - false - false - - - - - - - - - - - - - \ No newline at end of file diff --git a/csproj_templates/SL20.csproj b/csproj_templates/SL20.csproj deleted file mode 100644 index 0abb104..0000000 --- a/csproj_templates/SL20.csproj +++ /dev/null @@ -1,44 +0,0 @@ - - - SILVERLIGHT - SL20 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - v2.0 - false - false - false - - - bin\SL20\Debug - obj\SL20\Debug\ - $(DefineConstants);NOSERIALIZABLE;NOSORTEDLIST;NOEXTENSIONS - true - - - bin\SL20\Release - obj\SL20\Release\ - $(DefineConstants);NOSERIALIZABLE;NOSORTEDLIST;NOEXTENSIONS - true - - - - - - - - - - OfflineApplication - - - - - \ No newline at end of file diff --git a/csproj_templates/SL30.csproj b/csproj_templates/SL30.csproj deleted file mode 100644 index 82ea9a8..0000000 --- a/csproj_templates/SL30.csproj +++ /dev/null @@ -1,47 +0,0 @@ - - - SILVERLIGHT - SL30 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - v3.5 - false - false - false - - - bin\SL30\Debug - obj\SL30\Debug\ - $(DefineConstants);NOSERIALIZABLE;NOSORTEDLIST - true - - - bin\SL30\Release - obj\SL30\Release\ - $(DefineConstants);NOSERIALIZABLE;NOSORTEDLIST - true - - - - - - - - - - - - - OfflineApplication - - - - - \ No newline at end of file diff --git a/csproj_templates/SL40.csproj b/csproj_templates/SL40.csproj deleted file mode 100644 index 8a38e3d..0000000 --- a/csproj_templates/SL40.csproj +++ /dev/null @@ -1,48 +0,0 @@ - - - SILVERLIGHT - SL40 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - v4.0 - false - false - false - $(TargetFrameworkVersion) - - - bin\SL40\Debug - obj\SL40\Debug\ - $(DefineConstants);NOSERIALIZABLE;NOSORTEDLIST - true - - - bin\SL40\Release - obj\SL40\Release\ - $(DefineConstants);NOSERIALIZABLE;NOSORTEDLIST - true - - - - - - - - - - - - - OfflineApplication - - - - - \ No newline at end of file diff --git a/csproj_templates/SLTest.targets b/csproj_templates/SLTest.targets deleted file mode 100644 index 29da239..0000000 --- a/csproj_templates/SLTest.targets +++ /dev/null @@ -1,34 +0,0 @@ - - - - true - true - true - $(AssemblyName).xap - Properties\AppManifest.xml - $(RootNamespace).App - TestPage.html - true - $(TargetFrameworkVersion) - Properties\OutOfBrowserSettings.xml - true - - - - - - - - App.xaml - - - - - MSBuild:Compile - Designer - - - - \ No newline at end of file diff --git a/keys/Google.ProtocolBuffers.snk b/keys/Google.ProtocolBuffers.snk deleted file mode 100644 index 6bbfc90..0000000 Binary files a/keys/Google.ProtocolBuffers.snk and /dev/null differ diff --git a/keys/generate_new_key.bat b/keys/generate_new_key.bat deleted file mode 100644 index 9f99c07..0000000 --- a/keys/generate_new_key.bat +++ /dev/null @@ -1,13 +0,0 @@ -@ECHO OFF -IF EXIST "C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin\sn.exe" GOTO FOUND -goto USEPATH - -:FOUND -"C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin\sn.exe" -k %~dp0\Google.ProtocolBuffers.snk -GOTO EXIT - -:USEPATH -sn.exe -k %~dp0\Google.ProtocolBuffers.snk -GOTO EXIT - -:EXIT \ No newline at end of file diff --git a/lib/7-Zip 9.20/7-zip.chm b/lib/7-Zip 9.20/7-zip.chm deleted file mode 100644 index 08e4df2..0000000 Binary files a/lib/7-Zip 9.20/7-zip.chm and /dev/null differ diff --git a/lib/7-Zip 9.20/7za.exe b/lib/7-Zip 9.20/7za.exe deleted file mode 100644 index 7f6bf86..0000000 Binary files a/lib/7-Zip 9.20/7za.exe and /dev/null differ diff --git a/lib/7-Zip 9.20/license.txt b/lib/7-Zip 9.20/license.txt deleted file mode 100644 index 530ff36..0000000 --- a/lib/7-Zip 9.20/license.txt +++ /dev/null @@ -1,29 +0,0 @@ - 7-Zip Command line version - ~~~~~~~~~~~~~~~~~~~~~~~~~~ - License for use and distribution - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - 7-Zip Copyright (C) 1999-2010 Igor Pavlov. - - 7za.exe is distributed under the GNU LGPL license - - Notes: - You can use 7-Zip on any computer, including a computer in a commercial - organization. You don't need to register or pay for 7-Zip. - - - GNU LGPL information - -------------------- - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You can receive a copy of the GNU Lesser General Public License from - http://www.gnu.org/ diff --git a/lib/7-Zip 9.20/readme.txt b/lib/7-Zip 9.20/readme.txt deleted file mode 100644 index 9ae4222..0000000 --- a/lib/7-Zip 9.20/readme.txt +++ /dev/null @@ -1,41 +0,0 @@ -7-Zip Command line version 9.20 -------------------------------- - -7-Zip is a file archiver with high compression ratio. -7za.exe is a standalone command line version of 7-Zip. - -7-Zip Copyright (C) 1999-2010 Igor Pavlov. - -Features of 7za.exe: - - High compression ratio in new 7z format - - Supported formats: - - Packing / unpacking: 7z, xz, ZIP, GZIP, BZIP2 and TAR - - Unpacking only: Z, lzma - - Highest compression ratio for ZIP and GZIP formats. - - Fast compression and decompression - - Strong AES-256 encryption in 7z and ZIP formats. - -7za.exe is a free software distributed under the GNU LGPL. -Read license.txt for more information. - -Source code of 7za.exe and 7-Zip can be found at -http://www.7-zip.org/ - -7za.exe can work in Windows 95/98/ME/NT/2000/2003/2008/XP/Vista/7. - -There is also port of 7za.exe for POSIX systems like Unix (Linux, Solaris, OpenBSD, -FreeBSD, Cygwin, AIX, ...), MacOS X and BeOS: - -http://p7zip.sourceforge.net/ - - - This distributive packet contains the following files: - - 7za.exe - 7-Zip standalone command line version. - readme.txt - This file. - license.txt - License information. - 7-zip.chm - User's Manual in HTML Help format. - - ---- -End of document diff --git a/lib/CsProjectProjector/CsProjectProjector.exe b/lib/CsProjectProjector/CsProjectProjector.exe deleted file mode 100644 index a038e80..0000000 Binary files a/lib/CsProjectProjector/CsProjectProjector.exe and /dev/null differ diff --git a/lib/Microsoft.Silverlight.Testing/April2010/EULA.rtf b/lib/Microsoft.Silverlight.Testing/April2010/EULA.rtf deleted file mode 100644 index a907d5d..0000000 Binary files a/lib/Microsoft.Silverlight.Testing/April2010/EULA.rtf and /dev/null differ diff --git a/lib/Microsoft.Silverlight.Testing/April2010/Microsoft.Silverlight.Testing.dll b/lib/Microsoft.Silverlight.Testing/April2010/Microsoft.Silverlight.Testing.dll deleted file mode 100644 index 0c6df18..0000000 Binary files a/lib/Microsoft.Silverlight.Testing/April2010/Microsoft.Silverlight.Testing.dll and /dev/null differ diff --git a/lib/Microsoft.Silverlight.Testing/April2010/Microsoft.Silverlight.Testing.extmap.xml b/lib/Microsoft.Silverlight.Testing/April2010/Microsoft.Silverlight.Testing.extmap.xml deleted file mode 100644 index 352d487..0000000 --- a/lib/Microsoft.Silverlight.Testing/April2010/Microsoft.Silverlight.Testing.extmap.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - Microsoft.Silverlight.Testing - 2.0.5.0 - 31bf3856ad364e35 - Microsoft.Silverlight.Testing.dll - - - - \ No newline at end of file diff --git a/lib/Microsoft.Silverlight.Testing/April2010/Microsoft.Silverlight.Testing.pdb b/lib/Microsoft.Silverlight.Testing/April2010/Microsoft.Silverlight.Testing.pdb deleted file mode 100644 index a86119c..0000000 Binary files a/lib/Microsoft.Silverlight.Testing/April2010/Microsoft.Silverlight.Testing.pdb and /dev/null differ diff --git a/lib/Microsoft.Silverlight.Testing/April2010/Microsoft.Silverlight.Testing.xml b/lib/Microsoft.Silverlight.Testing/April2010/Microsoft.Silverlight.Testing.xml deleted file mode 100644 index 477ce70..0000000 --- a/lib/Microsoft.Silverlight.Testing/April2010/Microsoft.Silverlight.Testing.xml +++ /dev/null @@ -1,14796 +0,0 @@ - - - - Microsoft.Silverlight.Testing - - - - - A class containing an Assert method. - - - - - The MethodInfo object used to invoke Assert.IsNotNull. - - - - - The MethodInfo object used to invoke Assert.AreNotSame. - - - - - The MethodInfo object used to invoke Assert.AreNotEqual. - - - - - The MethodInfo object used to invoke Assert.AreSame. - - - - - The MethodInfo object used to invoke Assert.AreEqual. - - - - - The MethodInfo object used to invoke Assert.IsNull. - - - - - The MethodInfo object used to invoke Assert.IsFalse. - - - - - The MethodInfo object used to invoke Assert.IsTrue. - - - - - A regular expression which identifies a pattern signifying an - anonymous type. This pattern is emitted by the Expression object - when it converts an anonymous type to a string. - - - - - A regular expression which identifies a pattern emitted by an - Expression object when it converts an anonymous type to a - string. - - - - - Asserts a condition is true. - - The condition that must be true. - - - - Asserts a condition is true. - - The condition that must be true. - The message to be displayed when the test fails. - - - - Generates an assert failure message using the code block - responsible for the failure. - - The predicate that fails. - The user-provided assertion failure message. - - A constant expression containing the user-provided failure - message or a description of the expression that failed. - - - - Analyzes the expression and creates an action which calls the - correct assert method based on its contents. - - The predicate expression. - The message to display if an assertion fails. - An action which calls the correct assert method. - - - - Analyzes a predicate expression and invokes the correct assert - method. - - The type of the argument to the predicate. - - A predicate to be converted into an - assert statement. - The assertion message. - - - - Creates an action from certain types of supported binary expression - patterns. If no supported pattern is found null is returned. Based - on analyzing the predicate the action invokes the correct Assert - method. - - A binary expression extracted from a - predicate expression. - The message to display if the assertion - fails. - An action that invokes an Assert method. - - - - Mark the test method as one which expects asynchronous execution. - It is important to call TestComplete() once it is ready or your - test will never continue/timeout. - - - - - An attribute that contains known bug information that can be logged - during a unit test run. - - When applied to a test method, it will invert the result. This makes it - possible to perform automated runs and continuous integration while - validating and tracking known issues. - - The attribute should have the Fixed bool set to True, or be removed, - once the issue is resolved. - - - - - Construct a new BugAttribute with no bug description. - - - - - Construct a new BugAttribute with a bug description. - - Known issue text. - - - - Return the bug information. - - Known issue as a string. - - - - Gets the bug description. - - - - - Gets or sets a value indicating whether the known issue has been - fixed. If it has, the attribute is ignored and will not affect - test results. - - - - - Represents a control that builds on top of the standard platform Button, - offering the ability to modify the corner radii or even use special - button modes. - - - - - Identifies the SecondaryVisibility dependency property. - - - - - Identifies the CornerRadius dependency property. - - - - - Gets or sets the visibility of a secondary set of visuals in the - template. - - - - - Gets or sets the corner radius to use. - - - - - A color selection converter for translating a bool result into - a color. - - - - - Initializes a new instance of the ColorSelectorConverter type. - - - - - Convert a boolean value to a Color value. - - The value. - The target parameter. - ConverterParameter is of type Visibility. - The culture parameter. - Returns the object. - - - - Support 2-way databinding of the VisibilityConverter, converting - Visibility to a boolean. - - The value. - The target parameter. - ConverterParameter is of type Visibility. - The culture parameter. - Returns the object. - - - - Gets or sets the color to use for true values. - - - - - Gets or sets the color to use for false values. - - - - - A set of extension methods for manipulating collections. - - Experimental - - - - Returns a value indicating whether a collection is read-only. - - The collection to examine. - A value indicating whether a collection is read-only. - - - - Returns a value Indicating whether an item can be inserted in a - collection. - - The collection. - The item to be inserted. - A value Indicating whether an item can be inserted in a - collection. - - - - Inserts an item into the collection at an index. - - The collection. - The index at which to insert the item. - The item to be inserted. - - - - Gets the number of items in the collection. - - The collection. - The number of items in the collection. - - - - Adds an item to the collection. - - The collection. - The item to be added. - - - - Removes an item from the collection. - - The collection. - The item to be removed. - - - - Removes an item at a given index from the collection. - - The collection. - The index of the item to be removed. - - - - A color selection converter for translating a bool result into - a color. - - - - - The default true color. - - - - - The default false color. - - - - - Initializes a new instance of the ColorSelectorConverter type. - - - - - Convert a boolean value to a Color value. - - The value. - The target parameter. - ConverterParameter is of type Visibility. - The culture parameter. - Returns the object. - - - - Support 2-way databinding of the VisibilityConverter, converting - Visibility to a boolean. - - The value. - The target parameter. - ConverterParameter is of type Visibility. - The culture parameter. - Returns the object. - - - - Gets or sets the color to use for true values. - - - - - Gets or sets the color to use for false values. - - - - - A set of extension methods for the sequence class. - ;dsf - - - - Produces a sequence of items using a seed value and iteration - method. - - The type of the sequence. - The initial value. - The iteration function. - A sequence of items using a seed value and iteration - method. - - - - Prepend an item to a sequence. - - The type of the sequence. - The sequence to append the item to. - The item to append to the sequence. - A new sequence. - - - - Accepts two sequences and applies a function to the corresponding - values in the two sequences. - - The type of the first sequence. - The type of the second sequence. - The return type of the function. - The first sequence. - The second sequence. - The function to apply to the corresponding values - from the two sequences. - A sequence of transformed values from both sequences. - - - - A converter for modifying the font weight based on a parameter. - - - - - Convert a boolean value to a FontWeight value. - - The value object. - The target parameter. - ConverterParameter is of type Visibility. - The culture parameter. - Returns the object. - - - - Support 2-way databinding of the VisibilityConverter, converting - Visibility to a bool. - - The value object. - The target parameter. - ConverterParameter is of type Visibility. - The culture parameter. - Returns the object. - - - - Determine the visibility mode based on a converter parameter. This - parameter is of type Visibility, and specifies what visibility value - to return when the boolean value is true. - - The parameter object. - Returns a FontWeight value. - - - - Determine whether or not weight is inverted based on a converter - parameter. - - The parameter instance. - Returns a value indicating whether the instance is - inverting. - - - - Collection of functions for functional programming tasks. - - - - - Traverses a tree by accepting an initial value and a function that - retrieves the child nodes of a node. - - The type of the stream. - The initial node. - A function that retrieves the child - nodes of a node. - A predicate that evaluates a node - and returns a value indicating whether that node and it's children - should be traversed. - A stream of nodes. - - - - The test results header control. - - - - - Initializes a new instance of the Header type. - - - - - InitializeComponent - - - - - A value converter for collapsing or showing elements based on the bound - object's type name. Does not walk the hierarchy - it is explicit to the - most specific class for the value. This class, - InvertedTypeNameVisibilityConverter, offers the opposite behavior of the - TypeNameVisibilityConverter class. - - - - - A value converter for collapsing or showing elements based on the bound - object's type name. Does not walk the hierarchy - it is explicit to the - most specific class for the value. - - - - - Convert a value based on CLR type to a Visibility value. Does not - walk the type tree, however. - - The value instance. - The target parameter. - ConverterParameter is the name of the type, - both short and full names are checked, short name first. - The culture parameter. - Returns the object. - - - - Convert back, not supported with this value converter. - - The value instance. - The target parameter. - ConverterParameter is of type Visibility. - The culture parameter. - Returns the object. - - - - Gets a value indicating whether the visibility value should be - inverted. - - - - - Gets a value indicating whether the visibility value should be - inverted. - - - - - Provides useful extensions to ItemsControl instances. - - Experimental - - - - Gets the Panel that contains the containers of an ItemsControl. - - The ItemsControl. - - The Panel that contains the containers of an ItemsControl, or null - if the Panel could not be found. - - - is null. - - - - - Gets the ScrollViewer that contains the containers of an - ItemsControl. - - The ItemsControl. - - The ScrollViewer that contains the containers of an ItemsControl, or - null if a ScrollViewer could not be found. - - - is null. - - - - - Get the item containers of an ItemsControl. - - The ItemsControl. - The item containers of an ItemsControl. - - is null. - - - - - Get the item containers of an ItemsControl. - - - The type of the item containers. - - The ItemsControl. - The item containers of an ItemsControl. - - is null. - - - - - Get the item containers of an ItemsControl. - - - The type of the item containers. - - The ItemsControl. - The item containers of an ItemsControl. - - - - Get the items and item containers of an ItemsControl. - - The ItemsControl. - The items and item containers of an ItemsControl. - - is null. - - - - - Get the items and item containers of an ItemsControl. - - - The type of the item containers. - - The ItemsControl. - The items and item containers of an ItemsControl. - - is null. - - - - - Get the items and item containers of an ItemsControl. - - - The type of the item containers. - - The ItemsControl. - The items and item containers of an ItemsControl. - - is null. - - - - - Returns a value indicating whether an item can be added to an - ItemsControl. - - The ItemsControl instance. - The item to be added. - A value Indicating whether an item can be added to an - ItemsControl. - - - - Returns a value indicating whether an item can be removed from the - ItemsControl. - - The items control. - A value indicating whether an item can be removed from the - ItemsControl. - - - - Inserts an item into an ItemsControl. - - The ItemsControl instance. - The index at which to insert the item. - The item to be inserted. - - - - Adds an item to an ItemsControl. - - The ItemsControl instance. - The item to be inserted. - - - - Removes an item from an ItemsControl. - - The ItemsControl instance. - The item to be removed. - - - - Removes an item from an ItemsControl. - - The ItemsControl instance. - The index of the item to be removed. - - - - Gets the number of items in an ItemsControl. - - The ItemsControl instance. - The number of items in the ItemsControl. - - - - Represents a control that applies a layout transformation to its Content. - - Preview - - - - Name of the TransformRoot template part. - - - - - Name of the Presenter template part. - - - - - Acceptable difference between two doubles. - - - - - Number of decimals to round the Matrix to. - - - - - Identifies the LayoutTransform DependencyProperty. - - - - - Root element for performing transformations. - - - - - ContentPresenter element for displaying the content. - - - - - RenderTransform/MatrixTransform applied to _transformRoot. - - - - - Transformation matrix corresponding to _matrixTransform. - - - - - Actual DesiredSize of Child element (the value it returned from its MeasureOverride method). - - - - - Initializes a new instance of the LayoutTransformer class. - - - - - Builds the visual tree for the LayoutTransformer control when a new - template is applied. - - - - - Handles changes to the Transform DependencyProperty. - - Source of the change. - Event args. - - - - Applies the layout transform on the LayoutTransformer control content. - - - Only used in advanced scenarios (like animating the LayoutTransform). - Should be used to notify the LayoutTransformer control that some aspect - of its Transform property has changed. - - - - - Processes the Transform to determine the corresponding Matrix. - - Transform to process. - - - - Walks the Transform(Group) and returns the corresponding Matrix. - - Transform(Group) to walk. - Computed Matrix. - - - - Provides the behavior for the "Measure" pass of layout. - - The available size that this element can give to child elements. - The size that this element determines it needs during layout, based on its calculations of child element sizes. - - - - Provides the behavior for the "Arrange" pass of layout. - - The final area within the parent that this element should use to arrange itself and its children. - The actual size used. - - Using the WPF paramater name finalSize instead of Silverlight's finalSize for clarity - - - - - Compute the largest usable size (greatest area) after applying the transformation to the specified bounds. - - Arrange bounds. - Largest Size possible. - - - - Returns true if Size a is smaller than Size b in either dimension. - - Second Size. - First Size. - True if Size a is smaller than Size b in either dimension. - - - - Rounds the non-offset elements of a Matrix to avoid issues due to floating point imprecision. - - Matrix to round. - Number of decimal places to round to. - Rounded Matrix. - - - - Implements WPF's Rect.Transform on Silverlight. - - Rect to transform. - Matrix to transform with. - Bounding box of transformed Rect. - - - - Implements WPF's Matrix.Multiply on Silverlight. - - First matrix. - Second matrix. - Multiplication result. - - - - Implements WPF's Matrix.HasInverse on Silverlight. - - Matrix to check for inverse. - True if the Matrix has an inverse. - - - - Outputs diagnostic info if DIAGNOSTICWRITELINE is defined. - - Diagnostic message. - - - - Gets or sets the layout transform to apply on the LayoutTransformer - control content. - - - Corresponds to UIElement.LayoutTransform. - - - - - Gets the child element being transformed. - - - - - The TagEditor control provides a brief user interface allowing for the - selection of a set of tests, used to filter the test run. - - - - - Key used to lookup the TagHistory site setting. - - - - - Number of seconds to wait before running the test. - - - - - Initializes a new instance of the TagEditor type. - - The tag expression to use. - - - - Initializes a new instance of the TagEditor type. - - - - - Fires the Complete event. - - The event arguments. - - - - Handle touch of the button to display the text box. - - Tag button. - Event arguments. - - - - Handle selection of a tag button. - - Tag button. - Event arguments. - - - - Handle changes to the Tag text. - - Tag TextBox. - Event arguments. - - - - Handle clicks to the Run button. - - Run Button. - Event arguments. - - - - Handle timer ticks. - - The timer. - Event arguments. - - - - Stop the timer. - - - - - Run the unit tests. - - - - - Cancels the selection of a tag expression. - - The source object. - The event data. - - - - InitializeComponent - - - - - Gets or sets the timer used to automatically run tests if no tag is - entered. - - - - - Gets or sets the number of seconds already waited. - - - - - Gets or sets the tag history. - - - - - An event that indicates that the tag editor is complete. This can be - in response to many actions: the user entering a tag expression, the - time expiring and the default being selected, or the selection being - canceled. - - - - - Mobile test exceptions page. - - - - - Initializes a new instance of the page. - - - - - InitializeComponent - - - - - Mobile test method details page. - - - - - Initializes a new instance of the page. - - - - - InitializeComponent - - - - - A user control designed for mobile platforms. The control should be used - as the root visual for a Silverlight plugin if developers would like to - use the advanced TestSurface functionality. - - - - - An interface for any test page instances to implement. - - - - - Gets the test panel instance. - - - - - An interface for any test page instances to implement. - - - - - Requests navigation back a page. - - A value indicating whether the operation was successful. - - - - Contains the slide manager for the primitive user interface - navigation system. - - - - - Backing field for the unit test harness instance. - - - - - Backing field for the startup timer. - - - - - Backing field for the model manager. - - - - - Initializes a new instance of the MobileTestPage class. - - - - - Initializes the MobileTestPage object. - - The test harness instance. - - - - Waits for the Settings to become available, either by the service or - system setting the instance property. - - The source timer. - The event arguments. - - - - Creates a new slide and inserts it into the slide manager, plus - visual tree. - - The text header to use. - The content to inside the slide. - Returns the new Slide instance. - - - - Handles the completion event on the tag expression editor to begin - the test run using the user-provided settings. - - The source object. - The event arguments. - - - - Starts the test run. - - - - - Handles the test harness complete event, to display results. - - The source object. - The event data. - - - - Handles the movement back to the test assemblies list. - - The source object. - The event arguments. - - - - Handles the movement back to the test classes list. - - The source object. - The event arguments. - - - - Handles the movement back to the test methods list. - - The source object. - The event arguments. - - - - Handles the selection of a test assembly. - - The source object. - The event arguments. - - - - Handles the selection of a test class. - - The source object. - The event arguments. - - - - Handles the selection of a test method. - - The source object. - The event arguments. - - - - Requests navigation back a page. - - A value indicating whether the operation was successful. - - - - InitializeComponent - - - - - Gets the test surface, a dynamic Panel that removes its children - elements after each test completes. - - - - - Gets the unit test harness instance. - - - - - A derived TreeView control specific to the application needs for - showing results in real-time. - - - - - Represents a control that displays hierarchical data in a tree structure - that has items that can expand and collapse. - - Stable - - - - The IUpdateVisualState interface is used to provide the - InteractionHelper with access to the type's UpdateVisualState method. - - - - - Update the visual state of the control. - - - A value indicating whether to automatically generate transitions to - the new state, or instantly transition to the new state. - - - - - A value indicating whether a read-only dependency property change - handler should allow the value to be set. This is used to ensure - that read-only properties cannot be changed via SetValue, etc. - - - - - A value indicating whether a dependency property change handler - should ignore the next change notification. This is used to reset - the value of properties without performing any of the actions in - their change handlers. - - - - - Identifies the - - dependency property. - - - The identifier for the - - property. - - - - - SelectedItemProperty property changed handler. - - TreeView that changed its SelectedItem. - Event arguments. - - - - Identifies the - - dependency property. - - - The identifier for the - - dependency property. - - - - - SelectedValueProperty property changed handler. - - TreeView that changed its SelectedValue. - Event arguments. - - - - Identifies the - - dependency property. - - - The identifier for the - - dependency property. - - - - - SelectedValuePathProperty property changed handler. - - TreeView that changed its SelectedValuePath. - Event arguments. - - - - Identifies the - - dependency property. - - - The identifier for the - - dependency property. - - - - - ItemContainerStyleProperty property changed handler. - - - TreeView that changed its ItemContainerStyle. - - Event arguments. - - - - Initializes a new instance of the - class. - - - - - Returns a - - for use by the Silverlight automation infrastructure. - - - A - - for the control. - - - - - Builds the visual tree for the - control when a new - control template is applied. - - - - - Update the visual state of the TreeView. - - - A value indicating whether to use transitions when updating the - visual state. - - - - - Creates a to - display content. - - - A to use as a - container for content. - - - - - Determines whether the specified item is a - , which is the - default container for items in the - control. - - The object to evaluate. - - True if the item is a - ; otherwise, - false. - - - - - Prepares the container element to display the specified item. - - - The container element used to display the specified item. - - The item to display. - - - - Removes all templates, styles, and bindings for the object displayed - as a . - - - The element to - clear. - - - The item that is contained in the - . - - - - - Makes adjustments to the - control when the - value of the - property - changes. - - - A - - that contains data about the change. - - - - - Select any descendents when adding new TreeViewItems to a TreeView. - - The added item. - - - - Propagate OnKeyDown messages from the root TreeViewItems to their - TreeView. - - Event arguments. - - Because Silverlight's ScrollViewer swallows many useful key events - (which it can ignore on WPF if you override HandlesScrolling or use - an internal only variable in Silverlight), the root TreeViewItems - explicitly propagate KeyDown events to their parent TreeView. - - - - - Provides handling for the - event when a key - is pressed while the control has focus. - - - A that contains - the event data. - - - is null. - - - - - Handle keys related to scrolling. - - The key to handle. - A value indicating whether the key was handled. - - - - Handle scrolling a page up or down. - - - A value indicating whether the page should be scrolled up. - - - A value indicating whether the scroll was handled. - - - - - Provides handling for the KeyUp event. - - Event arguments. - - - - Provides handling for the MouseEnter event. - - Event arguments. - - - - Provides handling for the MouseLeave event. - - Event arguments. - - - - Provides handling for the MouseMove event. - - Event arguments. - - - - Provides handling for the - - event. - - - A that - contains the event data. - - - - - Provides handling for the MouseLeftButtonUp event. - - Event arguments. - - - - Provides handling for mouse button events. - - A value indicating whether the event was handled. - - - - Provides handling for the GotFocus event. - - Event arguments. - - - - Provides handling for the LostFocus event. - - Event arguments. - - - - Raises the - - event when the - - property value changes. - - - A - that contains the event data. - - - - - Change whether a TreeViewItem is selected. - - - Item whose selection is changing. - - - Container of the item whose selection is changing. - - - A value indicating whether the TreeViewItem is selected. - - - - - Update the selected value of the of the TreeView based on the value - of the currently selected TreeViewItem and the SelectedValuePath. - - - Value of the currently selected TreeViewItem. - - - - - Select the first item of the TreeView. - - - - - Focus the first item in the TreeView. - - A value indicating whether the item was focused. - - - - Focus the last item in the TreeView. - - A value indicating whether the item was focused. - - - - Gets the selected item in a - . - - - The currently selected item or null if no item is selected. The - default value is null. - - - - - Gets the value of the - - property that is specified by the - - property. - - - The value of the - - property that is specified by the - - property, or null if no item is selected. The default value is null. - - - - - Gets or sets the property path that is used to get the - - property of the - - property in a . - - - The property path that is used to get the - - property of the - - property in a . The - default value is . - - - - - Gets or sets the that is - applied to the container element generated for each item. - - - The applied to the container - element that contains each item. - - - - - Gets the currently selected TreeViewItem container. - - - - - Gets a value indicating whether the currently selected TreeViewItem - container is properly hooked up to the TreeView. - - - - - Gets or sets a value indicating whether the selected item is - currently being changed. - - - - - Gets the ItemsControlHelper that is associated with this control. - - - - - Gets the helper that provides all of the standard - interaction functionality. - - - - - Gets a value indicating whether the Control key is currently - pressed. - - - - - Gets a value indicating whether the Shift key is currently pressed. - - - - - Occurs when the value of the - - property changes. - - - - - Overrides the item to allow for simple binding to the expanded - property on the item. - - Returns a new container for an item. - - - - This method returns the container with an expanded binding. - - Returns the container with an expanded binding. - - - - A derived TreeViewItem for IsExpanded binding. - - - - - Provides a selectable item for the - control. - - Stable - - - - Represents a control that contains a collection of items and a header. - - Stable - - - - Identifies the - - dependency property. - - - The identifier for the - - dependency property. - - - Note: WPF defines this property via a call to AddOwner of - HeaderedContentControl's HeaderProperty. - - - - - HeaderProperty property changed handler. - - - HeaderedItemsControl that changed its Header. - - Event arguments. - - - - Identifies the - - dependency property. - - - The identifier for the - - dependency property. - - - Note: WPF defines this property via a call to AddOwner of - HeaderedContentControl's HeaderTemplateProperty. - - - - - HeaderTemplateProperty property changed handler. - - - HeaderedItemsControl that changed its HeaderTemplate. - - Event arguments. - - - - Identifies the - - dependency property. - - - The identifier for the - - dependency property. - - - - - ItemContainerStyleProperty property changed handler. - - - HeaderedItemsControl that changed its ItemContainerStyle. - - Event arguments. - - - - Initializes a new instance of the - class. - - - - - Called when the value of the - - property changes. - - - The old value of the - - property. - - - The new value of the - - property. - - - - - Called when the value of the - - property changes. - - - The old value of the - - property. - - - The new value of the - - property. - - - - - Builds the visual tree for the - when a - new template is applied. - - - - - Prepares the specified element to display the specified item. - - - The container element used to display the specified item. - - The content to display. - - - - Prepares the specified container to display the specified item. - - - Container element used to display the specified item. - - Specified item to display. - The parent ItemsControl. - - The ItemContainerStyle for the parent ItemsControl. - - - - - Prepare a PrepareHeaderedItemsControlContainer container for an - item. - - Container to prepare. - Item to be placed in the container. - The parent ItemsControl. - - The ItemContainerStyle for the parent ItemsControl. - - - - - Check whether a control has the default value for a property. - - The control to check. - The property to check. - - True if the property has the default value; false otherwise. - - - - - Gets or sets a value indicating whether the Header property has been - set to the item of an ItemsControl. - - - - - Gets or sets the item that labels the control. - - - The item that labels the control. The default value is null. - - - - - Gets or sets a data template that is used to display the contents of - the control's header. - - - Gets or sets a data template that is used to display the contents of - the control's header. The default is null. - - - - - Gets or sets the that is - applied to the container element generated for each item. - - - The that is applied to the - container element generated for each item. The default is null. - - - - - Gets the ItemsControlHelper that is associated with this control. - - - - - The name of the ExpanderButton template part. - - - - - The name of the Header template part. - - - - - The ExpanderButton template part is used to expand and collapse the - TreeViewItem. - - - - - The Header template part is used to distinguish the bound Header - content of the TreeViewItem. - - - - - The ExpansionStates visual state group. - - - - - A value indicating whether a read-only dependency property change - handler should allow the value to be set. This is used to ensure - that read-only properties cannot be changed via SetValue, etc. - - - - - Identifies the - - dependency property. - - - The identifier for the - - dependency property. - - - - - HasItemsProperty property changed handler. - - TreeViewItem that changed its HasItems. - Event arguments. - - - - Identifies the - - dependency property. - - - The identifier for the - - dependency property. - - - - - IsExpandedProperty property changed handler. - - TreeViewItem that changed its IsExpanded. - Event arguments. - - - - Identifies the - - dependency property. - - - The identifier for the - - dependency property. - - - - - IsSelectedProperty property changed handler. - - TreeViewItem that changed its IsSelected. - Event arguments. - - - - Identifies the - - dependency property. - - - The identifier for the - - dependency property. - - - - - IsSelectionActiveProperty property changed handler. - - TreeViewItem that changed its IsSelectionActive. - Event arguments. - - - - A reference to the parent ItemsControl of a TreeViewItem. - - - - - Initializes a new instance of the - class. - - - - - Returns a - - for use by the Silverlight automation infrastructure. - - - A - - object for the - . - - - - - Builds the visual tree for the - control when a - new control template is applied. - - - - - Provides handling for the ExpansionStates CurrentChanged event. - - The ExpansionState VisualStateGroup. - Event arguments. - - - - Scroll the TreeViewItem into view. - - - - - Update the visual state of the control. - - - A value indicating whether to automatically generate transitions to - the new state, or instantly transition to the new state. - - - - - Update the visual state of the control. - - - A value indicating whether to automatically generate transitions to - the new state, or instantly transition to the new state. - - - - - Creates a to - display content. - - - A to use as a - container for content. - - - - - Determines whether an object is a - . - - The object to evaluate. - - True if is a - ; otherwise, - false. - - - - - Prepares the specified container element to display the specified - item. - - - Container element used to display the specified item. - - The item to display. - - - - Removes all templates, styles, and bindings for the object displayed - as a . - - - The element to - clear. - - - The item that is contained in the - . - - - - - Makes adjustments to the - when the value - of the - property changes. - - - A - - that contains data about the change. - - - - - Raise a RoutedEvent. - - Event handler. - Event arguments. - - - - Raises an - event - when the - - property changes from false to true. - - - A that contains the - event data. - - - - - Raises a - - event when the - - property changes from true to false. - - - A that contains the - event data. - - - - - Handle changes to the IsExpanded property. - - Event handler. - Event arguments. - - - - Raises the - event - when the - - property changes from false to true. - - - A that contains the - event data. - - - - - Raises the - - event when the - - property changes from true to false. - - - A that contains the - event data. - - - - - Provides handling for the - event. - - - A that contains the - event data. - - - - - Provides handling for the - event. - - - A that contains the - event data. - - - - - Handle the ExpanderButton's GotFocus event. - - The ExpanderButton. - Event Arguments. - - - - Provides handling for the - event. - - - A that contains - the event data. - - - - - Provides handling for the - event. - - - A that contains - the event data. - - - - - Provides handling for the Header's MouseLeftButtonDown event. - - The Header template part. - Event arguments. - - - - Provides handling for the ExpanderButton's Click event. - - The ExpanderButton. - Event Arguments. - - - - Provides handling for the - event. - - - A that - contains the event data. - - - - - Provides handling for the - event. - - - A that - contains the event data. - - - - - Provides handling for the - event when the - has focus. - - - A that contains - the event data. - - - - - Try moving the focus down from the selected item. - - - A value indicating whether the focus was successfully moved. - - - - - Provides handling for the - event. - - - A that contains - the event data. - - - - - Try moving the focus up from the selected item. - - - A value indicating whether the focus was successfully moved. - - - - - Handle scrolling a page up or down. - - - A value indicating whether the page should be scrolled up. - - The ScrollViewer being scrolled. - The height of the viewport. - The top of item to start from. - The bottom of the item to start from. - The height of this item. - - A value indicating whether the scroll was handled. - - - - - Calculate the distance between this TreeViewItem and the item being - paged from. - - - A value indicating whether the page should be scrolled up. - - The element being paged from. - The ScrollViewer being scrolled. - The top of item to start from. - The bottom of the item to start from. - - The distance between the top/bottom of one item to the other. - - - A value indicating whether the scroll was handled. - - - - - Change the selected status of the TreeViewItem. - - - A value indicating whether the TreeViewItem is selected. - - - - - Update the ancestors of this item when it changes selection. - - - A value indicating whether the item is selected. - - - Unselection updates need to occur before selection updates because - the old and new selected items may share a partial path. - - - - - Determine whether the TreeViewItem should be allowed to handle a key - event. - - - A value indicating whether the key event should be handled. - - - - - Navigate the focus to the next TreeViewItem below this item. - - - A value indicating whether the focus was navigated. - - - - - Navigate the focus to the very last TreeViewItem descendent of the - this item. - - - A value indicating whether the focus was navigated. - - - - - Find the next focusable TreeViewItem below this item. - - - A value indicating whether the item should recurse into its child - items when searching for the next focusable TreeViewItem. - - The next focusable TreeViewItem below this item. - - - - Find the last focusable TreeViewItem contained by this item. - - - The last focusable TreeViewItem contained by this item. - - - - - Find the previous focusable TreeViewItem above this item. - - - The previous focusable TreeViewItem above this item. - - - - - Gets or sets the ExpanderButton template part is used to expand and - collapse the TreeViewItem. - - - - - Gets the Header template part that is used to distinguish the bound - Header content of the TreeViewItem. - - - - - Gets or sets the ExpansionStates visual state group. - - - - - Gets or sets a value indicating whether a dependency property change - handler should ignore the next change notification. This is used to - reset the value of properties without performing any of the actions - in their change handlers. - - - - - Gets a value indicating whether this - contains - items. - - - True if this - contains items; otherwise, false. The default is false. - - - - - Gets or sets a value indicating whether the - - contained by this - are expanded - or collapsed. - - - True to indicate the contents of the - - collection are expanded; false to indicate the items are collapsed. - The default is false. - - - - - Gets or sets a value indicating whether this - is selected. - - - True if this - is selected; otherwise, false. The default is false. - - - - - Gets a value indicating whether the - has focus. - - - True if this - has focus; otherwise, false. The default is false. - - - - - Gets the helper that provides all of the standard - interaction functionality. - - - - - Gets or sets a value indicating whether the TreeView's currently - selected item is a descendent of this TreeViewItem. - - - - - Gets or sets a value indicating whether the TreeViewItem should - ignore the next GotFocus event it receives because it has already - been handled by one of its children. - - - - - Gets or sets a value indicating whether checking ContainsSelection - should actually perform the update notifications because the item - was selected before it was in the visual tree. - - - - - Gets or sets a value indicating whether a user initiated action - caused the IsExpanded property to be set. - - - - - Gets or sets a reference to the parent ItemsControl of a - TreeViewItem. - - - - - Gets a reference to the parent TreeViewItem of this TreeViewItem. - - - - - Gets a reference to the parent TreeView of the TreeViewItem. - - - - - Gets a value indicating whether this TreeViewItem is a root of the - TreeView. - - - - - Gets a value indicating whether the TreeViewItem can expand when it - receives appropriate user input. - - - - - Occurs when the - - property changes from true to false. - - - - - Occurs when the - - property changes from false to true. - - - - - Occurs when the - - property of a - changes from false to true. - - - - - Occurs when the - - property of a - changes from true to false. - - - - - Overrides the item to allow for simple binding to the expanded - property on the item. - - Returns a new container for an item. - - - - Overrides the key down event to allow toggling the space. - - The key event arguments data. - - - - A specialized content control that contains a fixed header, a standard - header content property, plus content. It is designed specifically for - a "slide-based" user interface for simple user interfaces. - - - - - The visual state group name for slide position. - - - - - The visual state name for left position. - - - - - The visual state name for right position. - - - - - The normal visual state name for position. - - - - - The content template part name. - - - - - The header template part name. - - - - - The fixed header template name. - - - - - The manager of the slide and its siblings. - - - - - Identifies the Header dependency property. - - - - - Identifies the FixedHeader dependency property. - - - - - Identifies the Position dependency property. - - - - - PositionProperty property changed handler. - - Slide that changed its Position. - Event arguments. - - - - Initializes a new instance of the Slide class. - - - - - Remove the slide from the parent manager. - - - - - Locate template parts and assign instances to fields during template - application. - - - - - Fires the slide changed event. - - - - - Fires the current state changed event. - - The source object. - The event arguments. - - - - Helps debugging by providing information about the slide name. - - Returns the name of the slide. - - - - Updates the visual state. - - A value indicating whether to use - visual transitions for the state change. - The slide position to use. - - - - Event fired when the current slide changes. - - - - - Gets or sets the primary header content. - - - - - Gets or sets the fixed header content. - - - - - Gets or sets the position of the slide. - - - - - Gets or sets the slide manager for the slide. - - - - - A helper class to managing sets of slides. - - - - - Initializes a new instance of the SlideManager class. - - - - - Stores the linked list node for the current slide. - - - - - Backing field for the set of slides. - - - - - Adds a slide or an array of slides to the managed slide set. - - The slides to manage. - - - - Initializes the position of the slide based on location. - - The slide instance. - A property indicating whether the slide is the - first to be managed. - - - - Manages a new slide, inserting it after an existing slide node. - - The node to insert after. - The new slide instance. - Returns the linked list node that is inserted. - - - - Inserts a slide as the first in the linked list. - - The new slide instance. - Returns the linked list node. - - - - Insert a slide after a provided linked list node. - - The node to insert after. - The new slide to insert. - Returns the new linked list node. - - - - Remove a slide from management. - - The slide instance. - - - - Move to the previous slide. - - - - - Move to the next slide. - - - - - Moves to a specific slide, moving the others to the appropriate - direction on screen. - - The slide to move to. - - - - Move in a direction. - - A value indicating whether the direction to - move is forward or not. - - - - Gets the current slide instance. - - - - - Indicates the position that the slide should have. - - - - - Normal position, centered on the screen. - - - - - To the left of the screen. - - - - - To the right of the screen. - - - - - The TagEditor control provides a brief user interface allowing for the - selection of a set of tests, used to filter the test run. - - - - - Key used to lookup the TagHistory site setting. - - - - - Key used to lookup whether the last run used tag expressions. - - - - - Number of seconds to wait before running the test. - - - - - Backing field for the last run used value. - - - - - Initializes a new instance of the TagEditor type. Also includes a - set of sample tags for display to the end user. - - The tag expression to use. - Sample tags to display. - - - - Initializes a new instance of the TagEditor type. - - The tag expression to use. - - - - Initializes a new instance of the TagEditor type. - - - - - Handles the key down event. - - The key event arguments. - - - - Fires the Complete event. - - The event arguments. - - - - Creates a new button. - - The button content. - Returns a new Button instance. - - - - Handle selection of a tag button. - - Tag button. - Event arguments. - - - - Handle changes to the Tag text. - - Tag TextBox. - Event arguments. - - - - Handle clicks to the Run button. - - Run Button. - Event arguments. - - - - Handle timer ticks. - - The timer. - Event arguments. - - - - Stop the timer. - - - - - Run the unit tests. - - - - - Cancels the selection of a tag expression. - - The source object. - The event data. - - - - InitializeComponent - - - - - Gets or sets the timer used to automatically run tests if no tag is - entered. - - - - - Gets or sets the number of seconds already waited. - - - - - Gets or sets the tag history. - - - - - An event that indicates that the tag editor is complete. This can be - in response to many actions: the user entering a tag expression, the - time expiring and the default being selected, or the selection being - canceled. - - - - - A class for storing event information relating to a user's selected - tag expression for a test run. - - - - - Initializes a new instance of the TagExpression event arguments - class. - - The tag expression. - - - - Gets the tag expression stored in the event arguments. - - - - - Gets a value indicating whether a tag expression has been set. - - - - - Displays information about any exceptions listed in the results. - - - - - Initializes a new instance of the TestExceptionDetails class. - - - - - InitializeComponent - - - - - Details view for test method data. - - - - - Initializes a new instance of the TestMethodDetails class. - - - - - InitializeComponent - - - - - A set of simple time helper methods. - - - - - Returns a human-readable formatting of the time different between - two DateTime instances. - - The starting time. - The finishing time. - Returns a human-readable string. - - - - Returns a human-readable formatting of the time different between - two DateTime instances. - - The time span instance. - Returns a human-readable string. - - - - A plural 's' as the suffix, when not equal to one. - - The string value. - The number to check. - Returns an empty string or the English plural 's'. - - - - Provides the necessary infrastructure to enable drawing connecting - lines between the TreeViewItems in a TreeView. - - Experimental - - - - Gets the value of the ConnectingLineInfo attached property for a - specified TreeViewItem. - - - The TreeViewItem from which the property value is read. - - - The ConnectingLineInfo property value for the TreeViewItem. - - - - - Identifies the ConnectingLineInfo dependency property. - - - - - Gets the value of the IsVerticalConnectingLineOf attached property - for a specified Line. - - The Line from which the property value is read. - The IsVerticalConnectingLineOf property value for the Line. - - - - Sets the value of the IsVerticalConnectingLineOf attached property to a specified Line. - - The Line to which the attached property is written. - The needed IsVerticalConnectingLineOf value. - - - - Identifies the IsVerticalConnectingLineOf dependency property. - - - - - IsVerticalConnectingLineOfProperty property changed handler. - - - Line that changed its IsVerticalConnectingLineOf TreeViewItem. - - Event arguments. - - - - Gets the value of the IsHorizontalConnectingLineOf attached property - for a specified Line. - - - The Line from which the property value is read. - - - The IsHorizontalConnectingLineOf property value for the Line. - - - - - Sets the value of the IsHorizontalConnectingLineOf attached property - to a specified Line. - - - The Line to which the attached property is written. - - - The needed IsHorizontalConnectingLineOf value. - - - - - Identifies the IsHorizontalConnectingLineOf dependency property. - - - - - IsHorizontalConnectingLineOfProperty property changed handler. - - - Line that changed its IsHorizontalConnectingLineOf TreeViewItem. - - Event arguments. - - - - Gets the value of the IsExpanderButtonOf attached property for a - specified ToggleButton. - - - The ToggleButton from which the property value is read. - - - The IsExpanderButtonOf property value for the ToggleButton. - - - - - Sets the value of the IsExpanderButtonOf attached property to a - specified ToggleButton. - - - The ToggleButton to which the attached property is written. - - The needed IsExpanderButtonOf value. - - - - Identifies the IsExpanderButtonOf dependency property. - - - - - IsExpanderButtonOfProperty property changed handler. - - - ToggleButton that changed its IsExpanderButtonOf TreeViewItem. - - Event arguments. - - - - Gets the value of the IsHeaderOf attached property for a specified - FrameworkElement. - - - The FrameworkElement from which the property value is read. - - - The IsHeaderOf property value for the FrameworkElement. - - - - - Sets the value of the IsHeaderOf attached property to a specified - FrameworkElement. - - - The FrameworkElement to which the attached property is written. - - The needed IsHeaderOf value. - - - - Identifies the IsHeaderOf dependency property. - - - - - IsHeaderOfProperty property changed handler. - - - FrameworkElement that changed its IsHeaderOf TreeViewItem. - - Event arguments. - - - - Provides useful extensions to TreeView and TreeViewItem instances. - - Experimental - - - - Get the parent ItemsControl of an element. - - The element. - - The parent ItemsControl of an element, or null if not found. - - - - - Get the ancestor ItemsControls of an element. - - The element. - - The ancestor ItemsControls of an element. - - - - - Get the parent TreeViewItem of a TreeViewItem. - - The TreeViewItem. - - The parent TreeViewItem if found, otherwise null. - - - is null. - - - - - Get the parent TreeView of a TreeViewItem. - - The TreeViewItem. - The parent TreeView if found, otherwise null. - - is null. - - - - - Get the TreeViewItem containers of a TreeView. - - The TreeView. - The TreeViewItem containers of a TreeView. - - is null. - - - - - Get the child TreeViewItem containers of a TreeViewItem. - - The TreeViewItem. - - The child TreeViewItem containers of a TreeViewItem. - - - is null. - - - - - Get the items and TreeViewItem containers of a TreeView. - - The TreeView. - - The items and TreeViewItem containers of a TreeView. - - - is null. - - - - - Get the items and TreeViewItem containers of a TreeViewItem. - - The TreeViewItem. - - The items and TreeViewItem containers of a TreeViewItem. - - - is null. - - - - - Get the TreeViewItem containers of a TreeView. - - The TreeView. - The TreeViewItem containers of a TreeView. - - is null. - - - - - Get the descendant TreeViewItem containers of a TreeViewItem. - - The TreeViewItem. - - The descendant TreeViewItem containers of a TreeViewItem. - - - is null. - - - - - Get the descendant items and TreeViewItem containers of a TreeView. - - The TreeView. - - The descendant items and TreeViewItem containers of a TreeView. - - - is null. - - - - - Get the descendant items and TreeViewItem containers of a - TreeViewItem. - - The TreeViewItem. - - The descendant items and TreeViewItem containers of a TreeViewItem. - - - is null. - - - - - Get the items and TreeViewItem containers of a TreeView or - TreeViewItem. - - The TreeView or TreeViewItem. - - The items and TreeViewItem containers of a TreeView or TreeViewItem. - - - - - Get the sibling items and containers of the item. - - The TreeViewItem. - The sibling items and containers of the item. - - - - Get the TreeViewItems already created that are used to represent the - given item. - - The TreeView. - The item being represented. - - A sequence of TreeViewItems that represent the given item, or an - empty sequence if none were found. - - - is null. - - - - - Get the TreeViewItem already created that is used to represent the - given item. - - The TreeView. - The item being represented. - - The TreeViewItems that represents the given item, or null if no - container was found. - - - If multiple TreeViewItems represent the same item, the first item - found via a breadth-first search will be used. - - - is null. - - - - - Gets a path of items and TreeViewItem containers from the - TreeViewItem to the root of the TreeView. - - The TreeViewItem. - - A path of items and TreeViewItem containers from the TreeViewItem to - the root of the TreeView. - - - is null. - - - - - Gets a path of items and TreeViewItem containers from the - TreeViewItem to the root of the TreeView. - - The TreeViewItem. - - A path of items and TreeViewItem containers from the TreeViewItem to - the root of the TreeView. - - - - - Get the item wrapped by this container. - - The TreeViewItem. - - The item wrapped by the container, or null if not found. - - - is null. - - - - - Get the item of the parent container for a specified - . - - - The TreeView containing the . - - The child item. - - The item of the parent container for the specified - , or null if not found. - - - - - Gets a value indicating whether the TreeViewItem is a root of its - TreeView. - - The TreeViewItem. - - A value indicating whether the TreeViewItem is a root of its - TreeView. - - - is null. - - - - - Gets a value indicating whether the TreeViewItem is a leaf in its - TreeView. - - The TreeViewItem. - - A value indicating whether the TreeViewItem is a leaf in its - TreeView. - - - is null. - - - - - Gets the depth of a TreeViewItem in its TreeView (using a zero-based - index). - - The TreeViewItem. - - The depth of a TreeViewItem in its TreeView (using a zero-based - index). - - - is null. - - - is not in a TreeView. - - - - - Get the selected TreeViewItem in a TreeView. - - The TreeView. - - The selected TreeViewItem, or null if no selected item found. - - - is null. - - - - - Sets the selected TreeViewItem of a TreeView. - - The TreeView. - The TreeViewItem to select. - - is null. - - - - - Clear the selection of the TreeView. - - The TreeView. - - is null. - - - - - Select an item in the TreeView. - - The TreeView. - The item to select. - - A value indicating whether the item was successfully set as the - TreeView's SelectedItem. - - - is null. - - - - - Gets the path to the TreeView's selected item. - - The TreeView. - The path to the TreeView's selected item. - - is null. - - - - - Recursively expand or collapse the TreeViewItem and all of its - descendants. - - The TreeViewItem. - - A value indicating whether to expand or collapse. - - - The number of levels that have already been collapsed or expanded. - This is used in conjunction with the optional maximumDepth to only - expand a specified number of layers. - - - An optional depth that defines the number of layers to expand or - collapse. - - - - - Expand or collapse all of the descendants of the TreeView. - - The TreeView. - - A value indicating whether to expand or collapse. - - - An optional depth that defines the number of layers to expand or - collapse. - - - - - Expand all of the items in a TreeView. - - The TreeView. - - is null. - - - - - Collapse all of the items in a TreeView. - - The TreeView. - - is null. - - - - - Expand a specified number of layers in a TreeView. - - The TreeView. - The number of layers to expand. - - is null. - - - - - Expand a path from the given item to the root of it's TreeView. - - The TreeViewItem. - - A value indicating whether to collapse siblings while expanding the - path. This will result in only the path from the item to the root - being expanded. - - - - - Expand a path from the TreeViewItem to the root of the TreeView. - - The TreeViewItem. - - is null. - - - - - Expand the path from the SelectedItem to the root of the TreeView. - - The TreeView. - - is null. - - - - - Collapse all TreeViewItems except those along the path from the - TreeView's SelectedItem to the root of the TreeView. - - The TreeView. - - is null. - - - - - Expand the given path of items starting from the TreeView's root. - - The TreeView. - - The sequence of items corresponding to the path to expand. - - - is null. - - - is null. - - - - - Expand the given path of items starting from the TreeView's root. - - - The type of items provided in . - - The TreeView. - - The sequence of items corresponding to the path to expand. - - - is null. - - - is null. - - - - - Expand the given path of items starting from the TreeView's root. - - - The type of items provided in . - - The TreeView. - - A function that takes a TreeViewItem's item and returns a value to - compare against elements of the given . - The item itself will be used if - is null. - - - The sequence of items corresponding to the path to expand. - - - is null. - - - is null. - - - - - Expand the given path of items starting from the TreeView's root. - - - The type of items provided in . - - The TreeView. - - A function that takes a TreeViewItem's item and returns a value to - compare against elements of the given . - The item itself will be used if - is null. - - - The sequence of items corresponding to the path to expand. - - - is null. - - - is null. - - - - - Gets the value of the IsChecked attached property for a specified - TreeViewItem. - - - The TreeViewItem from which the property value is read. - - - The IsChecked property value for the TreeViewItem. - - - - - Sets the value of the IsChecked attached property to a specified - TreeViewItem. - - - The TreeViewItem to which the attached property is written. - - The needed IsChecked value. - - - - Identifies the IsChecked dependency property. - - - - - IsCheckedProperty property changed handler. - - The TreeViewItem that changed IsChecked. - Event arguments. - - - - Gets the value of the AssociatedCheckBox attached property for a - specified TreeViewItem. - - - The TreeViewItem from which the property value is read. - - - The AssociatedCheckBox property value for the TreeViewItem. - - - - - Sets the value of the AssociatedCheckBox attached property to a - specified TreeViewItem. - - - The TreeViewItem to which the attached property is written. - - The needed AssociatedCheckBox value. - - - - Identifies the AssociatedCheckBox dependency property. - - - - - AssociatedCheckBoxProperty property changed handler. - - - The TreeViewItem that changed its AssociatedCheckBox. - - Event arguments. - - - - Get the sequence of items and containers with their IsChecked - property set to True. - - The TreeView. - - The sequence of items and containers with their IsChecked property - set to True. - - - is null. - - - - - Get the sequence of items and containers with their IsChecked - property set to True. - - The TreeView. - - A value indicating whether to include TreeViewItems with an - indeterminate IsChecked value. - - - The sequence of items and containers with their IsChecked property - set to True or also set to null if indeterminate values are - included. - - - is null. - - - - - Gets or sets a value indicating whether recursive calls to - OnIsCheckedPropertyChanged should ignore their notifications or - process them accordingly. - - - - - Gets or sets a value indicating whether recursive calls to - OnIsCheckedPropertyChanged should update their children when their - IsChecked value has changed. - - - - - Represents a CheckBox whose value is associated with the - TreeViewExtensions.IsChecked attached property of TreeViewItems. - - Experimental - - - - The parent TreeViewItem of the CheckBox. - - - - - Initializes a new instance of the TreeViewItemCheckBox class. - - - - - Associate the parent TreeViewItem with the CheckBox. - - - - - Update the TreeViewItem's IsChecked property when this IsChecked - property is changed. - - The CheckBox. - Event arguments. - - - - Gets the parent TreeViewItem of the CheckBox. - - - - - Represents the necessary information to draw connecting lines in a - TreeViewItem. - - Experimental - - - - Initializes a new instance of the TreeViewItemConnectingLineInfo - class. - - The TreeViewItem. - - - - Position the connecting lines in the TreeViewItem. - - - - - Position the vertical connecting line in the TreeViewItem. - - - - - Gets the TreeViewItem. - - - - - Gets or sets the vertical connecting line of the TreeViewItem. - - - - - Gets or sets the horizontal connecting line of the TreeViewItem. - - - - - Gets or sets the expander button of the TreeViewItem. - - - - - Gets or sets the header of the TreeViewItem. - - - - - Used to convert TreeViewItems into a value based on their depth in - the TreeView. - - Experimental - - - - Initializes a new instance of the TreeViewItemIndentationConverter - class. - - - - - Convert a TreeViewItem into a value based on the depth of the item - in the TreeView. - - The TreeViewItem. - - The indentation type to convert to (such as Thickness or double). - - - The number of pixels to indent each level of the TreeView. A - default value of 15.0 will be used if no parameter is provided. - - - The culture used to convert the TreeViewItem. - - - A value based on the depth of the item in the TreeView. - - - - - Wrap the indentation in the desired type. - - - The number of pixels to indent the TreeViewItem. - - - The indentation type to convert to (such as Thickness or double). - - - A value based on the depth of the item in the TreeView. - - - - - Convert an indentation back into a TreeViewItem. This always throws - a NotSupportedException. - - The indentation. - The type of the indentation. - - The number of pixels to indent each level of the TreeView. - - - The culture used to convert the TreeViewItem. - - Always throws a NotSupportedException. - - - - A set of simple extension methods for applications. - - - - - Checks whether the application host object is not null. - - The application instance. - Returns a value indicating whether the object is not null. - - - - Checks whether the application host and its source object is not - null. - - The application instance. - Returns a value indicating whether the object is not null. - - - - A value converter for collapsing or showing elements. - - - - - Convert a boolean value to a Visibility value. - - The value instance. - The target parameter. - ConverterParameter is of type Visibility. - The culture parameter. - Returns the object. - - - - Support two-way databinding of the VisibilityConverter, converting - Visibility to a bool. - - The value instance. - The target parameter. - ConverterParameter is of type Visibility. - The culture parameter. - Returns the object. - - - - Determine the visibility mode based on a converter parameter. This - parameter is of type Visibility,and specifies what visibility value - to return when the boolean value is true. - - The parameter object. - Returns a Visibility value. - - - - Determine whether or not visibility is inverted based on a converter - parameter. When the parameter is specified as Collapsed, that means - that when the boolean value is true, we should return Collapsed, - which is inverted. - - The parameter object. - Returns a value indicating whether the visibility is - inverted. - - - - Visual states helper code. - - - - - Gets the implementation root of the Control. - - The DependencyObject. - - Implements Silverlight's corresponding internal property on Control. - - Returns the implementation root or null. - - - - This method tries to get the named VisualStateGroup for the - dependency object. The provided object's ImplementationRoot will be - looked up in this call. - - The dependency object. - The visual state group's name. - Returns null or the VisualStateGroup object. - - - - Provides useful extensions for working with the visual tree. - - - Since many of these extension methods are declared on types like - DependencyObject high up in the class hierarchy, we've placed them in - the Primitives namespace which is less likely to be imported for normal - scenarios. - - Experimental - - - - Get the visual tree ancestors of an element. - - The element. - The visual tree ancestors of the element. - - is null. - - - - - Get the visual tree ancestors of an element and the element itself. - - The element. - - The visual tree ancestors of an element and the element itself. - - - is null. - - - - - Get the visual tree ancestors of an element and the element itself. - - The element. - - The visual tree ancestors of an element and the element itself. - - - - - Get the visual tree children of an element. - - The element. - The visual tree children of an element. - - is null. - - - - - Get the visual tree children of an element and the element itself. - - The element. - - The visual tree children of an element and the element itself. - - - is null. - - - - - Get the visual tree children of an element and the element itself. - - The element. - - The visual tree children of an element and the element itself. - - - - - Get the visual tree descendants of an element. - - The element. - The visual tree descendants of an element. - - is null. - - - - - Get the visual tree descendants of an element and the element - itself. - - The element. - - The visual tree descendants of an element and the element itself. - - - is null. - - - - - Get the visual tree descendants of an element and the element - itself. - - The element. - - The visual tree descendants of an element and the element itself. - - - - - Get the visual tree siblings of an element. - - The element. - The visual tree siblings of an element. - - is null. - - - - - Get the visual tree siblings of an element and the element itself. - - The element. - - The visual tree siblings of an element and the element itself. - - - is null. - - - - - Get the bounds of an element relative to another element. - - The element. - - The element relative to the other element. - - - The bounds of the element relative to another element, or null if - the elements are not related. - - - is null. - - - is null. - - - - - Perform an action when the element's LayoutUpdated event fires. - - The element. - The action to perform. - - is null. - - - is null. - - - - - Retrieves all the logical children of a framework element using a - breadth-first search. For performance reasons this method manually - manages the stack instead of using recursion. - - The parent framework element. - The logical children of the framework element. - - - - Retrieves all the logical descendents of a framework element using a - breadth-first search. For performance reasons this method manually - manages the stack instead of using recursion. - - The parent framework element. - The logical children of the framework element. - - - - The CodeCoverage class is used to collect code coverage information from - assemblies that have been instrumented to call the Visit function at the - beginning of every basic block. - - - - - A bit array used to track which basic blocks have been executed. - - - - - A counter of the hit blocks. - - - - - Record that a basic block is being executed. - - Id of the basic block. - - - - Get the coverage data serialized as a string for easy transport. - - Previous releases of the framework used a simplistic bit - list, this release updates the coverage reporting endpoint to an - alternate version that ends in base 64. This maintains test runner - compatibility with previous official releases. - Coverage data serialized as a string. - - - - Gets the current number of hit blocks. - - - - - Gets the current size of the blocks counter. This is not actually - the number of hit blocks, but it should return 0 always except - when at least one block is hit. - - - - - Base class for test cases that use special functionality of the - Microsoft.Silverlight.Testing unit test framework. - - Tests that derive from CustomTest in most cases will not be source- or - functionality- compatible with the more advanced desktop Visual Studio - Test Team environment and harnesses. - - - - - Process an exception using the test engine logic for - ExpectedExceptions and logging the exception if needed. - - Exception object. - - - - Gets or sets a value indicating whether global unhandled exceptions - should be intercepted by the test harness. - - - - - Gets or sets the unit test harness instance. Hidden from the VS - browser as test developers should not need to use this property. - - - - - Gets the current test task container. - - The current container for the test's tasks. - - - - Manages the unit test status and model by attaching to the unit test - harness instance. Validates that all key logging can be done without - special hooks inside of the unit test harness implementation. - - - - - The unit test harness instance. - - - - - The test run data. - - - - - Map assembly metadata to data objects. - - - - - Map test class metadata to data objects. - - - - - Map test metadata to data objects. - - - - - Backing field for the last result. - - - - - Backing field for the last failing result. - - - - - Initializes a new instance of the DataManager type. - - The unit test harness instance. - - - - Initializes a new instance of the DataManager. - - The unit test harness instance. - Returns a new instance of a DataManager class. - - - - Connect to unit test harness events for processing and updating the - underlying unit test run model. - - - - - Unhook from the unit test harness events. - - - - - Process the starting of the test run. - - The source object. - The event data. - - - - Process the test class starting event. - - The source object. - The event data. - - - - Process the test class complete event. - - The source object. - The event data. - - - - Process the start of a test method. - - The source object. - The event data. - - - - Process the completion of test methods. - - The source object. - The event data. - - - - Process a result. - - The result data. - - - - Gets or creates the data model object for an assembly. - - The test assembly. - Returns the data object. - - - - Gets or creates the data model object for a test class. - - The test class. - Returns the data object. - - - - Gets or creates the data model object for a test method. - - The test method. - The parent test class data object. - Returns the data object. - - - - Gets the unit test harness instance. - - - - - Gets the unit test model. - - - - - A data object storing the hierarchical results for a test assembly in a - test run. - - - - - A base class for model objects that implement the property - changed interface, to simplify calling the change handlers, - and cache the underlying event argument instances. - - - - - A static set of change argument instances, eventually - storing one argument instance for each property name to - reduce churn at runtime. - - - - - Notify any listeners that the property value has changed. - - The property name. - - - - The property changed event. - - - - - A type that provides a string result report. - - - - - Generates a simple text result report for the metadata. - - Reports a text report. - - - - Initializes a new instance of the TestAssemblyData type. - - The test assembly metadata. - - - - Backing field for the expanded property. - - - - - Backing field for a passed value. - - - - - Backing store for the set of test class. - - - - - Retrieves the results report. - - Returns a string containing the report. - - - - Gets or sets a value indicating whether the item is expanded in - a hierarchical display. - - - - - Gets or sets the checked value. Don't think this is actually used. - - - - - Gets or sets a value indicating whether the test passed. If failed, - will propagate to the parent metadata object. - - - - - Gets the name of the assembly. - - - - - Gets an observable collection of test class data objects. - - - - - A data object that generates property change notifications and can - be used for rich data binding to test results. Does keep a reference - to all results. - - - - - Stores the test method metadata. - - - - - Parent data object. - - - - - A value indicating whether the test is currently executing. - - - - - The test outcome. - - - - - Backing field for linked data. - - - - - Backing field for linked data. - - - - - Backing field for linked data. - - - - - Backing field for linked data. - - - - - Initializes a new instance of the TestMethodData type. - - The test method metadata. - The test class that is the parent object. - - - - Runs through the metadata for bugs. - - - - - Backing field for known bugs. - - - - - Backing field for bugs that are marked fixed. - - - - - Calculates whether the item is considered "notable", in that it - should have a visual cue or hint for the user. - - - - - Stores a value indicating whether the result is notable. - - - - - Backing field for the checked property. - - - - - Backing field for the expanded property. - - - - - Retrieves the results report. - - Returns a string containing the report. - - - - Gets or sets the result of the test method. - - - - - Gets the known bugs for display in the UI. - - - - - Gets the fixed bugs for display. - - - - - Gets the expected exception name for a negative test, if any. - - - - - Gets a simplified exception stack trace that omits the trace below - the invoke of the test method by the test framework. - - - - - Gets the short, simple name of the exception type recorded in the - test result, if any. - - - - - Gets a value indicating whether the method has results. - - - - - Gets a value indicating whether the method has passed. Returns - true until there is a result. - - - - - Gets or sets a value indicating whether the test method is running. - - - - - Gets or sets a value indicating whether the result is notable. - Notable is defined as either currently running, or not having - passed. This can allow a user interface to react to an - interesting result. - - - - - Gets the parent data object. - - - - - Gets an instance of the actual metadata object. - - - - - Gets the name of the test method. - - - - - Gets a visibility value to allow for easy showing or - hiding of a user interface component that displays the - description. - - Returns a visibility value. - - - - Gets the elapsed time in a readable format. - - Returns a string of the readable time elapsed. - - - - Gets the description of the test method. - - - - - Gets or sets a value indicating whether the item is checked in the - user interface. - - - - - Gets or sets a value indicating whether the item is expanded in - a hierarchical display. - - - - - Gets or sets the previous result. - - - - - Gets or sets the next result. - - - - - Gets or sets the previous failing result. - - - - - Gets or sets the next failing result. - - - - - A provider of code coverage information to an external process. - - - - - The base class for test service providers. - - - - - Initializes a new base provider class. - - The owning test service provider. - The display name of the service. - - - - Initializes the provider. - - - - - Increments the busy service counter. - - - - - Decrements the busy service counter. - - - - - Invokes a method on this provider using reflection. - - The name of the method. - The optional parameters. - - - - Call the InitializeCompleted event. - - - - - Performs a callback. Null action and/or result are permitted. - - The optional callback action. - The result to pass back. - - - - Event fired once initialization is complete. - - - - - Gets the display name for the provider. - - - - - Gets the owning test service. - - - - - Gets a value indicating whether the provider has been initialized - yet. - - - - - Initializes a new code coverage provider. - - The test service. - - - - Save string-based code coverage data. - - The code coverage data, as a string. - The callback action. - - - - A provider of environment variables and environmental information that - uses the test service provider infrastructure. - - - - - Initializes a new environment provider. - - The test service. - - - - Retrieve an environment variable from the system. - - The variable name. - The callback action. - - - - Miscellaneous internal extension methods. - - - - - Attempts to retrieve a custom assembly attribute. - - The type of attribute to retrieve. - The assembly reference. - An out attribute reference. - Returns true if the attribute is found. - - - - Transform the XElement into a dictionary of key/value pairs. - - The type of enumeration. - The key type. - The value type. - The root enumerable. - The key selector. - The item selector. - Returns a new dictionary. - - - - A type that stores global settings in the isolated storage for the - application. An implementation of the - type. - - - - - A provider of string dictionary values. - - - - - Initializes a new SettingsProvider object. - - The test service. - - - - Initializes a new SettingsProvider object. - - The test service. - The service name. - - - - Saves the settings. - - Classes that inherit from SettingsProvider: hide this - function. Do not call up through to this base method. - The service callback. - - - - Gets the settings dictionary. - - - - - Gets a value indicating whether the settings are read-only. - - - - - Gets the settings source for end-user display. - - - - - The unique key used for storing the test framework's settings - dictionary. - - - - - The underlying settings object. - - - - - Initializes a new isolated storage settings provider. - - The test service instance. - - - - Initializes the isolated storage settings provider. - - - - - Saves the current settings values. - - The service completion callback. - - - - Recalls the stored settings values from isolated storage. - - - - - Initialize the isolated storage application settings object. - - - - - Result object for asynchronous test service response. - - - - - Creates a new ServiceResult object for a failed result, the - sets the exception. - - The Exception object. - Returns a new ServiceResult with the Exception set. - - - - The result LINQ element. - - - - - Initializes a new instance of the ServiceResult class. - - - - - Process the response text. - - - - - Attempt to process and return the root element of a successful - request. Returns null if there was an Exception. - - The root XML element of the response. - - - - Sets the result. - - The LINQ element for the result. - - - - Gets or sets a value indicating whether the result has been - processed. - - - - - Gets or sets the exception intercepted or generated during the - request or - processing timeframe. - - - - - Gets the root XElement of the test service result. - - - - - Gets a value indicating whether the request was successful. - - - - - The type of test service in use. Used by the more advanced service - scenarios in SilverlightTestServiceProvider. - - - - - No service, or unknown service type. - - - - - A direct connection, be it the file system, isolated storage, or - similar. - - - - - A web service. - - - - - The Silverlight test service provider is built for compilation with - Silverlight builds of the test framework. Populates with the important - providers for web browser-hosted test runs. - - - The Silverlight test service provider is built for compilation with - Silverlight builds of the test framework. Populates with the important - providers for web browser-hosted test runs. - - - - - A system that provides test services. - - - - - The dictionary of services registered with this provider instance. - - - - - Initializes a new test service provider instance. - - - - - Initializes the provider and all of its test services. - - - - - Initialize all services and features synchronously. - - - - - Register a new service that the test service should expose. - - Known feature type. - Instance of the feature's - type. - - - - Register a new service that the test service should expose. - - String name of the feature if the known - enum value does not exist. - Instance of the feature's - type. - - - - Unregisters a feature. - - Known feature type. - - - - Unregisters a feature. - - Known feature type string. - - - - Check if a requested feature is supported by the test service - provider. - - Feature of interest. - A value indicating whether the feature exists. - - - - Check if a requested feature is supported by the test service - provider. - - Feature of interest. - A value indicating whether the feature exists. - - - - Retrieve a feature. An exception will be thrown if the service - does not exist. - - Type of a service, ProviderBase. - The feature of interest. - Returns the feature, cast properly. - - - - Retrieve a feature. - - Feature of interest. - The feature's provider. - - - - Retrieve a feature. - - Feature of interest. - The service or null if one was not present. - - - - Require a feature, or throw an exception if it isn't available. - - Feature of interest. - The required type. - The service or null if one was not present. - - - - Require a feature, or throw an exception if it isn't available. - - Feature of interest. - The required type. - The service or null if one was not present. - - - - Require a feature or interest. - - Feature of interest. - The service or null if one was not present. - - - - Requires a service. - - Feature of interest. - The service or null if one was not present. - - - - Check for and required the presence of a service. Throws an - InvalidOperationException message if the service is unavailable. - - Feature of interest. - The service or null if one was not present. - - - - Require a specific feature, and that it can be cast properly. - - Feature of interest. - The type to verify assignment for a cast. - The service or null if one was not present. - - - - Looks for a specific service. - - Feature of interest. - The service or null if one was not present. - - - - Gets or sets a unique test run identifier, if any is present. - - - - - Gets or sets an integer value that can be used to manage simple - reference counting services. - - - - - The service verifier and information. - - - - - Initializes a new instance of the SilverlightTestService class. - - - - - Initializes a new instance of the SilverlightTestService class. - - Unit test settings to read the service path - and other information from. - - - - Initializes the Silverlight test service. Performs a service check - if needed before initializing the other providers. - - - - - Sets the custom ID information for the test run, if passed into - the run. - - - - - Determine the service path to attempt to use, and prepares the - verification object using those parameters. - - Unit test settings object to try and read - settings from. - - - - Pauses the initialization process to attempt a service connection. - The result will alter the underlying ServiceType being used by - this provider to ensure a fallback experience can be used. - - This verification step will block the initialization and entire - test run until it continues. - - - - - Continues the initialization process for the test service provider. - - - - - Populates with the standard providers for Silverlight in-browser - testing. - - - - - Gets the service type that is in use. - - - - - Gets the web service proxy. - - - - - A special verification class used by SilverlightTestService. - - - - - The name of a simple 'ping' method exposed by the service. - - - - - Attempts to verify the service connection. Calls the proper - success/failure Action once a verification result is possible. - - The Action to call upon connection - verification. - An Action to call upon failure. - - - - Gets or sets the service hostname. - - - - - Gets or sets the service port. - - - - - Gets or sets path to the simple POX service. - - - - - Gets the URI to the service. - - - - - A test service that reports test run results. - - - - - Initializes a new reporting provider instance. - - The test service. - - - - Begins a call to the test service to write to the log. - - The callback, used to read or verify results - from the service call. - The name of the log to write. - The log file content. - - - - Begins a call to the test service to report a test run's results. - - The callback, used to read or verify results - from the service call. - A value indicating whether the test run was a - failure. - The failed scenario count. - The total scenario count. - Any message to report along with the failure. - - - - Set of known, well-defined test service features. - - - - - Code coverage reporting. - - - - - Provides run parameters and settings. - - - - - Provides test reporting services. - - - - - Provides environment information. - - - - - A provider of code coverage information to an external process. - - - - - The MethodName_SaveCodeCoverage method name. - - - - - Initializes a new code coverage provider. - - The test service. - - - - Save string-based code coverage data. - - The code coverage data, as a string. - The callback action. - - - - A provider of environment variables and environmental information that - uses the test service provider infrastructure. - - - - - The MethodName_GetEnvironmentVariable method name. - - - - - Initializes a new environment provider. - - The web test service. - - - - Retrieve an environment variable from the system. - - The variable name. - The callback action. - - - - Result object for asynchronous test service response that uses a simple - web service / POX call. - - - - - Initializes a new web service result. - - The request object. - The response object. - - - - Initializes a new web service result. - - The request object. - The response object. - The details to associate for debugging - purposes. - - - - Reads the web response, if successful, and parses out the string - content. - - - - - Process the response text. - - - - - Gets the web request associated with the service call. - - - - - Gets the web response associated with the service call. - - - - - Gets the details of the request, used for interactive debugging - sessions only. - - - - - Gets the string retrieved from the response. - - - - - A test service that reads command line settings. - - - - - Name of the method MethodName_GetRunParameters. - - - - - Initializes a new settings provider instance. - - The test service. - - - - Initialize the web settings provider. - - - - - Read the run parameters. - - The service result. - - - - A test service that reports test run results. - - - - - Name of the method MethodName_ReportTestResults. - - - - - Name of the method MethodName_WriteLog. - - - - - Initializes a new reporting provider instance. - - The test service. - - - - Begins a call to the test service to write to the log. - - The callback, used to read or verify results - from the service call. - The name of the log to write. - The log file content. - - - - Begins a call to the test service to report a test run's results. - - The callback, used to read or verify results - from the service call. - A value indicating whether the test run was a - failure. - The failed scenario count. - The total scenario count. - Any message to report along with the failure. - - - - Provides out-of-process access to operating system functions and other - services such as visual verification, if present. - - - Provides out-of-process access to operating system functions and other - services such as visual verification, if present. - - - Provides out-of-process access to operating system functions and other - services such as visual verification, if present. - - - - - The service address. - - - - - The synchronization context. - - - - - Initializes a new plain-old-XML test service. This assumes that - the caller has already verifier that a service is present and - responding at the service address. - - The base service URI, such as - "scheme://hostname:port/servicePath/". - - - - Creates a simple REST-style Uri given the method/service name and - a dictionary of key/value pairs to send as arguments. - - The method/service name. - A set of key/value pairs. - Returns a new Uri. - - - - Creates a simple REST-style Uri given the method/service name and - a dictionary of key/value pairs to send as arguments. - - The method/service name. - A set of key/value pairs. - Optional query string. - Returns a new Uri. - - - - Builds a simple dictionary from parameters. The value follows the - key parameter. {[key, value], } ... - - The ToString() method is called on every object. - - The parameters. - Returns a key/value dictionary from the parameters. - - - - Begin a POX method call. The callback is used with the result when - it becomes available. - - The method name. - The callback action. - - - - Begin a POX method call. The callback is used with the result when - it becomes available. - - The method name. - Dictionary of key/value pairs. - The callback action. - - - - Begin a POX method call. The callback is used with the result when - it becomes available. - - The method name. - Dictionary of key/value pairs. - Optional string that will transform the - request to a POST request. - The callback action. - - - - The intermediate step that writes the POST data and then continues - the web request. - - The async result object. - - - - Process the response callback from a POX method call. - - The async result object. - - - - On the UI thread, invoke the callback action with the result. - - The temporary state object. - - - - A simple type to store the state information for the cross-thread - callback. - - - - - Initializes a new TemporaryStateObject object. - - The callback action. - The result object. - - - - Gets the callback action. - - - - - Gets the result object. - - - - - The request data class, stores information used in a request for - associating this data with the response. - - - - - Initializes a new request data object. - - The request Uri. - The request object. - The callback action. - - - - Converts the request data object into a web service result - object. - - The response object. - Returns a new WebServiceResult instance. - - - - Gets or sets the optional post data for the request. - - - - - Gets the web request. - - - - - Gets the request Uri. - - - - - Gets the callback action. - - - - - A type which handles preparing the underlying dispatcher or timer from - which the test work items execute. - - - - - Handle calling into the test framework as needed to perform the test - run, process the internal test dispatcher queue, and keep execution - moving forward. - - - - - Delegate that returns whether more work remains and runs the next - set of work. - - - - - Backing field for a value indicaing whether the dispatcher should be - running. - - - - - Creates a new RunMethodManager, taking in a conditional delegate to - run for each step to see if more work remains. - - - The conditional delegate that performs work and indicates whether - additional work remains. - - - - - Create a new run method manager object. - - - Conditional indicating whether more work will remain after - performing the work. - - - Returns the run method manager. Typically depends on the execution - platform and environment. - - - - - Create a new run method manager object. - - - Conditional indicating whether more work will remain after - performing the work. - - A Dispatcher instance. - - Returns the run method manager. Typically depends on the execution - platform and environment. - - - - - A completely synchronous implementation, unless overridden, that - calls RunNextStep() until the harness is finished. - - The default implementation will not work with a presentation-rich - test environment. - - - - - Calls a conditional delegate, and returns whether there is more work - to be done. - - - Returns a value indicating whether there is additional work - remaining after executing the current work. - - - - - Calls the Complete event handler. - - - - - Event that is called when all work is complete. - - - - - Gets or sets a value indicating whether the dispatcher should be - running. - - - - - Stored Dispatcher instance. - - - - - Sets up a new run method manager. - - - Conditional delegate which returns true as long as there is - additional work. - - An instance of the dispatcher to use. - - - - Begin the execution process by hooking up the underlying - DispatcherTimer to call into the test framework regularly and - perform test work items. - - - - - A data object that generates property change notifications and can - be used for rich data binding to test results. Does keep a reference - to all results. - - - - - Parent object reference. - - - - - Initializes a new instance of the TestClassData type. - - The test class metadata. - The parent test assembly data object. - - - - Backing store for the set of test class. - - - - - Backing field for the expanded property. - - - - - Collapses the test class node unless there is at least one child - test method that failed. - - - - - Backing field for a passed value. - - - - - Retrieves the results report. - - Returns a string containing the report. - - - - Gets the parent data object. - - - - - Gets the name of the test class. - - - - - Gets the namespace for the test class. - - - - - Gets an observable collection of test class data objects. - - - - - Gets or sets a value indicating whether the item is expanded in - a hierarchical display. - - - - - Gets or sets the checked value. Don't think this is actually used. - - - - - Gets or sets a value indicating whether the test passed. If failed, - will propagate to the parent metadata object. - - - - - A data object that generates property change notifications and can - be used for rich data binding to test results. Does keep a reference - to all results. - - - - - The unit test harness instance. - - - - - Backing field for information about the test application in use. - - - - - Initializes a new instance of the test run results. - - The unit test harness. - - - - Backing store for the set of test assemblies. - - - - - Title backing field. - - - - - Stores the total number of expected scenarios. - - - - - Stores the current test information. - - - - - Stores the current test information. - - - - - Stores the number of run scenarios. - - - - - Count of failed scenarios. - - - - - Backing field for whether the app is running. - - - - - Gets the test application information instance. - - - - - Gets the unit test harness instance. - - - - - Gets an observable collection of test assembly data objects. - - - - - Gets or sets the informational run title. - - - - - Gets or sets the number of total scenarios. - - - - - Gets or sets the current test name. - - - - - Gets or sets the current test name. - - - - - Gets or sets the number of run scenarios. - - - - - Gets or sets the number of failed scenarios. - - - - - Gets a value indicating whether the run is complete and passed. - - - - - Gets a value indicating whether all passing results have been - processed. - - - - - Gets the number of passed scenarios, defined as the number of - run scenarios minus the number of failed scenarios tracked. - - - - - Gets a value indicating whether the dispatcher is currently running. - - - - - Gets a value indicating whether the test run is in action. - - - - - Assembly complete event arguments. - - - - - Generic unit test harness event arguments base class that contains a - reference to the harness. - - - - - Initializes a new instance of the UnitTestHarnessEventArgs class. - - The test harness. - - - - Gets the unit test harness reference. - - - - - Initializes a new instance of the TestAssemblyCompletedEventArgs - type. - - The assembly metadata. - The test harness instance. - - - - Gets the assembly metadata. - - - - - Test assembly starting event arguments. - - - - - Initializes a new instance of the TestAssemblyStartingEventArgs - type. - - The assembly metadata. - The unit test harness instance. - - - - Gets the assembly metadata information. - - - - - The test class completed event arguments. - - - - - Initializes a new instance of the TestClassCompletedEventArgs - class. - - Test class metadata. - The harness instance. - - - - Gets the test class metadata. - - - - - Information about the start of a test class event. - - - - - Initializes a new instance of the TestClassStartingEventArgs type. - - The test class metadata. - The unit test harness reference. - - - - Gets the test class instance. - - - - - Test method starting event arguments. - - - - - Initializes a new instance of the TestMethodStartingEventArgs type. - - The test method metadata. - The test class metadata. - The test harness instance. - - - - Gets the test method metadata. - - - - - Gets the test class metadata. - - - - - Test method completed event arguments, contains the result. - - - - - Initializes a new instance of the TestRunStartingEventArgs - type. - - The test run filter. - The test run settings object. - - - - Gets the unit test run settings. - - - - - Gets the test run filter. - - - - - Gets or sets the test harness name. - - - - - Gets or sets the number of valid, enqueued assemblies scheduled. - - - - - Tag attribute used to associate individual test cases with tags to - easily test related functionality. - - - The infrastructure associated with the TagAttribute is not yet in place. - - - - - List of reserved words that cannot be used as tags. - - - This list should be shared with the tag parser implementation when - available. - - - - - List of reserved characters that cannot be used in tags. - - - This list should be shared with the tag parser implementation when - available. - - - - - Initializes a new instance of the TagAttribute class. - - - Tag associated with the test method or class. - - - - - Gets the tag associated with the test method or class. - - - - - Set of extension methods used by the harness. - - - - - An AddRange implementation for the generic IList interface. - - The list type. - The list object. - The collection to copy into the list. - - - - Replace a list's contents with the items in the IEnumerable. - - The list type. - The list object. - The sequence to copy into the list. - - - - The IProvideDynamicTestMethods interface is used to provide additional - test methods dynamically at runtime. - - - - - Get the dynamic test methods. - - Sequence of dynamic test methods. - - - - A type filter for just a specific test. Allows the re-running of a - single result again in the same process. - - - - - A type to filter down complete sets of classes, tests and methods. - - - - - The default unit test run name. - - - - - Unit test settings. - - - - - Initializes a new test run filter using an existing settings file. - - A unit test settings instance. - The unit test harness. - - - - Retrieve a set of test classes from a test assembly. - - The test assembly metadata object. - Test class instance dictionary. - Returns a new list of test class metadata objects. - - - - Sort the test classes if the settings for alphabetical sorting are - present. - - List of test classes. - - - - Filter out tests based on the standard-supported methods. - - List of test classes. - Test class instance dictionary. - - - - Perform any custom filtering that the TestRunFilter needs. - - List of test classes. - Test class instance dictionary. - - - - If specific string-contains filters are present. - - List of test classes. - Test class instance dictionary. - - - - If any exclusive classes are found, filter them. - - List of test classes. - Test class instance dictionary. - - - - Retrieves the test methods from a test class metadata object. - - The test class metadata object. - The test class instance. - Returns a list of test method metadata objects. - - - - Filter the test methods. - - List of test methods. - - - - Perform any custom filtering that the TestRunFilter needs. - - List of test methods. - - - - If any exclusive classes are found, filter them. - - List of test methods. - - - - Sorts the test methods, if requested. - - List of test methods. - - - - Gets a friendly name for the test run. - - - - - Gets the unit test harness. - - - - - The test class. - - - - - The test method. - - - - - Initializes a new test run filter using an existing settings file. - - The test class metadata. - The test method metadata. - - - - Retrieve a set of test classes from a test assembly. - - The test assembly metadata object. - Test class instance dictionary. - Returns a new list of test class metadata objects. - - - - Retrieves the test methods from a test class metadata object. - - The test class metadata object. - The test class instance. - Returns a list of test method metadata objects. - - - - A helper class that manages tags and associated metadata. Tag - expressions are evaluated at the TestClass level. - - - A helper class that manages tags and associated metadata. Tag - expressions are evaluated at the TestClass level. - - - A helper class that manages tags and associated metadata. Tag - expressions are evaluated at the TestClass level. - - - - - The prefix for any tags generated from priority values. - - - - - A reference to the tag attribute type. - - - - - The test tags associated with the class. - - - - - The test tags associated with methods. - - - - - The ability to grab the set of methods, given a test class type, - and the tag of interest. - - - - - The test class type. - - - - - Initializes a new tag manager. - - The test class type. - The set of methods to run. - - - - Reflect, read and prepare the tags for the class metadata. Performs - the work if this is the first time the metadata has been seen. - - The reflection object for the test class. - - - - Reflect, read and prepare the tags for the method metadata. Performs - the work if this is the first time the metadata has been seen. - - The method metadata. - - - - Get the test methods that correspond to a tag expression. - - Tag expression. - Test methods for the tag expression. - - - - Gets or sets the universe of all test methods for expression - evaluation. - - - - - Evaluate tag expressions. - - - Tag expressions are derived from the following EBNF grammar: - {Expression} := - {Expression} + {Term} | - {Expression} - {Term} | - {Term} - {Term} := - {Term} * {Factor} | - {Factor} - {Factor} := - !{Factor} | - ({Expression}) | - {Tag} - {Tag} := - All | - [^InvalidCharacters]+ - - The non-terminals for {Expression} and {Term} will be left factored - in the recursive descent parser below. - - - - - Union character. - - - - - Intersection character. - - - - - Complement character. - - - - - Difference character. - - - - - The "All" string constant. - - - - - Invalid characters in a tag name. - - - - - Evaluate a tag expression. - - The owner object. - Tag expression. - Test methods associated with the tag expression. - - - - The owning TagManager instance. - - - - - Expression being evaluated. - - - - - Current position in the expression. - - - - - Create an expression evaluator. - - The owner object. - Expression object. - - - - Match a sequence of characters. - - String to match. - - - - Try to match a sequence of characters. - - String to match. - Returns a value indicating whether the match was - successful. - - - - Evaluate an expression. - - Test methods described by the expression. - - - - Evaluate an expression. - - Test methods described by the expression. - - We need to factor out left recursion, so: - {Expression} := - {Expression} + {Term} | - {Expression} - {Term} | - {Term} - becomes: - {Expression} := - {Term}{Expression'} - - {Expression'} := - #empty# - + {Term}{Expression'} - - {Term}{Expression'} - - - - - Evaluate an expression. - - - Left term already read as part of the expression. - - Test methods described by the expression. - - Non-terminal created for left-factoring: - {Expression'} := - #empty# - + {Term}{Expression'} - - {Term}{Expression'} - - - - - Evaluate a term. - - Test methods described by the expression. - - We need to factor out left recursion, so: - {Term} := - {Factor} * {Term} | - {Factor} - becomes: - {Term} := - {Factor}{Term'} - - {Term'} := - #empty# - ^ {Factor}{Term'} - - - - - Evaluate a term. - - - Left term already read as part of the expression. - - Test methods described by the expression. - - Non-terminal created for left-factoring: - {Term'} := - #empty# - ^ {Factor}{Term'} - - - - - Evaluate a factor. - - Test methods described by the expression. - - {Factor} := - !{Factor} | - ({Expression}) | - {Tag} - - - - - Creates a new empty collection. - - Returns an empty collection. - - - - Evaluate a tag. - - Test methods described by the expression. - - {Tag} := - All | - [^InvalidCharacters]+ - - - - - A string list for storing tags. Provides an Add method that takes - an attribute object and, if a TagAttribute, will append its tag - value to the list. - - - - - Initializes a new Tags instance. - - - - - Initializes a new Tags instance from an existing collection. - - The collection to copy. - - - - Adds a TagAttribute's tag value. - - The tag object. - - - - A method and class filter that uses expressions and the TagAttribute. - - - - - The name to use for the test run when the tag expression is null. - - - - - Initializes a new test run filter with the tag expression setting. - - Unit test settings. - Unit test harness. - - - - Initializes a new test run filter with the tag expression. - - Unit test settings. - Unit test harness. - The tag expression to use. - - - - Sets the tag expression property. - - The tag expression to use. - - - - A value indicating whether the warning has been logged yet. - - - - - Apply tag filtering. - - List of test classes. - Test class instance dictionary. - - - - Apply tag filtering. - - List of test methods. - - - - Apply the tag filtering. - - The tag manager instance. - Set of methods. - - - - Exclusive attributes are not supported when also using tagging. - - List of test classes. - Test class instance dictionary. - - - - Exclusive attributes are not supported when also using tagging. - - List of test methods. - - - - Gets the tag expression in use by the run filter. - - - - - Helper code for TestAssembly logic. - - - - - Check whether [Exclusive] attribute is present on any classes. - - Collection of class metadata objects. - Returns a value indicating whether any of the classes - include an [Exclusive] attribute. - - - - Sorts the test classes alphabetically by name. - - A list of test class metadata objects. - - - - Test class helper. - - - - - A value indicating whether the warning has been logged in this run. - - - - - Filter the set of test classes by removing unused classes. - - The input list of test class metadata objects. - The classes to run. - - - - Look through the classes for the [Exclusive] attribute. If found, - remove any classes where the attribute is not present. - - The input list of classes. - The log writer object. - - - - Look for the /p:FilterClass parameter in the test harness settings. - Try to do a substring match on all filtered test classes. - - The parameters. - List of test classes to be filtered. - - - - Test method completed event arguments, contains the result. - - - - - Initializes a new instance of the TestMethodCompletedEventArgs - type. - - The result instance. - - - - Initializes a new instance of the TestMethodCompletedEventArgs - type. - - The result instance. - The unit test harness. - - - - Gets the test method result. - - - - - Helper code for TestMethod logic. - - - - - A value indicating whether the warning has been logged in this run. - - - - - Check whether [Exclusive] is present on >= 1 of the methods. - - The methods to search through. - True if at least one of the methods has Exclusive. - - - - Look through the methods for the [Exclusive] attribute. If found, - remove any methods where the attribute is not present. - - The methods to filter. - The log writer object. - - - - A helper utility for firing events as the unit test harness from any - component, internal or not. Enables expansion. - - - - - Stored instance of the harness. - - - - - Initializes a new intance of the UnitTestHarnessEvents helper. - - The harness reference. - - - - Calls the test assembly starting event. - - The event data. - - - - Calls the test assembly completed event. - - The event data. - - - - Calls the test class starting event handlers. - - The event data. - - - - Calls the test class completed event. - - The event data. - - - - Calls the test method starting event. - - The event data. - - - - Calls the test method completed event. - - The event data. - - - - Calls the test run starting event. - - The event data. - - - - A factory for creating the unit test objects. - - - - - The unit test harness. - - - - - Initializes a new unit test logic factory. - - The unit test harness reference. - - - - Creates a new AssemblyManager. - - The unit test provider. - The run filter. - The unit test assembly metadata object. - Returns a new AssemblyManager. - - - - Creates a new TestClassManager. - - The unit test provider. - The run filter. - The test class metadata. - The test class instance. - Returns a new TestClassManager. - - - - Creates a new TestMethodManager. - - The unit test provider. - The test class metadata. - The test method metadata. - The test class instance. - Returns a new TestMethodManager. - - - - A log provider that outputs in a simple custom test format that Visual - Studio recognizes. - - - A log provider that outputs in a simple custom test format that Visual - Studio recognizes. - - - - - LogProvider interface with a single Process method that handles a - LogMessage object. - - - - - A dictionary of conditional action handlers. - - - - - A dictionary of types/actions for handling specific types of log - messages. - - - - - Perform any needed operations to log the message. - - Instance of LogMessage type. - - - - Method that processes any messages not handled any other way. - - The log message. - - - - Registers an action for a specific message type. - - The type of interest. - The handler for the type. Takes a LogMessage - parameter. - - - - Registers a conditional handler. During the log message processing - step, all conditional callbacks will be tried. The first positive - result will then call the associated processing Action for that - conditional method entry. - - A conditional callback that takes a - LogMessage input parameter. - A log message processing Action that is called - when the condition is true. - - - - Removes a conditional callback. - - The condition. - - - - Clear all existing conditional handlers. - - - - - Clear all existing message type handlers. - - - - - Interface for LogProviders that want access to external test settings. - - - - - Initializes the provider. - - The settings. - - - - The filename to use for saving test results. - - - - - The default test adapter type name. - - - - - The default test list name. - - - - - The default computer name. - - - - - The default user name. - - - - - The default configuration name. - - - - - The default configuration description. - - - - - The Visual Studio log format writer. - - - - - Initializes a new instance of the VisualStudioLogProvider class. - - - - - Register the handler conditions of interest to this log provider. - - - - - Assembly start code. - - The log message. - - - - Process an Exception that was not the expected Exception type. - - The log message. - - - - Process an Exception that is logged or stored. - - The log message object. - - - - Sets the test run configuration information when the test assembly - begins processing. - - The test assembly metadata object. - - - - Generate a name for the test run that will be used when - displaying the result in Visual Studio. - - The test assembly metadata object. - Returns the test run name. - - - - Generates a new Guid string value. - - Returns a new Guid string value. - - - - Process a UTF result message. - - The log message object. - - - - Process [Bug(...)]. - - A KnownBugLogMessage object. - - - - The run filter has been selected. - - The log message object. - - - - Saves the log file data. - - The unit test harness. - - - - Initializes the test harness. - - The test harness settings. - - - - Gets or sets the test results filename. - - - - - Gets or sets the test adapter type name reported in the Visual - Studio results log file. - - - - - Gets or sets the TestRunId. - - - - - Gets or sets the test list name. - - - - - Gets or sets the computer name that is reported in the results - log file. - - - - - Gets or sets the user name that is reported in the results file. - - - - - Gets or sets the TestRunConfigurationName. - - - - - Gets or sets the TestRunConfigurationDescription. - - - - - Gets or sets a prefix for use in the test run name. - - - - - Gets or sets the TestRunConfigurationId. - - - - - Gets the current assembly name. - - - - - A log provider that outputs in a simple custom test format that - Visual Studio recognizes. This is a simple, subset writer. - - - - - Date time format string representing round-trip date/time - pattern. - - - - - A unique ID representing the Visual Studio unit test type ID. - - - - - The namespace for Visual Studio team test results. - - Was of XNamespace type in XLinq implementation. - - - - A dictionary containing test list names and guids. - - - - - Stores temporary, pending elements for the next result. - - - - - Initializes a new Writer object. - - - - - Stores property values in the respective elements, clears any - lookup dictionaries. - - - - - Returns a string value of the DateTime object. - - The DateTime object. - Returns the formatted string. - - - - Returns the XML log file as a string. - - The XML value. - - - - Creates the initial results document and its XElements. - - - - - Creates a new XElement within the results XML namespace. - - The element name. - Returns a new named element. - - - - The total number of scenarios. - - - - - The set of outcomes and counts. - - - - - Increment the number of passing results. - - The test outcome. - - - - Adds the result of a test method into the log. - - The test metadata. - The storage value. - The code base value. - The adapter type name. - The class name. - The test list name. - The computer name. - The start time. - The end time. - The outcome. - - - - Adds a WriteLine to the next result to be processed. - - The text to output. - - - - Adds an error message to the next result to be processed. - - The message. - - - - Adds an Exception to the next result to be processed. - - The Exception object. - - - - Adds pending output for the next result. - - The element to wrap in an Output element. - - - - Returns the GUID for a test list name. The result is stored - in memory. - - The test list name. - Returns the test list name guid. - - - - Gets or sets the time that the test run started. - - - - - Gets or sets the time that the writer object and/or test run was created. - - - - - Gets or sets the time that the test run was finished. - - - - - Gets the root XML node for the test run and its results. - - - - - Gets or sets the test type ID used for new results. - - - - - Gets the TestRunConfiguration element. - - - - - Gets the Counters element. - - - - - Gets the TestDefinitions element. - - - - - Gets the TestLists element. - - - - - Gets the TestEntries element. - - - - - Gets the Times element. - - - - - Gets the ResultSummary element. - - - - - Gets the Results element. - - - - - Sets the TestRunId. - - - - - Sets the TestRunName. - - - - - Sets the TestRunUser. - - - - - Sets the TestRunConfigurationName. - - - - - Sets the TestRunConfigurationId. - - - - - Sets the overall run outcome value. - - - - - Sets the TestRunConfigurationDescription. - - - - - A user control that should be used as the root visual for a Silverlight - plugin if developers would like to use the advanced TestSurface - functionality within Microsoft.Silverlight.Testing. - - The TestSurface is automatically cleared after each test scenario - completes, eliminating the need for many additional cleanup methods. - - - - - Initializes the TestPage object. - - - - - InitializeComponent - - - - - Gets the test surface, a dynamic Panel that removes its children - elements after each test completes. - - - - - A log provider that outputs failures as a string. - - - - - A list of failing results. - - - - - Initializes a new TextFailuresLogProvider instance. - - - - - Retrieve the text log of all failures in the unit test run. - - Returns the log contents. - - - - Register the handler conditions of interest to this log provider. - - - - - Process a UTF result message. - - The log message object. - - - - A user control that should be used as the root visual for a Silverlight - plugin if developers would like to use the advanced TestSurface - functionality within Microsoft.Silverlight.Testing. The TestSurface is - automatically cleared after each test scenario completes, eliminating - the need for many additional cleanup methods. - - - - - Backing field for the unit test harness instance. - - - - - Backing field for the model manager. - - - - - Backing field for the startup timer. - - - - - Backing field for a value indicating whether the clipboard feature - is supported. - - - - - Initializes the TestPage object. - - - - - Initializes the TestPage object. - - The test harness instance. - - - - Waits for the Settings to become available, either by the service or - system setting the instance property. - - The source timer. - The event arguments. - - - - Starts the test run. - - - - - Handles the test assembly starting event to expand the test stage - height. - - The source object. - The event data. - - - - Handles the test harness complete event, to display results. - - The source object. - The event data. - - - - Handles the click on the test stage. - - The source object. - The event data. - - - - Expand and collapse the test stage. - - A value indicating whether to expand the stage. - - - - - Handles the completion of a test method. - - The source object. - The event arguments. - - - - Handles the completion event on the tag expression editor to begin - the test run using the user-provided settings. - - The source object. - The event arguments. - - - - Handles navigation back or forward. - - The source object. - The event arguments. - - - - Installs the application. - - The source object. - The event arguments. - - - - Offers clipboard interface support for copying test run results. - - The source object. - The event arguments. - - - - Handles the click on a play/pause button for the run dispatcher. - - The source object. - The event arguments. - - - - Copies text into the clipboard. If the Silverlight runtime on the - system does not support the clipboard API, then it reverts to a - large text box that allows the user to manually copy and paste. - - The text to set. - - - - InitializeComponent - - - - - Gets the test surface, a dynamic Panel that removes its children - elements after each test completes. - - - - - Gets the unit test harness instance. - - - - - Gets the tree view instance. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to There are no remaining test work items. - - - - - Looks up a localized string similar to Exception: Type "{0}" Message "{1}". - - - - - Looks up a localized string similar to Ignoring "{0}". - - - - - Looks up a localized string similar to Incorrect exception type "{0}" received. Was expecting a "{1}" type.. - - - - - Looks up a localized string similar to No Exception was observed. Was expecting a "{0}" type exception.. - - - - - Looks up a localized string similar to Tag cannot be empty!. - - - - - Looks up a localized string similar to The tag "{0}" contains the invalid character "{1}"!. - - - - - Looks up a localized string similar to Tag "{0}" is reserved!. - - - - - Looks up a localized string similar to tagExpression cannot be empty!. - - - - - Looks up a localized string similar to Expected end of tag expression "{0}" at position {1}!. - - - - - Looks up a localized string similar to Tag expected in expression "{0}" at position {1}!. - - - - - Looks up a localized string similar to Invalid tag expression "{0}" (expected "{1}" at position {2})!. - - - - - Looks up a localized string similar to Tag expression "{0}" is in use.. - - - - - Looks up a localized string similar to Exclusive classes are in use. - - - - - Looks up a localized string similar to Exclusive methods are in use. - - - - - Looks up a localized string similar to The known issue could not be verified. A failure will be recorded. If this bug has been fixed, please mark the Fixed attribute value to True.. - - - - - Looks up a localized string similar to No TestHarness is available.. - - - - - Looks up a localized string similar to The "{0}" functionality is not supported within this unit test system.. - - - - - Looks up a localized string similar to Initialization of UnitTestHarness. - - - - - Looks up a localized string similar to No composite work items exist to be cleared.. - - - - - Looks up a localized string similar to No test classes were selected to be in the test run.. - - - - - Looks up a localized string similar to Test harness was not specified on test harness settings object. If a test harness settings object was passed in, please verify that it contains a reference to a test harness.. - - - - - Looks up a localized string similar to Test bug: A test cannot use Test Task objects, such as callbacks and conditionals, or the PumpMessages feature, unless marked with the [Asynchronous] attribute.. - - - - - A central entry point for unit test projects and applications. - - - A central entry point for unit test projects and applications. - - - - - Friendly unit test system name. - - - - - A partial method for PrepareDefaultLogManager. - - The test harness settings. - - - - A partial method for setting the TestService. - - The test harness settings. - - - - Creates a new TestPage visual that in turn will setup and begin a - unit test run. - - A new RootVisual. - Assumes the calling assembly is a test assembly. - - - - Creates a new TestPage visual that in turn will setup and begin a - unit test run. - - Test harness settings to be applied. - A new RootVisual. - Assumes the calling assembly is a test assembly. - - - - Merge any settings provided by a test service with the parameters - that were passed inside the TestHarnessSettings. - - The test service. - The run settings. - - - - Initializes the test service and its contained providers. - - The run settings. - Action to call once the test service is - initialized and ready to continue the run's execution. - - - - Register another available unit test provider for the unit test system. - - A unit test provider. - - - - Test harness instance. - - - - - Start a new unit test run. - - Unit test settings object. - - - - Prepares the default log manager. - - The test harness settings. - - - - Tries to instantiate and initialize a VSTT provider. Requires that - XLinq is available and included in the application package. - - The test harness settings object. - - - - Creates the default settings that would be used by the UnitTestHarness - if none were specified. - - A new RootVisual. - Assumes the calling assembly is a test assembly. - - - - Call the TestHarnessCompleted event. - - The test harness completed event arguments. - - - - Create a default settings object for unit testing. - - The assembly reflection object. - A unit test settings instance. - - - - Gets the test system name built into the assembly. - - - - - Gets a string representing the file version attribute of the main - unit test framework assembly, if present. - - - - - A completed test harness handler. - - - - - A class contains extension methods and helpers for dealing with WorkItem - instances and improving framework performance. - - - - - Enqueues a work item into the task queue. The work item will run - immediately following the previous work item, and may not leave any - time before executing the next. This is a specialized method to be - used for performance improvements. - - The work item test. - The unit of work. - - - - Enqueues a method into the task queue. The method will run - immediately following the previous work item, and may not leave any - time before executing the next. This is a specialized method to be - used for performance improvements. - - The work item test. - The callback action or method. - - - - Enqueues a conditional statement into the task queue. The method will - run immediately following the previous work item, and may not leave - any time before executing the next. This is a specialized method to - be used for performance improvements. - - The work item test. - The conditional function or statement. - - - - Custom test class that provides the ability to perform semi-asynchronous - test tasks on the main thread. Requires the custom unit test harness - that manages and invokes test work items on the thread when needed. - - Tests using this functionality will not be compatible with the full - desktop framework's Visual Studio Team Test environment. - - - - - Signal that a test is complete when using Async testing. - - WARNING: If you use your own methods for completing, such as an - HtmlTimer or other threading method, it is possible that this call - will occur *AFTER* the test has timed out when using Timeouts. As - such, be very careful as you could complete the call to the *next* - test. - - - - - Add a task object to the test queue. For a test that is currently - executing, all tasks contained within the queue are executed to - completion (unless an Exception is thrown) -before- moving on to - the next test. - - The test task queue replaces the PumpMessages(...) system that - permitted a single callback. This enables specialized tasks, such - as DOM bridge tasks, sleep tasks, and conditional continue tasks. - - Asynchronous test task - instance. - - - - Delay a minimum amount of time before continuing. Similar to a sleep - call that is not a blocking call. - - The minimum time span to wait before continuing. - - - - Creates a delay work item instance. - - The minimum time span to wait before continuing. - Returns a new work item. - - - - Delay a minimum amount of time before continuing. Similar to a sleep - call that is not a blocking call. - - The minimum number of milliseconds to wait - until the delay is finished. - - - - Requires a bool returning delegate to be passed in. Instructs the - test task queue to wait until the conditional call returns True to - continue executing other test tasks and/or ending the test method. - - Conditional method or delegate. - Test will halt until this condition returns True. - - - - Creates a conditional work item instance. - - Conditional method or delegate. - Test will halt until this condition returns True. - Returns a new work item. - - - - Enqueue a test task which calls the TestComplete method of - SilverlightTest. - - - - - Add a Callback method into the test task queue. Similar to the - PumpMessages(...) call, with the difference being that there is no - longer a single requirement: you can enqueue several callback - methods and other test tasks, all of which will execute before the - test completes and/or the engine continues. - - Void-returning delegate, - anonymous delegates work fine too. - - - - Creates a callback work item instance. - - Void-returning delegate, - anonymous delegates work fine too. - Returns a new work item. - - - - Adds a number of callback methods into the test task queue. - - Set of Action instances. - - - - Sleep a minimum number of milliseconds before calling a test - callback delegate. - - Minimum number of - milliseconds to sleep. The only guarantee to the tester - is that the sleep will be >= this amount of ms, and NOT - that there is precision or an exact time. - Callback method to - execute after the minimum amount of time has - elapsed. - - - - Enqueue an action. A shortcut for the EnqueueCallback. - - The action to enqueue. - - - - Sleep a minimum number of milliseconds. This is the simplified - overload which requires no callback. - - Minimum number of - milliseconds to sleep. The only guarantee to the tester is that the - sleep will be >= this amount of ms, and NOT that there is precision - or an exact time. - - - - A special indicator attribute to enable better debugging using - Microsoft.Silverlight.Testing. - - As there is very little parameter information available for a test run, - this attribute singles out specific classes to execute when found. - - This attribute is unique to this environment and not compatible with any - desktop unit test framework without using a shim if it is left in code. - - - - - Implementation of useful properties and features for presentation - platform tests (Silverlight and WPF). - - Tests using this functionality will not be compatible with the full - desktop framework's Visual Studio Team Test environment. - - - - - Gets the test panel. - - - - - Provides access to Silverlight-specific test features and - functionality. - - Tests using this functionality will not be compatible with the full - desktop framework's Visual Studio Team Test environment. - - - - - A test work item is a task that is invoked until it is complete. It - maintains its own state to be able to notify the caller when it is - finally complete, with no further work to be run. - - It is possible that some implementations of a TestWorkItem may actually - contain a set of sub-tasks by implementing a composite pattern. - - - - - A value indicating whether the task can immediately execute. - - - - - Invoke the task. Return false only when the task is complete. - - True if there is additional work to be completed. False - when there is none. - - - - Called by the task after the work is complete. - - - - - Gets a value indicating whether the task's work is complete. - - - - - Gets or sets a value indicating whether the work item can be - executed immediately, and does not rely on special asynchronous - operation. Used for performance improvements. The setter is also - public. - - - - - The extended writer for the unit testing harness and consumers. - - - - - A utility type that writes new log messages to the test harness log - queue. - - - - - The factory used for creating new LogMessage types. - - - - - The test harness that contains the method to post new events into - the log message queue. - - - - - Initialize a new writer class, using the default LogMessageFactory - to create new messages. - - The test harness instance. - - - - Initialize a new writer class. - - The test harness instance. - - The factory to use when creating new messages. - - - - - Posts a log message to the test harness queue for processing. - - The log message object. - - - - Creates a new log message using the embedded factory. - - Returns a new LogMessage instance. - - - - Creates a new log message using the embedded factory. - - The message type. - Returns a new LogMessage instance. - - - - Creates a new log message using the embedded factory. - - The message type. - The text message. - Returns a new LogMessage instance. - - - - Decorate a log message with a value. - - The log message to decorate. - The key for this decoration. - The value of this decoration. - - - - Decorate the log message object with an Exception object. - - The log message object. - The Exception. - - - - Decorate the log message object with a name. - - The log message object. - Name property value. - - - - Decorate the log message object with a test stage value. - - The log message object. - Test stage value. - - - - Decorate the log message object with a test outcome object. - - The log message object. - Test outcome object. - - - - Decorate the log message object with a test granularity object. - - The log message object. - Test granularity object. - - - - Sets the type of the log message. - - The log message object. - The new value to set the message type to. - - - - This writes a new line of information similar to a Debug::WriteLine - call. - - The text to write. - - - - Writes information through a new log message. - - The information string. - - - - Writes a message relating to the test infrastructure. - - The text to write. - - - - Writes an environment message. - - The text to write. - - - - Writes a TestRun message. - - The text to write. - - - - Log an error message. - - The error message string. - The Exception object to decorate the message - with. - - - - Log an error message. - - The error message string. - - - - Log a warning message. - - The warning message string. - The Exception object to decorate the message - with. - - - - Log a warning message. - - The warning message string. - - - - Record a test outcome. - - The accompanying message. - The outcome value. - - - - Writes information about an encountered, known issue. - - Information about the known issue. - - - - Records a log message that indicates a named, granular test stage - has happened. - - Any message for the log. - A name for the object or event. - The test granularity value. - The test stage value. - - - - Initializes the unit test log message writer helper. - - The test harness reference. - - - - Marks a message as a unit test system-specific message. - - The log message object. - - - - An incorrect exception type has occurred. - - The expected type. - The actual exception's type. - The test metadata. - The method metadata. - - - - No Exception was intercepted, yet one was expected. - - The expected exception type. - The test class metadata. - The test method metadata. - - - - Logs and Exception that was intercepted or observed. - - The actual Exception instance. - The test class metadata. - The test method metadata. - - - - Enqueues a Ignore message. - - The granularity of the ignore operation. - The name of the test skipped. - - - - Enqueues a message containing a test run filter. - - The test run filter. - - - - Records a log message that indicates a named, granular test stage has - happened. - - The assembly metadata object. - The test granularity value. - The test stage value. - - - - Log a test class's stage. - - The test class metadata object. - The test stage. - - - - Log the result of a unit test scenario. - - The result of the test. - - - - Log a test method's stage. - - The test method metadata object. - The test stage. - - - - Records a harness state for the unit test harness. - - The unit test harness. - The harness name. - The test stage. - - - - A test harness for interacting with unit test providers such as Visual - Studio Team Test's metadata. - - - - - Display name for this harness. - - - - - Manages the attachment state of a global exception handler. - - - - - Container of all work items for the test harness. - - - - - Manager of the stack of dispatchers, so that the appropriate parent - container handles exceptions and completion events. - - - - - Number of valid test assemblies encountered. - - - - - The current run's known number of test methods. - - - - - Backing field for the event firing helper. - - - - - Initiate unit test harness. - - - - - Queue of log messages awaiting processing. - - - - - Adds a log provider to the listening log providers group. - - Log provider object. - - - - Enqueue a log message object for processing by the log providers. - - The log message object. - - - - Begin running the test harness. - - - Make sure to subscribe to the Complete event before calling this - method, in some harnesses this may be a synchronous Run followed - immediately by the Complete event being fired. - - - - - Complete event. - - The sender. - The event arguments. - - - - Stores a log file for the test run. Depending on the execution - environment, this call may not successful. - - The name of the log file. - The log file content as a string. - - - - If supported by any attached test service, this publishes the final - test results. Typical harness implementations may immediately close - the web browser channel upon receiving the message, so any other - reporting should be done first. - - - - - Process all queued log messages. - - - - - Fill member variables with any non-null settings of the same type. - - Settings container class. - - - - Initializes all log providers. - - - - - Call the TestHarnessCompleted event. - - - - - Call the Publishing event. - - The event arguments. - - - - Overrides the PublishResults method so that final reporting is only - done once all other logging is finished. - - - - - Publish final results. If not yet ready, will keep waiting around - as a work item until it is done. - - - - - Stored dispatcher instance. - - - - - Checks if a reporting provider is connected to the test service. - - Returns true if a reporting provider is connected to the - test service. - - - - Immediately sets the overall status using a log message and - processes the message queue. - - The message to set. - - - - Sets the unit test harness property for a test case that inherits - from the abstract base type 'CustomTest'. - - A CustomText instance. - - - - Initialize the harness with a set of test assemblies. - - - - - Restarts the run dispatcher. - - - - - Track the results for our execution and also track the fail state. - - Scenario result to process. - - - - Fires the test assembly starting event. - - The event data. - - - - Fires the play pause event. - - Event data. - - - - Fires the test assembly completed event. - - The event data. - - - - Fires the test class starting event. - - The event data. - - - - Fires the test class completed event. - - The event data. - - - - Fires the test method starting event. - - The event data. - - - - Notifies observers that a test method has been completed. Also - clears the test panel's visual tree. - - The event data. - - - - Notifies observers that a test run has been started. - - The event data. - - - - Reference to the test page object. - - - - - Attempts to report the code coverage information using the test - service provider. If there is no available coverage reporting - service, this is a silent failure. Only reports if >= 1 blocks - are hit. - - The test service. - - - - Enqueue a test assembly from a simple Assembly reference. - - The test assembly. - The run filter settings for the test assembly's run. - - - - Enqueues a test assembly. - - The test assembly metadata. - The run filter settings for the test assembly's run. - - - - Flush the current log manager and then perform the next invoke. - - Returns true if work remains. - - - - Creates the test run filter for the initial run. - - The unit test settings. - Returns a new TestRunFilter instance. - - - - Determine what test assemblies need to be executed. Enqueue tasks - for the unit test assembly providers to run the tests. - - - - - Calculates the number of methods for a run. - - The assembly manager. - The test assembly. - The test run filter. - Returns the number of known methods returned. - - - - Event fired at the completion of the harness' work. - - Sender object instance. - Event arguments. - - - - Listener event for any unhandled exceptions. - - Sender object instance. - Event arguments. - - - - Creates the set of harness tasks to run and hooks up to the Complete event. - - - - - Gets the list of results. - - - - - Gets the log message writer instance. This can be used to easily - post informative messages to the log message queue and providers. - - - - - Gets or sets the logic factory used for instantiating the - unit test logic and management objects. - - - - - Gets or sets the overall harness state - overloaded types can be - used to store additional information. - - - - - Gets the log providers list. - - - - - Gets or sets the wrapper that handles calling the next Run step - method until complete; allows for a virtual Run method. - - - - - Gets the dictionary of Parameters passed into the test harness. - - - - - Gets or sets the settings used to initialize the test harness. - - - - - Gets a set of events that can be fired for test results and other - important test runtime events. - - - - - The test harness is publishing results. - - - - - Gets the TestService referenced by the test harness settings. The - test service provides advanced, optional functionality that is - useful to harness and test case developers. A typical test service - operates outside the process or security boundary. - - - - - Complete event fired when the test harness has finished its test - run. - - - - - Gets a dispatcher instance. - - - - - Gets the root container for test work to be completed. - - - - - Gets the known number of test methods in the current test run. - - - - - Gets or sets a value indicating whether to intercept exceptions at - the app domain level and funnel into the current container or not. - - - - - Gets the internal DispatcherStack being used by the test harness. - - - - - The test assembly starting event. - - - - - On the play or pause change of the dispatcher. - - - - - Gets or sets a value indicating whether the dispatcher is currently - running. - - - - - Test assembly completed event. - - - - - Test class starting event. - - - - - The test class completed event. - - - - - The test method starting event. - - - - - An event that is fired whenever a test method completes. - - - - - An event that is fired when the test run is starting. - - - - - Gets or sets the test page. - - - - - Gets the test panel manager instance. - - - - - Well-known keys that can be used to mark decorator instances in log - message objects. - - - - - Indicates that the message is specific to the unit test system. - - - - - The unit test harness reference. - - - - - The metadata interfacing object for a test assembly. - - - - - The metadata interfacing object for a test class. - - - - - The metadata interfacing object for a test method. - - - - - Indicates that the incorrect exception was intercepted. - - - - - Indicates that the message indicates a skipped/ignored item. - - - - - The type of the expected exception. - - - - - The type of the actual exception. - - - - - The actual exception. - - - - - A TestRunFilter object. - - - - - A ScenarioResult object. - - - - - Helper conditional methods for unit test-specific log messages. - - - - - Determines whether a log message meets a specific condition or set - of conditions. - - The log message object. - Returns true if the condition is met. - - - - Determines whether a log message meets a specific condition or set - of conditions. - - The unit test decorator of interest. - Returns true if the condition is met. - - - - Returns a value indicating whether the message is marked as a unit - test system message. - - The message. - Returns true if the message is a unit test system-marked - message. - - - - Determines whether a log message meets a specific condition or set - of conditions. - - The log message object. - Returns true if the condition is met. - - - - Determines whether a log message meets a specific condition or set - of conditions. - - The log message object. - Returns true if the condition is met. - - - - Determines whether a log message has an attached TestRunFilter. - - The log message object. - Returns a value indicating whether the condition is met. - - - - Determines whether a log message meets a specific condition or set - of conditions. - - The log message object. - Returns true if the condition is met. - - - - Determines whether a log message meets a specific condition or set - of conditions. - - The log message object. - Returns true if the condition is met. - - - - Determines whether a log message meets a specific condition or set - of conditions. - - The log message object. - Returns true if the condition is met. - - - - A lazy method type. - - - - - A class that does a lazy lookup when needed using reflection. - - - - - Attribute Type instance. - - - - - The Type to search with. - - - - - Whether the search has happened. - - - - - The method reflection object. - - - - - Construct a new lazy method wrapper. - - The attribute type. - - - - Construct a new lazy method wrapper. - - Type to search. - Attribute type. - - - - Does a search and retrieves the method information. - - The method reflection object. - - - - Whether the type has a method info. - - A value indicating whether the method information has - been found. - - - - Perform a search on the type. - - - - - Gets the type of attribute the lazy method is searching for. - - - - - Gets the underlying type that is searched. - - - - - Gets or sets a value indicating whether a lookup has already been attempted. - - - - - Gets or sets the underlying MethodInfo from reflection. - - - - - Underlying Assembly reflection object. - - - - - Create a new lazy method from a MethodInfo instance. - - Assembly reflection object. - Attribute Type instance. - - - - Performs a search on the MethodInfo for the attributes needed. - - - - - Test assembly metadata interface. - - - - - Gets a collection of test class metadata objects. - - Returns a collection of metadata objects. - - - - Gets the initialization method. - - - - - Gets the cleanup method. - - - - - Gets a reference to the unit test provider. - - - - - Gets the name of the test assembly. - - - - - Gets the test harness used to initialize the assembly. - - - - - An expected exception marker for a test method. - - - - - Gets the expected exception type. - - - - - Gets any message associated with the expected exception object. - - - - - Represents the host type information for a test. - - - - - Gets the Host type. - - - - - Gets the host data. - - - - - A representation of a test's priority. - - - - - Metadata representing a test class. - - - - - Retrieve a collection of the test method metadata objects setup by - the unit test provider. - - A collection of test method interfaces. - - - - Gets the test class Type instance. - - - - - Gets a value indicating whether the test class should be ignored. - - - - - Gets the per-test initialization method. - - - - - Gets the per-test cleanup method. - - - - - Gets the one-time class initialization method. - - - - - Gets the one-time class cleanup method. - - - - - Gets the name of the test class. - - - - - Gets a reference to the parent test assembly metadata - instance. - - - - - Test method metadata. - - - - - Used for decorating with unit test provider-specific capabilities, - such as the TestContext concept. - - Instance to decorate. - - - - Get any attribute on the test method that are provided dynamically. - - - Dynamically provided attributes on the test method. - - - - - Invoke the test method. - - Instance of the test class. - - - - Gets the test method reflection object. - - - - - Hooks up to any unit test provider-enabled WriteLine capability - for unit tests. - - - - - Gets a value indicating whether the test is marked to be ignored. - - - - - Gets any description for the method. - - - - - Gets a name for the method. - - - - - Gets any category information for the method. - - - - - Gets any test owner information. - - - - - Gets any expected exception attribute . - - - - - Gets any timeout information. - - - - - Gets a collection of any test properties. - - - - - Gets a collection of any test work items. - - - - - Gets any priority information. - - - - - A property for a test method. - - - - - Gets the test property name. - - - - - Gets the test property value. - - - - - Provider model for a unit test system that uses reflection and metadata - to enable a unit test run. - - - - - Retrieve the metadata instance for a test assembly given a - reflection Assembly instance. - - The test harness using the provider. - Reflected test assembly. - Unit test provider-specific metadata instance for - the test assembly. - - - - Gets a value indicating whether a specific capability or set of - capabilities are supported by the unit test provider. - - Capability of interest. - Gets a value indicating whether the capability is - supported. - - - - Checks if an Exception actually represents an assertion that failed - to improve the logging experience. - - Exception object. - Returns true if the Exception is an assertion exception - type. - - - - Gets the name of the unit test provider. - - - - - Gets the capabilities that the unit test provider implements. - - - - - Work item for a test. - - - - - Gets the associated information from the work item. - - - - - Event arguments that pass along a string value. - - - - - Create a new event argument instance. - - - - - Create a new event argument instance that stores a string value. - - String value to pass along. - - - - String value stored in the event arguments. - - - - - Gets the stored string value. - - - - - A set of capabilities that a unit test provider may chose to implement - through the metadata interfaces. - - - - - No defined capabilities. - - - - - Support for attribute [AssemblyInitialize]. - - - - - Support for attribute [AssemblyCleanup]. - - - - - Support for attribute [Ignore] for classes. - - - - - Support for attribute [Ignore] for methods. - - - - - Support for attribute [Description] on methods. - - - - - Support for attribute [Category] on methods. - - - - - Support for attribute [Owner] on method. - - - - - Support for attribute [Priority] on method. - - - - - Support for attribute [TestProperty](...) on methods. - - - - - Support for attribute [Timeout] on methods. - - - - - Support for attribute [WorkItem(...)]('s) on methods. - - - - - Test work item type that does not complete until the sleep time has - elapsed. This is NOT a blocking Sleep. - - - - - The amount of time to delay for. - - - - - The DateTime that marks the point in time the task is complete. - - - - - Create a new Sleep work item, including the number of - milliseconds to wait until continuing. - - Amount of time to wait/delay. - - - - On the first time, will calculate the final DateTime. Otherwise, - null operation (returns) until that time. - - Returns a value indicating whether there is more work to be - done. - - - - Expected exception metadata. - - - - - Private constructor. - - - - - Creates a new expected exception metadata wrapper. - - Attribute value. - - - - The expected exception attribute. - - - - - Gets the type of the expected exception. - - - - - Gets any message to include in a failure. - - - - - A simple wrapper for a priority integer value that overrides the - ToString method. - - - - - Initializes a new instance of the Priority class. - - The priority. - - - - Gets the priority as string. - - Returns the priority. - - - - Gets the priority value. - - - - - The set of provider attributes. - - - - - Initializes the VSTT metadata provider. - - - - - Gets VSTT [TestClass] attribute. - - - - - Gets VSTT [Ignore] attribute. - - - - - Gets VSTT [ClassInitialize] attribute. - - - - - Gets VSTT [Priority] attribute. - - - - - Gets VSTT [ClassCleanup] attribute. - - - - - Gets VSTT [TestInitialize] attribute. - - - - - Gets VSTT [TestCleanup] attribute. - - - - - Gets VSTT [Description] attribute. - - - - - Gets VSTT [Timeout] attribute. - - - - - Gets VSTT [Owner] attribute. - - - - - Gets VSTT [ExpectedException] attribute. - - - - - Gets VSTT [AssemblyInitialize] attribute. - - - - - Gets VSTT [AssemblyCleanup] attribute. - - - - - Gets VSTT [TestMethod] attribute. - - - - - Gets VSTT [TestProperty] attribute. - - - - - Test class wrapper. - - - - - Construct a new test class metadata interface. - - Assembly metadata interface object. - - - - Creates a new test class wrapper. - - Assembly metadata object. - Type of the class. - - - - Test Type. - - - - - Collection of test method interface objects. - - - - - A value indicating whether tests are loaded. - - - - - A dictionary of method types and method interface objects. - - - - - Gets a collection of test method wrapper instances. - - A collection of test method interface objects. - - - - Exposes the name of the test class. - - Returns the name of the test class. - - - - Gets the test assembly metadata. - - - - - Gets the underlying Type of the test class. - - - - - Gets the name of the test class. - - - - - Gets a value indicating whether an Ignore attribute present - on the class. - - - - - Gets any test initialize method. - - - - - Gets any test cleanup method. - - - - - Gets any class initialize method. - - - - - Gets any class cleanup method. - - - - - Methods enum. - - - - - Initialize method. - - - - - Cleanup method. - - - - - Test init method. - - - - - Test cleanup method. - - - - - A provider wrapper for a test method. - - - - - Property name for the TestContext. - - - - - Default value for methods when no priority attribute is defined. - - - - - An empty object array. - - - - - Method reflection object. - - - - - Private constructor, the constructor requires the method reflection object. - - - - - Creates a new test method wrapper object. - - The reflected method. - - - - Call the WriteLine method. - - String to WriteLine. - - - - Decorates a test class instance with the unit test framework's - specific test context capability, if supported. - - Instance to decorate. - - - - Get any attribute on the test method that are provided dynamically. - - - Dynamically provided attributes on the test method. - - - - - Invoke the test method. - - Instance of the test class. - - - - Exposes the name of the test method as a string. - - Returns the name of the test method. - - - - Allows the test to perform a string WriteLine. - - - - - Gets the underlying reflected method. - - - - - Gets a value indicating whether there is an Ignore attribute. - - - - - Gets any description marked on the test method. - - - - - Gets the name of the method. - - - - - Gets the Category. - - - - - Gets the owner name of the test. - - - - - Gets any expected exception attribute information for the test method. - - - - - Gets any timeout. A Nullable property. - - - - - Gets a Collection of test properties. - - - - - Gets a collection of test work items. - - - - - Gets Priority information. - - - - - Represents a simple test property with a key/value string pair. - - - - - Initializes a new instance of the TestProperty class. - - - - - Initializes a new instance of the TestProperty class. - - The initial property name. - The initial property value. - - - - Gets or sets the property name. - - - - - Gets or sets the property value. - - - - - A wrapper for the unit test context capability of Visual Studio Team - Test's unit test framework. - - - - - Create a new unit test context wrapper for the test method. - - Test method. - - - - Constructor of a new unit test context. - - - - - Test method. - - - - - Used to write trace messages while the test is running. - - Format string. - The arguments. - - - - Throw a not supported exception. - - Functionality that is not supported (string). - A new NotSupportedException. - - - - Adds a file name to the list in TestResult.ResultFileNames. - - Filename to add as a result. - - - - Begins a timer with the specified name. - - The name of the timer to create. - - - - Ends a timer with the specified name. - - Name of the timer. - - - - Cache of properties. - - - - - Gets test properties. - - - - - Gets current data row when test is used for data driven testing. - - - - - Gets current data connection row when test is used for data driven testing. - - - - - Gets the name of the test method. - - - - - Gets the current enum outcome - passed, failed, or inconclusive. - - - - - Assembly metadata for the Visual Studio Team Test unit test framework. - - - - - Assembly reflection object. - - - - - Assembly initialization method information. - - - - - Assembly cleanup method information. - - - - - Unit test provider used for the assembly. - - - - - The unit test harness. - - - - - Creates a new unit test assembly wrapper. - - Unit test metadata provider. - A reference to the unit test harness. - Assembly reflection object. - - - - Reflect and retrieve the test class metadata wrappers for - the test assembly. - - Returns a collection of test class metadata - interface objects. - - - - Gets the name of the test assembly. - - - - - Gets the unit test provider instance. - - - - - Gets any assembly initialize method. - - - - - Gets any assembly cleanup method. - - - - - Gets the test harness used to initialize the assembly. - - - - - Gets the test harness as a unit test harness. - - - - - Provider for the Visual Studio Team Test unit test (UT) framework - metadata. - - - - - Name of this provider. - - - - - The capabilities of the VSTT UTF provider. - - - - - Whether the capability is supported by this provider. - - Capability type. - A value indicating whether the capability is available. - - - - Create a new Visual Studio Team Test unit test framework provider - instance. - - - - - Cache of assemblies and assembly unit test interface objects. - - - - - VSTT unit test provider constructor; takes an assembly reference to - perform reflection on to retrieve all test class types. In this - implementation of an engine for the VSTT metadata, only a single - test Assembly can be utilized at a time for simplicity. - - The unit test harness. - Assembly reflection object. - Returns the assembly metadata interface. - - - - Check if the Exception is actually a failed assertion. - - Exception object to check. - True if the exception is actually an assert failure. - - - - Gets the name of the provider. - - - - - Gets the specialized capability descriptor. - - - - - Settings for the unit test system. - - - - - The tag expression key name. - - - - - By default test methods are sorted. - - - - - By default test classes are sorted. - - - - - Settings for the unit test system. - - - - - Gets the parameters from the response file. - - The parameters. - - - - Gets the components initialized by the entry-point assembly. These - are the dynamically loaded objects that may be needed by the - TestHarness. - - The components. - - - - Gets the log providers. - - - - - Gets or sets a set of sample tags for use in a tag editor screen. - - - - - Gets the list of test assemblies. - - The test assembly. - - - - Gets or sets the test service provider. The test service lights up - advanced out-of-process communication, reporting, logging, and - other valuable services. - - - - - Gets or sets the test harness. - - The test harness. - - - - Gets or sets the test service hostname to try using. Defaults to - localhost. - - - - - Gets or sets the test service port to try using. Defaults to 8000. - - - - - Gets or sets the test service path to try using. Defaults to - /externalInterface/. - - - - - Gets or sets a value indicating whether to start the run - immediately when the test system is run. Defaults to false to enable - the test service to load and information to be provided in the - user interface. - - - - - Gets or sets the type of the TestPanel to create. The type must - derive from Microsoft.Silverlight.Testing.ITestPanel. - - - - - Gets or sets a value indicating whether test methods are sorted - alphabetically. By default this value is true. - - - It is worth understanding that the order of unit test - execution should not affect the results of a test run. Any expected - ordering and verification from multiple test methods should be - refactored into a single unit test. - - - - - Gets or sets a value indicating whether test classes are sorted - alphabetically. This setting is True by default. - - - - - Gets or sets a value indicating whether to show the tag expression - editor user interface before starting the test run. - - - - - Gets or sets the tag expression used for selecting tests to run. - - - - - Gets a list of test classes to run. Enables filtering. - - This property should be considered obsolete. - - - - A manager for the underlying TestSurface Panel. - - - - - Private constructor. - - - - - The test page object. - - - - - A value indicating whether the panel is dirty. - - - - - Remove the children from the test surface, if it has - been used. - - - - - Remove the children from the test surface. - - - - - Gets or sets the Reference to the TestPage user control. - - - - - Gets the TestSurface Panel, and tracks the use for the - current test method. When the test completes, the panel children - will be cleared automatically. - - - - - A result from a test scenario. - - - - - Creates a result record. - - Test method metadata object. - Test class metadata object. - Test result object. - Exception instance, if any. - - - - The string representation of the ScenarioResult. - - Returns a verbose string representation of the result. - - - - Gets or sets the scenario's started time. - - - - - Gets or sets the scenario's finishing time. - - - - - Gets the test method metadata. - - - - - Gets the test class metadata. - - - - - Gets or sets the Result object. - - - - - Gets the Exception instance, if any. - - - - - Container and manager type which handles an entire test assembly; contains sub work - items that represent all actions needed to execute its tests. - - - - - A container that stores instances of the unit test harness and provider. - - - - - TestWorkItem which can contain sub-tasks; the underlying work item is - not marked complete until the Children have completed or an Exception - is thrown. - - - - - Store the underlying tasks. - - - - - Whether the TestTaskContainer::IsComplete should be set to true - after all children have been de-queued. - - - - - Whether the first invoke has happened yet or not. - - - - - Constructor for the TestTaskContainer type. - - - - - Optional method to call on the first invoke. - - - - - Invoke the test container; in turn will execute child work items - as needed. Supports executing multiple items immediately for - performance reasons. - - True if additional work remains, False once IsComplete - is set to true. - - - - Invoke the test container; in turn will execute child work items - as needed. - - The work item used for the invoke. - True if additional work remains, False once IsComplete - is set to true. - - - - Clear the children. - - - - - Dequeue a work item. - - A work item. - - - - Add a new work item to the container to schedule it for invocation. - - New test work item to enqueue. - - - - Adds a new work item that will execute more quickly. - - The item of work. - - - - Enqueues a callback or action that will quickly execute. - - The action or method. - - - - Add a new callback action and schedule it for invocation. - - The action. - - - - Return the top work item, if any, from this container. - - Peek into any test work item. - - - - Work items must call this method to indicate completion of the work - item; in turn fires the Complete event delegates. - - - - - Internal-only version which can be called during a test completion - through the relation - not necessarily the best design; events - may make more sense long-term. - - - - - Call when an exception occurs inside a work item. - - Exception object. - - - - Fire the Complete event. - - Empty event arguments. - - - - Fire the unhandled exception event. - - Exception object. - - - - Gets a value indicating whether the container is marked Complete - when all children have executed or not. - - - - - Gets a value indicating whether sub tasks remain. - - - - - Complete event is fired when the underlying WorkItemComplete method - is called by the work item. - - - - - Event fired when an exception is thrown and unhandled within the - underlying Invoke sequence. - - - - - Gets or sets a value indicating whether the task can execute - immediately. - - - - - The unit test provider. - - - - - Initializes a new unit test work item container. - - The unit test harness. - The unit test metadata provider. - - - - Logs a new message. - - Message object. - - - - Logs a message about the harness. - - Information about the harness. - - - - Gets the log message writer for the unit test system. - - - - - Gets the test harness instance. - - - - - Gets the unit test provider instance. - - - - - The test run filter object. - - - - - Unit test provider-agnostic assembly metadata. - - - - - Container of work items for running test classes. - - - - - Create a new assembly manager, takes in the harness, provider - reference and actual IAssembly object. - - The test run filter object. - Harness object. - The unit test metadata provider. - The test assembly metadata object. - - - - When the test run is ready to test the underlying test assembly that - this class manages, perform reflection and enqueue work items to run - the tests. - - - - - The assembly initialize method. - - - - - The assembly cleanup method. - - - - - Reflect over all test classes in the assembly and add any which are not - filtered out into the test work item queue. - - - - - Helper to enqueue a new method dispatcher. - - The method reflection object. - - - - Gets the collection of all the instances of the assembly's test - classes, used to keep a single reference of the type. - - - - - A method container. - - - - - The timeout time. - - - - - The test method metadata. - - - - - Constructs a new method container. - - - - - Constructs a new method container. - - An instance of the method's type. - The method reflection object. - The test method. - - - - The task that involves the method, and contains its own internal - test queue, if needed for asynchronous tasks. - - - - - The reflection object for the method. - - - - - Invoke into the method. - - Returns the condition of any remaining work. - - - - On the first invoke, make sure there's a task to call the method. - - - - - Gets the method's reflection object. - - - - - A dictionary that manages single instances of types for use across the - unit test system. - - - - - Returns the instance for a Type; if there is not an instance yet, - this will use Activator.CreateInstance to create it. - - The Type instance to retrieve. - Returns an instance of the Type. Returns a new instance - if the Type has not yet been used. - - - - Remove any instance for the type. - - The Type of instance to remove. - - - - Test class manager. - - - - - Test run filter object. - - - - - Reference to the class and its metadata. - - - - - Queue of any tests to run. - - - - - Class instance. - - - - - A container type that handles an entire test class throughout the - test run. - - Test run filter object. - The unit test harness. - The test class metadata interface. - The object instance. - The unit test provider. - - - - Code run the first time this container is invoked. - - - - - Custom tests need to be prepared before use. - - - - - The test initialize method. - - - - - The test cleanup method. - - - - - Reflect through the class to find any test methods, and add them to - the list of queued methods. Also, sorts the methods if appropriate - based on the settings file. - - - - - Add a new method dispatcher to the test work item queue. This is a - work item container which is able to manage its own internal test - work item queue. - - The method reflection object. - - - - A special type dedicated to keeping a running stack of the dispatch - managers that are actually enabled for "work item" use. The current - dispatcher is used by the test work item queue. - - - - - Dispatcher stack; a stack of work item containers. - - - - - Creates a new empty stack for work item containers. - - - - - Push a new dispatcher onto the stack. - - The composite work item to push. - - - - Pop a dispatcher off the stack. - - Returns the top-most container. Throws an - InvalidOperationException if none is available. - - - - Gets the current test work item dispatcher, which is the dispatcher - on the top of the stack. Returns null if there is none. - - - - - Manager for planning, processing, and reporting the result of a single - test method for a unit test provider. - - - - - Underlying test class object. - - - - - Underlying test method object. - - - - - Reference to an instance of the test class. - - - - - Scenario result of the test method. - - - - - The started time of execution. - - - - - Stores a collection of written lines. - - - - - A value indicating whether the bug attribute was present on this - method. If it is, the result will be inverted at completion. - - - - - Contains the main test contents. - - - - - Constructor for a test method manager, which handles executing a single test method - for a unit test provider. - - The unit test harness object. - The test class metadata object. - The test method metadata object. - The test class instance. - The unit test provider. - - - - Log a start message. - - - - - Log an end message. - - - - - Handles the write line event for the test method. - - The string event arguments. - - - - First invoke, plan for the method's execution. - - - - - Sets the start and finish times on the ScenarioResult object. - - - - - Creates the ScenarioResult instance for this test method. - - The initial test outcome value. - - - - Process the result. - - Source object. - Event arguments. - - - - Process an unhandled exception for the method. - - Source object. - Unhandled exception event arguments. - - - - Create a new method container to enclose a reflected method for execution. - - The method reflection object. - - - - Gets or sets a value indicating whether the bug attribute's logic - has already been processed. - - - - - Gets the write line output list. - - - - - A container which is able to attach to the underlying test dispatcher - stack to enable advanced asynchronous functionality, when supported. - - - - - The unit test harness. - - - - - The granularity of the contained item. - - - - - The test method metadata object. - - - - - Initializes dispatcher-stack attaching method container work item. - - Test harness. - Test instance. - Method reflection object. - Test method metadata. - Granularity of test. - - - - Connect to dispatcher stack for advanced functions, if supported. - - - - - Check a MethodInfo for the advanced async attribute. - - True if the work item queue is supported. - - - - A work item for tests to use which will call the delegate when the work - item is executed. - - - - - Stored void delegate. - - - - - Create a new Callback work item. - - Action to execute on Invoke. - - - - Execute the callback. - - Whether the work item is complete. - - - - A test work item that is complete once the condition is asserted. - - - - - The conditional delegate. - - - - - Construct a new conditional work item. - - Conditional delegate. - - - - Invoke the condition, will continue invoking until - the condition is false. - - Completes the invocation once the condition is true. - - - - A simple work item that invokes a method through the reflection - MethodInfo instance. - - - - - An empty object array. - - - - - An object instance. - - - - - Method reflection object. - - - - - The test method to invoke. - - - - - Creates a new method invoke work item for a MethodInfo instance. - - The type instance. - The method on the type to invoke when the - work item is executed. - The test method metadata. - - - - Invokes the underlying method on the instance and marks the - test work item as complete. - - False, noting the completion of the work item. - - - - Unit test providers. - - - - - List of unit test providers. - - - - - Static constructor that initializes the built-in unit test metadata providers. - - - - - Gets the unit test provider for an assembly. The framework only - currently supports a single provider per test assembly, so if more - than one registered provider can handle the assembly, at runtime an - InvalidOperationException is thrown. - - The test harness making the request. - Assembly reflection object. - The unit test provider for the test assembly. Throws if - more than one can process the assembly. Returns null if there is - not a provider for the assembly. - - - - Returns the IAssembly provider for an assembly. - - Test harness object. - Assembly reflection object. - Returns null or an IAssembly instance. - - - - Gets the list of Unit Test providers. - - - - - A dictionary that can store just about any kind of object, keyed off any - object. As a Hashtable, it permits using keys of - - enums - - objects - - types - - This makes it ideal for use in decorating and adorning special types in - the system, such as log messages. - - A strongly-typed decorator key could come from an enum value, while a - prototype extension to the test system could simply use a string key for - organizing. - - In all instances, the resulting object needs to be cast appropriately. - - - - - Check if a decorator exists. - - The decorator key object. - - Returns a value indicating whether the decorator key exists. Even - if the key exists, the instance value for the key could be set to - null, yielding a null instance. - - - - - Check if a set of decorators exists. - - The set of decorator(s) of interest. - - Returns a value indicating whether the decorators of interest were - present. - - - - - Retrieves the decorator instance if it exists. If not, this method - returns null. - - The decorator key object. - - Returns the instance or null if it does not exist. No exceptions - are thrown in this method. - - - - - Helper functionality for dealing with embedded resources in an assembly. - - - - - Get a string containing the text of an embedded resource in an - assembly. - - - An instance whose assembly can be retrieved through reflection. - - - Complete embedded resource name. - - - A string containing the embedded resource's string contents. - - - - - A simple factory used for creating new log messages. - - - - - Create a new LogMessage instance. - - Returns a new LogMessage instance. - - - - Create a new LogMessage instance. - - The type of message to create. - Returns a new LogMessage instance. - - - - Gets or sets the default log message type used for the creation of - unspecific log message types. - - - - - Well-known keys that can be used to mark decorator instances in log - message objects. - - - - - Key for a decorator that is a simple Exception object. - - - - - Key for a decorator that is a simple Name string property. - - - - - An associated TestOutcome value. - - - - - The stage of a message or event. - - - - - The granularity of a message or event. - - - - - A number of possible test outcomes or results. For compatibility, this - information resembles that of the desktop test framework, although many - of the states may not apply or be valid for an in-browser test harness. - - - - - A test outcome of Error. - - - - - A test outcome of Failed. - - - - - A test outcome of Timeout. - - - - - A test outcome of Aborted. - - - - - A test outcome of Inconclusive. - - - - - A test outcome of a run that was aborted, but passed. - - - - - A test outcome of NotRunnable. - - - - - A test outcome of NotExecuted. - - - - - A test outcome of Disconnected. - - - - - A test outcome of Warning. - - - - - A test outcome of Passed. - - - - - A test outcome of Completed. - - - - - A test outcome of InProgress. - - - - - A test outcome of Pending. - - - - - The stage of a test scenario, case or system running. - - - - - In the process of starting. - - - - - Currently running. - - - - - Finishing up. - - - - - The test is canceling. - - - - - Provides a property that will attach and detach a known event handler - delegate when the bit is flipped. - - - - - The event to fire when attached. - - - - - Whether the event handler is attached as a global unhandled - exception handler. - - - - - Creates a new exception handler "manager" with the provided - EventHandler. - - The event handler to manage. - - - - Mark the Handled property in the event args as True to stop any - event bubbling. - - Event arguments. - - Value indicating whether the Exception should be marked as handled. - - - - - Return the Exception property from the EventArgs. - - Event arguments. - - Returns the Exception object that the event arguments stores. - - - This method is compatible with the full desktop framework as well as - Silverlight. - - - - - Internal event that is hooked up to the global exception handler. - - Source object of the event. - Event arguments. - - - - Called after a change to the attachment field value. - - - - - Attach the handler globally. - - - - - Detach the handler globally. - - - - - Gets or sets a value indicating whether the handler is currently - attached to the global exception handler. - - - - - A log message. - - - - - The default log message used during initialization. - - - - - Initializes a new log message of the default message type. - - - - - Initializes a new log message. - - The message type. - - - - Converts to string representation. - - A string version of the LogMessage. - - - - Check if a decorator is present on the LogMessage. - - The decorator of interest. - - Returns a value indicating whether the decorator is present in the - DecoratorDictionary. - - - - - Check if a set of decorators are present. - - The decorator(s) of interest. - - Returns a value indicating whether the decorator(s) of interest are - present. - - - - - Gets the set of decorator instances attached to the log message. - - - - - Gets or sets the type of message. - - - - - Gets or sets the log's message. - - - - - Gets or sets the decorator type for the message. - - - The type of decorator. Only one explicit Type is permitted, - although multiple types within the same type hierarchy are - legitimate. - - Returns the instance of the decorator, if any. - - - - The hierarchy of test execution represented in more generic terms, this - allows for more robust and useful actions by log providers. - - - - - Harness-level granularity. - - - - - Group of test-level granularity. - - - - - Test-level granularity. - - - - - Scenario-level granularity. - - - - - The most verbose log provider, this calls .ToString() on each and every - LogMessage that it processes. The output will appear in an attached - debugger's "Output" window. - - - - - Initializes a new instance of the DebugOutputProvider class. - - - - - Display a LogMessage in the debug output window. - - Message object. - - - - Gets or sets a value indicating whether any TestResult failures will - be reported, regardless of whether the TestResult type is being - monitored for debug output. - - - - - Gets or sets a value indicating whether all messages appear in the - debug output. - - - - - Set of defined types of log messages to allow for some level of - filtering and selective processing of log messages. - - - - - Pass, fail, etc. - - - - - Debug::WriteLine or tracing. - - - - - Non-fatal log message. - - - - - Fatal error message. - - - - - Information about a known defect. - - - - - General information similar to a Console::WriteLine. - - - - - Operating system setting or platform values. - - - - - New unit of test or test run note. - - - - - Related test systems or out-of-process communication information. - - - - - Event information marking the completion of a test run. - - - - - Creates a new TestHarnessCompletedEventArgs. - - The final test harness state. - - - - Gets the final test harness state. - - This contains the final pass versus fail result at a minimum. - Specific harnesses may extend the type to contain additional - information, logs, scenario counts, or anything else. - - - - - A type which handles preparing the underlying dispatcher or timer from - which the test work items execute. - - - - - Millisecond interval to use for the interval between DispatcherTimer - ticks. - - - - - Dispatcher timer. - - - - - Creates a new run method manager using the default value for the - timer's millisecond interval. - - - Conditional delegate which returns true as long as there is - additional work. - - - - - Sets up a new run method manager. - - - Conditional delegate which returns true as long as there is - additional work. - - Milliseconds between ticks, at a - minimum. - - - - Begin the execution process by hooking up the underlying - DispatcherTimer to call into the test framework regularly and - perform test work items. - - - - - Call into the underlying work item queue, if the method manager is - still set to run. - - Sending object. - Event arguments. - - - - Base class representing the overall state of a test run. - - - - - Increment the failures counter. - - - - - Increments the total scenarios counter. - - - - - Gets the count of failing scenarios. - - - - - Gets the total count of scenarios run. - - - - - Gets a value indicating whether the status recorded indicates a - failure. - - - - - A set of helper methods for interacting with methods and types that are - marked with attributes. - - - - - Retrieve all types in an assembly that are decorated with a specific - attribute. - - Assembly to search. - - Instance of the Type of attribute that marks interesting methods. - - - A collection of types from the assembly. An empty collection is - returned if no types were found matching the constraints. - - - - - Given a MethodInfo type, returns the attributes (if any) that are of - the decoratingAttribute parameter's type. - - MemberInfo instance. - Attribute of interest. - - A collection populated with the Attribute instances. - - - - - Given a MethodInfo type, returns the attributes (if any) that are of - the decoratingAttribute parameter's type. - - MemberInfo instance. - Attribute of interest. - A value indicating whether to look for - inheriting custom attributes. - - A collection populated with the Attribute instances. - - - - - Given a test method, returns the attributes (if any) that are of - the decoratingAttribute parameter's type. - - ITestMethod instance. - Attribute of interest. - Whether to inherit attributes. - - A collection populated with the Attribute instances. - - - - - Retrieve a list of Reflection.Assembly types from a set of - instances and/or types. - - Set of instances or types. - A set of Assembly instances from the instances or types. - - - - Returns a list of unique assemblies from a set of types. - - Set of types. - - A list of unique Assembly instances from the input types. - - - - - Given a list of attributes, retrieves a single Attribute instance. - Will throw an exception if multiple attributes exist on the method. - - List of attributes. - - The attribute instance, or null if it does not exist. - - - - - Given a method and a decorative attribute of interest, retrieves a - single Attribute instance. Will throw an exception if multiple - attributes exist on the method. - - MemberInfo instance. - - Attribute type of interest. - - - The attribute instance, or null if it does not exist. - - - - - Given a test method and a decorative attribute of interest, - retrieves a single Attribute instance. Will throw an exception if - multiple attributes exist on the method. - - ITestMethod instance. - - Attribute type of interest. - - - The attribute instance, or null if it does not exist. - - - - - Given a test method and a decorative attribute of interest, - retrieves a single Attribute instance. Will throw an exception if - multiple attributes exist on the method. - - ITestMethod instance. - - Attribute type of interest. - - A value indicating whether to look for custom - inherited attributes. - - The attribute instance, or null if it does not exist. - - - - - Returns a value indicating whether a method has the attribute. - - MemberInfo instance. - Attribute of interest. - - A value indicating whether the type has the decorating attribute or - not. - - - - - Returns a value indicating whether a method has the attribute. - - ITestMethod instance. - Attribute of interest. - - A value indicating whether the type has the decorating attribute or - not. - - - - - Return a collection of MethodInfo instances given a type to look - through and the attribute of interest. - - Type to look through for methods. - Attribute of interest. - - A collection of the method reflection objects, if any, with the - marked attribute present. - - - - - Retrieve a MethodInfo from a single decorated method inside a type, - if any. Throws an Exception if there are > 1 methods that are - decorated with the attribute. - - Type of interest. - Attribute of interest. - - MethodInfo reflection object. Null if none are found. - - - - - Exposes clipboard functionality within Silverlight 3 applications when a - Silverlight 4 runtime is in use. - - - - - An empty array of object type. - - - - - Backing field for set text. - - - - - Backing field for get text. - - - - - Backing field for the contains text method. - - - - - A value indicating whether the clipboard feature is present. This - assumes that all 3 methods are present, in their current form for a - more recent runtime. - - - - - Sets Unicode text data to store on the clipboard, for later access - with System.Windows.Clipboard.GetText(). - - A string that contains the Unicode text data to - store on the clipboard. - - - - Retrieves Unicode text data from the system clipboard, if Unicode - text data exists. - - If Unicode text data is present on the system clipboard, - returns a string that contains the Unicode text data. Otherwise, - returns an empty string. - - - - - Queries the clipboard for the presence of data in the Unicode text - format. - - True if the system clipboard contains Unicode text data; - otherwise, false. - - - - Prepares to use the System.Windows.Clipboard type and throws an - exception if the feature cannot be completely located. - - - - - Prepares the type and reflects for new Silverlight features. - - - - - Gets a value indicating whether the clipboard feature is available - and supported. - - - - - A framework element that permits a binding to be evaluated in a new data - context leaf node. - - The type of dynamic binding to return. - - - - Gets or sets the string value binding used by the control. - - - - - Identifies the Value dependency property. - - - - - Initializes a new instance of the BindingEvaluator class. - - - - - Initializes a new instance of the BindingEvaluator class, - setting the initial binding to the provided parameter. - - The initial string value binding. - - - - Clears the data context so that the control does not keep a - reference to the last-looked up item. - - - - - Updates the data context of the framework element and returns the - updated binding value. - - The object to use as the data context. - If set to true, this parameter will - clear the data context immediately after retrieving the value. - Returns the evaluated T value of the bound dependency - property. - - - - Updates the data context of the framework element and returns the - updated binding value. - - The object to use as the data context. - Returns the evaluated T value of the bound dependency - property. - - - - Gets or sets the data item string value. - - - - - Gets or sets the value binding. - - - - - Specifies values that control the behavior of a control positioned - inside another control. - - Stable - - - - Specifies that the control should be positioned on the left of the - control. - - - - - Specifies that the control should be positioned on top of the - control. - - - - - Specifies that the control should be positioned on the right of the - control. - - - - - Specifies that the control should be positioned at the bottom of - control. - - - - - The InteractionHelper provides controls with support for all of the - common interactions like mouse movement, mouse clicks, key presses, - etc., and also incorporates proper event semantics when the control is - disabled. - - - - - The threshold used to determine whether two clicks are temporally - local and considered a double click (or triple, quadruple, etc.). - 500 milliseconds is the default double click value on Windows. - This value would ideally be pulled form the system settings. - - - - - The threshold used to determine whether two clicks are spatially - local and considered a double click (or triple, quadruple, etc.) - in pixels squared. We use pixels squared so that we can compare to - the distance delta without taking a square root. - - - - - Reference used to call UpdateVisualState on the base class. - - - - - Initializes a new instance of the InteractionHelper class. - - Control receiving interaction. - - - - Update the visual state of the control. - - - A value indicating whether to automatically generate transitions to - the new state, or instantly transition to the new state. - - - UpdateVisualState works differently than the rest of the injected - functionality. Most of the other events are overridden by the - calling class which calls Allow, does what it wants, and then calls - Base. UpdateVisualState is the opposite because a number of the - methods in InteractionHelper need to trigger it in the calling - class. We do this using the IUpdateVisualState internal interface. - - - - - Update the visual state of the control. - - - A value indicating whether to automatically generate transitions to - the new state, or instantly transition to the new state. - - - - - Handle the control's Loaded event. - - The control. - Event arguments. - - - - Handle changes to the control's IsEnabled property. - - The control. - Event arguments. - - - - Handles changes to the control's IsReadOnly property. - - The value of the property. - - - - Update the visual state of the control when its template is changed. - - - - - Check if the control's GotFocus event should be handled. - - Event arguments. - - A value indicating whether the event should be handled. - - - - - Base implementation of the virtual GotFocus event handler. - - - - - Check if the control's LostFocus event should be handled. - - Event arguments. - - A value indicating whether the event should be handled. - - - - - Base implementation of the virtual LostFocus event handler. - - - - - Check if the control's MouseEnter event should be handled. - - Event arguments. - - A value indicating whether the event should be handled. - - - - - Base implementation of the virtual MouseEnter event handler. - - - - - Check if the control's MouseLeave event should be handled. - - Event arguments. - - A value indicating whether the event should be handled. - - - - - Base implementation of the virtual MouseLeave event handler. - - - - - Check if the control's MouseLeftButtonDown event should be handled. - - Event arguments. - - A value indicating whether the event should be handled. - - - - - Base implementation of the virtual MouseLeftButtonDown event - handler. - - - - - Check if the control's MouseLeftButtonUp event should be handled. - - Event arguments. - - A value indicating whether the event should be handled. - - - - - Base implementation of the virtual MouseLeftButtonUp event handler. - - - - - Check if the control's KeyDown event should be handled. - - Event arguments. - - A value indicating whether the event should be handled. - - - - - Check if the control's KeyUp event should be handled. - - Event arguments. - - A value indicating whether the event should be handled. - - - - - Gets the control the InteractionHelper is targeting. - - - - - Gets a value indicating whether the control has focus. - - - - - Gets a value indicating whether the mouse is over the control. - - - - - Gets a value indicating whether the read-only property is set. - - - - - Gets a value indicating whether the mouse button is pressed down - over the control. - - - - - Gets or sets the last time the control was clicked. - - - The value is stored as Utc time because it is slightly more - performant than converting to local time. - - - - - Gets or sets the mouse position of the last click. - - The value is relative to the control. - - - - Gets the number of times the control was clicked. - - - - - The ItemContainerGenerator provides useful utilities for ItemsControls. - - Preview - - - - A Panel that is used as the ItemsHost of the ItemsControl. This - property will only be valid when the ItemsControl is live in the - tree and has generated containers for some of its items. - - - - - A ScrollViewer that is used to scroll the items in the ItemsHost. - - - - - Initializes a new instance of the ItemContainerGenerator. - - - The ItemsControl being tracked by the ItemContainerGenerator. - - - - - Apply a control template to the ItemsControl. - - - - - Prepares the specified container to display the specified item. - - - Container element used to display the specified item. - - - The ItemContainerStyle for the parent ItemsControl. - - - - - Update the style of any generated items when the ItemContainerStyle - has been changed. - - The ItemContainerStyle. - - Silverlight does not support setting a Style multiple times, so we - only attempt to set styles on elements whose style hasn't already - been set. - - - - - Scroll the desired element into the ScrollHost's viewport. - - Element to scroll into view. - - - - Gets or sets the ItemsControl being tracked by the - ItemContainerGenerator. - - - - - Gets a Panel that is used as the ItemsHost of the ItemsControl. - This property will only be valid when the ItemsControl is live in - the tree and has generated containers for some of its items. - - - - - Gets a ScrollViewer that is used to scroll the items in the - ItemsHost. - - - - - Numeric utility methods used by controls. These methods are similar in - scope to the WPF DoubleUtil class. - - - - - Check if a number is zero. - - The number to check. - True if the number is zero, false otherwise. - - - - Check if a number isn't really a number. - - The number to check. - - True if the number is not a number, false if it is a number. - - - - - Determine if one number is greater than another. - - First number. - Second number. - - True if the first number is greater than the second, false - otherwise. - - - - - Determine if one number is less than or close to another. - - First number. - Second number. - - True if the first number is less than or close to the second, false - otherwise. - - - - - Determine if two numbers are close in value. - - First number. - Second number. - - True if the first number is close in value to the second, false - otherwise. - - - - - NanUnion is a C++ style type union used for efficiently converting - a double into an unsigned long, whose bits can be easily - manipulated. - - - - - Floating point representation of the union. - - - - - Integer representation of the union. - - - - - Provides event data for various routed events that track property values - changing. Typically the events denote a cancellable action. - - - The type of the value for the dependency property that is changing. - - Preview - - - - Private member variable for Cancel property. - - - - - Initializes a new instance of the - - class. - - - The identifier - for the property that is changing. - - The previous value of the property. - - The new value of the property, assuming that the property change is - not cancelled. - - - True if the property change is cancellable by setting - - to true in event handling. false if the property change is not - cancellable. - - - - - Gets the - identifier for the property that is changing. - - - The identifier - for the property that is changing. - - - - - Gets a value that reports the previous value of the changing - property. - - - The previous value of the changing property. - - - - - Gets or sets a value that reports the new value of the changing - property, assuming that the property change is not cancelled. - - - The new value of the changing property. - - - - - Gets a value indicating whether the property change that originated - the RoutedPropertyChanging event is cancellable. - - - True if the property change is cancellable. false if the property - change is not cancellable. - - - - - Gets or sets a value indicating whether the property change that - originated the RoutedPropertyChanging event should be cancelled. - - - True to cancel the property change; this resets the property to - . - false to not cancel the property change; the value changes to - . - - - Attempted to cancel in an instance where - - is false. - - - - - Gets or sets a value indicating whether internal value coercion is - acting on the property change that originated the - RoutedPropertyChanging event. - - - True if coercion is active. false if coercion is not active. - - - This is a total hack to work around the class hierarchy for Value - coercion in NumericUpDown. - - - - - Represents methods that handle various routed events that track property - values changing. Typically the events denote a cancellable action. - - - The type of the value for the dependency property that is changing. - - - The object where the initiating property is changing. - - Event data for the event. - Preview - - - - The ScrollExtensions class provides utility methods for scrolling items - ScrollViewers. - - - - - The amount to scroll a ScrollViewer for a line change. - - - - - Scroll a ScrollViewer vertically by a given offset. - - The ScrollViewer. - The vertical offset to scroll. - - - - Scroll a ScrollViewer horizontally by a given offset. - - The ScrollViewer. - The horizontal offset to scroll. - - - - Scroll the ScrollViewer up by a line. - - The ScrollViewer. - - - - Scroll the ScrollViewer down by a line. - - The ScrollViewer. - - - - Scroll the ScrollViewer left by a line. - - The ScrollViewer. - - - - Scroll the ScrollViewer right by a line. - - The ScrollViewer. - - - - Scroll the ScrollViewer up by a page. - - The ScrollViewer. - - - - Scroll the ScrollViewer down by a page. - - The ScrollViewer. - - - - Scroll the ScrollViewer left by a page. - - The ScrollViewer. - - - - Scroll the ScrollViewer right by a page. - - The ScrollViewer. - - - - Scroll the ScrollViewer to the top. - - The ScrollViewer. - - - - Scroll the ScrollViewer to the bottom. - - The ScrollViewer. - - - - Get the top and bottom of an element with respect to its parent. - - The element to get the position of. - The parent of the element. - Vertical offset to the top of the element. - - Vertical offset to the bottom of the element. - - - - - Common TypeConverter functionality. - - - - - Returns a value indicating whether this converter can convert an - object of the given type to an instance of the expected type. - - Expected type of the converter. - - The type of the source that is being evaluated for conversion. - - - A value indicating whether the converter can convert the provided - type. - - - - - Attempts to convert a specified object to an instance of the - expected type. - - Expected type of the converter. - TypeConverter instance. - The object being converted. - - The instance of the expected type created from the converted object. - - - - - Determines whether conversion is possible to a specified type. - - Expected type of the converter. - - Identifies the data type to evaluate for conversion. - - - A value indicating whether conversion is possible. - - - - - Attempts to convert a specified object to an instance of the - desired type. - - TypeConverter instance. - The object being converted. - - The type to convert the value to. - - - The value of the conversion to the specified type. - - - - - Names and helpers for visual states in the controls. - - - - - Common state group. - - - - - Normal state of the Common state group. - - - - - Normal state of the Common state group. - - - - - MouseOver state of the Common state group. - - - - - Pressed state of the Common state group. - - - - - Disabled state of the Common state group. - - - - - Focus state group. - - - - - Unfocused state of the Focus state group. - - - - - Focused state of the Focus state group. - - - - - Selection state group. - - - - - Selected state of the Selection state group. - - - - - Unselected state of the Selection state group. - - - - - Selected inactive state of the Selection state group. - - - - - Expansion state group. - - - - - Expanded state of the Expansion state group. - - - - - Collapsed state of the Expansion state group. - - - - - Popup state group. - - - - - Opened state of the Popup state group. - - - - - Closed state of the Popup state group. - - - - - ValidationStates state group. - - - - - The valid state for the ValidationStates group. - - - - - Invalid, focused state for the ValidationStates group. - - - - - Invalid, unfocused state for the ValidationStates group. - - - - - ExpandDirection state group. - - - - - Down expand direction state of ExpandDirection state group. - - - - - Up expand direction state of ExpandDirection state group. - - - - - Left expand direction state of ExpandDirection state group. - - - - - Right expand direction state of ExpandDirection state group. - - - - - HasItems state group. - - - - - HasItems state of the HasItems state group. - - - - - NoItems state of the HasItems state group. - - - - - Increment state group. - - - - - State enabled for increment group. - - - - - State disabled for increment group. - - - - - Decrement state group. - - - - - State enabled for decrement group. - - - - - State disabled for decrement group. - - - - - InteractionMode state group. - - - - - Edit of the DisplayMode state group. - - - - - Display of the DisplayMode state group. - - - - - DisplayMode state group. - - - - - Edit of the DisplayMode state group. - - - - - Display of the DisplayMode state group. - - - - - Active state. - - - - - Inactive state. - - - - - Active state group. - - - - - Non-watermarked state. - - - - - Watermarked state. - - - - - Watermark state group. - - - - - Unfocused state for Calendar Buttons. - - - - - Focused state for Calendar Buttons. - - - - - CalendarButtons Focus state group. - - - - - Use VisualStateManager to change the visual state of the control. - - - Control whose visual state is being changed. - - - A value indicating whether to use transitions when updating the - visual state, or to snap directly to the new visual state. - - - Ordered list of state names and fallback states to transition into. - Only the first state to be found will be used. - - - - - Gets the implementation root of the Control. - - The DependencyObject. - - Implements Silverlight's corresponding internal property on Control. - - Returns the implementation root or null. - - - - This method tries to get the named VisualStateGroup for the - dependency object. The provided object's ImplementationRoot will be - looked up in this call. - - The dependency object. - The visual state group's name. - Returns null or the VisualStateGroup object. - - - - Represents a that supports - objects, - such as . - - Stable - - - - The DataTemplate to apply to the ItemTemplate property on a - generated HeaderedItemsControl (such as a MenuItem or a - TreeViewItem), to indicate how to display items from the next level - in the data hierarchy. - - - - - The Style to apply to the ItemContainerStyle property on a generated - HeaderedItemsControl (such as a MenuItem or a TreeViewItem), to - indicate how to style items from the next level in the data - hierarchy. - - - - - Initializes a new instance of the - class. - - - - - Gets or sets the collection that is used to generate content for the - next sublevel in the data hierarchy. - - - The collection that is used to generate content for the next - sublevel in the data hierarchy. The default value is null. - - - - - Gets a value indicating whether the ItemTemplate property was set on - the template. - - - - - Gets or sets the to - apply to the - - property on a generated - , such - as a , to - indicate how to display items from the next sublevel in the data - hierarchy. - - - The to apply to the - - property on a generated - , such - as a , to - indicate how to display items from the next sublevel in the data - hierarchy. - - - - - Gets a value indicating whether the ItemContainerStyle property was - set on the template. - - - - - Gets or sets the that is - applied to the item container for each child item. - - - The style that is applied to the item container for each child item. - - - - - Class to encapsulate drag behavior for a UIElement. - - Mature - - - - Inherited code: Requires comment. - - - - - Inherited code: Requires comment. - - - - - Inherited code: Requires comment. - - - - - Create an instance of the DragValidator class. - - - UIElement that represents the source of the drag operation. - - - - - Handle the MouseMove event for the UIElement to update the drag - operation. - - Inherited code: Requires comment. - Inherited code: Requires comment 1. - - - - Handle the MouseLeftButtonUp event for the UIElement to complete the - drag operation. - - Inherited code: Requires comment. - Inherited code: Requires comment 1. - - - - Handle the MouseLeftButtonDown event for the UIElement to start a - drag operation. - - Inherited code: Requires comment. - Inherited code: Requires comment 1. - - - - Invoke the DragStartedEvent handlers. - - - - - Invoke the DragDeltaEvent handlers. - - Inherited code: Requires comment. - - - - Invoke the DragCompletedEvent handlers. - - Inherited code: Requires comment. - Inherited code: Requires comment 1. - - - - Occurs when a drag operation has started. - - - - - Occurs when a drag operation has completed. - - - - - Occurs when a drag operation has progressed. - - - - - Represents a control that redistributes space between the rows of - columns of a control. - - Mature - - Represents the control that redistributes space between columns or rows - of a Grid control. - - Mature - - Represents the control that redistributes space between columns or rows - of a Grid control. - - Mature - - Represents the control that redistributes space between columns or rows - of a Grid control. - - Mature - - Represents the control that redistributes space between columns or rows - of a Grid control. - - Mature - - Represents the control that redistributes space between columns or rows - of a Grid control. - - Mature - - Represents the control that redistributes space between columns or rows - of a Grid control. - - Mature - - Represents the control that redistributes space between columns or rows - of a Grid control. - - Mature - - - - Inherited code: Requires comment. - - - - - Inherited code: Requires comment. - - - - - Default increment parameter. - - - - - Default increment parameter. - - - - - Identifies the - - dependency property. - - - An identifier for the - - dependency property. - - - - - Identifies the - - dependency property. - - - An identifier for the - - dependency property. - - - - - Called when the IsEnabled property changes. - - Sender object. - Property changed args. - - - - Is Null until a resize operation is initiated with ShowsPreview == - True, then it persists for the life of the GridSplitter. - - - - - Is initialized in the constructor. - - - - - Inherited code: Requires comment. - - - - - Holds the state for whether the mouse is over the control or not. - - - - - Initializes a new instance of the - class. - - - - - Builds the visual tree for the - - control when a new template is applied. - - - - - Returns a - - for use by the Silverlight automation infrastructure. - - - A - - for the - object. - - - - - Method to change the visual state of the control. - - - - - Change to the correct visual state for the GridSplitter. - - - True to use transitions when updating the visual state, false to - snap directly to the new visual state. - - - - - Handle the drag completed event to commit or cancel the resize - operation in progress. - - Inherited code: Requires comment. - Inherited code: Requires comment 1. - - - - Handle the drag delta event to update the UI for the resize - operation in progress. - - Inherited code: Requires comment. - Inherited code: Requires comment 1. - - - - Handle the drag started event to start a resize operation if the - control is enabled. - - Inherited code: Requires comment. - Inherited code: Requires comment 1. - - - - Handle the key down event to allow keyboard resizing or canceling a - resize operation. - - Inherited code: Requires comment. - Inherited code: Requires comment 1. - - - - Initialize the resize data and move the splitter by the specified - amount. - - - Horizontal amount to move the splitter. - - - Vertical amount to move the splitter. - - Inherited code: Requires comment. - - - - Called by keyboard event handler to move the splitter if allowed. - - - Horizontal amount to move the splitter. - - - Vertical amount to move the splitter. - - Inherited code: Requires comment. - - - - Creates the preview layer and adds it to the parent grid. - - Grid to add the preview layer to. - - - - Add the preview layer to the Grid if it is not there already and - then show the preview control. - - - - - Remove the preview control from the preview layer if it exists. - - - - - Initialize the resizeData object to hold the information for the - resize operation in progress. - - - Whether or not the preview should be shown. - - - - - Move the splitter and resize the affected columns or rows. - - - Amount to resize horizontally. - - - Amount to resize vertically. - - - Only one of horizontalChange or verticalChange will be non-zero. - - - - - Determine which adjacent column or row definitions need to be - included in the resize operation and set up resizeData accordingly. - - True if it is a valid resize operation. - - - - Cancel the resize operation in progress. - - - - - Get the actual length of the given definition. - - - Row or column definition to get the actual length for. - - - Height of a row definition or width of a column definition. - - - - - Determine the max and min that the two definitions can be resized. - - Inherited code: Requires comment. - - - - Determine the resize behavior based on the given direction and - alignment. - - Inherited code: Requires comment. - Inherited code: Requires comment 1. - - - - Determine the resize direction based on the horizontal and vertical - alignments. - - Inherited code: Requires comment. - - - - Create a DefinitionAbstraction instance for the given row or column - index in the grid. - - Inherited code: Requires comment. - Inherited code: Requires comment 1. - Inherited code: Requires comment 2. - Inherited code: Requires comment 3. - - - - Set the lengths of the two definitions depending on the split - behavior. - - - Inherited code: Requires comment. - - - Inherited code: Requires comment 1. - - - - - Set the height/width of the given row/column. - - Inherited code: Requires comment. - Inherited code: Requires comment 1. - - - - Determine if the given definition has its size set to the "*" value. - - Inherited code: Requires comment. - Inherited code: Requires comment 1. - - - - This code will run whenever the effective resize direction changes, - to update the template being used to display this control. - - - - - Exposes test hooks to unit tests with internal access. - - - - - Gets or sets Inherited code: Requires comment. - - - - - Gets or sets Inherited code: Requires comment. - - - - - Gets or sets the resize data. This is null unless a resize - operation is in progress. - - - - - Gets or sets a value indicating whether the - displays a - preview. - - - True if a preview is displayed; otherwise, false. - - - - - Gets or sets the that is used - for previewing changes. - - - The style that is used to preview changes. - - - - - Gets a value indicating whether or not the control has keyboard - focus. - - - - - Gets a test hook for unit tests with internal access. - - - - - Pretends to be the base class for RowDefinition and ClassDefinition - types so that objects of either type can be treated as one. - - Mature - - - - Creates an instance of the DefinitionAbstraction class based on - the given row or column definition. - - - RowDefinition or ColumnDefinition instance. - - - - - Gets the stored definition cast as a row definition. - - Null if not a RowDefinition. - - - - Gets the stored definition cast as a column definition. - - Null if not a ColumnDefinition. - - - - Gets the MaxHeight/MaxWidth for the row/column. - - - - - Gets the MinHeight/MinWidth for the row/column. - - - - - Gets the Height/Width for the row/column. - - - - - A collection of helper methods for working with double data types. - - Mature - - - - Epsilon is the smallest value such that 1.0+epsilon != 1.0. It - can be used to determine the acceptable tolerance for rounding - errors. - - - Epsilon is normally 2.2204460492503131E-16, but Silverlight 2 - uses floats so the effective epsilon is really 1.192093E-07. - - - - - Inherited code: Requires comment. - - - - - Determine if the two doubles are effectively equal within - tolerances. - - Inherited code: Requires comment. - Inherited code: Requires comment 1. - Inherited code: Requires comment 2. - - - - Inherited code: Requires comment. - - Mature - - - - Inherited code: Requires comment. - - - - - Inherited code: Requires comment. - - - - - Inherited code: Requires comment. - - - - - Inherited code: Requires comment. - - - - - Inherited code: Requires comment. - - Mature - - - - Inherited code: Requires comment. - - - - - Inherited code: Requires comment. - - - - - Inherited code: Requires comment. - - - - - Type to hold the data for the resize operation in progress. - - Mature - - - - Gets or sets Inherited code: Requires comment. - - - - - Gets or sets Inherited code: Requires comment. - - - - - Gets or sets Inherited code: Requires comment. - - - - - Gets or sets Inherited code: Requires comment. - - - - - Gets or sets Inherited code: Requires comment. - - - - - Gets or sets Inherited code: Requires comment. - - - - - Gets or sets Inherited code: Requires comment. - - - - - Gets or sets Inherited code: Requires comment. - - - - - Gets or sets Inherited code: Requires comment. - - - - - Gets or sets Inherited code: Requires comment. - - - - - Gets or sets Inherited code: Requires comment. - - - - - Gets or sets Inherited code: Requires comment. - - - - - Gets or sets Inherited code: Requires comment. - - - - - Gets or sets Inherited code: Requires comment. - - - - - Gets or sets a value indicating whether Inherited code: Requires comment. - - - - - Gets or sets Inherited code: Requires comment. - - - - - Gets or sets Inherited code: Requires comment. - - - - - Gets or sets Inherited code: Requires comment. - - - - - Inherited code: Requires comment. - - Mature - - - - Inherited code: Requires comment. - - - - - Inherited code: Requires comment. - - - - - Inherited code: Requires comment. - - - - - Expose test hooks for internal and private members of the - GridSplitter. - - - - - Reference to the outer 'parent' GridSplitter. - - - - - Initializes a new instance of the InternalTestHook class. - - The grid splitter to hook. - - - - Simulate the DragValidator's DragCompleted event. - - The sender. - Event arguments. - - - - Simulate the DragValidator's DragDelta event. - - The sender. - Event arguments. - - - - Simulate the DragValidator's DragStarted event. - - The sender. - Event arguments. - - - - Simulate using the keyboard to move the splitter. - - Horizontal change. - Vertical change. - - A value indicating whether the splitter was moved. - - - - - Gets the GridSplitter's GridResizeDirection. - - - - - Gets the GridSplitter's PreviewLayer. - - - - - Gets the GridSplitter's ResizeData. - - - - - Exposes types to - UI automation. - - Mature - - - - Initializes a new instance of the - - class. - - - The to - associate with the - . - - - - - Gets the control type for the element that is associated with the UI - Automation peer. - - The control type. - - - - Called by GetClassName that gets a human readable name that, in - addition to AutomationControlType, differentiates the control - represented by this AutomationPeer. - - The string that contains the name. - - - - Gets the control pattern for the - that is - associated with this - . - - - One of the enumeration values. - - - The object that implements the pattern interface, or null if the - specified pattern interface is not implemented by this peer. - - - - - Moves the control. - - - Absolute screen coordinates of the left side of the control. - - - Absolute screen coordinates of the top of the control. - - - - - Resizes the control. - - The new width of the window, in pixels. - - The new height of the window, in pixels. - - - - - Rotates the control. - - - The number of degrees to rotate the control. A positive number - rotates clockwise; a negative number rotates counterclockwise. - - - - - Gets a value indicating whether the control can be moved. - - - True if the element can be moved; otherwise, false. - - - - - Gets a value indicating whether the UI automation element can be - resized. - - - True if the element can be resized; otherwise, false. - - - - - Gets a value indicating whether the control can be rotated. - - - True if the element can be rotated; otherwise, false. - - - - - Represents the control that shows a preview of the GridSplitter's - redistribution of space between columns or rows of a Grid control. - - Mature - - - - Inherited code: Requires comment. - - - - - Inherited code: Requires comment. - - - - - Is Null until the PreviewControl is bound to a GridSplitter. - - - - - Tracks the bound GridSplitter's location for calculating the - PreviewControl's offset. - - - - - Instantiate the PreviewControl. - - - - - Called when template should be applied to the control. - - - - - Bind the the dimensions of the preview control to the associated - grid splitter. - - GridSplitter instance to target. - - - - Gets or sets Inherited code: Requires comment. - - - - - Gets or sets Inherited code: Requires comment. - - - - - Gets or sets the x-axis offset for the underlying render transform. - - - - - Gets or sets the y-axis offset for the underlying render transform. - - - - - Exposes types to UI - automation. - - Stable - - - - Initializes a new instance of the - - class. - - - The to associate - with the - . - - - - - Gets the control type for the - that is associated - with this - . - This method is called by - . - - - The - - enumeration value. - - - - - Gets the name of the - that is associated - with - . - This method is called by - . - - A string that contains TreeView. - - - - Gets a control pattern for the - that is associated - with this - . - - - One of the enumeration values that indicates the control pattern. - - - The object that implements the pattern interface, or null if the - specified pattern interface is not implemented by this peer. - - - - - Gets the collection of child elements of the - that is associated - with this - . - - The collection of child elements. - - - - Retrieves a UI automation provider for each child element that is - selected. - - An array of UI automation providers. - - This API supports the .NET Framework infrastructure and is not - intended to be used directly from your code. - - - - - Gets the TreeView that owns this TreeViewAutomationPeer. - - - - - Gets a value indicating whether the UI automation provider - allows more than one child element to be selected at the same time. - - - True if multiple selection is allowed; otherwise, false. - - - This API supports the .NET Framework infrastructure and is not - intended to be used directly from your code. - - - - - Gets a value indicating whether the UI automation provider - requires at least one child element to be selected. - - - True if selection is required; otherwise, false. - - - This API supports the .NET Framework infrastructure and is not - intended to be used directly from your code. - - - - - Exposes the items in - types to UI - automation. - - Stable - - - - Initializes a new instance of the - - class. - - - The instance - to associate with this - . - - - - - Gets the control type for the - that is - associated with this - . - This method is called by - . - - - The - - enumeration value. - - - - - Gets the name of the - that is - associated with this - . - This method is called by - . - - A string that contains TreeViewItem. - - - - Gets the control pattern for the - that is - associated with this - . - - - One of the enumeration values. - - - The object that implements the pattern interface, or null if the - specified pattern interface is not implemented by this peer. - - - - - Raise the IsSelected property changed event. - - - A value indicating whether the TreeViewItem is selected. - - - - - Raise an automation event when a TreeViewItem is expanded or - collapsed. - - - A value indicating whether the TreeViewItem was expanded. - - - A value indicating whether the TreeViewItem is expanded. - - - - - Displays all child nodes, controls, or content of the control. - - - This API supports the .NET Framework infrastructure and is not - intended to be used directly from your code. - - - - - Hides all nodes, controls, or content that are descendants of the - control. - - - This API supports the .NET Framework infrastructure and is not - intended to be used directly from your code. - - - - - Adds the current element to the collection of selected items. - - - This API supports the .NET Framework infrastructure and is not - intended to be used directly from your code. - - - - - Clears any selection and then selects the current element. - - - This API supports the .NET Framework infrastructure and is not - intended to be used directly from your code. - - - - - Removes the current element from the collection of selected items. - - - This API supports the .NET Framework infrastructure and is not - intended to be used directly from your code. - - - - - Scrolls the content area of a container object in order to display - the control within the visible region (viewport) of the container. - - - This API supports the .NET Framework infrastructure and is not - intended to be used directly from your code. - - - - - Gets the TreeViewItem that owns this TreeViewItemAutomationPeer. - - - - - Gets the state (expanded or collapsed) of the control. - - - The state (expanded or collapsed) of the control. - - - This API supports the .NET Framework infrastructure and is not - intended to be used directly from your code. - - - - - Gets a value indicating whether an item is selected. - - True if an item is selected; otherwise, false. - - This API supports the .NET Framework infrastructure and is not - intended to be used directly from your code. - - - - - Gets the UI automation provider that implements - - and acts as the container for the calling object. - - The UI automation provider. - - This API supports the .NET Framework infrastructure and is not - intended to be used directly from your code. - - - - - A specialized data template selector. - - - - - Initializes a new instance of the DataTemplateSelector type. - - - - - Convert a value to a data template. - - The value. - The target parameter. - ConverterParameter value. - The culture parameter. - Returns the object. - - - - No 2-way databinding support. - - The value. - The target parameter. - ConverterParameter value. - The culture parameter. - Returns the object. - - - - Gets or sets the default data template. - - - - - Gets or sets the test method template. - - - - - Gets or sets the test class template. - - - - - A specialized bool inversion selector. - - - - - Initializes a new instance of the InvertValueConverter class. - - - - - Convert a value to its opposite. Defines that null value will also - return false. - - The value. - The target parameter. - ConverterParameter value. - The culture parameter. - Returns the object. - - - - No 2-way databinding support. - - The value. - The target parameter. - ConverterParameter value. - The culture parameter. - Returns the object. - - - - A notification type for use in the Notifications ItemsControl. - - - - - Name of the template part. - - - - - Identifies the Title dependency property. - - - - - Identifies the CloseButtonVisibility dependency property. - - - - - Backing field for the close button. - - - - - Initializes a new instance of the Notification class. - - - - - Fires the Closed event. - - The event data. - - - - Overrides the on apply template method. - - - - - Connects to the Click event of the Close button. - - The source object. - The event arguments. - - - - Gets or sets the title of the notification. - - - - - Gets or sets the visibility of the close button. - - - - - Closed event that connects to the close button of the notification. - - - - - A class that contains notification information. - - - - - Initialize a new intance of the Notifications type. - - - - - Overrides the on apply template method. - - - - - Adds a notification object to the set of notifications. Connects the - close button handler to automatically remove the notification from - the visual tree. - - A notification instance. - - - - Handles the Closed event from the notification and removes the - child. - - The source object. - The event data. - - - - This class contains information about the test application and its - deployment settings. - - - - - Initializes a new instance of the class. - - - - - Handles the install state changed event. - - The source object. - The event arguments. - - - - Backing field for an installed property. - - - - - Gets a value indicating whether the test application is currently - installed out of browser. - - - - - Gets the text to show the user the state of the out of browser test - application. - - - - - Gets a value indicating whether out of browser is both supported and - not currently installed. - - - - - Gets a value indicating whether out of browser is supported by this - test application. - - - - - A simple implementation similar to XElement. - - - - - Backing field for child elements. - - - - - Backing field for attributes. - - - - - Backing field for the element name. - - - - - Backing field for optional XML namespace. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the element. - - The name of the element. - - - - Initializes a new instance of the element. - - The name of the element. - The XML namespace of the element. - - - - Initializes a new instance of the class using the reader as the - current root of the element. - - The XmlReader instance. - - - - Sets the value of a new child element. - - The element name. - The value of the new element. - - - - Sets the value of a new child element with an XML namespace value. - - The element name. - The value of the new element. - The XML namespace. - - - - Sets the value of an attribute. - - The attribute name. - The attribute value. - - - - Sets the value of the element. - - The new string value. - - - - Gets an attribute value. - - The attribute name. - Returns an instance of the attribute value. - - - - Adds a child element to the simple element instance. - - The child element instance. - - - - Returns descendants. - - The element name to look for. - Returns an enumeration of elements. - - - - Creates a new SimpleXElement. - - XML content. - Returns a new instance of the element and children. - - - - Parses the current level with the XmlReader instance. - - The reader instance. - A value indicating whether this is the first - parse. Actually this will always be true for now. - - - - Generates the string representation of the element and its tree. - - Returns the string representation of the element. - - - - Writes to the XML writer without document start and ends. - - The writer instance. - - - - Gets the element name. - - - - - Gets or sets the element text, if any. - - - - diff --git a/lib/Microsoft.Silverlight.Testing/April2010/Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll b/lib/Microsoft.Silverlight.Testing/April2010/Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll deleted file mode 100644 index 9313918..0000000 Binary files a/lib/Microsoft.Silverlight.Testing/April2010/Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll and /dev/null differ diff --git a/lib/Microsoft.Silverlight.Testing/April2010/Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.extmap.xml b/lib/Microsoft.Silverlight.Testing/April2010/Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.extmap.xml deleted file mode 100644 index 2410f71..0000000 --- a/lib/Microsoft.Silverlight.Testing/April2010/Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.extmap.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight - 2.0.5.0 - 31bf3856ad364e35 - Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - \ No newline at end of file diff --git a/lib/Microsoft.Silverlight.Testing/April2010/Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.pdb b/lib/Microsoft.Silverlight.Testing/April2010/Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.pdb deleted file mode 100644 index 6096960..0000000 Binary files a/lib/Microsoft.Silverlight.Testing/April2010/Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.pdb and /dev/null differ diff --git a/lib/Microsoft.Silverlight.Testing/April2010/Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.xml b/lib/Microsoft.Silverlight.Testing/April2010/Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.xml deleted file mode 100644 index 0b84c0a..0000000 --- a/lib/Microsoft.Silverlight.Testing/April2010/Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.xml +++ /dev/null @@ -1,3429 +0,0 @@ - - - - Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight - - - - - UrlToTest specifies the url that should be requested to give context to the test. - - - - - An unused attribute. - - - - - - Gets the URL to test. - - - - - AspNetDevelopmentServer specifies the settings to be used for the - ASP.NET Development Server for the test. - - - - - Initializes the AspNetDevelopmentServerAttribute. - - The name. - The path to web app. - - - - Initializes the AspNetDevelopmentServerAttribute. - - The name. - The path to web app. - The web app root. - - - - Gets the name. - - - - - Gets the PathToWebApp. - - - - - Gets the web app root. - - - - - AspNetDevelopmentServerHost specifies the settings to be used when - ASP.NET Development Server is the host server for the test. - - - - - Initializes the AspNetDevelopmentServerHostAttribute. - - The path to the web app. - - - - Initializes the AspNetDevelopmentServerHostAttribute. - - The path to the web app. - The web app root. - - - - Gets the path to the web application. - - - - - Gets the WebAppRoot. - - - - - For ASP.NET sites that require basic authentication, specify the - user name and password using the Credential attribute. - WARNING: The password is stored in plain text in source code - and in the compiled assembly. Restrict access to the source code - and assembly to protect this sensitive information. - - - - - Specify the user name and password needed to access the web site under test. - - The user name. - - The password. WARNING: The password is stored in plain text in source code - and in the compiled assembly. Restrict access to the source code and assembly - to protect this sensitive information. - - - - - Specify the user name, password, and domain needed to access the web site under test. - - The user name. - - The password. WARNING: The password is stored in plain text in source code - and in the compiled assembly. Restrict access to the source code and assembly - to protect this sensitive information. - - The domain. - - - - Gets the user name. - - - - - Gets the password. - - - - - Gets the domain. - - - - - Base class for Framework Exceptions, provides localization trick so that messages are in HA locale. - - - - - Initializes a new UnitTestAssertException. - - - - - Initializes UnitTestAssertException. - - The message. - - - - Gets the Message string. - - - - - AssertFailedException class. Used to indicate failure for a test case - - - - - Initializes a new AssertFailedException. - - The message. - - - - AssertFailedException - - The message. - The inner exception. - - - - The AssertInconclusiveException class. - - - - - Initializes a new AssertInconclusiveException. - - The message. - - - - Initializes a new AssertInconclusiveException. - - The message. - The inner exception. - - - - Initializes a new AssertInconclusiveException. - - - - - InternalTestFailureException class. Used to indicate internal failure - for a test case. - - - - - Initializes a new InternalTestFailureException. - - The message. - - - - Initializes a new InternalTestFailureException. - - The message. - The inner exception. - - - - Initializes a new InternalTestFailureException. - - - - - A collection of helper classes to test various conditions within - unit tests. If the condition being tested is not met, an exception - is thrown. - - - - - - - - - - Tests whether the specified condition is true and throws an exception - if the condition is false. - - The condition the test expects to be true. - - Thrown if is false. - - - - - Tests whether the specified condition is true and throws an exception - if the condition is false. - - The condition the test expects to be true. - - The message to include in the exception when - is false. The message is shown in test results. - - - Thrown if is false. - - - - - Tests whether the specified condition is true and throws an exception - if the condition is false. - - The condition the test expects to be true. - - The message to include in the exception when - is false. The message is shown in test results. - - - An array of parameters to use when formatting . - - - Thrown if is false. - - - - - Tests whether the specified condition is false and throws an exception - if the condition is true. - - The condition the test expects to be false. - - Thrown if is true. - - - - - Tests whether the specified condition is false and throws an exception - if the condition is true. - - The condition the test expects to be false. - - The message to include in the exception when - is true. The message is shown in test results. - - - Thrown if is true. - - - - - Tests whether the specified condition is false and throws an exception - if the condition is true. - - The condition the test expects to be false. - - The message to include in the exception when - is true. The message is shown in test results. - - - An array of parameters to use when formatting . - - - Thrown if is true. - - - - - Tests whether the specified object is null and throws an exception - if it is not. - - The object the test expects to be null. - - Thrown if is not null. - - - - - Tests whether the specified object is null and throws an exception - if it is not. - - The object the test expects to be null. - - The message to include in the exception when - is not null. The message is shown in test results. - - - Thrown if is not null. - - - - - Tests whether the specified object is null and throws an exception - if it is not. - - The object the test expects to be null. - - The message to include in the exception when - is not null. The message is shown in test results. - - - An array of parameters to use when formatting . - - - Thrown if is not null. - - - - - Tests whether the specified object is non-null and throws an exception - if it is null. - - The object the test expects not to be null. - - Thrown if is null. - - - - - Tests whether the specified object is non-null and throws an exception - if it is null. - - The object the test expects not to be null. - - The message to include in the exception when - is null. The message is shown in test results. - - - Thrown if is null. - - - - - Tests whether the specified object is non-null and throws an exception - if it is null. - - The object the test expects not to be null. - - The message to include in the exception when - is null. The message is shown in test results. - - - An array of parameters to use when formatting . - - - Thrown if is null. - - - - - Tests whether the specified objects both refer to the same object and - throws an exception if the two inputs do not refer to the same object. - - - The first object to compare. This is the value the test expects. - - - The second object to compare. This is the value produced by the code under test. - - - Thrown if does not refer to the same object - as . - - - - - Tests whether the specified objects both refer to the same object and - throws an exception if the two inputs do not refer to the same object. - - - The first object to compare. This is the value the test expects. - - - The second object to compare. This is the value produced by the code under test. - - - The message to include in the exception when - is not the same as . The message is shown - in test results. - - - Thrown if does not refer to the same object - as . - - - - - Tests whether the specified objects both refer to the same object and - throws an exception if the two inputs do not refer to the same object. - - - The first object to compare. This is the value the test expects. - - - The second object to compare. This is the value produced by the code under test. - - - The message to include in the exception when - is not the same as . The message is shown - in test results. - - - An array of parameters to use when formatting . - - - Thrown if does not refer to the same object - as . - - - - - Tests whether the specified objects refer to different objects and - throws an exception if the two inputs refer to the same object. - - - The first object to compare. This is the value the test expects not - to match . - - - The second object to compare. This is the value produced by the code under test. - - - Thrown if refers to the same object - as . - - - - - Tests whether the specified objects refer to different objects and - throws an exception if the two inputs refer to the same object. - - - The first object to compare. This is the value the test expects not - to match . - - - The second object to compare. This is the value produced by the code under test. - - - The message to include in the exception when - is the same as . The message is shown in - test results. - - - Thrown if refers to the same object - as . - - - - - Tests whether the specified objects refer to different objects and - throws an exception if the two inputs refer to the same object. - - - The first object to compare. This is the value the test expects not - to match . - - - The second object to compare. This is the value produced by the code under test. - - - The message to include in the exception when - is the same as . The message is shown in - test results. - - - An array of parameters to use when formatting . - - - Thrown if refers to the same object - as . - - - - - Tests whether the specified values are equal and throws an exception - if the two values are not equal. Different numeric types are treated - as unequal even if the logical values are equal. 42L is not equal to 42. - - The type of values to compare. - - The first value to compare. This is the value the tests expects. - - - The second value to compare. This is the value produced by the code under test. - - - Thrown if is not equal to - . - - - - - Tests whether the specified values are equal and throws an exception - if the two values are not equal. Different numeric types are treated - as unequal even if the logical values are equal. 42L is not equal to 42. - - The type of values to compare. - - The first value to compare. This is the value the tests expects. - - - The second value to compare. This is the value produced by the code under test. - - - The message to include in the exception when - is not equal to . The message is shown in - test results. - - - Thrown if is not equal to - . - - - - - Tests whether the specified values are equal and throws an exception - if the two values are not equal. Different numeric types are treated - as unequal even if the logical values are equal. 42L is not equal to 42. - - The type of values to compare. - - The first value to compare. This is the value the tests expects. - - - The second value to compare. This is the value produced by the code under test. - - - The message to include in the exception when - is not equal to . The message is shown in - test results. - - - An array of parameters to use when formatting . - - - Thrown if is not equal to - . - - - - - Tests whether the specified values are unequal and throws an exception - if the two values are equal. Different numeric types are treated - as unequal even if the logical values are equal. 42L is not equal to 42. - - The type of values to compare. - - The first value to compare. This is the value the test expects not - to match . - - - The second value to compare. This is the value produced by the code under test. - - - Thrown if is equal to . - - - - - Tests whether the specified values are unequal and throws an exception - if the two values are equal. Different numeric types are treated - as unequal even if the logical values are equal. 42L is not equal to 42. - - The type of values to compare. - - The first value to compare. This is the value the test expects not - to match . - - - The second value to compare. This is the value produced by the code under test. - - - The message to include in the exception when - is equal to . The message is shown in - test results. - - - Thrown if is equal to . - - - - - Tests whether the specified values are unequal and throws an exception - if the two values are equal. Different numeric types are treated - as unequal even if the logical values are equal. 42L is not equal to 42. - - The type of values to compare. - - The first value to compare. This is the value the test expects not - to match . - - - The second value to compare. This is the value produced by the code under test. - - - The message to include in the exception when - is equal to . The message is shown in - test results. - - - An array of parameters to use when formatting . - - - Thrown if is equal to . - - - - - Tests whether the specified objects are equal and throws an exception - if the two objects are not equal. Different numeric types are treated - as unequal even if the logical values are equal. 42L is not equal to 42. - - - The first object to compare. This is the object the tests expects. - - - The second object to compare. This is the object produced by the code under test. - - - Thrown if is not equal to - . - - - - - Tests whether the specified objects are equal and throws an exception - if the two objects are not equal. Different numeric types are treated - as unequal even if the logical values are equal. 42L is not equal to 42. - - - The first object to compare. This is the object the tests expects. - - - The second object to compare. This is the object produced by the code under test. - - - The message to include in the exception when - is not equal to . The message is shown in - test results. - - - Thrown if is not equal to - . - - - - - Tests whether the specified objects are equal and throws an exception - if the two objects are not equal. Different numeric types are treated - as unequal even if the logical values are equal. 42L is not equal to 42. - - - The first object to compare. This is the object the tests expects. - - - The second object to compare. This is the object produced by the code under test. - - - The message to include in the exception when - is not equal to . The message is shown in - test results. - - - An array of parameters to use when formatting . - - - Thrown if is not equal to - . - - - - - Tests whether the specified objects are unequal and throws an exception - if the two objects are equal. Different numeric types are treated - as unequal even if the logical values are equal. 42L is not equal to 42. - - - The first object to compare. This is the value the test expects not - to match . - - - The second object to compare. This is the object produced by the code under test. - - - Thrown if is equal to . - - - - - Tests whether the specified objects are unequal and throws an exception - if the two objects are equal. Different numeric types are treated - as unequal even if the logical values are equal. 42L is not equal to 42. - - - The first object to compare. This is the value the test expects not - to match . - - - The second object to compare. This is the object produced by the code under test. - - - The message to include in the exception when - is equal to . The message is shown in - test results. - - - Thrown if is equal to . - - - - - Tests whether the specified objects are unequal and throws an exception - if the two objects are equal. Different numeric types are treated - as unequal even if the logical values are equal. 42L is not equal to 42. - - - The first object to compare. This is the value the test expects not - to match . - - - The second object to compare. This is the object produced by the code under test. - - - The message to include in the exception when - is equal to . The message is shown in - test results. - - - An array of parameters to use when formatting . - - - Thrown if is equal to . - - - - - Tests whether the specified floats are equal and throws an exception - if they are not equal. - - - The first float to compare. This is the float the tests expects. - - - The second float to compare. This is the float produced by the code under test. - - - The required accuracy. An exception will be thrown only if - is different than - by more than . - - - Thrown if is not equal to - . - - - - - Tests whether the specified floats are equal and throws an exception - if they are not equal. - - - The first float to compare. This is the float the tests expects. - - - The second float to compare. This is the float produced by the code under test. - - - The required accuracy. An exception will be thrown only if - is different than - by more than . - - - The message to include in the exception when - is different than by more than - . The message is shown in test results. - - - Thrown if is not equal to - . - - - - - Tests whether the specified floats are equal and throws an exception - if they are not equal. - - - The first float to compare. This is the float the tests expects. - - - The second float to compare. This is the float produced by the code under test. - - - The required accuracy. An exception will be thrown only if - is different than - by more than . - - - The message to include in the exception when - is different than by more than - . The message is shown in test results. - - - An array of parameters to use when formatting . - - - Thrown if is not equal to - . - - - - - Tests whether the specified floats are unequal and throws an exception - if they are equal. - - - The first float to compare. This is the float the test expects not to - match . - - - The second float to compare. This is the float produced by the code under test. - - - The required accuracy. An exception will be thrown only if - is different than - by at most . - - - Thrown if is equal to . - - - - - Tests whether the specified floats are unequal and throws an exception - if they are equal. - - - The first float to compare. This is the float the test expects not to - match . - - - The second float to compare. This is the float produced by the code under test. - - - The required accuracy. An exception will be thrown only if - is different than - by at most . - - - The message to include in the exception when - is equal to or different by less than - . The message is shown in test results. - - - Thrown if is equal to . - - - - - Tests whether the specified floats are unequal and throws an exception - if they are equal. - - - The first float to compare. This is the float the test expects not to - match . - - - The second float to compare. This is the float produced by the code under test. - - - The required accuracy. An exception will be thrown only if - is different than - by at most . - - - The message to include in the exception when - is equal to or different by less than - . The message is shown in test results. - - - An array of parameters to use when formatting . - - - Thrown if is equal to . - - - - - Tests whether the specified doubles are equal and throws an exception - if they are not equal. - - - The first double to compare. This is the double the tests expects. - - - The second double to compare. This is the double produced by the code under test. - - - The required accuracy. An exception will be thrown only if - is different than - by more than . - - - Thrown if is not equal to - . - - - - - Tests whether the specified doubles are equal and throws an exception - if they are not equal. - - - The first double to compare. This is the double the tests expects. - - - The second double to compare. This is the double produced by the code under test. - - - The required accuracy. An exception will be thrown only if - is different than - by more than . - - - The message to include in the exception when - is different than by more than - . The message is shown in test results. - - - Thrown if is not equal to - . - - - - - Tests whether the specified doubles are equal and throws an exception - if they are not equal. - - - The first double to compare. This is the double the tests expects. - - - The second double to compare. This is the double produced by the code under test. - - - The required accuracy. An exception will be thrown only if - is different than - by more than . - - - The message to include in the exception when - is different than by more than - . The message is shown in test results. - - - An array of parameters to use when formatting . - - - Thrown if is not equal to - . - - - - - Tests whether the specified doubles are unequal and throws an exception - if they are equal. - - - The first double to compare. This is the double the test expects not to - match . - - - The second double to compare. This is the double produced by the code under test. - - - The required accuracy. An exception will be thrown only if - is different than - by at most . - - - Thrown if is equal to . - - - - - Tests whether the specified doubles are unequal and throws an exception - if they are equal. - - - The first double to compare. This is the double the test expects not to - match . - - - The second double to compare. This is the double produced by the code under test. - - - The required accuracy. An exception will be thrown only if - is different than - by at most . - - - The message to include in the exception when - is equal to or different by less than - . The message is shown in test results. - - - Thrown if is equal to . - - - - - Tests whether the specified doubles are unequal and throws an exception - if they are equal. - - - The first double to compare. This is the double the test expects not to - match . - - - The second double to compare. This is the double produced by the code under test. - - - The required accuracy. An exception will be thrown only if - is different than - by at most . - - - The message to include in the exception when - is equal to or different by less than - . The message is shown in test results. - - - An array of parameters to use when formatting . - - - Thrown if is equal to . - - - - - Tests whether the specified strings are equal and throws an exception - if they are not equal. The invariant culture is used for the comparison. - - - The first string to compare. This is the string the tests expects. - - - The second string to compare. This is the string produced by the code under test. - - - A Boolean indicating a case-sensitive or insensitive comparison. (true - indicates a case-insensitive comparison.) - - - Thrown if is not equal to - . - - - - - Tests whether the specified strings are equal and throws an exception - if they are not equal. The invariant culture is used for the comparison. - - - The first string to compare. This is the string the tests expects. - - - The second string to compare. This is the string produced by the code under test. - - - A Boolean indicating a case-sensitive or insensitive comparison. (true - indicates a case-insensitive comparison.) - - - The message to include in the exception when - is not equal to . The message is shown in - test results. - - - Thrown if is not equal to - . - - - - - Tests whether the specified strings are equal and throws an exception - if they are not equal. The invariant culture is used for the comparison. - - - The first string to compare. This is the string the tests expects. - - - The second string to compare. This is the string produced by the code under test. - - - A Boolean indicating a case-sensitive or insensitive comparison. (true - indicates a case-insensitive comparison.) - - - The message to include in the exception when - is not equal to . The message is shown in - test results. - - - An array of parameters to use when formatting . - - - Thrown if is not equal to - . - - - - - Tests whether the specified strings are equal and throws an exception - if they are not equal. - - - The first string to compare. This is the string the tests expects. - - - The second string to compare. This is the string produced by the code under test. - - - A Boolean indicating a case-sensitive or insensitive comparison. (true - indicates a case-insensitive comparison.) - - - A CultureInfo object that supplies culture-specific comparison information. - - - Thrown if is not equal to - . - - - - - Tests whether the specified strings are equal and throws an exception - if they are not equal. - - - The first string to compare. This is the string the tests expects. - - - The second string to compare. This is the string produced by the code under test. - - - A Boolean indicating a case-sensitive or insensitive comparison. (true - indicates a case-insensitive comparison.) - - - A CultureInfo object that supplies culture-specific comparison information. - - - The message to include in the exception when - is not equal to . The message is shown in - test results. - - - Thrown if is not equal to - . - - - - - Tests whether the specified strings are equal and throws an exception - if they are not equal. - - - The first string to compare. This is the string the tests expects. - - - The second string to compare. This is the string produced by the code under test. - - - A Boolean indicating a case-sensitive or insensitive comparison. (true - indicates a case-insensitive comparison.) - - - A CultureInfo object that supplies culture-specific comparison information. - - - The message to include in the exception when - is not equal to . The message is shown in - test results. - - - An array of parameters to use when formatting . - - - Thrown if is not equal to - . - - - - - Tests whether the specified strings are unequal and throws an exception - if they are equal. The invariant culture is used for the comparison. - - - The first string to compare. This is the string the test expects not to - match . - - - The second string to compare. This is the string produced by the code under test. - - - A Boolean indicating a case-sensitive or insensitive comparison. (true - indicates a case-insensitive comparison.) - - - Thrown if is equal to . - - - - - Tests whether the specified strings are unequal and throws an exception - if they are equal. The invariant culture is used for the comparison. - - - The first string to compare. This is the string the test expects not to - match . - - - The second string to compare. This is the string produced by the code under test. - - - A Boolean indicating a case-sensitive or insensitive comparison. (true - indicates a case-insensitive comparison.) - - - The message to include in the exception when - is equal to . The message is shown in - test results. - - - Thrown if is equal to . - - - - - Tests whether the specified strings are unequal and throws an exception - if they are equal. The invariant culture is used for the comparison. - - - The first string to compare. This is the string the test expects not to - match . - - - The second string to compare. This is the string produced by the code under test. - - - A Boolean indicating a case-sensitive or insensitive comparison. (true - indicates a case-insensitive comparison.) - - - The message to include in the exception when - is equal to . The message is shown in - test results. - - - An array of parameters to use when formatting . - - - Thrown if is equal to . - - - - - Tests whether the specified strings are unequal and throws an exception - if they are equal. - - - The first string to compare. This is the string the test expects not to - match . - - - The second string to compare. This is the string produced by the code under test. - - - A Boolean indicating a case-sensitive or insensitive comparison. (true - indicates a case-insensitive comparison.) - - - A CultureInfo object that supplies culture-specific comparison information. - - - Thrown if is equal to . - - - - - Tests whether the specified strings are unequal and throws an exception - if they are equal. - - - The first string to compare. This is the string the test expects not to - match . - - - The second string to compare. This is the string produced by the code under test. - - - A Boolean indicating a case-sensitive or insensitive comparison. (true - indicates a case-insensitive comparison.) - - - A CultureInfo object that supplies culture-specific comparison information. - - - The message to include in the exception when - is equal to . The message is shown in - test results. - - - Thrown if is equal to . - - - - - Tests whether the specified strings are unequal and throws an exception - if they are equal. - - - The first string to compare. This is the string the test expects not to - match . - - - The second string to compare. This is the string produced by the code under test. - - - A Boolean indicating a case-sensitive or insensitive comparison. (true - indicates a case-insensitive comparison.) - - - A CultureInfo object that supplies culture-specific comparison information. - - - The message to include in the exception when - is equal to . The message is shown in - test results. - - - An array of parameters to use when formatting . - - - Thrown if is equal to . - - - - - Tests whether the specified object is an instance of the expected - type and throws an exception if the expected type is not in the - inheritance hierarchy of the object. - - - The object the test expects to be of the specified type. - - - The expected type of . - - - Thrown if is null or - is not in the inheritance hierarchy - of . - - - - - Tests whether the specified object is an instance of the expected - type and throws an exception if the expected type is not in the - inheritance hierarchy of the object. - - - The object the test expects to be of the specified type. - - - The expected type of . - - - The message to include in the exception when - is not an instance of . The message is - shown in test results. - - - Thrown if is null or - is not in the inheritance hierarchy - of . - - - - - Tests whether the specified object is an instance of the expected - type and throws an exception if the expected type is not in the - inheritance hierarchy of the object. - - - The object the test expects to be of the specified type. - - - The expected type of . - - - The message to include in the exception when - is not an instance of . The message is - shown in test results. - - - An array of parameters to use when formatting . - - - Thrown if is null or - is not in the inheritance hierarchy - of . - - - - - Tests whether the specified object is not an instance of the wrong - type and throws an exception if the specified type is in the - inheritance hierarchy of the object. - - - The object the test expects not to be of the specified type. - - - The type that should not be. - - - Thrown if is not null and - is in the inheritance hierarchy - of . - - - - - Tests whether the specified object is not an instance of the wrong - type and throws an exception if the specified type is in the - inheritance hierarchy of the object. - - - The object the test expects not to be of the specified type. - - - The type that should not be. - - - The message to include in the exception when - is an instance of . The message is shown - in test results. - - - Thrown if is not null and - is in the inheritance hierarchy - of . - - - - - Tests whether the specified object is not an instance of the wrong - type and throws an exception if the specified type is in the - inheritance hierarchy of the object. - - - The object the test expects not to be of the specified type. - - - The type that should not be. - - - The message to include in the exception when - is an instance of . The message is shown - in test results. - - - An array of parameters to use when formatting . - - - Thrown if is not null and - is in the inheritance hierarchy - of . - - - - - Throws an AssertFailedException. - - - Always thrown. - - - - - Throws an AssertFailedException. - - - The message to include in the exception. The message is shown in - test results. - - - Always thrown. - - - - - Throws an AssertFailedException. - - - The message to include in the exception. The message is shown in - test results. - - - An array of parameters to use when formatting . - - - Always thrown. - - - - - Throws an AssertInconclusiveException. - - - Always thrown. - - - - - Throws an AssertInconclusiveException. - - - The message to include in the exception. The message is shown in - test results. - - - Always thrown. - - - - - Throws an AssertInconclusiveException. - - - The message to include in the exception. The message is shown in - test results. - - - An array of parameters to use when formatting . - - - Always thrown. - - - - - Helper function that creates and throws an AssertionFailedException. - - name of the assertion throwing an exception. - message describing conditions for assertion failure. - The parameters. - - - - Checks the parameter for valid conditions - - The parameter. - The assertion name. - The parameter name. - The message. - The parameters. - - - - Safely converts an object to a string, handling null values and null characters. - Null values are converted to "(null)". Null characters are converted to "\\0". - - The object to convert to a string. - The converted string. - - - - Replaces null characters ('\0') with "\\0". - - The string to search. - The converted string with null characters replaced by "\\0". - - - - An exception from reflection will always be a TargetInvocationException - however - the goal of Private Accessors is to be seamless to the original code. - The only problem with throwing the inner exception is that the stack trace will - be overwritten. From here we register the stack trace of the inner exception - and then throw it. The Unit Test Adapter will then later rebuild the stack - from the cached shadow information plus the remaining stack from this throw. - - - - - - A collection of helper classes to test various conditions associated - with collections within unit tests. If the condition being tested is not - met, an exception is thrown. - - - - - Tests whether the specified collection contains the specified element - and throws an exception if the element is not in the collection. - - - The collection in which to search for the element. - - - The element that is expected to be in the collection. - - - Thrown if is not found in - . - - - - - Tests whether the specified collection contains the specified element - and throws an exception if the element is not in the collection. - - - The collection in which to search for the element. - - - The element that is expected to be in the collection. - - - The message to include in the exception when - is not in . The message is shown in - test results. - - - Thrown if is not found in - . - - - - - Tests whether the specified collection contains the specified element - and throws an exception if the element is not in the collection. - - - The collection in which to search for the element. - - - The element that is expected to be in the collection. - - - The message to include in the exception when - is not in . The message is shown in - test results. - - - An array of parameters to use when formatting . - - - Thrown if is not found in - . - - - - - Tests whether the specified collection does not contain the specified - element and throws an exception if the element is in the collection. - - - The collection in which to search for the element. - - - The element that is expected not to be in the collection. - - - Thrown if is found in - . - - - - - Tests whether the specified collection does not contain the specified - element and throws an exception if the element is in the collection. - - - The collection in which to search for the element. - - - The element that is expected not to be in the collection. - - - The message to include in the exception when - is in . The message is shown in test - results. - - - Thrown if is found in - . - - - - - Tests whether the specified collection does not contain the specified - element and throws an exception if the element is in the collection. - - - The collection in which to search for the element. - - - The element that is expected not to be in the collection. - - - The message to include in the exception when - is in . The message is shown in test - results. - - - An array of parameters to use when formatting . - - - Thrown if is found in - . - - - - - Tests whether all items in the specified collection are non-null and throws - an exception if any element is null. - - - The collection in which to search for null elements. - - - Thrown if a null element is found in . - - - - - Tests whether all items in the specified collection are non-null and throws - an exception if any element is null. - - - The collection in which to search for null elements. - - - The message to include in the exception when - contains a null element. The message is shown in test results. - - - Thrown if a null element is found in . - - - - - Tests whether all items in the specified collection are non-null and throws - an exception if any element is null. - - - The collection in which to search for null elements. - - - The message to include in the exception when - contains a null element. The message is shown in test results. - - - An array of parameters to use when formatting . - - - Thrown if a null element is found in . - - - - - Tests whether all items in the specified collection are unique or not and - throws if any two elements in the collection are equal. - - - The collection in which to search for duplicate elements. - - - Thrown if a two or more equal elements are found in - . - - - - - Tests whether all items in the specified collection are unique or not and - throws if any two elements in the collection are equal. - - - The collection in which to search for duplicate elements. - - - The message to include in the exception when - contains at least one duplicate element. The message is shown in - test results. - - - Thrown if a two or more equal elements are found in - . - - - - - Tests whether all items in the specified collection are unique or not and - throws if any two elements in the collection are equal. - - - The collection in which to search for duplicate elements. - - - The message to include in the exception when - contains at least one duplicate element. The message is shown in - test results. - - - An array of parameters to use when formatting . - - - Thrown if a two or more equal elements are found in - . - - - - - Tests whether one collection is a subset of another collection and - throws an exception if any element in the subset is not also in the - superset. - - - The collection expected to be a subset of . - - - The collection expected to be a superset of - - - Thrown if an element in is not found in - . - - - - - Tests whether one collection is a subset of another collection and - throws an exception if any element in the subset is not also in the - superset. - - - The collection expected to be a subset of . - - - The collection expected to be a superset of - - - The message to include in the exception when an element in - is not found in . - The message is shown in test results. - - - Thrown if an element in is not found in - . - - - - - Tests whether one collection is a subset of another collection and - throws an exception if any element in the subset is not also in the - superset. - - - The collection expected to be a subset of . - - - The collection expected to be a superset of - - - The message to include in the exception when an element in - is not found in . - The message is shown in test results. - - - An array of parameters to use when formatting . - - - Thrown if an element in is not found in - . - - - - - Tests whether one collection is not a subset of another collection and - throws an exception if all elements in the subset are also in the - superset. - - - The collection expected not to be a subset of . - - - The collection expected not to be a superset of - - - Thrown if every element in is also found in - . - - - - - Tests whether one collection is not a subset of another collection and - throws an exception if all elements in the subset are also in the - superset. - - - The collection expected not to be a subset of . - - - The collection expected not to be a superset of - - - The message to include in the exception when every element in - is also found in . - The message is shown in test results. - - - Thrown if every element in is also found in - . - - - - - Tests whether one collection is not a subset of another collection and - throws an exception if all elements in the subset are also in the - superset. - - - The collection expected not to be a subset of . - - - The collection expected not to be a superset of - - - The message to include in the exception when every element in - is also found in . - The message is shown in test results. - - - An array of parameters to use when formatting . - - - Thrown if every element in is also found in - . - - - - - Tests whether two collections contain the same elements and throws an - exception if either collection contains an element not in the other - collection. - - - The first collection to compare. This contains the elements the test - expects. - - - The second collection to compare. This is the collection produced by - the code under test. - - - Thrown if an element was found in one of the collections but not - the other. - - - - - Tests whether two collections contain the same elements and throws an - exception if either collection contains an element not in the other - collection. - - - The first collection to compare. This contains the elements the test - expects. - - - The second collection to compare. This is the collection produced by - the code under test. - - - The message to include in the exception when an element was found - in one of the collections but not the other. The message is shown - in test results. - - - Thrown if an element was found in one of the collections but not - the other. - - - - - Tests whether two collections contain the same elements and throws an - exception if either collection contains an element not in the other - collection. - - - The first collection to compare. This contains the elements the test - expects. - - - The second collection to compare. This is the collection produced by - the code under test. - - - The message to include in the exception when an element was found - in one of the collections but not the other. The message is shown - in test results. - - - An array of parameters to use when formatting . - - - Thrown if an element was found in one of the collections but not - the other. - - - - - Tests whether two collections contain the different elements and throws an - exception if the two collections contain identical elements without regard - to order. - - - The first collection to compare. This contains the elements the test - expects to be different than the actual collection. - - - The second collection to compare. This is the collection produced by - the code under test. - - - Thrown if the two collections contained the same elements, including - the same number of duplicate occurrences of each element. - - - - - Tests whether two collections contain the different elements and throws an - exception if the two collections contain identical elements without regard - to order. - - - The first collection to compare. This contains the elements the test - expects to be different than the actual collection. - - - The second collection to compare. This is the collection produced by - the code under test. - - - The message to include in the exception when - contains the same elements as . The message - is shown in test results. - - - Thrown if the two collections contained the same elements, including - the same number of duplicate occurrences of each element. - - - - - Tests whether two collections contain the different elements and throws an - exception if the two collections contain identical elements without regard - to order. - - - The first collection to compare. This contains the elements the test - expects to be different than the actual collection. - - - The second collection to compare. This is the collection produced by - the code under test. - - - The message to include in the exception when - contains the same elements as . The message - is shown in test results. - - - An array of parameters to use when formatting . - - - Thrown if the two collections contained the same elements, including - the same number of duplicate occurrences of each element. - - - - - Tests whether all elements in the specified collection are instances - of the expected type and throws an exception if the expected type is - not in the inheritance hierarchy of one or more of the elements. - - - The collection containing elements the test expects to be of the - specified type. - - - The expected type of each element of . - - - Thrown if an element in is null or - is not in the inheritance hierarchy - of an element in . - - - - - Tests whether all elements in the specified collection are instances - of the expected type and throws an exception if the expected type is - not in the inheritance hierarchy of one or more of the elements. - - - The collection containing elements the test expects to be of the - specified type. - - - The expected type of each element of . - - - The message to include in the exception when an element in - is not an instance of - . The message is shown in test results. - - - Thrown if an element in is null or - is not in the inheritance hierarchy - of an element in . - - - - - Tests whether all elements in the specified collection are instances - of the expected type and throws an exception if the expected type is - not in the inheritance hierarchy of one or more of the elements. - - - The collection containing elements the test expects to be of the - specified type. - - - The expected type of each element of . - - - The message to include in the exception when an element in - is not an instance of - . The message is shown in test results. - - - An array of parameters to use when formatting . - - - Thrown if an element in is null or - is not in the inheritance hierarchy - of an element in . - - - - - Tests whether the specified collections are equal and throws an exception - if the two collections are not equal. Equality is defined as having the same - elements in the same order and quantity. Different references to the same - value are considered equal. - - - The first collection to compare. This is the collection the tests expects. - - - The second collection to compare. This is the collection produced by the - code under test. - - - Thrown if is not equal to - . - - - - - Tests whether the specified collections are equal and throws an exception - if the two collections are not equal. Equality is defined as having the same - elements in the same order and quantity. Different references to the same - value are considered equal. - - - The first collection to compare. This is the collection the tests expects. - - - The second collection to compare. This is the collection produced by the - code under test. - - - The message to include in the exception when - is not equal to . The message is shown in - test results. - - - Thrown if is not equal to - . - - - - - Tests whether the specified collections are equal and throws an exception - if the two collections are not equal. Equality is defined as having the same - elements in the same order and quantity. Different references to the same - value are considered equal. - - - The first collection to compare. This is the collection the tests expects. - - - The second collection to compare. This is the collection produced by the - code under test. - - - The message to include in the exception when - is not equal to . The message is shown in - test results. - - - An array of parameters to use when formatting . - - - Thrown if is not equal to - . - - - - - Tests whether the specified collections are unequal and throws an exception - if the two collections are equal. Equality is defined as having the same - elements in the same order and quantity. Different references to the same - value are considered equal. - - - The first collection to compare. This is the collection the tests expects - not to match . - - - The second collection to compare. This is the collection produced by the - code under test. - - - Thrown if is equal to . - - - - - Tests whether the specified collections are unequal and throws an exception - if the two collections are equal. Equality is defined as having the same - elements in the same order and quantity. Different references to the same - value are considered equal. - - - The first collection to compare. This is the collection the tests expects - not to match . - - - The second collection to compare. This is the collection produced by the - code under test. - - - The message to include in the exception when - is equal to . The message is shown in - test results. - - - Thrown if is equal to . - - - - - Tests whether the specified collections are unequal and throws an exception - if the two collections are equal. Equality is defined as having the same - elements in the same order and quantity. Different references to the same - value are considered equal. - - - The first collection to compare. This is the collection the tests expects - not to match . - - - The second collection to compare. This is the collection produced by the - code under test. - - - The message to include in the exception when - is equal to . The message is shown in - test results. - - - An array of parameters to use when formatting . - - - Thrown if is equal to . - - - - - Tests whether the specified collections are equal and throws an exception - if the two collections are not equal. Equality is defined as having the same - elements in the same order and quantity. Different references to the same - value are considered equal. - - - The first collection to compare. This is the collection the tests expects. - - - The second collection to compare. This is the collection produced by the - code under test. - - - The compare implementation to use when comparing elements of the collection. - - - Thrown if is not equal to - . - - - - - Tests whether the specified collections are equal and throws an exception - if the two collections are not equal. Equality is defined as having the same - elements in the same order and quantity. Different references to the same - value are considered equal. - - - The first collection to compare. This is the collection the tests expects. - - - The second collection to compare. This is the collection produced by the - code under test. - - - The compare implementation to use when comparing elements of the collection. - - - The message to include in the exception when - is not equal to . The message is shown in - test results. - - - Thrown if is not equal to - . - - - - - Tests whether the specified collections are equal and throws an exception - if the two collections are not equal. Equality is defined as having the same - elements in the same order and quantity. Different references to the same - value are considered equal. - - - The first collection to compare. This is the collection the tests expects. - - - The second collection to compare. This is the collection produced by the - code under test. - - - The compare implementation to use when comparing elements of the collection. - - - The message to include in the exception when - is not equal to . The message is shown in - test results. - - - An array of parameters to use when formatting . - - - Thrown if is not equal to - . - - - - - Tests whether the specified collections are unequal and throws an exception - if the two collections are equal. Equality is defined as having the same - elements in the same order and quantity. Different references to the same - value are considered equal. - - - The first collection to compare. This is the collection the tests expects - not to match . - - - The second collection to compare. This is the collection produced by the - code under test. - - - The compare implementation to use when comparing elements of the collection. - - - Thrown if is equal to . - - - - - Tests whether the specified collections are unequal and throws an exception - if the two collections are equal. Equality is defined as having the same - elements in the same order and quantity. Different references to the same - value are considered equal. - - - The first collection to compare. This is the collection the tests expects - not to match . - - - The second collection to compare. This is the collection produced by the - code under test. - - - The compare implementation to use when comparing elements of the collection. - - - The message to include in the exception when - is equal to . The message is shown in - test results. - - - Thrown if is equal to . - - - - - Tests whether the specified collections are unequal and throws an exception - if the two collections are equal. Equality is defined as having the same - elements in the same order and quantity. Different references to the same - value are considered equal. - - - The first collection to compare. This is the collection the tests expects - not to match . - - - The second collection to compare. This is the collection produced by the - code under test. - - - The compare implementation to use when comparing elements of the collection. - - - The message to include in the exception when - is equal to . The message is shown in - test results. - - - An array of parameters to use when formatting . - - - Thrown if is equal to . - - - - - Constructs a dictionary containing the number of occurrences of each - element in the specified collection. - - - The collection to process. - - - The number of null elements in the collection. - - - A dictionary containing the number of occurrences of each element - in the specified collection. - - - - - Determines whether the first collection is a subset of the second - collection. If either set contains duplicate elements, the number - of occurrences of the element in the subset must be less than or - equal to the number of occurrences in the superset. - - - The collection the test expects to be contained in . - - - The collection the test expects to contain . - - - True if is a subset of - , false otherwise. - - - - - Finds a mismatched element between the two collections. A mismatched - element is one that appears a different number of times in the - expected collection than it does in the actual collection. The - collections are assumed to be different non-null references with the - same number of elements. The caller is responsible for this level of - verification. If there is no mismatched element, the function returns - false and the out parameters should not be used. - - The first collection to compare. - The second collection to compare. - - The expected number of occurrences of - or 0 if there is no mismatched - element. - - - The actual number of occurrences of - or 0 if there is no mismatched - element. - - - The mismatched element (may be null) or null if there is no - mismatched element. - - - true if a mismatched element was found; false otherwise. - - - - - compares the objects using object.Equals - - - - - This class is designed to help user doing unit testing. - GenericParameterHelper satisfies some comment generic type constraints - such as: - 1. public default constructor - 2. implements common interface: IComparable, IEnumerable, ICloneable - - - - - - public default constructor, satisfies the constraint in C# generics. - This constructor initializes the Data property to a random value. - - - - - This constructor initializes the Data property to a user-supplied value - - - - - - Do the value comparison for two GenericParameterHelper object - - object to do comparison with - true if obj has the same value as 'this' GenericParameterHelper object. - false otherwise. - - - - Returns a hash code for this object. - - - - - - Compares to the object. - - - - - - - Returns an IEnumerator object whose length is derived from - the Data property. - - - - - - Returns a GenericParameterHelper object that is equal to - 'this' one. - - - - - - Gets or sets the Data property. - - - - - Provides method signature discovery for generic methods. - - - - - Given a set of methods that match the base criteria, select a method based - upon an array of types. This method should return null if no method matches - the criteria. - - - - - Set of string assertions. - - - - - Tests whether the specified string contains the specified substring - and throws an exception if the substring does not occur within the - test string. - - - The string that is expected to contain . - - - The string expected to occur within . - - - Thrown if is not found in - . - - - - - Tests whether the specified string contains the specified substring - and throws an exception if the substring does not occur within the - test string. - - - The string that is expected to contain . - - - The string expected to occur within . - - - The message to include in the exception when - is not in . The message is shown in - test results. - - - Thrown if is not found in - . - - - - - Tests whether the specified string contains the specified substring - and throws an exception if the substring does not occur within the - test string. - - - The string that is expected to contain . - - - The string expected to occur within . - - - The message to include in the exception when - is not in . The message is shown in - test results. - - - An array of parameters to use when formatting . - - - Thrown if is not found in - . - - - - - Tests whether the specified string begins with the specified substring - and throws an exception if the test string does not start with the - substring. - - - The string that is expected to begin with . - - - The string expected to be a prefix of . - - - Thrown if does not begin with - . - - - - - Tests whether the specified string begins with the specified substring - and throws an exception if the test string does not start with the - substring. - - - The string that is expected to begin with . - - - The string expected to be a prefix of . - - - The message to include in the exception when - does not begin with . The message is - shown in test results. - - - Thrown if does not begin with - . - - - - - Tests whether the specified string begins with the specified substring - and throws an exception if the test string does not start with the - substring. - - - The string that is expected to begin with . - - - The string expected to be a prefix of . - - - The message to include in the exception when - does not begin with . The message is - shown in test results. - - - An array of parameters to use when formatting . - - - Thrown if does not begin with - . - - - - - Tests whether the specified string ends with the specified substring - and throws an exception if the test string does not end with the - substring. - - - The string that is expected to end with . - - - The string expected to be a suffix of . - - - Thrown if does not end with - . - - - - - Tests whether the specified string ends with the specified substring - and throws an exception if the test string does not end with the - substring. - - - The string that is expected to end with . - - - The string expected to be a suffix of . - - - The message to include in the exception when - does not end with . The message is - shown in test results. - - - Thrown if does not end with - . - - - - - Tests whether the specified string ends with the specified substring - and throws an exception if the test string does not end with the - substring. - - - The string that is expected to end with . - - - The string expected to be a suffix of . - - - The message to include in the exception when - does not end with . The message is - shown in test results. - - - An array of parameters to use when formatting . - - - Thrown if does not end with - . - - - - - Tests whether the specified string matches a regular expression and - throws an exception if the string does not match the expression. - - - The string that is expected to match . - - - The regular expression that is - expected to match. - - - Thrown if does not match - . - - - - - Tests whether the specified string matches a regular expression and - throws an exception if the string does not match the expression. - - - The string that is expected to match . - - - The regular expression that is - expected to match. - - - The message to include in the exception when - does not match . The message is shown in - test results. - - - Thrown if does not match - . - - - - - Tests whether the specified string matches a regular expression and - throws an exception if the string does not match the expression. - - - The string that is expected to match . - - - The regular expression that is - expected to match. - - - The message to include in the exception when - does not match . The message is shown in - test results. - - - An array of parameters to use when formatting . - - - Thrown if does not match - . - - - - - Tests whether the specified string does not match a regular expression - and throws an exception if the string matches the expression. - - - The string that is expected not to match . - - - The regular expression that is - expected to not match. - - - Thrown if matches . - - - - - Tests whether the specified string does not match a regular expression - and throws an exception if the string matches the expression. - - - The string that is expected not to match . - - - The regular expression that is - expected to not match. - - - The message to include in the exception when - matches . The message is shown in test - results. - - - Thrown if matches . - - - - - Tests whether the specified string does not match a regular expression - and throws an exception if the string matches the expression. - - - The string that is expected not to match . - - - The regular expression that is - expected to not match. - - - The message to include in the exception when - matches . The message is shown in test - results. - - - An array of parameters to use when formatting . - - - Thrown if matches . - - - - - TestContext class. This class should be fully abstract and not contain any - members. The adapter will implement the members. Users in the framework should - only access this via a well-defined interface. - - - - - Used to write trace messages while the test is running - - format string - the arguments - - - - Adds a file name to the list in TestResult.ResultFileNames - - - - - Begins a timer with the specified name - - - - - Ends a timer with the specified name - - - - - Per test properties - - - - - - Current data row when test is used for data driven testing. - - - - - Current data connection row when test is used for data driven testing. - - - - - Gets the test logs directory. - - - - - Gets the test directory. - - - - - Gets the test deployment directory. - - - - - Gets the test name. - - - - - Gets the CurrentTestOutcome. - - - - - Outcome of a test or a run. - If a new successful state needs to be added you will need to modify - RunResultAndStatistics in TestRun and TestOutcomeHelper below. - - NOTE: the order is important and is used for computing outcome for aggregations. - More important outcomes come first. See TestOutcomeHelper.GetAggregationOutcome. - - - - - Test was executed, but there were issues. - Issues may involve exceptions or failed assertions. - - - - - Test has completed, but we can't say if it passed or failed. - May be used for aborted tests... - - - - - Test was executed w/o any issues. - - - - - Test is currently executing. - - - - - There was a system error while we were trying to execute a test. - - - - - The test timed out. - - - - - Test was aborted by the user. - - - - - Test is in an unknown state - - - - - The data row. - - - - - The database connection. - - - - - Marks a test class. - - - - - Initializes a new test class attribute. - - - - - Marks a test method. - - - - - Initializes a new TestMethodAttribute. - - - - - A method marker called before a test method runs. - - - - - Initializes a new TestInitializeAttribute. - - - - - A method marker called after a test method runs. - - - - - Initializes a new TestCleanupAttribute. - - - - - Ignores a unit test. - - - - - Initializes a new IgnoreAttribute. - - - - - The ExpectedExceptionAttribute. - - - - - Initializes the ExpectedExceptionAttribute. - - The exception type. - - - - Initializes the ExpectedExceptionAttribute. - - The exception type. - The message. - - - - Gets the exception type. - - - - - Gets the message. - - - - - The test property attribute. - - - - - Initializes the TestPropertyAttribute. - - - - - - - Gets the name. - - - - - Gets the value. - - - - - The ClassInitializeAttribute. - - - - - Initializes the ClassInitializeAttribute. - - - - - The ClassCleanupAttribute. - - - - - Initializes the ClassCleanupAttribute. - - - - - The AssemblyInitializeAttribute. - - - - - Initializes the AssemblyInitializeAttribute. - - - - - The AssemblyCleanupAttribute. - - - - - Initializes the AssemblyCleanupAttribute. - - - - - Description of the test. - - - - - Initializes the DescriptionAttribute. - - The description. - - - - Gets the description. - - - - - The OwnerAttribute. - - - - - Initializes the OwnerAttribute. - - The owner. - - - - Gets the owner. - - - - - CSS Project Structure URI. - - - - - Initializes the CSS Project Structure URI. - - The structure. - - - - Gets the property structure. - - - - - CSS Iteration URI - - - - - Initializes the CssIterationAttribute. - - The parameter. - - - - Gets the CssIteration. - - - - - Priority attribute; used to specify the priority of a unit test. - - - - - Initializes the PriorityAttribute. - - The priority. - - - - Gets the Priority. - - - - - Timeout attribute; used to specify the timeout of a unit test. - - - - - Initializes the TimeoutAttribute. - - - - - - Gets the Timeout. - - - - - WorkItem attribute; used to specify a work item associated with this test. - - - - - Initializes the WorkItemAttribute. - - - - - - Gets the ID. - - - - - HostType specifies the type of host that this unit test will - run in. - - - - - Initializes the host type attribute. - - - - - - Constructor of HostTypeAttribute. - - The type of the host. - Custom data for the host adapter. - - - The reason this is string (and not object) is that currently CMI cannot parse arbitrary instances of object and we deprioritized changing CMI. - - - - Gets the host type. - - - - - Gets the host data. - - - - - Used to specify deployment item (file or directory) for per-test deployment. - Can be specified on test class or test method. - Can have multiple instances of the attribute to specify more than one item. - The item path can be absolute or relative, if relative, it is relative to RunConfig.RelativePathRoot. - - - [DeploymentItem("file1.xml")] - [DeploymentItem("file2.xml", "DataFiles")] - [DeploymentItem("bin\Debug")] - - - - - Initializes DeploymentItemAttribute. - - The path. - - - - Initializes DeploymentItemAttribute. - - The path. - The output directory. - - - - Verifiable interface. - - - - - The IsValid method. - - Returns a value. - - - diff --git a/lib/NUnit-config/Microsoft.VisualStudio.TestTools.cs b/lib/NUnit-config/Microsoft.VisualStudio.TestTools.cs deleted file mode 100644 index fd151da..0000000 --- a/lib/NUnit-config/Microsoft.VisualStudio.TestTools.cs +++ /dev/null @@ -1,54 +0,0 @@ - -using System; -#if CLIENTPROFILE -namespace Microsoft.VisualStudio.TestTools.UnitTesting -{ - [AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = false)] - public sealed class TestClassAttribute : NUnit.Framework.TestFixtureAttribute - { - } - - [AttributeUsage(AttributeTargets.Method, Inherited = true, AllowMultiple = false)] - public sealed class TestMethodAttribute : NUnit.Framework.TestAttribute - { - } - - [AttributeUsage(AttributeTargets.Method, Inherited = true, AllowMultiple = false)] - public sealed class TestInitializeAttribute : NUnit.Framework.SetUpAttribute - { - } - - [AttributeUsage(AttributeTargets.Method, Inherited = true, AllowMultiple = false)] - public sealed class IgnoreAttribute : NUnit.Framework.IgnoreAttribute - { - } - - [AttributeUsage(AttributeTargets.Method, Inherited = true, AllowMultiple = false)] - public sealed class ExpectedExceptionAttribute : NUnit.Framework.ExpectedExceptionAttribute - { - public ExpectedExceptionAttribute(Type type) : base(type) - { } - } - - public class Assert : NUnit.Framework.Assert - { - [Obsolete("Do not use AreEqual on Byte[], use TestUtil.AssertBytesEqual(,)")] - public static void AreEqual(byte[] b1, byte[] b2) - { - NUnit.Framework.Assert.AreEqual(b1, b2); - } - - [Obsolete("No not use assert with miss-matched types.")] - public static new void AreEqual(object b1, object b2) - { - NUnit.Framework.Assert.AreEqual(b1, b2); - } - - //Allowed if the types match - public static void AreEqual(T b1, T b2) - { - NUnit.Framework.Assert.AreEqual(b1, b2); - } - } -} -#endif \ No newline at end of file diff --git a/lib/NUnit-config/nunit-console.v2.0.config b/lib/NUnit-config/nunit-console.v2.0.config deleted file mode 100644 index 30453c9..0000000 --- a/lib/NUnit-config/nunit-console.v2.0.config +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/lib/NUnit-config/nunit-console.v3.5.config b/lib/NUnit-config/nunit-console.v3.5.config deleted file mode 100644 index 30453c9..0000000 --- a/lib/NUnit-config/nunit-console.v3.5.config +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/lib/NUnit-config/nunit-console.v4.0.config b/lib/NUnit-config/nunit-console.v4.0.config deleted file mode 100644 index 08ee954..0000000 --- a/lib/NUnit-config/nunit-console.v4.0.config +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/lib/NUnit/Logo.ico b/lib/NUnit/Logo.ico deleted file mode 100644 index 13c4ff9..0000000 Binary files a/lib/NUnit/Logo.ico and /dev/null differ diff --git a/lib/NUnit/NUnit.nupkg b/lib/NUnit/NUnit.nupkg deleted file mode 100644 index 7e9a777..0000000 Binary files a/lib/NUnit/NUnit.nupkg and /dev/null differ diff --git a/lib/NUnit/NUnitFitTests.html b/lib/NUnit/NUnitFitTests.html deleted file mode 100644 index b7eb5c9..0000000 --- a/lib/NUnit/NUnitFitTests.html +++ /dev/null @@ -1,277 +0,0 @@ - - - -

NUnit Acceptance Tests

-

- Developers love self-referential programs! Hence, NUnit has always run all it's - own tests, even those that are not really unit tests. -

Now, beginning with NUnit 2.4, NUnit has top-level tests using Ward Cunningham's - FIT framework. At this time, the tests are pretty rudimentary, but it's a start - and it's a framework for doing more. -

Running the Tests

-

Open a console or shell window and navigate to the NUnit bin directory, which - contains this file. To run the test under Microsoft .Net, enter the command -

    runFile NUnitFitTests.html TestResults.html .
- To run it under Mono, enter -
    mono runFile.exe NUnitFitTests.html TestResults.html .
- Note the space and dot at the end of each command. The results of your test - will be in TestResults.html in the same directory. -

Platform and CLR Version

- - - - -
NUnit.Fixtures.PlatformInfo
-

Verify Unit Tests

-

- Load and run the NUnit unit tests, verifying that the results are as expected. - When these tests are run on different platforms, different numbers of tests may - be skipped, so the values for Skipped and Run tests are informational only. -

- The number of tests in each assembly should be constant across all platforms - - any discrepancy usually means that one of the test source files was not - compiled on the platform. There should be no failures and no tests ignored. -

Note: - At the moment, the nunit.extensions.tests assembly is failing because the - fixture doesn't initialize addins in the test domain. -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NUnit.Fixtures.AssemblyRunner
AssemblyTests()Run()Skipped()Ignored()Failures()
nunit.framework.tests.dll397  00
nunit.core.tests.dll355  00
nunit.util.tests.dll238  00
nunit.mocks.tests.dll43  00
nunit.extensions.tests.dll5  00
nunit-console.tests.dll40  00
nunit.uikit.tests.dll34  00
nunit-gui.tests.dll15  00
nunit.fixtures.tests.dll6  00
-

Code Snippet Tests

-

- These tests create a test assembly from a snippet of code and then load and run - the tests that it contains, verifying that the structure of the loaded tests is - as expected and that the number of tests run, skipped, ignored or failed is - correct. -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NUnit.Fixtures.SnippetRunner
CodeTree()Run()Skipped()Ignored()Failures()
public class TestClass
-{
-}
-
EMPTY0000
using NUnit.Framework;
-
-[TestFixture]
-public class TestClass
-{
-}
-
TestClass0000
using NUnit.Framework;
-
-[TestFixture]
-public class TestClass
-{
-    [Test]
-    public void T1() { }
-    [Test]
-    public void T2() { }
-    [Test]
-    public void T3() { }
-}
-
TestClass
->T1
->T2
->T3
-
3000
using NUnit.Framework;
-
-[TestFixture]
-public class TestClass1
-{
-    [Test]
-    public void T1() { }
-}
-
-[TestFixture]
-public class TestClass2
-{
-    [Test]
-    public void T2() { }
-    [Test]
-    public void T3() { }
-}
-
TestClass1
->T1
-TestClass2
->T2
->T3
-
3000
using NUnit.Framework;
-
-[TestFixture]
-public class TestClass
-{
-    [Test]
-    public void T1() { }
-    [Test, Ignore]
-    public void T2() { }
-    [Test]
-    public void T3() { }
-}
-
TestClass
->T1
->T2
->T3
-
2010
using NUnit.Framework;
-
-[TestFixture]
-public class TestClass
-{
-    [Test]
-    public void T1() { }
-    [Test, Explicit]
-    public void T2() { }
-    [Test]
-    public void T3() { }
-}
-
TestClass
->T1
->T2
->T3
-
2100
-

Summary Information

- - - - -
fit.Summary
- - diff --git a/lib/NUnit/fit-license.txt b/lib/NUnit/fit-license.txt deleted file mode 100644 index af37532..0000000 --- a/lib/NUnit/fit-license.txt +++ /dev/null @@ -1,342 +0,0 @@ - - - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. \ No newline at end of file diff --git a/lib/NUnit/lib/nunit.framework.dll b/lib/NUnit/lib/nunit.framework.dll deleted file mode 100644 index 6856e51..0000000 Binary files a/lib/NUnit/lib/nunit.framework.dll and /dev/null differ diff --git a/lib/NUnit/lib/nunit.framework.xml b/lib/NUnit/lib/nunit.framework.xml deleted file mode 100644 index c98e5ad..0000000 --- a/lib/NUnit/lib/nunit.framework.xml +++ /dev/null @@ -1,10407 +0,0 @@ - - - - nunit.framework - - - - - Attribute used to apply a category to a test - - - - - The name of the category - - - - - Construct attribute for a given category based on - a name. The name may not contain the characters ',', - '+', '-' or '!'. However, this is not checked in the - constructor since it would cause an error to arise at - as the test was loaded without giving a clear indication - of where the problem is located. The error is handled - in NUnitFramework.cs by marking the test as not - runnable. - - The name of the category - - - - Protected constructor uses the Type name as the name - of the category. - - - - - The name of the category - - - - - Used to mark a field for use as a datapoint when executing a theory - within the same fixture that requires an argument of the field's Type. - - - - - Used to mark an array as containing a set of datapoints to be used - executing a theory within the same fixture that requires an argument - of the Type of the array elements. - - - - - Attribute used to provide descriptive text about a - test case or fixture. - - - - - Construct the attribute - - Text describing the test - - - - Gets the test description - - - - - Enumeration indicating how the expected message parameter is to be used - - - - Expect an exact match - - - Expect a message containing the parameter string - - - Match the regular expression provided as a parameter - - - Expect a message that starts with the parameter string - - - - ExpectedExceptionAttribute - - - - - - Constructor for a non-specific exception - - - - - Constructor for a given type of exception - - The type of the expected exception - - - - Constructor for a given exception name - - The full name of the expected exception - - - - Gets or sets the expected exception type - - - - - Gets or sets the full Type name of the expected exception - - - - - Gets or sets the expected message text - - - - - Gets or sets the user message displayed in case of failure - - - - - Gets or sets the type of match to be performed on the expected message - - - - - Gets the name of a method to be used as an exception handler - - - - - ExplicitAttribute marks a test or test fixture so that it will - only be run if explicitly executed from the gui or command line - or if it is included by use of a filter. The test will not be - run simply because an enclosing suite is run. - - - - - Default constructor - - - - - Constructor with a reason - - The reason test is marked explicit - - - - The reason test is marked explicit - - - - - Attribute used to mark a test that is to be ignored. - Ignored tests result in a warning message when the - tests are run. - - - - - Constructs the attribute without giving a reason - for ignoring the test. - - - - - Constructs the attribute giving a reason for ignoring the test - - The reason for ignoring the test - - - - The reason for ignoring a test - - - - - Abstract base for Attributes that are used to include tests - in the test run based on environmental settings. - - - - - Constructor with no included items specified, for use - with named property syntax. - - - - - Constructor taking one or more included items - - Comma-delimited list of included items - - - - Name of the item that is needed in order for - a test to run. Multiple itemss may be given, - separated by a comma. - - - - - Name of the item to be excluded. Multiple items - may be given, separated by a comma. - - - - - The reason for including or excluding the test - - - - - PlatformAttribute is used to mark a test fixture or an - individual method as applying to a particular platform only. - - - - - Constructor with no platforms specified, for use - with named property syntax. - - - - - Constructor taking one or more platforms - - Comma-deliminted list of platforms - - - - CultureAttribute is used to mark a test fixture or an - individual method as applying to a particular Culture only. - - - - - Constructor with no cultures specified, for use - with named property syntax. - - - - - Constructor taking one or more cultures - - Comma-deliminted list of cultures - - - - Marks a test to use a combinatorial join of any argument data - provided. NUnit will create a test case for every combination of - the arguments provided. This can result in a large number of test - cases and so should be used judiciously. This is the default join - type, so the attribute need not be used except as documentation. - - - - - PropertyAttribute is used to attach information to a test as a name/value pair.. - - - - - Construct a PropertyAttribute with a name and string value - - The name of the property - The property value - - - - Construct a PropertyAttribute with a name and int value - - The name of the property - The property value - - - - Construct a PropertyAttribute with a name and double value - - The name of the property - The property value - - - - Constructor for derived classes that set the - property dictionary directly. - - - - - Constructor for use by derived classes that use the - name of the type as the property name. Derived classes - must ensure that the Type of the property value is - a standard type supported by the BCL. Any custom - types will cause a serialization Exception when - in the client. - - - - - Gets the property dictionary for this attribute - - - - - Default constructor - - - - - Marks a test to use pairwise join of any argument data provided. - NUnit will attempt too excercise every pair of argument values at - least once, using as small a number of test cases as it can. With - only two arguments, this is the same as a combinatorial join. - - - - - Default constructor - - - - - Marks a test to use a sequential join of any argument data - provided. NUnit will use arguements for each parameter in - sequence, generating test cases up to the largest number - of argument values provided and using null for any arguments - for which it runs out of values. Normally, this should be - used with the same number of arguments for each parameter. - - - - - Default constructor - - - - - Summary description for MaxTimeAttribute. - - - - - Construct a MaxTimeAttribute, given a time in milliseconds. - - The maximum elapsed time in milliseconds - - - - RandomAttribute is used to supply a set of random values - to a single parameter of a parameterized test. - - - - - ValuesAttribute is used to provide literal arguments for - an individual parameter of a test. - - - - - Abstract base class for attributes that apply to parameters - and supply data for the parameter. - - - - - Gets the data to be provided to the specified parameter - - - - - The collection of data to be returned. Must - be set by any derived attribute classes. - We use an object[] so that the individual - elements may have their type changed in GetData - if necessary. - - - - - Construct with one argument - - - - - - Construct with two arguments - - - - - - - Construct with three arguments - - - - - - - - Construct with an array of arguments - - - - - - Get the collection of values to be used as arguments - - - - - Construct a set of doubles from 0.0 to 1.0, - specifying only the count. - - - - - - Construct a set of doubles from min to max - - - - - - - - Construct a set of ints from min to max - - - - - - - - Get the collection of values to be used as arguments - - - - - RangeAttribute is used to supply a range of values to an - individual parameter of a parameterized test. - - - - - Construct a range of ints using default step of 1 - - - - - - - Construct a range of ints specifying the step size - - - - - - - - Construct a range of longs - - - - - - - - Construct a range of doubles - - - - - - - - Construct a range of floats - - - - - - - - RepeatAttribute may be applied to test case in order - to run it multiple times. - - - - - Construct a RepeatAttribute - - The number of times to run the test - - - - RequiredAddinAttribute may be used to indicate the names of any addins - that must be present in order to run some or all of the tests in an - assembly. If the addin is not loaded, the entire assembly is marked - as NotRunnable. - - - - - Initializes a new instance of the class. - - The required addin. - - - - Gets the name of required addin. - - The required addin name. - - - - Summary description for SetCultureAttribute. - - - - - Construct given the name of a culture - - - - - - Summary description for SetUICultureAttribute. - - - - - Construct given the name of a culture - - - - - - Attribute used to mark a class that contains one-time SetUp - and/or TearDown methods that apply to all the tests in a - namespace or an assembly. - - - - - SetUpFixtureAttribute is used to identify a SetUpFixture - - - - - Attribute used to mark a static (shared in VB) property - that returns a list of tests. - - - - - Attribute used to identify a method that is called - immediately after each test is run. The method is - guaranteed to be called, even if an exception is thrown. - - - - - Adding this attribute to a method within a - class makes the method callable from the NUnit test runner. There is a property - called Description which is optional which you can provide a more detailed test - description. This class cannot be inherited. - - - - [TestFixture] - public class Fixture - { - [Test] - public void MethodToTest() - {} - - [Test(Description = "more detailed description")] - publc void TestDescriptionMethod() - {} - } - - - - - - Descriptive text for this test - - - - - TestCaseAttribute is used to mark parameterized test cases - and provide them with their arguments. - - - - - The ITestCaseData interface is implemented by a class - that is able to return complete testcases for use by - a parameterized test method. - - NOTE: This interface is used in both the framework - and the core, even though that results in two different - types. However, sharing the source code guarantees that - the various implementations will be compatible and that - the core is able to reflect successfully over the - framework implementations of ITestCaseData. - - - - - Gets the argument list to be provided to the test - - - - - Gets the expected result - - - - - Gets the expected exception Type - - - - - Gets the FullName of the expected exception - - - - - Gets the name to be used for the test - - - - - Gets the description of the test - - - - - Gets a value indicating whether this is ignored. - - true if ignored; otherwise, false. - - - - Gets the ignore reason. - - The ignore reason. - - - - Construct a TestCaseAttribute with a list of arguments. - This constructor is not CLS-Compliant - - - - - - Construct a TestCaseAttribute with a single argument - - - - - - Construct a TestCaseAttribute with a two arguments - - - - - - - Construct a TestCaseAttribute with a three arguments - - - - - - - - Gets the list of arguments to a test case - - - - - Gets or sets the expected result. - - The result. - - - - Gets a list of categories associated with this test; - - - - - Gets or sets the category associated with this test. - May be a single category or a comma-separated list. - - - - - Gets or sets the expected exception. - - The expected exception. - - - - Gets or sets the name the expected exception. - - The expected name of the exception. - - - - Gets or sets the expected message of the expected exception - - The expected message of the exception. - - - - Gets or sets the type of match to be performed on the expected message - - - - - Gets or sets the description. - - The description. - - - - Gets or sets the name of the test. - - The name of the test. - - - - Gets or sets the ignored status of the test - - - - - Gets or sets the ignored status of the test - - - - - Gets the ignore reason. - - The ignore reason. - - - - FactoryAttribute indicates the source to be used to - provide test cases for a test method. - - - - - Construct with the name of the factory - for use with languages - that don't support params arrays. - - An array of the names of the factories that will provide data - - - - Construct with a Type and name - for use with languages - that don't support params arrays. - - The Type that will provide data - The name of the method, property or field that will provide data - - - - The name of a the method, property or fiend to be used as a source - - - - - A Type to be used as a source - - - - - [TestFixture] - public class ExampleClass - {} - - - - - Default constructor - - - - - Construct with a object[] representing a set of arguments. - In .NET 2.0, the arguments may later be separated into - type arguments and constructor arguments. - - - - - - Descriptive text for this fixture - - - - - Gets and sets the category for this fixture. - May be a comma-separated list of categories. - - - - - Gets a list of categories for this fixture - - - - - The arguments originally provided to the attribute - - - - - Gets or sets a value indicating whether this should be ignored. - - true if ignore; otherwise, false. - - - - Gets or sets the ignore reason. May set Ignored as a side effect. - - The ignore reason. - - - - Get or set the type arguments. If not set - explicitly, any leading arguments that are - Types are taken as type arguments. - - - - - Attribute used to identify a method that is - called before any tests in a fixture are run. - - - - - Attribute used to identify a method that is called after - all the tests in a fixture have run. The method is - guaranteed to be called, even if an exception is thrown. - - - - - Adding this attribute to a method within a - class makes the method callable from the NUnit test runner. There is a property - called Description which is optional which you can provide a more detailed test - description. This class cannot be inherited. - - - - [TestFixture] - public class Fixture - { - [Test] - public void MethodToTest() - {} - - [Test(Description = "more detailed description")] - publc void TestDescriptionMethod() - {} - } - - - - - - WUsed on a method, marks the test with a timeout value in milliseconds. - The test will be run in a separate thread and is cancelled if the timeout - is exceeded. Used on a method or assembly, sets the default timeout - for all contained test methods. - - - - - Construct a TimeoutAttribute given a time in milliseconds - - The timeout value in milliseconds - - - - Marks a test that must run in the STA, causing it - to run in a separate thread if necessary. - - On methods, you may also use STAThreadAttribute - to serve the same purpose. - - - - - Construct a RequiresSTAAttribute - - - - - Marks a test that must run in the MTA, causing it - to run in a separate thread if necessary. - - On methods, you may also use MTAThreadAttribute - to serve the same purpose. - - - - - Construct a RequiresMTAAttribute - - - - - Marks a test that must run on a separate thread. - - - - - Construct a RequiresThreadAttribute - - - - - Construct a RequiresThreadAttribute, specifying the apartment - - - - - ValueSourceAttribute indicates the source to be used to - provide data for one parameter of a test method. - - - - - Construct with the name of the factory - for use with languages - that don't support params arrays. - - The name of the data source to be used - - - - Construct with a Type and name - for use with languages - that don't support params arrays. - - The Type that will provide data - The name of the method, property or field that will provide data - - - - The name of a the method, property or fiend to be used as a source - - - - - A Type to be used as a source - - - - - AttributeExistsConstraint tests for the presence of a - specified attribute on a Type. - - - - - The Constraint class is the base of all built-in constraints - within NUnit. It provides the operator overloads used to combine - constraints. - - - - - The IConstraintExpression interface is implemented by all - complete and resolvable constraints and expressions. - - - - - Return the top-level constraint for this expression - - - - - - Static UnsetObject used to detect derived constraints - failing to set the actual value. - - - - - The actual value being tested against a constraint - - - - - The display name of this Constraint for use by ToString() - - - - - Argument fields used by ToString(); - - - - - The builder holding this constraint - - - - - Construct a constraint with no arguments - - - - - Construct a constraint with one argument - - - - - Construct a constraint with two arguments - - - - - Sets the ConstraintBuilder holding this constraint - - - - - Write the failure message to the MessageWriter provided - as an argument. The default implementation simply passes - the constraint and the actual value to the writer, which - then displays the constraint description and the value. - - Constraints that need to provide additional details, - such as where the error occured can override this. - - The MessageWriter on which to display the message - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - Test whether the constraint is satisfied by an - ActualValueDelegate that returns the value to be tested. - The default implementation simply evaluates the delegate - but derived classes may override it to provide for delayed - processing. - - An ActualValueDelegate - True for success, false for failure - - - - Test whether the constraint is satisfied by a given reference. - The default implementation simply dereferences the value but - derived classes may override it to provide for delayed processing. - - A reference to the value to be tested - True for success, false for failure - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - Write the actual value for a failing constraint test to a - MessageWriter. The default implementation simply writes - the raw value of actual, leaving it to the writer to - perform any formatting. - - The writer on which the actual value is displayed - - - - Default override of ToString returns the constraint DisplayName - followed by any arguments within angle brackets. - - - - - - Returns the string representation of this constraint - - - - - This operator creates a constraint that is satisfied only if both - argument constraints are satisfied. - - - - - This operator creates a constraint that is satisfied if either - of the argument constraints is satisfied. - - - - - This operator creates a constraint that is satisfied if the - argument constraint is not satisfied. - - - - - Returns a DelayedConstraint with the specified delay time. - - The delay in milliseconds. - - - - - Returns a DelayedConstraint with the specified delay time - and polling interval. - - The delay in milliseconds. - The interval at which to test the constraint. - - - - - The display name of this Constraint for use by ToString(). - The default value is the name of the constraint with - trailing "Constraint" removed. Derived classes may set - this to another name in their constructors. - - - - - Returns a ConstraintExpression by appending And - to the current constraint. - - - - - Returns a ConstraintExpression by appending And - to the current constraint. - - - - - Returns a ConstraintExpression by appending Or - to the current constraint. - - - - - Class used to detect any derived constraints - that fail to set the actual value in their - Matches override. - - - - - Constructs an AttributeExistsConstraint for a specific attribute Type - - - - - - Tests whether the object provides the expected attribute. - - A Type, MethodInfo, or other ICustomAttributeProvider - True if the expected attribute is present, otherwise false - - - - Writes the description of the constraint to the specified writer - - - - - AttributeConstraint tests that a specified attribute is present - on a Type or other provider and that the value of the attribute - satisfies some other constraint. - - - - - Abstract base class used for prefixes - - - - - The base constraint - - - - - Construct given a base constraint - - - - - - Constructs an AttributeConstraint for a specified attriute - Type and base constraint. - - - - - - - Determines whether the Type or other provider has the - expected attribute and if its value matches the - additional constraint specified. - - - - - Writes a description of the attribute to the specified writer. - - - - - Writes the actual value supplied to the specified writer. - - - - - Returns a string representation of the constraint. - - - - - BasicConstraint is the abstract base for constraints that - perform a simple comparison to a constant value. - - - - - Initializes a new instance of the class. - - The expected. - The description. - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - NullConstraint tests that the actual value is null - - - - - Initializes a new instance of the class. - - - - - TrueConstraint tests that the actual value is true - - - - - Initializes a new instance of the class. - - - - - FalseConstraint tests that the actual value is false - - - - - Initializes a new instance of the class. - - - - - NaNConstraint tests that the actual value is a double or float NaN - - - - - Test that the actual value is an NaN - - - - - - - Write the constraint description to a specified writer - - - - - - BinaryConstraint is the abstract base of all constraints - that combine two other constraints in some fashion. - - - - - The first constraint being combined - - - - - The second constraint being combined - - - - - Construct a BinaryConstraint from two other constraints - - The first constraint - The second constraint - - - - AndConstraint succeeds only if both members succeed. - - - - - Create an AndConstraint from two other constraints - - The first constraint - The second constraint - - - - Apply both member constraints to an actual value, succeeding - succeeding only if both of them succeed. - - The actual value - True if the constraints both succeeded - - - - Write a description for this contraint to a MessageWriter - - The MessageWriter to receive the description - - - - Write the actual value for a failing constraint test to a - MessageWriter. The default implementation simply writes - the raw value of actual, leaving it to the writer to - perform any formatting. - - The writer on which the actual value is displayed - - - - OrConstraint succeeds if either member succeeds - - - - - Create an OrConstraint from two other constraints - - The first constraint - The second constraint - - - - Apply the member constraints to an actual value, succeeding - succeeding as soon as one of them succeeds. - - The actual value - True if either constraint succeeded - - - - Write a description for this contraint to a MessageWriter - - The MessageWriter to receive the description - - - - CollectionConstraint is the abstract base class for - constraints that operate on collections. - - - - - Construct an empty CollectionConstraint - - - - - Construct a CollectionConstraint - - - - - - Determines whether the specified enumerable is empty. - - The enumerable. - - true if the specified enumerable is empty; otherwise, false. - - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - Protected method to be implemented by derived classes - - - - - - - CollectionItemsEqualConstraint is the abstract base class for all - collection constraints that apply some notion of item equality - as a part of their operation. - - - - - Construct an empty CollectionConstraint - - - - - Construct a CollectionConstraint - - - - - - Flag the constraint to use the supplied IComparer object. - - The IComparer object to use. - Self. - - - - Flag the constraint to use the supplied IComparer object. - - The IComparer object to use. - Self. - - - - Flag the constraint to use the supplied Comparison object. - - The IComparer object to use. - Self. - - - - Flag the constraint to use the supplied IEqualityComparer object. - - The IComparer object to use. - Self. - - - - Flag the constraint to use the supplied IEqualityComparer object. - - The IComparer object to use. - Self. - - - - Compares two collection members for equality - - - - - Return a new CollectionTally for use in making tests - - The collection to be included in the tally - - - - Flag the constraint to ignore case and return self. - - - - - EmptyCollectionConstraint tests whether a collection is empty. - - - - - Check that the collection is empty - - - - - - - Write the constraint description to a MessageWriter - - - - - - UniqueItemsConstraint tests whether all the items in a - collection are unique. - - - - - Check that all items are unique. - - - - - - - Write a description of this constraint to a MessageWriter - - - - - - CollectionContainsConstraint is used to test whether a collection - contains an expected object as a member. - - - - - Construct a CollectionContainsConstraint - - - - - - Test whether the expected item is contained in the collection - - - - - - - Write a descripton of the constraint to a MessageWriter - - - - - - CollectionEquivalentCOnstraint is used to determine whether two - collections are equivalent. - - - - - Construct a CollectionEquivalentConstraint - - - - - - Test whether two collections are equivalent - - - - - - - Write a description of this constraint to a MessageWriter - - - - - - CollectionSubsetConstraint is used to determine whether - one collection is a subset of another - - - - - Construct a CollectionSubsetConstraint - - The collection that the actual value is expected to be a subset of - - - - Test whether the actual collection is a subset of - the expected collection provided. - - - - - - - Write a description of this constraint to a MessageWriter - - - - - - CollectionOrderedConstraint is used to test whether a collection is ordered. - - - - - Construct a CollectionOrderedConstraint - - - - - Modifies the constraint to use an IComparer and returns self. - - - - - Modifies the constraint to use an IComparer<T> and returns self. - - - - - Modifies the constraint to use a Comparison<T> and returns self. - - - - - Modifies the constraint to test ordering by the value of - a specified property and returns self. - - - - - Test whether the collection is ordered - - - - - - - Write a description of the constraint to a MessageWriter - - - - - - Returns the string representation of the constraint. - - - - - - If used performs a reverse comparison - - - - - CollectionTally counts (tallies) the number of - occurences of each object in one or more enumerations. - - - - - Construct a CollectionTally object from a comparer and a collection - - - - - Try to remove an object from the tally - - The object to remove - True if successful, false if the object was not found - - - - Try to remove a set of objects from the tally - - The objects to remove - True if successful, false if any object was not found - - - - The number of objects remaining in the tally - - - - - ComparisonAdapter class centralizes all comparisons of - values in NUnit, adapting to the use of any provided - IComparer, IComparer<T> or Comparison<T> - - - - - Returns a ComparisonAdapter that wraps an IComparer - - - - - Returns a ComparisonAdapter that wraps an IComparer<T> - - - - - Returns a ComparisonAdapter that wraps a Comparison<T> - - - - - Compares two objects - - - - - Gets the default ComparisonAdapter, which wraps an - NUnitComparer object. - - - - - Construct a ComparisonAdapter for an IComparer - - - - - Compares two objects - - - - - - - - Construct a default ComparisonAdapter - - - - - ComparisonAdapter<T> extends ComparisonAdapter and - allows use of an IComparer<T> or Comparison<T> - to actually perform the comparison. - - - - - Construct a ComparisonAdapter for an IComparer<T> - - - - - Compare a Type T to an object - - - - - Construct a ComparisonAdapter for a Comparison<T> - - - - - Compare a Type T to an object - - - - - Abstract base class for constraints that compare values to - determine if one is greater than, equal to or less than - the other. - - - - - The value against which a comparison is to be made - - - - - If true, less than returns success - - - - - if true, equal returns success - - - - - if true, greater than returns success - - - - - The predicate used as a part of the description - - - - - ComparisonAdapter to be used in making the comparison - - - - - Initializes a new instance of the class. - - The value against which to make a comparison. - if set to true less succeeds. - if set to true equal succeeds. - if set to true greater succeeds. - String used in describing the constraint. - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - Modifies the constraint to use an IComparer and returns self - - - - - Modifies the constraint to use an IComparer<T> and returns self - - - - - Modifies the constraint to use a Comparison<T> and returns self - - - - - Tests whether a value is greater than the value supplied to its constructor - - - - - Initializes a new instance of the class. - - The expected value. - - - - Tests whether a value is greater than or equal to the value supplied to its constructor - - - - - Initializes a new instance of the class. - - The expected value. - - - - Tests whether a value is less than the value supplied to its constructor - - - - - Initializes a new instance of the class. - - The expected value. - - - - Tests whether a value is less than or equal to the value supplied to its constructor - - - - - Initializes a new instance of the class. - - The expected value. - - - - Delegate used to delay evaluation of the actual value - to be used in evaluating a constraint - - - - - ConstraintBuilder maintains the stacks that are used in - processing a ConstraintExpression. An OperatorStack - is used to hold operators that are waiting for their - operands to be reognized. a ConstraintStack holds - input constraints as well as the results of each - operator applied. - - - - - Initializes a new instance of the class. - - - - - Appends the specified operator to the expression by first - reducing the operator stack and then pushing the new - operator on the stack. - - The operator to push. - - - - Appends the specified constraint to the expresson by pushing - it on the constraint stack. - - The constraint to push. - - - - Sets the top operator right context. - - The right context. - - - - Reduces the operator stack until the topmost item - precedence is greater than or equal to the target precedence. - - The target precedence. - - - - Resolves this instance, returning a Constraint. If the builder - is not currently in a resolvable state, an exception is thrown. - - The resolved constraint - - - - Gets a value indicating whether this instance is resolvable. - - - true if this instance is resolvable; otherwise, false. - - - - - OperatorStack is a type-safe stack for holding ConstraintOperators - - - - - Initializes a new instance of the class. - - The builder. - - - - Pushes the specified operator onto the stack. - - The op. - - - - Pops the topmost operator from the stack. - - - - - - Gets a value indicating whether this is empty. - - true if empty; otherwise, false. - - - - Gets the topmost operator without modifying the stack. - - The top. - - - - ConstraintStack is a type-safe stack for holding Constraints - - - - - Initializes a new instance of the class. - - The builder. - - - - Pushes the specified constraint. As a side effect, - the constraint's builder field is set to the - ConstraintBuilder owning this stack. - - The constraint. - - - - Pops this topmost constrait from the stack. - As a side effect, the constraint's builder - field is set to null. - - - - - - Gets a value indicating whether this is empty. - - true if empty; otherwise, false. - - - - Gets the topmost constraint without modifying the stack. - - The topmost constraint - - - - ConstraintExpression represents a compound constraint in the - process of being constructed from a series of syntactic elements. - - Individual elements are appended to the expression as they are - reognized. Once an actual Constraint is appended, the expression - returns a resolvable Constraint. - - - - - ConstraintExpressionBase is the abstract base class for the - generated ConstraintExpression class, which represents a - compound constraint in the process of being constructed - from a series of syntactic elements. - - NOTE: ConstraintExpressionBase is aware of some of its - derived classes, which is an apparent violation of - encapsulation. Ideally, these classes would be a - single class, but they must be separated in order to - allow parts to be generated under .NET 1.x and to - provide proper user feedback in syntactically - aware IDEs. - - - - - The ConstraintBuilder holding the elements recognized so far - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the - class passing in a ConstraintBuilder, which may be pre-populated. - - The builder. - - - - Returns a string representation of the expression as it - currently stands. This should only be used for testing, - since it has the side-effect of resolving the expression. - - - - - - Appends an operator to the expression and returns the - resulting expression itself. - - - - - Appends a self-resolving operator to the expression and - returns a new ResolvableConstraintExpression. - - - - - Appends a constraint to the expression and returns that - constraint, which is associated with the current state - of the expression being built. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the - class passing in a ConstraintBuilder, which may be pre-populated. - - The builder. - - - - Returns a new PropertyConstraintExpression, which will either - test for the existence of the named property on the object - being tested or apply any following constraint to that property. - - - - - Returns a new AttributeConstraint checking for the - presence of a particular attribute on an object. - - - - - Returns a new AttributeConstraint checking for the - presence of a particular attribute on an object. - - - - - Returns the constraint provided as an argument - used to allow custom - custom constraints to easily participate in the syntax. - - - - - Returns the constraint provided as an argument - used to allow custom - custom constraints to easily participate in the syntax. - - - - - Returns a constraint that tests two items for equality - - - - - Returns a constraint that tests that two references are the same object - - - - - Returns a constraint that tests whether the - actual value is greater than the suppled argument - - - - - Returns a constraint that tests whether the - actual value is greater than or equal to the suppled argument - - - - - Returns a constraint that tests whether the - actual value is greater than or equal to the suppled argument - - - - - Returns a constraint that tests whether the - actual value is less than the suppled argument - - - - - Returns a constraint that tests whether the - actual value is less than or equal to the suppled argument - - - - - Returns a constraint that tests whether the - actual value is less than or equal to the suppled argument - - - - - Returns a constraint that tests whether the actual - value is of the exact type supplied as an argument. - - - - - Returns a constraint that tests whether the actual - value is of the exact type supplied as an argument. - - - - - Returns a constraint that tests whether the actual value - is of the type supplied as an argument or a derived type. - - - - - Returns a constraint that tests whether the actual value - is of the type supplied as an argument or a derived type. - - - - - Returns a constraint that tests whether the actual value - is of the type supplied as an argument or a derived type. - - - - - Returns a constraint that tests whether the actual value - is of the type supplied as an argument or a derived type. - - - - - Returns a constraint that tests whether the actual value - is assignable from the type supplied as an argument. - - - - - Returns a constraint that tests whether the actual value - is assignable from the type supplied as an argument. - - - - - Returns a constraint that tests whether the actual value - is assignable from the type supplied as an argument. - - - - - Returns a constraint that tests whether the actual value - is assignable from the type supplied as an argument. - - - - - Returns a constraint that tests whether the actual value - is a collection containing the same elements as the - collection supplied as an argument. - - - - - Returns a constraint that tests whether the actual value - is a subset of the collection supplied as an argument. - - - - - Returns a new CollectionContainsConstraint checking for the - presence of a particular object in the collection. - - - - - Returns a new CollectionContainsConstraint checking for the - presence of a particular object in the collection. - - - - - Returns a new ContainsConstraint. This constraint - will, in turn, make use of the appropriate second-level - constraint, depending on the type of the actual argument. - This overload is only used if the item sought is a string, - since any other type implies that we are looking for a - collection member. - - - - - Returns a constraint that succeeds if the actual - value contains the substring supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value contains the substring supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value starts with the substring supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value starts with the substring supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value ends with the substring supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value ends with the substring supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value matches the Regex pattern supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value matches the Regex pattern supplied as an argument. - - - - - Returns a constraint that tests whether the path provided - is the same as an expected path after canonicalization. - - - - - Returns a constraint that tests whether the path provided - is the same path or under an expected path after canonicalization. - - - - - Returns a constraint that tests whether the path provided - is the same path or under an expected path after canonicalization. - - - - - Returns a constraint that tests whether the actual value falls - within a specified range. - - - - - Returns a ConstraintExpression that negates any - following constraint. - - - - - Returns a ConstraintExpression that negates any - following constraint. - - - - - Returns a ConstraintExpression, which will apply - the following constraint to all members of a collection, - succeeding if all of them succeed. - - - - - Returns a ConstraintExpression, which will apply - the following constraint to all members of a collection, - succeeding if at least one of them succeeds. - - - - - Returns a ConstraintExpression, which will apply - the following constraint to all members of a collection, - succeeding if all of them fail. - - - - - Returns a new ConstraintExpression, which will apply the following - constraint to the Length property of the object being tested. - - - - - Returns a new ConstraintExpression, which will apply the following - constraint to the Count property of the object being tested. - - - - - Returns a new ConstraintExpression, which will apply the following - constraint to the Message property of the object being tested. - - - - - Returns a new ConstraintExpression, which will apply the following - constraint to the InnerException property of the object being tested. - - - - - With is currently a NOP - reserved for future use. - - - - - Returns a constraint that tests for null - - - - - Returns a constraint that tests for True - - - - - Returns a constraint that tests for False - - - - - Returns a constraint that tests for NaN - - - - - Returns a constraint that tests for empty - - - - - Returns a constraint that tests whether a collection - contains all unique items. - - - - - Returns a constraint that tests whether an object graph is serializable in binary format. - - - - - Returns a constraint that tests whether an object graph is serializable in xml format. - - - - - Returns a constraint that tests whether a collection is ordered - - - - - Helper class with properties and methods that supply - a number of constraints used in Asserts. - - - - - Returns a new PropertyConstraintExpression, which will either - test for the existence of the named property on the object - being tested or apply any following constraint to that property. - - - - - Returns a new AttributeConstraint checking for the - presence of a particular attribute on an object. - - - - - Returns a new AttributeConstraint checking for the - presence of a particular attribute on an object. - - - - - Returns a constraint that tests two items for equality - - - - - Returns a constraint that tests that two references are the same object - - - - - Returns a constraint that tests whether the - actual value is greater than the suppled argument - - - - - Returns a constraint that tests whether the - actual value is greater than or equal to the suppled argument - - - - - Returns a constraint that tests whether the - actual value is greater than or equal to the suppled argument - - - - - Returns a constraint that tests whether the - actual value is less than the suppled argument - - - - - Returns a constraint that tests whether the - actual value is less than or equal to the suppled argument - - - - - Returns a constraint that tests whether the - actual value is less than or equal to the suppled argument - - - - - Returns a constraint that tests whether the actual - value is of the exact type supplied as an argument. - - - - - Returns a constraint that tests whether the actual - value is of the exact type supplied as an argument. - - - - - Returns a constraint that tests whether the actual value - is of the type supplied as an argument or a derived type. - - - - - Returns a constraint that tests whether the actual value - is of the type supplied as an argument or a derived type. - - - - - Returns a constraint that tests whether the actual value - is of the type supplied as an argument or a derived type. - - - - - Returns a constraint that tests whether the actual value - is of the type supplied as an argument or a derived type. - - - - - Returns a constraint that tests whether the actual value - is assignable from the type supplied as an argument. - - - - - Returns a constraint that tests whether the actual value - is assignable from the type supplied as an argument. - - - - - Returns a constraint that tests whether the actual value - is assignable from the type supplied as an argument. - - - - - Returns a constraint that tests whether the actual value - is assignable from the type supplied as an argument. - - - - - Returns a constraint that tests whether the actual value - is a collection containing the same elements as the - collection supplied as an argument. - - - - - Returns a constraint that tests whether the actual value - is a subset of the collection supplied as an argument. - - - - - Returns a new CollectionContainsConstraint checking for the - presence of a particular object in the collection. - - - - - Returns a new CollectionContainsConstraint checking for the - presence of a particular object in the collection. - - - - - Returns a new ContainsConstraint. This constraint - will, in turn, make use of the appropriate second-level - constraint, depending on the type of the actual argument. - This overload is only used if the item sought is a string, - since any other type implies that we are looking for a - collection member. - - - - - Returns a constraint that succeeds if the actual - value contains the substring supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value contains the substring supplied as an argument. - - - - - Returns a constraint that fails if the actual - value contains the substring supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value starts with the substring supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value starts with the substring supplied as an argument. - - - - - Returns a constraint that fails if the actual - value starts with the substring supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value ends with the substring supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value ends with the substring supplied as an argument. - - - - - Returns a constraint that fails if the actual - value ends with the substring supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value matches the Regex pattern supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value matches the Regex pattern supplied as an argument. - - - - - Returns a constraint that fails if the actual - value matches the pattern supplied as an argument. - - - - - Returns a constraint that tests whether the path provided - is the same as an expected path after canonicalization. - - - - - Returns a constraint that tests whether the path provided - is the same path or under an expected path after canonicalization. - - - - - Returns a constraint that tests whether the path provided - is the same path or under an expected path after canonicalization. - - - - - Returns a constraint that tests whether the actual value falls - within a specified range. - - - - - Returns a ConstraintExpression that negates any - following constraint. - - - - - Returns a ConstraintExpression that negates any - following constraint. - - - - - Returns a ConstraintExpression, which will apply - the following constraint to all members of a collection, - succeeding if all of them succeed. - - - - - Returns a ConstraintExpression, which will apply - the following constraint to all members of a collection, - succeeding if at least one of them succeeds. - - - - - Returns a ConstraintExpression, which will apply - the following constraint to all members of a collection, - succeeding if all of them fail. - - - - - Returns a new ConstraintExpression, which will apply the following - constraint to the Length property of the object being tested. - - - - - Returns a new ConstraintExpression, which will apply the following - constraint to the Count property of the object being tested. - - - - - Returns a new ConstraintExpression, which will apply the following - constraint to the Message property of the object being tested. - - - - - Returns a new ConstraintExpression, which will apply the following - constraint to the InnerException property of the object being tested. - - - - - Returns a constraint that tests for null - - - - - Returns a constraint that tests for True - - - - - Returns a constraint that tests for False - - - - - Returns a constraint that tests for NaN - - - - - Returns a constraint that tests for empty - - - - - Returns a constraint that tests whether a collection - contains all unique items. - - - - - Returns a constraint that tests whether an object graph is serializable in binary format. - - - - - Returns a constraint that tests whether an object graph is serializable in xml format. - - - - - Returns a constraint that tests whether a collection is ordered - - - - - The ConstraintOperator class is used internally by a - ConstraintBuilder to represent an operator that - modifies or combines constraints. - - Constraint operators use left and right precedence - values to determine whether the top operator on the - stack should be reduced before pushing a new operator. - - - - - The precedence value used when the operator - is about to be pushed to the stack. - - - - - The precedence value used when the operator - is on the top of the stack. - - - - - Reduce produces a constraint from the operator and - any arguments. It takes the arguments from the constraint - stack and pushes the resulting constraint on it. - - - - - - The syntax element preceding this operator - - - - - The syntax element folowing this operator - - - - - The precedence value used when the operator - is about to be pushed to the stack. - - - - - The precedence value used when the operator - is on the top of the stack. - - - - - PrefixOperator takes a single constraint and modifies - it's action in some way. - - - - - Reduce produces a constraint from the operator and - any arguments. It takes the arguments from the constraint - stack and pushes the resulting constraint on it. - - - - - - Returns the constraint created by applying this - prefix to another constraint. - - - - - - - Negates the test of the constraint it wraps. - - - - - Constructs a new NotOperator - - - - - Returns a NotConstraint applied to its argument. - - - - - Abstract base for operators that indicate how to - apply a constraint to items in a collection. - - - - - Constructs a CollectionOperator - - - - - Represents a constraint that succeeds if all the - members of a collection match a base constraint. - - - - - Returns a constraint that will apply the argument - to the members of a collection, succeeding if - they all succeed. - - - - - Represents a constraint that succeeds if any of the - members of a collection match a base constraint. - - - - - Returns a constraint that will apply the argument - to the members of a collection, succeeding if - any of them succeed. - - - - - Represents a constraint that succeeds if none of the - members of a collection match a base constraint. - - - - - Returns a constraint that will apply the argument - to the members of a collection, succeeding if - none of them succeed. - - - - - Represents a constraint that simply wraps the - constraint provided as an argument, without any - further functionality, but which modifes the - order of evaluation because of its precedence. - - - - - Constructor for the WithOperator - - - - - Returns a constraint that wraps its argument - - - - - Abstract base class for operators that are able to reduce to a - constraint whether or not another syntactic element follows. - - - - - Operator used to test for the presence of a named Property - on an object and optionally apply further tests to the - value of that property. - - - - - Constructs a PropOperator for a particular named property - - - - - Reduce produces a constraint from the operator and - any arguments. It takes the arguments from the constraint - stack and pushes the resulting constraint on it. - - - - - - Gets the name of the property to which the operator applies - - - - - Operator that tests for the presence of a particular attribute - on a type and optionally applies further tests to the attribute. - - - - - Construct an AttributeOperator for a particular Type - - The Type of attribute tested - - - - Reduce produces a constraint from the operator and - any arguments. It takes the arguments from the constraint - stack and pushes the resulting constraint on it. - - - - - Operator that tests that an exception is thrown and - optionally applies further tests to the exception. - - - - - Construct a ThrowsOperator - - - - - Reduce produces a constraint from the operator and - any arguments. It takes the arguments from the constraint - stack and pushes the resulting constraint on it. - - - - - Abstract base class for all binary operators - - - - - Reduce produces a constraint from the operator and - any arguments. It takes the arguments from the constraint - stack and pushes the resulting constraint on it. - - - - - - Abstract method that produces a constraint by applying - the operator to its left and right constraint arguments. - - - - - Gets the left precedence of the operator - - - - - Gets the right precedence of the operator - - - - - Operator that requires both it's arguments to succeed - - - - - Construct an AndOperator - - - - - Apply the operator to produce an AndConstraint - - - - - Operator that requires at least one of it's arguments to succeed - - - - - Construct an OrOperator - - - - - Apply the operator to produce an OrConstraint - - - - - ContainsConstraint tests a whether a string contains a substring - or a collection contains an object. It postpones the decision of - which test to use until the type of the actual argument is known. - This allows testing whether a string is contained in a collection - or as a substring of another string using the same syntax. - - - - - Initializes a new instance of the class. - - The expected. - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - Flag the constraint to use the supplied IComparer object. - - The IComparer object to use. - Self. - - - - Flag the constraint to use the supplied IComparer object. - - The IComparer object to use. - Self. - - - - Flag the constraint to use the supplied Comparison object. - - The IComparer object to use. - Self. - - - - Flag the constraint to use the supplied IEqualityComparer object. - - The IComparer object to use. - Self. - - - - Flag the constraint to use the supplied IEqualityComparer object. - - The IComparer object to use. - Self. - - - - Flag the constraint to ignore case and return self. - - - - - Applies a delay to the match so that a match can be evaluated in the future. - - - - - Creates a new DelayedConstraint - - The inner constraint two decorate - The time interval after which the match is performed - If the value of is less than 0 - - - - Creates a new DelayedConstraint - - The inner constraint two decorate - The time interval after which the match is performed - The time interval used for polling - If the value of is less than 0 - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for if the base constraint fails, false if it succeeds - - - - Test whether the constraint is satisfied by a delegate - - The delegate whose value is to be tested - True for if the base constraint fails, false if it succeeds - - - - Test whether the constraint is satisfied by a given reference. - Overridden to wait for the specified delay period before - calling the base constraint with the dereferenced value. - - A reference to the value to be tested - True for success, false for failure - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - Write the actual value for a failing constraint test to a MessageWriter. - - The writer on which the actual value is displayed - - - - Returns the string representation of the constraint. - - - - - EmptyDirectoryConstraint is used to test that a directory is empty - - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - Write the actual value for a failing constraint test to a - MessageWriter. The default implementation simply writes - the raw value of actual, leaving it to the writer to - perform any formatting. - - The writer on which the actual value is displayed - - - - EmptyConstraint tests a whether a string or collection is empty, - postponing the decision about which test is applied until the - type of the actual argument is known. - - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - EqualConstraint is able to compare an actual value with the - expected value provided in its constructor. Two objects are - considered equal if both are null, or if both have the same - value. NUnit has special semantics for some object types. - - - - - If true, strings in error messages will be clipped - - - - - NUnitEqualityComparer used to test equality. - - - - - Initializes a new instance of the class. - - The expected value. - - - - Flag the constraint to use a tolerance when determining equality. - - Tolerance value to be used - Self. - - - - Flag the constraint to use the supplied IComparer object. - - The IComparer object to use. - Self. - - - - Flag the constraint to use the supplied IComparer object. - - The IComparer object to use. - Self. - - - - Flag the constraint to use the supplied IComparer object. - - The IComparer object to use. - Self. - - - - Flag the constraint to use the supplied Comparison object. - - The IComparer object to use. - Self. - - - - Flag the constraint to use the supplied IEqualityComparer object. - - The IComparer object to use. - Self. - - - - Flag the constraint to use the supplied IEqualityComparer object. - - The IComparer object to use. - Self. - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - Write a failure message. Overridden to provide custom - failure messages for EqualConstraint. - - The MessageWriter to write to - - - - Write description of this constraint - - The MessageWriter to write to - - - - Display the failure information for two collections that did not match. - - The MessageWriter on which to display - The expected collection. - The actual collection - The depth of this failure in a set of nested collections - - - - Displays a single line showing the types and sizes of the expected - and actual collections or arrays. If both are identical, the value is - only shown once. - - The MessageWriter on which to display - The expected collection or array - The actual collection or array - The indentation level for the message line - - - - Displays a single line showing the point in the expected and actual - arrays at which the comparison failed. If the arrays have different - structures or dimensions, both values are shown. - - The MessageWriter on which to display - The expected array - The actual array - Index of the failure point in the underlying collections - The indentation level for the message line - - - - Flag the constraint to ignore case and return self. - - - - - Flag the constraint to suppress string clipping - and return self. - - - - - Flag the constraint to compare arrays as collections - and return self. - - - - - Switches the .Within() modifier to interpret its tolerance as - a distance in representable values (see remarks). - - Self. - - Ulp stands for "unit in the last place" and describes the minimum - amount a given value can change. For any integers, an ulp is 1 whole - digit. For floating point values, the accuracy of which is better - for smaller numbers and worse for larger numbers, an ulp depends - on the size of the number. Using ulps for comparison of floating - point results instead of fixed tolerances is safer because it will - automatically compensate for the added inaccuracy of larger numbers. - - - - - Switches the .Within() modifier to interpret its tolerance as - a percentage that the actual values is allowed to deviate from - the expected value. - - Self - - - - Causes the tolerance to be interpreted as a TimeSpan in days. - - Self - - - - Causes the tolerance to be interpreted as a TimeSpan in hours. - - Self - - - - Causes the tolerance to be interpreted as a TimeSpan in minutes. - - Self - - - - Causes the tolerance to be interpreted as a TimeSpan in seconds. - - Self - - - - Causes the tolerance to be interpreted as a TimeSpan in milliseconds. - - Self - - - - Causes the tolerance to be interpreted as a TimeSpan in clock ticks. - - Self - - - - EqualityAdapter class handles all equality comparisons - that use an IEqualityComparer, IEqualityComparer<T> - or a ComparisonAdapter. - - - - - Compares two objects, returning true if they are equal - - - - - Returns an EqualityAdapter that wraps an IComparer. - - - - - Returns an EqualityAdapter that wraps an IEqualityComparer. - - - - - Returns an EqualityAdapter that wraps an IEqualityComparer<T>. - - - - - Returns an EqualityAdapter that wraps an IComparer<T>. - - - - - Returns an EqualityAdapter that wraps a Comparison<T>. - - - - Helper routines for working with floating point numbers - - - The floating point comparison code is based on this excellent article: - http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm - - - "ULP" means Unit in the Last Place and in the context of this library refers to - the distance between two adjacent floating point numbers. IEEE floating point - numbers can only represent a finite subset of natural numbers, with greater - accuracy for smaller numbers and lower accuracy for very large numbers. - - - If a comparison is allowed "2 ulps" of deviation, that means the values are - allowed to deviate by up to 2 adjacent floating point values, which might be - as low as 0.0000001 for small numbers or as high as 10.0 for large numbers. - - - - - Compares two floating point values for equality - First floating point value to be compared - Second floating point value t be compared - - Maximum number of representable floating point values that are allowed to - be between the left and the right floating point values - - True if both numbers are equal or close to being equal - - - Floating point values can only represent a finite subset of natural numbers. - For example, the values 2.00000000 and 2.00000024 can be stored in a float, - but nothing inbetween them. - - - This comparison will count how many possible floating point values are between - the left and the right number. If the number of possible values between both - numbers is less than or equal to maxUlps, then the numbers are considered as - being equal. - - - Implementation partially follows the code outlined here: - http://www.anttirt.net/2007/08/19/proper-floating-point-comparisons/ - - - - - Compares two double precision floating point values for equality - First double precision floating point value to be compared - Second double precision floating point value t be compared - - Maximum number of representable double precision floating point values that are - allowed to be between the left and the right double precision floating point values - - True if both numbers are equal or close to being equal - - - Double precision floating point values can only represent a limited series of - natural numbers. For example, the values 2.0000000000000000 and 2.0000000000000004 - can be stored in a double, but nothing inbetween them. - - - This comparison will count how many possible double precision floating point - values are between the left and the right number. If the number of possible - values between both numbers is less than or equal to maxUlps, then the numbers - are considered as being equal. - - - Implementation partially follows the code outlined here: - http://www.anttirt.net/2007/08/19/proper-floating-point-comparisons/ - - - - - - Reinterprets the memory contents of a floating point value as an integer value - - - Floating point value whose memory contents to reinterpret - - - The memory contents of the floating point value interpreted as an integer - - - - - Reinterprets the memory contents of a double precision floating point - value as an integer value - - - Double precision floating point value whose memory contents to reinterpret - - - The memory contents of the double precision floating point value - interpreted as an integer - - - - - Reinterprets the memory contents of an integer as a floating point value - - Integer value whose memory contents to reinterpret - - The memory contents of the integer value interpreted as a floating point value - - - - - Reinterprets the memory contents of an integer value as a double precision - floating point value - - Integer whose memory contents to reinterpret - - The memory contents of the integer interpreted as a double precision - floating point value - - - - Union of a floating point variable and an integer - - - The union's value as a floating point variable - - - The union's value as an integer - - - The union's value as an unsigned integer - - - Union of a double precision floating point variable and a long - - - The union's value as a double precision floating point variable - - - The union's value as a long - - - The union's value as an unsigned long - - - - MessageWriter is the abstract base for classes that write - constraint descriptions and messages in some form. The - class has separate methods for writing various components - of a message, allowing implementations to tailor the - presentation as needed. - - - - - Construct a MessageWriter given a culture - - - - - Method to write single line message with optional args, usually - written to precede the general failure message. - - The message to be written - Any arguments used in formatting the message - - - - Method to write single line message with optional args, usually - written to precede the general failure message, at a givel - indentation level. - - The indentation level of the message - The message to be written - Any arguments used in formatting the message - - - - Display Expected and Actual lines for a constraint. This - is called by MessageWriter's default implementation of - WriteMessageTo and provides the generic two-line display. - - The constraint that failed - - - - Display Expected and Actual lines for given values. This - method may be called by constraints that need more control over - the display of actual and expected values than is provided - by the default implementation. - - The expected value - The actual value causing the failure - - - - Display Expected and Actual lines for given values, including - a tolerance value on the Expected line. - - The expected value - The actual value causing the failure - The tolerance within which the test was made - - - - Display the expected and actual string values on separate lines. - If the mismatch parameter is >=0, an additional line is displayed - line containing a caret that points to the mismatch point. - - The expected string value - The actual string value - The point at which the strings don't match or -1 - If true, case is ignored in locating the point where the strings differ - If true, the strings should be clipped to fit the line - - - - Writes the text for a connector. - - The connector. - - - - Writes the text for a predicate. - - The predicate. - - - - Writes the text for an expected value. - - The expected value. - - - - Writes the text for a modifier - - The modifier. - - - - Writes the text for an actual value. - - The actual value. - - - - Writes the text for a generalized value. - - The value. - - - - Writes the text for a collection value, - starting at a particular point, to a max length - - The collection containing elements to write. - The starting point of the elements to write - The maximum number of elements to write - - - - Abstract method to get the max line length - - - - - Static methods used in creating messages - - - - - Static string used when strings are clipped - - - - - Returns the representation of a type as used in NUnitLite. - This is the same as Type.ToString() except for arrays, - which are displayed with their declared sizes. - - - - - - - Converts any control characters in a string - to their escaped representation. - - The string to be converted - The converted string - - - - Return the a string representation for a set of indices into an array - - Array of indices for which a string is needed - - - - Get an array of indices representing the point in a collection or - array corresponding to a single int index into the collection. - - The collection to which the indices apply - Index in the collection - Array of indices - - - - Clip a string to a given length, starting at a particular offset, returning the clipped - string with ellipses representing the removed parts - - The string to be clipped - The maximum permitted length of the result string - The point at which to start clipping - The clipped string - - - - Clip the expected and actual strings in a coordinated fashion, - so that they may be displayed together. - - - - - - - - - Shows the position two strings start to differ. Comparison - starts at the start index. - - The expected string - The actual string - The index in the strings at which comparison should start - Boolean indicating whether case should be ignored - -1 if no mismatch found, or the index where mismatch found - - - - The Numerics class contains common operations on numeric values. - - - - - Checks the type of the object, returning true if - the object is a numeric type. - - The object to check - true if the object is a numeric type - - - - Checks the type of the object, returning true if - the object is a floating point numeric type. - - The object to check - true if the object is a floating point numeric type - - - - Checks the type of the object, returning true if - the object is a fixed point numeric type. - - The object to check - true if the object is a fixed point numeric type - - - - Test two numeric values for equality, performing the usual numeric - conversions and using a provided or default tolerance. If the tolerance - provided is Empty, this method may set it to a default tolerance. - - The expected value - The actual value - A reference to the tolerance in effect - True if the values are equal - - - - Compare two numeric values, performing the usual numeric conversions. - - The expected value - The actual value - The relationship of the values to each other - - - - NUnitComparer encapsulates NUnit's default behavior - in comparing two objects. - - - - - Compares two objects - - - - - - - - Returns the default NUnitComparer. - - - - - NUnitEqualityComparer encapsulates NUnit's handling of - equality tests between objects. - - - - - If true, all string comparisons will ignore case - - - - - If true, arrays will be treated as collections, allowing - those of different dimensions to be compared - - - - - If non-zero, equality comparisons within the specified - tolerance will succeed. - - - - - Comparison object used in comparisons for some constraints. - - - - - Compares two objects for equality. - - - - - Helper method to compare two arrays - - - - - Method to compare two DirectoryInfo objects - - first directory to compare - second directory to compare - true if equivalent, false if not - - - - Returns the default NUnitEqualityComparer - - - - - Gets and sets a flag indicating whether case should - be ignored in determining equality. - - - - - Gets and sets a flag indicating that arrays should be - compared as collections, without regard to their shape. - - - - - Gets and sets an external comparer to be used to - test for equality. It is applied to members of - collections, in place of NUnit's own logic. - - - - - Gets and sets a tolerance used to compare objects of - certin types. - - - - - Gets the list of failure points for the last Match performed. - - - - - PathConstraint serves as the abstract base of constraints - that operate on paths and provides several helper methods. - - - - - The expected path used in the constraint - - - - - The actual path being tested - - - - - Flag indicating whether a caseInsensitive comparison should be made - - - - - Construct a PathConstraint for a give expected path - - The expected path - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - Returns true if the expected path and actual path match - - - - - Returns the string representation of this constraint - - - - - Canonicalize the provided path - - - The path in standardized form - - - - Test whether two paths are the same - - The first path - The second path - Indicates whether case should be ignored - - - - - Test whether one path is under another path - - The first path - supposed to be the parent path - The second path - supposed to be the child path - Indicates whether case should be ignored - - - - - Test whether one path is the same as or under another path - - The first path - supposed to be the parent path - The second path - supposed to be the child path - - - - - Modifies the current instance to be case-insensitve - and returns it. - - - - - Modifies the current instance to be case-sensitve - and returns it. - - - - - Summary description for SamePathConstraint. - - - - - Initializes a new instance of the class. - - The expected path - - - - Test whether the constraint is satisfied by a given value - - The expected path - The actual path - True for success, false for failure - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - SubPathConstraint tests that the actual path is under the expected path - - - - - Initializes a new instance of the class. - - The expected path - - - - Test whether the constraint is satisfied by a given value - - The expected path - The actual path - True for success, false for failure - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - SamePathOrUnderConstraint tests that one path is under another - - - - - Initializes a new instance of the class. - - The expected path - - - - Test whether the constraint is satisfied by a given value - - The expected path - The actual path - True for success, false for failure - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - Predicate constraint wraps a Predicate in a constraint, - returning success if the predicate is true. - - - - - Construct a PredicateConstraint from a predicate - - - - - Determines whether the predicate succeeds when applied - to the actual value. - - - - - Writes the description to a MessageWriter - - - - - NotConstraint negates the effect of some other constraint - - - - - Initializes a new instance of the class. - - The base constraint to be negated. - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for if the base constraint fails, false if it succeeds - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - Write the actual value for a failing constraint test to a MessageWriter. - - The writer on which the actual value is displayed - - - - AllItemsConstraint applies another constraint to each - item in a collection, succeeding if they all succeed. - - - - - Construct an AllItemsConstraint on top of an existing constraint - - - - - - Apply the item constraint to each item in the collection, - failing if any item fails. - - - - - - - Write a description of this constraint to a MessageWriter - - - - - - SomeItemsConstraint applies another constraint to each - item in a collection, succeeding if any of them succeeds. - - - - - Construct a SomeItemsConstraint on top of an existing constraint - - - - - - Apply the item constraint to each item in the collection, - succeeding if any item succeeds. - - - - - - - Write a description of this constraint to a MessageWriter - - - - - - NoItemConstraint applies another constraint to each - item in a collection, failing if any of them succeeds. - - - - - Construct a SomeItemsConstraint on top of an existing constraint - - - - - - Apply the item constraint to each item in the collection, - failing if any item fails. - - - - - - - Write a description of this constraint to a MessageWriter - - - - - - PropertyExistsConstraint tests that a named property - exists on the object provided through Match. - - Originally, PropertyConstraint provided this feature - in addition to making optional tests on the vaue - of the property. The two constraints are now separate. - - - - - Initializes a new instance of the class. - - The name of the property. - - - - Test whether the property exists for a given object - - The object to be tested - True for success, false for failure - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - Write the actual value for a failing constraint test to a - MessageWriter. - - The writer on which the actual value is displayed - - - - Returns the string representation of the constraint. - - - - - - PropertyConstraint extracts a named property and uses - its value as the actual value for a chained constraint. - - - - - Initializes a new instance of the class. - - The name. - The constraint to apply to the property. - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - Write the actual value for a failing constraint test to a - MessageWriter. The default implementation simply writes - the raw value of actual, leaving it to the writer to - perform any formatting. - - The writer on which the actual value is displayed - - - - Returns the string representation of the constraint. - - - - - - RangeConstraint tests whethe two values are within a - specified range. - - - - - Initializes a new instance of the class. - - From. - To. - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - Modifies the constraint to use an IComparer and returns self. - - - - - Modifies the constraint to use an IComparer<T> and returns self. - - - - - Modifies the constraint to use a Comparison<T> and returns self. - - - - - ResolvableConstraintExpression is used to represent a compound - constraint being constructed at a point where the last operator - may either terminate the expression or may have additional - qualifying constraints added to it. - - It is used, for example, for a Property element or for - an Exception element, either of which may be optionally - followed by constraints that apply to the property or - exception. - - - - - Create a new instance of ResolvableConstraintExpression - - - - - Create a new instance of ResolvableConstraintExpression, - passing in a pre-populated ConstraintBuilder. - - - - - Resolve the current expression to a Constraint - - - - - Appends an And Operator to the expression - - - - - Appends an Or operator to the expression. - - - - - ReusableConstraint wraps a resolved constraint so that it - may be saved and reused as needed. - - - - - Construct a ReusableConstraint - - The constraint or expression to be reused - - - - Conversion operator from a normal constraint to a ReusableConstraint. - - The original constraint to be wrapped as a ReusableConstraint - - - - - Returns the string representation of the constraint. - - A string representing the constraint - - - - Resolves the ReusableConstraint by returning the constraint - that it originally wrapped. - - A resolved constraint - - - - SameAsConstraint tests whether an object is identical to - the object passed to its constructor - - - - - Initializes a new instance of the class. - - The expected object. - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - BinarySerializableConstraint tests whether - an object is serializable in binary format. - - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - Write the actual value for a failing constraint test to a - MessageWriter. The default implementation simply writes - the raw value of actual, leaving it to the writer to - perform any formatting. - - The writer on which the actual value is displayed - - - - Returns the string representation - - - - - BinarySerializableConstraint tests whether - an object is serializable in binary format. - - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - Write the actual value for a failing constraint test to a - MessageWriter. The default implementation simply writes - the raw value of actual, leaving it to the writer to - perform any formatting. - - The writer on which the actual value is displayed - - - - Returns the string representation of this constraint - - - - - StringConstraint is the abstract base for constraints - that operate on strings. It supports the IgnoreCase - modifier for string operations. - - - - - The expected value - - - - - Indicates whether tests should be case-insensitive - - - - - Constructs a StringConstraint given an expected value - - The expected value - - - - Modify the constraint to ignore case in matching. - - - - - EmptyStringConstraint tests whether a string is empty. - - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - NullEmptyStringConstraint tests whether a string is either null or empty. - - - - - Constructs a new NullOrEmptyStringConstraint - - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - SubstringConstraint can test whether a string contains - the expected substring. - - - - - Initializes a new instance of the class. - - The expected. - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - StartsWithConstraint can test whether a string starts - with an expected substring. - - - - - Initializes a new instance of the class. - - The expected string - - - - Test whether the constraint is matched by the actual value. - This is a template method, which calls the IsMatch method - of the derived class. - - - - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - EndsWithConstraint can test whether a string ends - with an expected substring. - - - - - Initializes a new instance of the class. - - The expected string - - - - Test whether the constraint is matched by the actual value. - This is a template method, which calls the IsMatch method - of the derived class. - - - - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - RegexConstraint can test whether a string matches - the pattern provided. - - - - - Initializes a new instance of the class. - - The pattern. - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - ThrowsConstraint is used to test the exception thrown by - a delegate by applying a constraint to it. - - - - - Initializes a new instance of the class, - using a constraint to be applied to the exception. - - A constraint to apply to the caught exception. - - - - Executes the code of the delegate and captures any exception. - If a non-null base constraint was provided, it applies that - constraint to the exception. - - A delegate representing the code to be tested - True if an exception is thrown and the constraint succeeds, otherwise false - - - - Converts an ActualValueDelegate to a TestDelegate - before calling the primary overload. - - - - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - Write the actual value for a failing constraint test to a - MessageWriter. The default implementation simply writes - the raw value of actual, leaving it to the writer to - perform any formatting. - - The writer on which the actual value is displayed - - - - Returns the string representation of this constraint - - - - - Get the actual exception thrown - used by Assert.Throws. - - - - - ThrowsNothingConstraint tests that a delegate does not - throw an exception. - - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True if no exception is thrown, otherwise false - - - - Converts an ActualValueDelegate to a TestDelegate - before calling the primary overload. - - - - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - Write the actual value for a failing constraint test to a - MessageWriter. The default implementation simply writes - the raw value of actual, leaving it to the writer to - perform any formatting. - - The writer on which the actual value is displayed - - - - Modes in which the tolerance value for a comparison can - be interpreted. - - - - - The tolerance was created with a value, without specifying - how the value would be used. This is used to prevent setting - the mode more than once and is generally changed to Linear - upon execution of the test. - - - - - The tolerance is used as a numeric range within which - two compared values are considered to be equal. - - - - - Interprets the tolerance as the percentage by which - the two compared values my deviate from each other. - - - - - Compares two values based in their distance in - representable numbers. - - - - - The Tolerance class generalizes the notion of a tolerance - within which an equality test succeeds. Normally, it is - used with numeric types, but it can be used with any - type that supports taking a difference between two - objects and comparing that difference to a value. - - - - - Constructs a linear tolerance of a specdified amount - - - - - Constructs a tolerance given an amount and ToleranceMode - - - - - Tests that the current Tolerance is linear with a - numeric value, throwing an exception if it is not. - - - - - Returns an empty Tolerance object, equivalent to - specifying an exact match. - - - - - Gets the ToleranceMode for the current Tolerance - - - - - Gets the value of the current Tolerance instance. - - - - - Returns a new tolerance, using the current amount as a percentage. - - - - - Returns a new tolerance, using the current amount in Ulps. - - - - - Returns a new tolerance with a TimeSpan as the amount, using - the current amount as a number of days. - - - - - Returns a new tolerance with a TimeSpan as the amount, using - the current amount as a number of hours. - - - - - Returns a new tolerance with a TimeSpan as the amount, using - the current amount as a number of minutes. - - - - - Returns a new tolerance with a TimeSpan as the amount, using - the current amount as a number of seconds. - - - - - Returns a new tolerance with a TimeSpan as the amount, using - the current amount as a number of milliseconds. - - - - - Returns a new tolerance with a TimeSpan as the amount, using - the current amount as a number of clock ticks. - - - - - Returns true if the current tolerance is empty. - - - - - TypeConstraint is the abstract base for constraints - that take a Type as their expected value. - - - - - The expected Type used by the constraint - - - - - Construct a TypeConstraint for a given Type - - - - - - Write the actual value for a failing constraint test to a - MessageWriter. TypeConstraints override this method to write - the name of the type. - - The writer on which the actual value is displayed - - - - ExactTypeConstraint is used to test that an object - is of the exact type provided in the constructor - - - - - Construct an ExactTypeConstraint for a given Type - - The expected Type. - - - - Test that an object is of the exact type specified - - The actual value. - True if the tested object is of the exact type provided, otherwise false. - - - - Write the description of this constraint to a MessageWriter - - The MessageWriter to use - - - - InstanceOfTypeConstraint is used to test that an object - is of the same type provided or derived from it. - - - - - Construct an InstanceOfTypeConstraint for the type provided - - The expected Type - - - - Test whether an object is of the specified type or a derived type - - The object to be tested - True if the object is of the provided type or derives from it, otherwise false. - - - - Write a description of this constraint to a MessageWriter - - The MessageWriter to use - - - - AssignableFromConstraint is used to test that an object - can be assigned from a given Type. - - - - - Construct an AssignableFromConstraint for the type provided - - - - - - Test whether an object can be assigned from the specified type - - The object to be tested - True if the object can be assigned a value of the expected Type, otherwise false. - - - - Write a description of this constraint to a MessageWriter - - The MessageWriter to use - - - - AssignableToConstraint is used to test that an object - can be assigned to a given Type. - - - - - Construct an AssignableToConstraint for the type provided - - - - - - Test whether an object can be assigned to the specified type - - The object to be tested - True if the object can be assigned a value of the expected Type, otherwise false. - - - - Write a description of this constraint to a MessageWriter - - The MessageWriter to use - - - - Thrown when an assertion failed. - - - - - The error message that explains - the reason for the exception - - - The error message that explains - the reason for the exception - The exception that caused the - current exception - - - - Serialization Constructor - - - - - Thrown when an assertion failed. - - - - - - - The error message that explains - the reason for the exception - The exception that caused the - current exception - - - - Serialization Constructor - - - - - Thrown when a test executes inconclusively. - - - - - The error message that explains - the reason for the exception - - - The error message that explains - the reason for the exception - The exception that caused the - current exception - - - - Serialization Constructor - - - - - Thrown when an assertion failed. - - - - - - - The error message that explains - the reason for the exception - The exception that caused the - current exception - - - - Serialization Constructor - - - - - Delegate used by tests that execute code and - capture any thrown exception. - - - - - The Assert class contains a collection of static methods that - implement the most common assertions used in NUnit. - - - - - We don't actually want any instances of this object, but some people - like to inherit from it to add other static methods. Hence, the - protected constructor disallows any instances of this object. - - - - - The Equals method throws an AssertionException. This is done - to make sure there is no mistake by calling this function. - - - - - - - override the default ReferenceEquals to throw an AssertionException. This - implementation makes sure there is no mistake in calling this function - as part of Assert. - - - - - - - Helper for Assert.AreEqual(double expected, double actual, ...) - allowing code generation to work consistently. - - The expected value - The actual value - The maximum acceptable difference between the - the expected and the actual - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Throws a with the message and arguments - that are passed in. This allows a test to be cut short, with a result - of success returned to NUnit. - - The message to initialize the with. - Arguments to be used in formatting the message - - - - Throws a with the message and arguments - that are passed in. This allows a test to be cut short, with a result - of success returned to NUnit. - - The message to initialize the with. - - - - Throws a with the message and arguments - that are passed in. This allows a test to be cut short, with a result - of success returned to NUnit. - - - - - Throws an with the message and arguments - that are passed in. This is used by the other Assert functions. - - The message to initialize the with. - Arguments to be used in formatting the message - - - - Throws an with the message that is - passed in. This is used by the other Assert functions. - - The message to initialize the with. - - - - Throws an . - This is used by the other Assert functions. - - - - - Throws an with the message and arguments - that are passed in. This causes the test to be reported as ignored. - - The message to initialize the with. - Arguments to be used in formatting the message - - - - Throws an with the message that is - passed in. This causes the test to be reported as ignored. - - The message to initialize the with. - - - - Throws an . - This causes the test to be reported as ignored. - - - - - Throws an with the message and arguments - that are passed in. This causes the test to be reported as inconclusive. - - The message to initialize the with. - Arguments to be used in formatting the message - - - - Throws an with the message that is - passed in. This causes the test to be reported as inconclusive. - - The message to initialize the with. - - - - Throws an . - This causes the test to be reported as Inconclusive. - - - - - Apply a constraint to an actual value, succeeding if the constraint - is satisfied and throwing an assertion exception on failure. - - A Constraint to be applied - The actual value to test - - - - Apply a constraint to an actual value, succeeding if the constraint - is satisfied and throwing an assertion exception on failure. - - A Constraint to be applied - The actual value to test - The message that will be displayed on failure - - - - Apply a constraint to an actual value, succeeding if the constraint - is satisfied and throwing an assertion exception on failure. - - A Constraint expression to be applied - The actual value to test - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Apply a constraint to an actual value, succeeding if the constraint - is satisfied and throwing an assertion exception on failure. - - A Constraint expression to be applied - An ActualValueDelegate returning the value to be tested - - - - Apply a constraint to an actual value, succeeding if the constraint - is satisfied and throwing an assertion exception on failure. - - A Constraint expression to be applied - An ActualValueDelegate returning the value to be tested - The message that will be displayed on failure - - - - Apply a constraint to an actual value, succeeding if the constraint - is satisfied and throwing an assertion exception on failure. - - An ActualValueDelegate returning the value to be tested - A Constraint expression to be applied - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Apply a constraint to a referenced value, succeeding if the constraint - is satisfied and throwing an assertion exception on failure. - - A Constraint to be applied - The actual value to test - - - - Apply a constraint to a referenced value, succeeding if the constraint - is satisfied and throwing an assertion exception on failure. - - A Constraint to be applied - The actual value to test - The message that will be displayed on failure - - - - Apply a constraint to a referenced value, succeeding if the constraint - is satisfied and throwing an assertion exception on failure. - - A Constraint to be applied - The actual value to test - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Asserts that a condition is true. If the condition is false the method throws - an . - - The evaluated condition - The message to display if the condition is false - Arguments to be used in formatting the message - - - - Asserts that a condition is true. If the condition is false the method throws - an . - - The evaluated condition - The message to display if the condition is false - - - - Asserts that a condition is true. If the condition is false the method throws - an . - - The evaluated condition - - - - Asserts that the code represented by a delegate throws an exception - that satisfies the constraint provided. - - A TestDelegate to be executed - A ThrowsConstraint used in the test - - - - Verifies that a delegate throws a particular exception when called. - - A constraint to be satisfied by the exception - A TestSnippet delegate - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Verifies that a delegate throws a particular exception when called. - - A constraint to be satisfied by the exception - A TestSnippet delegate - The message that will be displayed on failure - - - - Verifies that a delegate throws a particular exception when called. - - A constraint to be satisfied by the exception - A TestSnippet delegate - - - - Verifies that a delegate throws a particular exception when called. - - The exception Type expected - A TestSnippet delegate - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Verifies that a delegate throws a particular exception when called. - - The exception Type expected - A TestSnippet delegate - The message that will be displayed on failure - - - - Verifies that a delegate throws a particular exception when called. - - The exception Type expected - A TestSnippet delegate - - - - Verifies that a delegate throws a particular exception when called. - - Type of the expected exception - A TestSnippet delegate - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Verifies that a delegate throws a particular exception when called. - - Type of the expected exception - A TestSnippet delegate - The message that will be displayed on failure - - - - Verifies that a delegate throws a particular exception when called. - - Type of the expected exception - A TestSnippet delegate - - - - Verifies that a delegate throws an exception when called - and returns it. - - A TestDelegate - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Verifies that a delegate throws an exception when called - and returns it. - - A TestDelegate - The message that will be displayed on failure - - - - Verifies that a delegate throws an exception when called - and returns it. - - A TestDelegate - - - - Verifies that a delegate throws an exception of a certain Type - or one derived from it when called and returns it. - - The expected Exception Type - A TestDelegate - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Verifies that a delegate throws an exception of a certain Type - or one derived from it when called and returns it. - - The expected Exception Type - A TestDelegate - The message that will be displayed on failure - - - - Verifies that a delegate throws an exception of a certain Type - or one derived from it when called and returns it. - - The expected Exception Type - A TestDelegate - - - - Verifies that a delegate throws an exception of a certain Type - or one derived from it when called and returns it. - - The expected Exception Type - A TestDelegate - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Verifies that a delegate throws an exception of a certain Type - or one derived from it when called and returns it. - - The expected Exception Type - A TestDelegate - The message that will be displayed on failure - - - - Verifies that a delegate throws an exception of a certain Type - or one derived from it when called and returns it. - - The expected Exception Type - A TestDelegate - - - - Verifies that a delegate does not throw an exception - - A TestSnippet delegate - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Verifies that a delegate does not throw an exception. - - A TestSnippet delegate - The message that will be displayed on failure - - - - Verifies that a delegate does not throw an exception. - - A TestSnippet delegate - - - - Asserts that a condition is true. If the condition is false the method throws - an . - - The evaluated condition - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Asserts that a condition is true. If the condition is false the method throws - an . - - The evaluated condition - The message to display in case of failure - - - - Asserts that a condition is true. If the condition is false the method throws - an . - - The evaluated condition - - - - Asserts that a condition is true. If the condition is false the method throws - an . - - The evaluated condition - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Asserts that a condition is true. If the condition is false the method throws - an . - - The evaluated condition - The message to display in case of failure - - - - Asserts that a condition is true. If the condition is false the method throws - an . - - The evaluated condition - - - - Asserts that a condition is false. If the condition is true the method throws - an . - - The evaluated condition - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Asserts that a condition is false. If the condition is true the method throws - an . - - The evaluated condition - The message to display in case of failure - - - - Asserts that a condition is false. If the condition is true the method throws - an . - - The evaluated condition - - - - Asserts that a condition is false. If the condition is true the method throws - an . - - The evaluated condition - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Asserts that a condition is false. If the condition is true the method throws - an . - - The evaluated condition - The message to display in case of failure - - - - Asserts that a condition is false. If the condition is true the method throws - an . - - The evaluated condition - - - - Verifies that the object that is passed in is not equal to null - If the object is null then an - is thrown. - - The object that is to be tested - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the object that is passed in is not equal to null - If the object is null then an - is thrown. - - The object that is to be tested - The message to display in case of failure - - - - Verifies that the object that is passed in is not equal to null - If the object is null then an - is thrown. - - The object that is to be tested - - - - Verifies that the object that is passed in is not equal to null - If the object is null then an - is thrown. - - The object that is to be tested - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the object that is passed in is not equal to null - If the object is null then an - is thrown. - - The object that is to be tested - The message to display in case of failure - - - - Verifies that the object that is passed in is not equal to null - If the object is null then an - is thrown. - - The object that is to be tested - - - - Verifies that the object that is passed in is equal to null - If the object is not null then an - is thrown. - - The object that is to be tested - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the object that is passed in is equal to null - If the object is not null then an - is thrown. - - The object that is to be tested - The message to display in case of failure - - - - Verifies that the object that is passed in is equal to null - If the object is not null then an - is thrown. - - The object that is to be tested - - - - Verifies that the object that is passed in is equal to null - If the object is not null then an - is thrown. - - The object that is to be tested - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the object that is passed in is equal to null - If the object is not null then an - is thrown. - - The object that is to be tested - The message to display in case of failure - - - - Verifies that the object that is passed in is equal to null - If the object is not null then an - is thrown. - - The object that is to be tested - - - - Verifies that the double that is passed in is an NaN value. - If the object is not NaN then an - is thrown. - - The value that is to be tested - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the double that is passed in is an NaN value. - If the object is not NaN then an - is thrown. - - The value that is to be tested - The message to display in case of failure - - - - Verifies that the double that is passed in is an NaN value. - If the object is not NaN then an - is thrown. - - The value that is to be tested - - - - Verifies that the double that is passed in is an NaN value. - If the object is not NaN then an - is thrown. - - The value that is to be tested - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the double that is passed in is an NaN value. - If the object is not NaN then an - is thrown. - - The value that is to be tested - The message to display in case of failure - - - - Verifies that the double that is passed in is an NaN value. - If the object is not NaN then an - is thrown. - - The value that is to be tested - - - - Assert that a string is empty - that is equal to string.Empty - - The string to be tested - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Assert that a string is empty - that is equal to string.Empty - - The string to be tested - The message to display in case of failure - - - - Assert that a string is empty - that is equal to string.Empty - - The string to be tested - - - - Assert that an array, list or other collection is empty - - An array, list or other collection implementing ICollection - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Assert that an array, list or other collection is empty - - An array, list or other collection implementing ICollection - The message to display in case of failure - - - - Assert that an array, list or other collection is empty - - An array, list or other collection implementing ICollection - - - - Assert that a string is not empty - that is not equal to string.Empty - - The string to be tested - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Assert that a string is not empty - that is not equal to string.Empty - - The string to be tested - The message to display in case of failure - - - - Assert that a string is not empty - that is not equal to string.Empty - - The string to be tested - - - - Assert that an array, list or other collection is not empty - - An array, list or other collection implementing ICollection - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Assert that an array, list or other collection is not empty - - An array, list or other collection implementing ICollection - The message to display in case of failure - - - - Assert that an array, list or other collection is not empty - - An array, list or other collection implementing ICollection - - - - Assert that a string is either null or equal to string.Empty - - The string to be tested - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Assert that a string is either null or equal to string.Empty - - The string to be tested - The message to display in case of failure - - - - Assert that a string is either null or equal to string.Empty - - The string to be tested - - - - Assert that a string is not null or empty - - The string to be tested - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Assert that a string is not null or empty - - The string to be tested - The message to display in case of failure - - - - Assert that a string is not null or empty - - The string to be tested - - - - Asserts that an object may be assigned a value of a given Type. - - The expected Type. - The object under examination - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Asserts that an object may be assigned a value of a given Type. - - The expected Type. - The object under examination - The message to display in case of failure - - - - Asserts that an object may be assigned a value of a given Type. - - The expected Type. - The object under examination - - - - Asserts that an object may be assigned a value of a given Type. - - The expected Type. - The object under examination - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Asserts that an object may be assigned a value of a given Type. - - The expected Type. - The object under examination - The message to display in case of failure - - - - Asserts that an object may be assigned a value of a given Type. - - The expected Type. - The object under examination - - - - Asserts that an object may not be assigned a value of a given Type. - - The expected Type. - The object under examination - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Asserts that an object may not be assigned a value of a given Type. - - The expected Type. - The object under examination - The message to display in case of failure - - - - Asserts that an object may not be assigned a value of a given Type. - - The expected Type. - The object under examination - - - - Asserts that an object may not be assigned a value of a given Type. - - The expected Type. - The object under examination - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Asserts that an object may not be assigned a value of a given Type. - - The expected Type. - The object under examination - The message to display in case of failure - - - - Asserts that an object may not be assigned a value of a given Type. - - The expected Type. - The object under examination - - - - Asserts that an object is an instance of a given type. - - The expected Type - The object being examined - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Asserts that an object is an instance of a given type. - - The expected Type - The object being examined - The message to display in case of failure - - - - Asserts that an object is an instance of a given type. - - The expected Type - The object being examined - - - - Asserts that an object is an instance of a given type. - - The expected Type - The object being examined - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Asserts that an object is an instance of a given type. - - The expected Type - The object being examined - The message to display in case of failure - - - - Asserts that an object is an instance of a given type. - - The expected Type - The object being examined - - - - Asserts that an object is an instance of a given type. - - The expected Type - The object being examined - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Asserts that an object is an instance of a given type. - - The expected Type - The object being examined - The message to display in case of failure - - - - Asserts that an object is an instance of a given type. - - The expected Type - The object being examined - - - - Asserts that an object is not an instance of a given type. - - The expected Type - The object being examined - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Asserts that an object is not an instance of a given type. - - The expected Type - The object being examined - The message to display in case of failure - - - - Asserts that an object is not an instance of a given type. - - The expected Type - The object being examined - - - - Asserts that an object is not an instance of a given type. - - The expected Type - The object being examined - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Asserts that an object is not an instance of a given type. - - The expected Type - The object being examined - The message to display in case of failure - - - - Asserts that an object is not an instance of a given type. - - The expected Type - The object being examined - - - - Asserts that an object is not an instance of a given type. - - The expected Type - The object being examined - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Asserts that an object is not an instance of a given type. - - The expected Type - The object being examined - The message to display in case of failure - - - - Asserts that an object is not an instance of a given type. - - The expected Type - The object being examined - - - - Verifies that two values are equal. If they are not, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that two values are equal. If they are not, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - - - - Verifies that two values are equal. If they are not, then an - is thrown. - - The expected value - The actual value - - - - Verifies that two values are equal. If they are not, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that two values are equal. If they are not, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - - - - Verifies that two values are equal. If they are not, then an - is thrown. - - The expected value - The actual value - - - - Verifies that two values are equal. If they are not, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that two values are equal. If they are not, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - - - - Verifies that two values are equal. If they are not, then an - is thrown. - - The expected value - The actual value - - - - Verifies that two values are equal. If they are not, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that two values are equal. If they are not, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - - - - Verifies that two values are equal. If they are not, then an - is thrown. - - The expected value - The actual value - - - - Verifies that two values are equal. If they are not, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that two values are equal. If they are not, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - - - - Verifies that two values are equal. If they are not, then an - is thrown. - - The expected value - The actual value - - - - Verifies that two doubles are equal considering a delta. If the - expected value is infinity then the delta value is ignored. If - they are not equal then an is - thrown. - - The expected value - The actual value - The maximum acceptable difference between the - the expected and the actual - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that two doubles are equal considering a delta. If the - expected value is infinity then the delta value is ignored. If - they are not equal then an is - thrown. - - The expected value - The actual value - The maximum acceptable difference between the - the expected and the actual - The message to display in case of failure - - - - Verifies that two doubles are equal considering a delta. If the - expected value is infinity then the delta value is ignored. If - they are not equal then an is - thrown. - - The expected value - The actual value - The maximum acceptable difference between the - the expected and the actual - - - - Verifies that two doubles are equal considering a delta. If the - expected value is infinity then the delta value is ignored. If - they are not equal then an is - thrown. - - The expected value - The actual value - The maximum acceptable difference between the - the expected and the actual - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that two doubles are equal considering a delta. If the - expected value is infinity then the delta value is ignored. If - they are not equal then an is - thrown. - - The expected value - The actual value - The maximum acceptable difference between the - the expected and the actual - The message to display in case of failure - - - - Verifies that two doubles are equal considering a delta. If the - expected value is infinity then the delta value is ignored. If - they are not equal then an is - thrown. - - The expected value - The actual value - The maximum acceptable difference between the - the expected and the actual - - - - Verifies that two objects are equal. Two objects are considered - equal if both are null, or if both have the same value. NUnit - has special semantics for some object types. - If they are not equal an is thrown. - - The value that is expected - The actual value - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that two objects are equal. Two objects are considered - equal if both are null, or if both have the same value. NUnit - has special semantics for some object types. - If they are not equal an is thrown. - - The value that is expected - The actual value - The message to display in case of failure - - - - Verifies that two objects are equal. Two objects are considered - equal if both are null, or if both have the same value. NUnit - has special semantics for some object types. - If they are not equal an is thrown. - - The value that is expected - The actual value - - - - Verifies that two values are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that two values are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - - - - Verifies that two values are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - - - - Verifies that two values are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that two values are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - - - - Verifies that two values are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - - - - Verifies that two values are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that two values are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - - - - Verifies that two values are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - - - - Verifies that two values are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that two values are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - - - - Verifies that two values are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - - - - Verifies that two values are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that two values are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - - - - Verifies that two values are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - - - - Verifies that two values are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that two values are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - - - - Verifies that two values are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - - - - Verifies that two values are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that two values are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - - - - Verifies that two values are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - - - - Verifies that two objects are not equal. Two objects are considered - equal if both are null, or if both have the same value. NUnit - has special semantics for some object types. - If they are equal an is thrown. - - The value that is expected - The actual value - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that two objects are not equal. Two objects are considered - equal if both are null, or if both have the same value. NUnit - has special semantics for some object types. - If they are equal an is thrown. - - The value that is expected - The actual value - The message to display in case of failure - - - - Verifies that two objects are not equal. Two objects are considered - equal if both are null, or if both have the same value. NUnit - has special semantics for some object types. - If they are equal an is thrown. - - The value that is expected - The actual value - - - - Asserts that two objects refer to the same object. If they - are not the same an is thrown. - - The expected object - The actual object - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Asserts that two objects refer to the same object. If they - are not the same an is thrown. - - The expected object - The actual object - The message to display in case of failure - - - - Asserts that two objects refer to the same object. If they - are not the same an is thrown. - - The expected object - The actual object - - - - Asserts that two objects do not refer to the same object. If they - are the same an is thrown. - - The expected object - The actual object - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Asserts that two objects do not refer to the same object. If they - are the same an is thrown. - - The expected object - The actual object - The message to display in case of failure - - - - Asserts that two objects do not refer to the same object. If they - are the same an is thrown. - - The expected object - The actual object - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - - - - Asserts that an object is contained in a list. - - The expected object - The list to be examined - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Asserts that an object is contained in a list. - - The expected object - The list to be examined - The message to display in case of failure - - - - Asserts that an object is contained in a list. - - The expected object - The list to be examined - - - - Gets the number of assertions executed so far and - resets the counter to zero. - - - - - AssertionHelper is an optional base class for user tests, - allowing the use of shorter names for constraints and - asserts and avoiding conflict with the definition of - , from which it inherits much of its - behavior, in certain mock object frameworks. - - - - - Apply a constraint to an actual value, succeeding if the constraint - is satisfied and throwing an assertion exception on failure. Works - identically to - - A Constraint to be applied - The actual value to test - - - - Apply a constraint to an actual value, succeeding if the constraint - is satisfied and throwing an assertion exception on failure. Works - identically to - - A Constraint to be applied - The actual value to test - The message that will be displayed on failure - - - - Apply a constraint to an actual value, succeeding if the constraint - is satisfied and throwing an assertion exception on failure. Works - identically to - - A Constraint to be applied - The actual value to test - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Apply a constraint to an actual value, succeeding if the constraint - is satisfied and throwing an assertion exception on failure. - - A Constraint expression to be applied - An ActualValueDelegate returning the value to be tested - - - - Apply a constraint to an actual value, succeeding if the constraint - is satisfied and throwing an assertion exception on failure. - - A Constraint expression to be applied - An ActualValueDelegate returning the value to be tested - The message that will be displayed on failure - - - - Apply a constraint to an actual value, succeeding if the constraint - is satisfied and throwing an assertion exception on failure. - - An ActualValueDelegate returning the value to be tested - A Constraint expression to be applied - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Apply a constraint to a referenced value, succeeding if the constraint - is satisfied and throwing an assertion exception on failure. - - A Constraint to be applied - The actual value to test - - - - Apply a constraint to a referenced value, succeeding if the constraint - is satisfied and throwing an assertion exception on failure. - - A Constraint to be applied - The actual value to test - The message that will be displayed on failure - - - - Apply a constraint to a referenced value, succeeding if the constraint - is satisfied and throwing an assertion exception on failure. - - A Constraint to be applied - The actual value to test - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Asserts that a condition is true. If the condition is false the method throws - an . Works Identically to - . - - The evaluated condition - The message to display if the condition is false - Arguments to be used in formatting the message - - - - Asserts that a condition is true. If the condition is false the method throws - an . Works Identically to - . - - The evaluated condition - The message to display if the condition is false - - - - Asserts that a condition is true. If the condition is false the method throws - an . Works Identically to . - - The evaluated condition - - - - Asserts that the code represented by a delegate throws an exception - that satisfies the constraint provided. - - A TestDelegate to be executed - A ThrowsConstraint used in the test - - - - Returns a ListMapper based on a collection. - - The original collection - - - - - Provides static methods to express the assumptions - that must be met for a test to give a meaningful - result. If an assumption is not met, the test - should produce an inconclusive result. - - - - - The Equals method throws an AssertionException. This is done - to make sure there is no mistake by calling this function. - - - - - - - override the default ReferenceEquals to throw an AssertionException. This - implementation makes sure there is no mistake in calling this function - as part of Assert. - - - - - - - Apply a constraint to an actual value, succeeding if the constraint - is satisfied and throwing an InconclusiveException on failure. - - A Constraint expression to be applied - The actual value to test - - - - Apply a constraint to an actual value, succeeding if the constraint - is satisfied and throwing an InconclusiveException on failure. - - A Constraint expression to be applied - The actual value to test - The message that will be displayed on failure - - - - Apply a constraint to an actual value, succeeding if the constraint - is satisfied and throwing an InconclusiveException on failure. - - A Constraint expression to be applied - The actual value to test - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Apply a constraint to an actual value, succeeding if the constraint - is satisfied and throwing an InconclusiveException on failure. - - A Constraint expression to be applied - An ActualValueDelegate returning the value to be tested - - - - Apply a constraint to an actual value, succeeding if the constraint - is satisfied and throwing an InconclusiveException on failure. - - A Constraint expression to be applied - An ActualValueDelegate returning the value to be tested - The message that will be displayed on failure - - - - Apply a constraint to an actual value, succeeding if the constraint - is satisfied and throwing an InconclusiveException on failure. - - An ActualValueDelegate returning the value to be tested - A Constraint expression to be applied - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Apply a constraint to a referenced value, succeeding if the constraint - is satisfied and throwing an InconclusiveException on failure. - - A Constraint expression to be applied - The actual value to test - - - - Apply a constraint to a referenced value, succeeding if the constraint - is satisfied and throwing an InconclusiveException on failure. - - A Constraint expression to be applied - The actual value to test - The message that will be displayed on failure - - - - Apply a constraint to a referenced value, succeeding if the constraint - is satisfied and throwing an InconclusiveException on failure. - - A Constraint expression to be applied - The actual value to test - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Asserts that a condition is true. If the condition is false the method throws - an . - - The evaluated condition - The message to display if the condition is false - Arguments to be used in formatting the message - - - - Asserts that a condition is true. If the condition is false the method throws - an . - - The evaluated condition - The message to display if the condition is false - - - - Asserts that a condition is true. If the condition is false the - method throws an . - - The evaluated condition - - - - Asserts that the code represented by a delegate throws an exception - that satisfies the constraint provided. - - A TestDelegate to be executed - A ThrowsConstraint used in the test - - - - A set of Assert methods operationg on one or more collections - - - - - The Equals method throws an AssertionException. This is done - to make sure there is no mistake by calling this function. - - - - - - - override the default ReferenceEquals to throw an AssertionException. This - implementation makes sure there is no mistake in calling this function - as part of Assert. - - - - - - - Asserts that all items contained in collection are of the type specified by expectedType. - - IEnumerable containing objects to be considered - System.Type that all objects in collection must be instances of - - - - Asserts that all items contained in collection are of the type specified by expectedType. - - IEnumerable containing objects to be considered - System.Type that all objects in collection must be instances of - The message that will be displayed on failure - - - - Asserts that all items contained in collection are of the type specified by expectedType. - - IEnumerable containing objects to be considered - System.Type that all objects in collection must be instances of - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Asserts that all items contained in collection are not equal to null. - - IEnumerable containing objects to be considered - - - - Asserts that all items contained in collection are not equal to null. - - IEnumerable containing objects to be considered - The message that will be displayed on failure - - - - Asserts that all items contained in collection are not equal to null. - - IEnumerable of objects to be considered - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Ensures that every object contained in collection exists within the collection - once and only once. - - IEnumerable of objects to be considered - - - - Ensures that every object contained in collection exists within the collection - once and only once. - - IEnumerable of objects to be considered - The message that will be displayed on failure - - - - Ensures that every object contained in collection exists within the collection - once and only once. - - IEnumerable of objects to be considered - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Asserts that expected and actual are exactly equal. The collections must have the same count, - and contain the exact same objects in the same order. - - The first IEnumerable of objects to be considered - The second IEnumerable of objects to be considered - - - - Asserts that expected and actual are exactly equal. The collections must have the same count, - and contain the exact same objects in the same order. - If comparer is not null then it will be used to compare the objects. - - The first IEnumerable of objects to be considered - The second IEnumerable of objects to be considered - The IComparer to use in comparing objects from each IEnumerable - - - - Asserts that expected and actual are exactly equal. The collections must have the same count, - and contain the exact same objects in the same order. - - The first IEnumerable of objects to be considered - The second IEnumerable of objects to be considered - The message that will be displayed on failure - - - - Asserts that expected and actual are exactly equal. The collections must have the same count, - and contain the exact same objects in the same order. - If comparer is not null then it will be used to compare the objects. - - The first IEnumerable of objects to be considered - The second IEnumerable of objects to be considered - The IComparer to use in comparing objects from each IEnumerable - The message that will be displayed on failure - - - - Asserts that expected and actual are exactly equal. The collections must have the same count, - and contain the exact same objects in the same order. - - The first IEnumerable of objects to be considered - The second IEnumerable of objects to be considered - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Asserts that expected and actual are exactly equal. The collections must have the same count, - and contain the exact same objects in the same order. - If comparer is not null then it will be used to compare the objects. - - The first IEnumerable of objects to be considered - The second IEnumerable of objects to be considered - The IComparer to use in comparing objects from each IEnumerable - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Asserts that expected and actual are equivalent, containing the same objects but the match may be in any order. - - The first IEnumerable of objects to be considered - The second IEnumerable of objects to be considered - - - - Asserts that expected and actual are equivalent, containing the same objects but the match may be in any order. - - The first IEnumerable of objects to be considered - The second IEnumerable of objects to be considered - The message that will be displayed on failure - - - - Asserts that expected and actual are equivalent, containing the same objects but the match may be in any order. - - The first IEnumerable of objects to be considered - The second IEnumerable of objects to be considered - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Asserts that expected and actual are not exactly equal. - - The first IEnumerable of objects to be considered - The second IEnumerable of objects to be considered - - - - Asserts that expected and actual are not exactly equal. - If comparer is not null then it will be used to compare the objects. - - The first IEnumerable of objects to be considered - The second IEnumerable of objects to be considered - The IComparer to use in comparing objects from each IEnumerable - - - - Asserts that expected and actual are not exactly equal. - - The first IEnumerable of objects to be considered - The second IEnumerable of objects to be considered - The message that will be displayed on failure - - - - Asserts that expected and actual are not exactly equal. - If comparer is not null then it will be used to compare the objects. - - The first IEnumerable of objects to be considered - The second IEnumerable of objects to be considered - The IComparer to use in comparing objects from each IEnumerable - The message that will be displayed on failure - - - - Asserts that expected and actual are not exactly equal. - - The first IEnumerable of objects to be considered - The second IEnumerable of objects to be considered - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Asserts that expected and actual are not exactly equal. - If comparer is not null then it will be used to compare the objects. - - The first IEnumerable of objects to be considered - The second IEnumerable of objects to be considered - The IComparer to use in comparing objects from each IEnumerable - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Asserts that expected and actual are not equivalent. - - The first IEnumerable of objects to be considered - The second IEnumerable of objects to be considered - - - - Asserts that expected and actual are not equivalent. - - The first IEnumerable of objects to be considered - The second IEnumerable of objects to be considered - The message that will be displayed on failure - - - - Asserts that expected and actual are not equivalent. - - The first IEnumerable of objects to be considered - The second IEnumerable of objects to be considered - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Asserts that collection contains actual as an item. - - IEnumerable of objects to be considered - Object to be found within collection - - - - Asserts that collection contains actual as an item. - - IEnumerable of objects to be considered - Object to be found within collection - The message that will be displayed on failure - - - - Asserts that collection contains actual as an item. - - IEnumerable of objects to be considered - Object to be found within collection - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Asserts that collection does not contain actual as an item. - - IEnumerable of objects to be considered - Object that cannot exist within collection - - - - Asserts that collection does not contain actual as an item. - - IEnumerable of objects to be considered - Object that cannot exist within collection - The message that will be displayed on failure - - - - Asserts that collection does not contain actual as an item. - - IEnumerable of objects to be considered - Object that cannot exist within collection - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Asserts that superset is not a subject of subset. - - The IEnumerable superset to be considered - The IEnumerable subset to be considered - - - - Asserts that superset is not a subject of subset. - - The IEnumerable superset to be considered - The IEnumerable subset to be considered - The message that will be displayed on failure - - - - Asserts that superset is not a subject of subset. - - The IEnumerable superset to be considered - The IEnumerable subset to be considered - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Asserts that superset is a subset of subset. - - The IEnumerable superset to be considered - The IEnumerable subset to be considered - - - - Asserts that superset is a subset of subset. - - The IEnumerable superset to be considered - The IEnumerable subset to be considered - The message that will be displayed on failure - - - - Asserts that superset is a subset of subset. - - The IEnumerable superset to be considered - The IEnumerable subset to be considered - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Assert that an array, list or other collection is empty - - An array, list or other collection implementing IEnumerable - The message to be displayed on failure - Arguments to be used in formatting the message - - - - Assert that an array, list or other collection is empty - - An array, list or other collection implementing IEnumerable - The message to be displayed on failure - - - - Assert that an array,list or other collection is empty - - An array, list or other collection implementing IEnumerable - - - - Assert that an array, list or other collection is empty - - An array, list or other collection implementing IEnumerable - The message to be displayed on failure - Arguments to be used in formatting the message - - - - Assert that an array, list or other collection is empty - - An array, list or other collection implementing IEnumerable - The message to be displayed on failure - - - - Assert that an array,list or other collection is empty - - An array, list or other collection implementing IEnumerable - - - - Assert that an array, list or other collection is ordered - - An array, list or other collection implementing IEnumerable - The message to be displayed on failure - Arguments to be used in formatting the message - - - - Assert that an array, list or other collection is ordered - - An array, list or other collection implementing IEnumerable - The message to be displayed on failure - - - - Assert that an array, list or other collection is ordered - - An array, list or other collection implementing IEnumerable - - - - Assert that an array, list or other collection is ordered - - An array, list or other collection implementing IEnumerable - A custom comparer to perform the comparisons - The message to be displayed on failure - Arguments to be used in formatting the message - - - - Assert that an array, list or other collection is ordered - - An array, list or other collection implementing IEnumerable - A custom comparer to perform the comparisons - The message to be displayed on failure - - - - Assert that an array, list or other collection is ordered - - An array, list or other collection implementing IEnumerable - A custom comparer to perform the comparisons - - - - Static helper class used in the constraint-based syntax - - - - - Creates a new SubstringConstraint - - The value of the substring - A SubstringConstraint - - - - Creates a new CollectionContainsConstraint. - - The item that should be found. - A new CollectionContainsConstraint - - - - Summary description for DirectoryAssert - - - - - The Equals method throws an AssertionException. This is done - to make sure there is no mistake by calling this function. - - - - - - - override the default ReferenceEquals to throw an AssertionException. This - implementation makes sure there is no mistake in calling this function - as part of Assert. - - - - - - - We don't actually want any instances of this object, but some people - like to inherit from it to add other static methods. Hence, the - protected constructor disallows any instances of this object. - - - - - Verifies that two directories are equal. Two directories are considered - equal if both are null, or if both have the same value byte for byte. - If they are not equal an is thrown. - - A directory containing the value that is expected - A directory containing the actual value - The message to display if directories are not equal - Arguments to be used in formatting the message - - - - Verifies that two directories are equal. Two directories are considered - equal if both are null, or if both have the same value byte for byte. - If they are not equal an is thrown. - - A directory containing the value that is expected - A directory containing the actual value - The message to display if directories are not equal - - - - Verifies that two directories are equal. Two directories are considered - equal if both are null, or if both have the same value byte for byte. - If they are not equal an is thrown. - - A directory containing the value that is expected - A directory containing the actual value - - - - Verifies that two directories are equal. Two directories are considered - equal if both are null, or if both have the same value byte for byte. - If they are not equal an is thrown. - - A directory path string containing the value that is expected - A directory path string containing the actual value - The message to display if directories are not equal - Arguments to be used in formatting the message - - - - Verifies that two directories are equal. Two directories are considered - equal if both are null, or if both have the same value byte for byte. - If they are not equal an is thrown. - - A directory path string containing the value that is expected - A directory path string containing the actual value - The message to display if directories are not equal - - - - Verifies that two directories are equal. Two directories are considered - equal if both are null, or if both have the same value byte for byte. - If they are not equal an is thrown. - - A directory path string containing the value that is expected - A directory path string containing the actual value - - - - Asserts that two directories are not equal. If they are equal - an is thrown. - - A directory containing the value that is expected - A directory containing the actual value - The message to display if directories are not equal - Arguments to be used in formatting the message - - - - Asserts that two directories are not equal. If they are equal - an is thrown. - - A directory containing the value that is expected - A directory containing the actual value - The message to display if directories are not equal - - - - Asserts that two directories are not equal. If they are equal - an is thrown. - - A directory containing the value that is expected - A directory containing the actual value - - - - Asserts that two directories are not equal. If they are equal - an is thrown. - - A directory path string containing the value that is expected - A directory path string containing the actual value - The message to display if directories are equal - Arguments to be used in formatting the message - - - - Asserts that two directories are not equal. If they are equal - an is thrown. - - A directory path string containing the value that is expected - A directory path string containing the actual value - The message to display if directories are equal - - - - Asserts that two directories are not equal. If they are equal - an is thrown. - - A directory path string containing the value that is expected - A directory path string containing the actual value - - - - Asserts that the directory is empty. If it is not empty - an is thrown. - - A directory to search - The message to display if directories are not equal - Arguments to be used in formatting the message - - - - Asserts that the directory is empty. If it is not empty - an is thrown. - - A directory to search - The message to display if directories are not equal - - - - Asserts that the directory is empty. If it is not empty - an is thrown. - - A directory to search - - - - Asserts that the directory is empty. If it is not empty - an is thrown. - - A directory to search - The message to display if directories are not equal - Arguments to be used in formatting the message - - - - Asserts that the directory is empty. If it is not empty - an is thrown. - - A directory to search - The message to display if directories are not equal - - - - Asserts that the directory is empty. If it is not empty - an is thrown. - - A directory to search - - - - Asserts that the directory is not empty. If it is empty - an is thrown. - - A directory to search - The message to display if directories are not equal - Arguments to be used in formatting the message - - - - Asserts that the directory is not empty. If it is empty - an is thrown. - - A directory to search - The message to display if directories are not equal - - - - Asserts that the directory is not empty. If it is empty - an is thrown. - - A directory to search - - - - Asserts that the directory is not empty. If it is empty - an is thrown. - - A directory to search - The message to display if directories are not equal - Arguments to be used in formatting the message - - - - Asserts that the directory is not empty. If it is empty - an is thrown. - - A directory to search - The message to display if directories are not equal - - - - Asserts that the directory is not empty. If it is empty - an is thrown. - - A directory to search - - - - Asserts that path contains actual as a subdirectory or - an is thrown. - - A directory to search - sub-directory asserted to exist under directory - The message to display if directory is not within the path - Arguments to be used in formatting the message - - - - Asserts that path contains actual as a subdirectory or - an is thrown. - - A directory to search - sub-directory asserted to exist under directory - The message to display if directory is not within the path - - - - Asserts that path contains actual as a subdirectory or - an is thrown. - - A directory to search - sub-directory asserted to exist under directory - - - - Asserts that path contains actual as a subdirectory or - an is thrown. - - A directory to search - sub-directory asserted to exist under directory - The message to display if directory is not within the path - Arguments to be used in formatting the message - - - - Asserts that path contains actual as a subdirectory or - an is thrown. - - A directory to search - sub-directory asserted to exist under directory - The message to display if directory is not within the path - - - - Asserts that path contains actual as a subdirectory or - an is thrown. - - A directory to search - sub-directory asserted to exist under directory - - - - Asserts that path does not contain actual as a subdirectory or - an is thrown. - - A directory to search - sub-directory asserted to exist under directory - The message to display if directory is not within the path - Arguments to be used in formatting the message - - - - Asserts that path does not contain actual as a subdirectory or - an is thrown. - - A directory to search - sub-directory asserted to exist under directory - The message to display if directory is not within the path - - - - Asserts that path does not contain actual as a subdirectory or - an is thrown. - - A directory to search - sub-directory asserted to exist under directory - - - - Asserts that path does not contain actual as a subdirectory or - an is thrown. - - A directory to search - sub-directory asserted to exist under directory - The message to display if directory is not within the path - Arguments to be used in formatting the message - - - - Asserts that path does not contain actual as a subdirectory or - an is thrown. - - A directory to search - sub-directory asserted to exist under directory - The message to display if directory is not within the path - - - - Asserts that path does not contain actual as a subdirectory or - an is thrown. - - A directory to search - sub-directory asserted to exist under directory - - - - Summary description for FileAssert. - - - - - The Equals method throws an AssertionException. This is done - to make sure there is no mistake by calling this function. - - - - - - - override the default ReferenceEquals to throw an AssertionException. This - implementation makes sure there is no mistake in calling this function - as part of Assert. - - - - - - - We don't actually want any instances of this object, but some people - like to inherit from it to add other static methods. Hence, the - protected constructor disallows any instances of this object. - - - - - Verifies that two Streams are equal. Two Streams are considered - equal if both are null, or if both have the same value byte for byte. - If they are not equal an is thrown. - - The expected Stream - The actual Stream - The message to display if Streams are not equal - Arguments to be used in formatting the message - - - - Verifies that two Streams are equal. Two Streams are considered - equal if both are null, or if both have the same value byte for byte. - If they are not equal an is thrown. - - The expected Stream - The actual Stream - The message to display if objects are not equal - - - - Verifies that two Streams are equal. Two Streams are considered - equal if both are null, or if both have the same value byte for byte. - If they are not equal an is thrown. - - The expected Stream - The actual Stream - - - - Verifies that two files are equal. Two files are considered - equal if both are null, or if both have the same value byte for byte. - If they are not equal an is thrown. - - A file containing the value that is expected - A file containing the actual value - The message to display if Streams are not equal - Arguments to be used in formatting the message - - - - Verifies that two files are equal. Two files are considered - equal if both are null, or if both have the same value byte for byte. - If they are not equal an is thrown. - - A file containing the value that is expected - A file containing the actual value - The message to display if objects are not equal - - - - Verifies that two files are equal. Two files are considered - equal if both are null, or if both have the same value byte for byte. - If they are not equal an is thrown. - - A file containing the value that is expected - A file containing the actual value - - - - Verifies that two files are equal. Two files are considered - equal if both are null, or if both have the same value byte for byte. - If they are not equal an is thrown. - - The path to a file containing the value that is expected - The path to a file containing the actual value - The message to display if Streams are not equal - Arguments to be used in formatting the message - - - - Verifies that two files are equal. Two files are considered - equal if both are null, or if both have the same value byte for byte. - If they are not equal an is thrown. - - The path to a file containing the value that is expected - The path to a file containing the actual value - The message to display if objects are not equal - - - - Verifies that two files are equal. Two files are considered - equal if both are null, or if both have the same value byte for byte. - If they are not equal an is thrown. - - The path to a file containing the value that is expected - The path to a file containing the actual value - - - - Asserts that two Streams are not equal. If they are equal - an is thrown. - - The expected Stream - The actual Stream - The message to be displayed when the two Stream are the same. - Arguments to be used in formatting the message - - - - Asserts that two Streams are not equal. If they are equal - an is thrown. - - The expected Stream - The actual Stream - The message to be displayed when the Streams are the same. - - - - Asserts that two Streams are not equal. If they are equal - an is thrown. - - The expected Stream - The actual Stream - - - - Asserts that two files are not equal. If they are equal - an is thrown. - - A file containing the value that is expected - A file containing the actual value - The message to display if Streams are not equal - Arguments to be used in formatting the message - - - - Asserts that two files are not equal. If they are equal - an is thrown. - - A file containing the value that is expected - A file containing the actual value - The message to display if objects are not equal - - - - Asserts that two files are not equal. If they are equal - an is thrown. - - A file containing the value that is expected - A file containing the actual value - - - - Asserts that two files are not equal. If they are equal - an is thrown. - - The path to a file containing the value that is expected - The path to a file containing the actual value - The message to display if Streams are not equal - Arguments to be used in formatting the message - - - - Asserts that two files are not equal. If they are equal - an is thrown. - - The path to a file containing the value that is expected - The path to a file containing the actual value - The message to display if objects are not equal - - - - Asserts that two files are not equal. If they are equal - an is thrown. - - The path to a file containing the value that is expected - The path to a file containing the actual value - - - - GlobalSettings is a place for setting default values used - by the framework in performing asserts. - - - - - Default tolerance for floating point equality - - - - - Helper class with properties and methods that supply - a number of constraints used in Asserts. - - - - - Returns a new PropertyConstraintExpression, which will either - test for the existence of the named property on the object - being tested or apply any following constraint to that property. - - - - - Returns a new AttributeConstraint checking for the - presence of a particular attribute on an object. - - - - - Returns a new AttributeConstraint checking for the - presence of a particular attribute on an object. - - - - - Returns a new CollectionContainsConstraint checking for the - presence of a particular object in the collection. - - - - - Returns a ConstraintExpression that negates any - following constraint. - - - - - Returns a ConstraintExpression, which will apply - the following constraint to all members of a collection, - succeeding if all of them succeed. - - - - - Returns a ConstraintExpression, which will apply - the following constraint to all members of a collection, - succeeding if at least one of them succeeds. - - - - - Returns a ConstraintExpression, which will apply - the following constraint to all members of a collection, - succeeding if all of them fail. - - - - - Returns a new ConstraintExpression, which will apply the following - constraint to the Length property of the object being tested. - - - - - Returns a new ConstraintExpression, which will apply the following - constraint to the Count property of the object being tested. - - - - - Returns a new ConstraintExpression, which will apply the following - constraint to the Message property of the object being tested. - - - - - Returns a new ConstraintExpression, which will apply the following - constraint to the InnerException property of the object being tested. - - - - - Interface implemented by a user fixture in order to - validate any expected exceptions. It is only called - for test methods marked with the ExpectedException - attribute. - - - - - Method to handle an expected exception - - The exception to be handled - - - - Helper class with properties and methods that supply - a number of constraints used in Asserts. - - - - - Returns a constraint that tests two items for equality - - - - - Returns a constraint that tests that two references are the same object - - - - - Returns a constraint that tests whether the - actual value is greater than the suppled argument - - - - - Returns a constraint that tests whether the - actual value is greater than or equal to the suppled argument - - - - - Returns a constraint that tests whether the - actual value is greater than or equal to the suppled argument - - - - - Returns a constraint that tests whether the - actual value is less than the suppled argument - - - - - Returns a constraint that tests whether the - actual value is less than or equal to the suppled argument - - - - - Returns a constraint that tests whether the - actual value is less than or equal to the suppled argument - - - - - Returns a constraint that tests whether the actual - value is of the exact type supplied as an argument. - - - - - Returns a constraint that tests whether the actual - value is of the exact type supplied as an argument. - - - - - Returns a constraint that tests whether the actual value - is of the type supplied as an argument or a derived type. - - - - - Returns a constraint that tests whether the actual value - is of the type supplied as an argument or a derived type. - - - - - Returns a constraint that tests whether the actual value - is of the type supplied as an argument or a derived type. - - - - - Returns a constraint that tests whether the actual value - is of the type supplied as an argument or a derived type. - - - - - Returns a constraint that tests whether the actual value - is assignable from the type supplied as an argument. - - - - - Returns a constraint that tests whether the actual value - is assignable from the type supplied as an argument. - - - - - Returns a constraint that tests whether the actual value - is assignable from the type supplied as an argument. - - - - - Returns a constraint that tests whether the actual value - is assignable from the type supplied as an argument. - - - - - Returns a constraint that tests whether the actual value - is a collection containing the same elements as the - collection supplied as an argument. - - - - - Returns a constraint that tests whether the actual value - is a subset of the collection supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value contains the substring supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value starts with the substring supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value ends with the substring supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value matches the Regex pattern supplied as an argument. - - - - - Returns a constraint that tests whether the path provided - is the same as an expected path after canonicalization. - - - - - Returns a constraint that tests whether the path provided - is the same path or under an expected path after canonicalization. - - - - - Returns a constraint that tests whether the path provided - is the same path or under an expected path after canonicalization. - - - - - Returns a constraint that tests whether the actual value falls - within a specified range. - - - - - Returns a ConstraintExpression that negates any - following constraint. - - - - - Returns a ConstraintExpression, which will apply - the following constraint to all members of a collection, - succeeding if all of them succeed. - - - - - Returns a constraint that tests for null - - - - - Returns a constraint that tests for True - - - - - Returns a constraint that tests for False - - - - - Returns a constraint that tests for NaN - - - - - Returns a constraint that tests for empty - - - - - Returns a constraint that tests whether a collection - contains all unique items. - - - - - Returns a constraint that tests whether an object graph is serializable in binary format. - - - - - Returns a constraint that tests whether an object graph is serializable in xml format. - - - - - Returns a constraint that tests whether a collection is ordered - - - - - The Iz class is a synonym for Is intended for use in VB, - which regards Is as a keyword. - - - - - The List class is a helper class with properties and methods - that supply a number of constraints used with lists and collections. - - - - - List.Map returns a ListMapper, which can be used to map - the original collection to another collection. - - - - - - - ListMapper is used to transform a collection used as an actual argument - producing another collection to be used in the assertion. - - - - - Construct a ListMapper based on a collection - - The collection to be transformed - - - - Produces a collection containing all the values of a property - - The collection of property values - - - - - Randomizer returns a set of random values in a repeatable - way, to allow re-running of tests if necessary. - - - - - Get a randomizer for a particular member, returning - one that has already been created if it exists. - This ensures that the same values are generated - each time the tests are reloaded. - - - - - Get a randomizer for a particular parameter, returning - one that has already been created if it exists. - This ensures that the same values are generated - each time the tests are reloaded. - - - - - Construct a randomizer using a random seed - - - - - Construct a randomizer using a specified seed - - - - - Return an array of random doubles between 0.0 and 1.0. - - - - - - - Return an array of random doubles with values in a specified range. - - - - - Return an array of random ints with values in a specified range. - - - - - Get a random seed for use in creating a randomizer. - - - - - The SpecialValue enum is used to represent TestCase arguments - that cannot be used as arguments to an Attribute. - - - - - Null represents a null value, which cannot be used as an - argument to an attriute under .NET 1.x - - - - - Basic Asserts on strings. - - - - - The Equals method throws an AssertionException. This is done - to make sure there is no mistake by calling this function. - - - - - - - override the default ReferenceEquals to throw an AssertionException. This - implementation makes sure there is no mistake in calling this function - as part of Assert. - - - - - - - Asserts that a string is found within another string. - - The expected string - The string to be examined - The message to display in case of failure - Arguments used in formatting the message - - - - Asserts that a string is found within another string. - - The expected string - The string to be examined - The message to display in case of failure - - - - Asserts that a string is found within another string. - - The expected string - The string to be examined - - - - Asserts that a string is not found within another string. - - The expected string - The string to be examined - The message to display in case of failure - Arguments used in formatting the message - - - - Asserts that a string is found within another string. - - The expected string - The string to be examined - The message to display in case of failure - - - - Asserts that a string is found within another string. - - The expected string - The string to be examined - - - - Asserts that a string starts with another string. - - The expected string - The string to be examined - The message to display in case of failure - Arguments used in formatting the message - - - - Asserts that a string starts with another string. - - The expected string - The string to be examined - The message to display in case of failure - - - - Asserts that a string starts with another string. - - The expected string - The string to be examined - - - - Asserts that a string does not start with another string. - - The expected string - The string to be examined - The message to display in case of failure - Arguments used in formatting the message - - - - Asserts that a string does not start with another string. - - The expected string - The string to be examined - The message to display in case of failure - - - - Asserts that a string does not start with another string. - - The expected string - The string to be examined - - - - Asserts that a string ends with another string. - - The expected string - The string to be examined - The message to display in case of failure - Arguments used in formatting the message - - - - Asserts that a string ends with another string. - - The expected string - The string to be examined - The message to display in case of failure - - - - Asserts that a string ends with another string. - - The expected string - The string to be examined - - - - Asserts that a string does not end with another string. - - The expected string - The string to be examined - The message to display in case of failure - Arguments used in formatting the message - - - - Asserts that a string does not end with another string. - - The expected string - The string to be examined - The message to display in case of failure - - - - Asserts that a string does not end with another string. - - The expected string - The string to be examined - - - - Asserts that two strings are equal, without regard to case. - - The expected string - The actual string - The message to display in case of failure - Arguments used in formatting the message - - - - Asserts that two strings are equal, without regard to case. - - The expected string - The actual string - The message to display in case of failure - - - - Asserts that two strings are equal, without regard to case. - - The expected string - The actual string - - - - Asserts that two strings are not equal, without regard to case. - - The expected string - The actual string - The message to display in case of failure - Arguments used in formatting the message - - - - Asserts that two strings are Notequal, without regard to case. - - The expected string - The actual string - The message to display in case of failure - - - - Asserts that two strings are not equal, without regard to case. - - The expected string - The actual string - - - - Asserts that a string matches an expected regular expression pattern. - - The regex pattern to be matched - The actual string - The message to display in case of failure - Arguments used in formatting the message - - - - Asserts that a string matches an expected regular expression pattern. - - The regex pattern to be matched - The actual string - The message to display in case of failure - - - - Asserts that a string matches an expected regular expression pattern. - - The regex pattern to be matched - The actual string - - - - Asserts that a string does not match an expected regular expression pattern. - - The regex pattern to be used - The actual string - The message to display in case of failure - Arguments used in formatting the message - - - - Asserts that a string does not match an expected regular expression pattern. - - The regex pattern to be used - The actual string - The message to display in case of failure - - - - Asserts that a string does not match an expected regular expression pattern. - - The regex pattern to be used - The actual string - - - - The TestCaseData class represents a set of arguments - and other parameter info to be used for a parameterized - test case. It provides a number of instance modifiers - for use in initializing the test case. - - Note: Instance modifiers are getters that return - the same instance after modifying it's state. - - - - - The argument list to be provided to the test - - - - - The expected result to be returned - - - - - The expected exception Type - - - - - The FullName of the expected exception - - - - - The name to be used for the test - - - - - The description of the test - - - - - A dictionary of properties, used to add information - to tests without requiring the class to change. - - - - - If true, indicates that the test case is to be ignored - - - - - The reason for ignoring a test case - - - - - Initializes a new instance of the class. - - The arguments. - - - - Initializes a new instance of the class. - - The argument. - - - - Initializes a new instance of the class. - - The first argument. - The second argument. - - - - Initializes a new instance of the class. - - The first argument. - The second argument. - The third argument. - - - - Sets the expected result for the test - - The expected result - A modified TestCaseData - - - - Sets the expected exception type for the test - - Type of the expected exception. - The modified TestCaseData instance - - - - Sets the expected exception type for the test - - FullName of the expected exception. - The modified TestCaseData instance - - - - Sets the name of the test case - - The modified TestCaseData instance - - - - Sets the description for the test case - being constructed. - - The description. - The modified TestCaseData instance. - - - - Applies a category to the test - - - - - - - Applies a named property to the test - - - - - - - - Applies a named property to the test - - - - - - - - Applies a named property to the test - - - - - - - - Ignores this TestCase. - - - - - - Ignores this TestCase, specifying the reason. - - The reason. - - - - - Gets the argument list to be provided to the test - - - - - Gets the expected result - - - - - Gets the expected exception Type - - - - - Gets the FullName of the expected exception - - - - - Gets the name to be used for the test - - - - - Gets the description of the test - - - - - Gets a value indicating whether this is ignored. - - true if ignored; otherwise, false. - - - - Gets the ignore reason. - - The ignore reason. - - - - Gets a list of categories associated with this test. - - - - - Gets the property dictionary for this test - - - - - Provide the context information of the current test - - - - - Constructs a TestContext using the provided context dictionary - - A context dictionary - - - - Get the current test context. This is created - as needed. The user may save the context for - use within a test, but it should not be used - outside the test for which it is created. - - - - - Gets a TestAdapter representing the currently executing test in this context. - - - - - Gets a ResultAdapter representing the current result for the test - executing in this context. - - - - - Gets the current directory for this TestContext - - - - - TestAdapter adapts a Test for consumption by - the user test code. - - - - - Constructs a TestAdapter for this context - - The context dictionary - - - - The name of the test. - - - - - The FullName of the test - - - - - The properties of the test. - - - - - ResultAdapter adapts a TestResult for consumption by - the user test code. - - - - - Construct a ResultAdapter for a context - - The context holding the result - - - - The TestState of current test. This maps to the ResultState - used in nunit.core and is subject to change in the future. - - - - - The TestStatus of current test. This enum will be used - in future versions of NUnit and so is to be preferred - to the TestState value. - - - - - The ResultState enum indicates the result of running a test - - - - - The result is inconclusive - - - - - The test was not runnable. - - - - - The test has been skipped. - - - - - The test has been ignored. - - - - - The test succeeded - - - - - The test failed - - - - - The test encountered an unexpected exception - - - - - The test was cancelled by the user - - - - - The TestStatus enum indicates the result of running a test - - - - - The test was inconclusive - - - - - The test has skipped - - - - - The test succeeded - - - - - The test failed - - - - - Helper class with static methods used to supply constraints - that operate on strings. - - - - - Returns a constraint that succeeds if the actual - value contains the substring supplied as an argument. - - - - - Returns a constraint that fails if the actual - value contains the substring supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value starts with the substring supplied as an argument. - - - - - Returns a constraint that fails if the actual - value starts with the substring supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value ends with the substring supplied as an argument. - - - - - Returns a constraint that fails if the actual - value ends with the substring supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value matches the Regex pattern supplied as an argument. - - - - - Returns a constraint that fails if the actual - value matches the pattern supplied as an argument. - - - - - Returns a ConstraintExpression, which will apply - the following constraint to all members of a collection, - succeeding if all of them succeed. - - - - - TextMessageWriter writes constraint descriptions and messages - in displayable form as a text stream. It tailors the display - of individual message components to form the standard message - format of NUnit assertion failure messages. - - - - - Prefix used for the expected value line of a message - - - - - Prefix used for the actual value line of a message - - - - - Length of a message prefix - - - - - Construct a TextMessageWriter - - - - - Construct a TextMessageWriter, specifying a user message - and optional formatting arguments. - - - - - - - Method to write single line message with optional args, usually - written to precede the general failure message, at a givel - indentation level. - - The indentation level of the message - The message to be written - Any arguments used in formatting the message - - - - Display Expected and Actual lines for a constraint. This - is called by MessageWriter's default implementation of - WriteMessageTo and provides the generic two-line display. - - The constraint that failed - - - - Display Expected and Actual lines for given values. This - method may be called by constraints that need more control over - the display of actual and expected values than is provided - by the default implementation. - - The expected value - The actual value causing the failure - - - - Display Expected and Actual lines for given values, including - a tolerance value on the expected line. - - The expected value - The actual value causing the failure - The tolerance within which the test was made - - - - Display the expected and actual string values on separate lines. - If the mismatch parameter is >=0, an additional line is displayed - line containing a caret that points to the mismatch point. - - The expected string value - The actual string value - The point at which the strings don't match or -1 - If true, case is ignored in string comparisons - If true, clip the strings to fit the max line length - - - - Writes the text for a connector. - - The connector. - - - - Writes the text for a predicate. - - The predicate. - - - - Write the text for a modifier. - - The modifier. - - - - Writes the text for an expected value. - - The expected value. - - - - Writes the text for an actual value. - - The actual value. - - - - Writes the text for a generalized value. - - The value. - - - - Writes the text for a collection value, - starting at a particular point, to a max length - - The collection containing elements to write. - The starting point of the elements to write - The maximum number of elements to write - - - - Write the generic 'Expected' line for a constraint - - The constraint that failed - - - - Write the generic 'Expected' line for a given value - - The expected value - - - - Write the generic 'Expected' line for a given value - and tolerance. - - The expected value - The tolerance within which the test was made - - - - Write the generic 'Actual' line for a constraint - - The constraint for which the actual value is to be written - - - - Write the generic 'Actual' line for a given value - - The actual value causing a failure - - - - Gets or sets the maximum line length for this writer - - - - - Helper class with properties and methods that supply - constraints that operate on exceptions. - - - - - Creates a constraint specifying the exact type of exception expected - - - - - Creates a constraint specifying the exact type of exception expected - - - - - Creates a constraint specifying the type of exception expected - - - - - Creates a constraint specifying the type of exception expected - - - - - Creates a constraint specifying an expected exception - - - - - Creates a constraint specifying an exception with a given InnerException - - - - - Creates a constraint specifying an expected TargetInvocationException - - - - - Creates a constraint specifying an expected TargetInvocationException - - - - - Creates a constraint specifying an expected TargetInvocationException - - - - - Creates a constraint specifying that no exception is thrown - - - - diff --git a/lib/NUnit/lib/nunit.mocks.dll b/lib/NUnit/lib/nunit.mocks.dll deleted file mode 100644 index 6ee2c1c..0000000 Binary files a/lib/NUnit/lib/nunit.mocks.dll and /dev/null differ diff --git a/lib/NUnit/lib/pnunit.framework.dll b/lib/NUnit/lib/pnunit.framework.dll deleted file mode 100644 index 6c105d7..0000000 Binary files a/lib/NUnit/lib/pnunit.framework.dll and /dev/null differ diff --git a/lib/NUnit/license.txt b/lib/NUnit/license.txt deleted file mode 100644 index ab91df4..0000000 --- a/lib/NUnit/license.txt +++ /dev/null @@ -1,15 +0,0 @@ -Copyright � 2002-2008 Charlie Poole -Copyright � 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov -Copyright � 2000-2002 Philip A. Craig - -This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment (see the following) in the product documentation is required. - -Portions Copyright � 2002-2008 Charlie Poole or Copyright � 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov or Copyright � 2000-2002 Philip A. Craig - -2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. - -3. This notice may not be removed or altered from any source distribution. diff --git a/lib/NUnit/tools/NUnitTests.VisualState.xml b/lib/NUnit/tools/NUnitTests.VisualState.xml deleted file mode 100644 index 603cda7..0000000 --- a/lib/NUnit/tools/NUnitTests.VisualState.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - [0-1000]D:\Dev\NUnit\nunit-2.5\work\build\net\2.0\release\NUnitTests.nunit - [0-1000]D:\Dev\NUnit\nunit-2.5\work\build\net\2.0\release\NUnitTests.nunit - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/lib/NUnit/tools/NUnitTests.config b/lib/NUnit/tools/NUnitTests.config deleted file mode 100644 index 9487c07..0000000 --- a/lib/NUnit/tools/NUnitTests.config +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/NUnit/tools/NUnitTests.nunit b/lib/NUnit/tools/NUnitTests.nunit deleted file mode 100644 index bb80dd6..0000000 --- a/lib/NUnit/tools/NUnitTests.nunit +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/lib/NUnit/tools/TestResult.xml b/lib/NUnit/tools/TestResult.xml deleted file mode 100644 index 058d42b..0000000 --- a/lib/NUnit/tools/TestResult.xml +++ /dev/null @@ -1,5971 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/lib/NUnit/tools/agent.conf b/lib/NUnit/tools/agent.conf deleted file mode 100644 index b4cf550..0000000 --- a/lib/NUnit/tools/agent.conf +++ /dev/null @@ -1,4 +0,0 @@ - - 8080 - . - \ No newline at end of file diff --git a/lib/NUnit/tools/agent.log.conf b/lib/NUnit/tools/agent.log.conf deleted file mode 100644 index d340cad..0000000 --- a/lib/NUnit/tools/agent.log.conf +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/lib/NUnit/tools/launcher.log.conf b/lib/NUnit/tools/launcher.log.conf deleted file mode 100644 index d340cad..0000000 --- a/lib/NUnit/tools/launcher.log.conf +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/lib/NUnit/tools/lib/Failure.png b/lib/NUnit/tools/lib/Failure.png deleted file mode 100644 index 2e400b2..0000000 Binary files a/lib/NUnit/tools/lib/Failure.png and /dev/null differ diff --git a/lib/NUnit/tools/lib/Ignored.png b/lib/NUnit/tools/lib/Ignored.png deleted file mode 100644 index 478efbf..0000000 Binary files a/lib/NUnit/tools/lib/Ignored.png and /dev/null differ diff --git a/lib/NUnit/tools/lib/Inconclusive.png b/lib/NUnit/tools/lib/Inconclusive.png deleted file mode 100644 index 4807b7c..0000000 Binary files a/lib/NUnit/tools/lib/Inconclusive.png and /dev/null differ diff --git a/lib/NUnit/tools/lib/Skipped.png b/lib/NUnit/tools/lib/Skipped.png deleted file mode 100644 index 7c9fc64..0000000 Binary files a/lib/NUnit/tools/lib/Skipped.png and /dev/null differ diff --git a/lib/NUnit/tools/lib/Success.png b/lib/NUnit/tools/lib/Success.png deleted file mode 100644 index 2a30150..0000000 Binary files a/lib/NUnit/tools/lib/Success.png and /dev/null differ diff --git a/lib/NUnit/tools/lib/fit.dll b/lib/NUnit/tools/lib/fit.dll deleted file mode 100644 index 40bbef0..0000000 Binary files a/lib/NUnit/tools/lib/fit.dll and /dev/null differ diff --git a/lib/NUnit/tools/lib/log4net.dll b/lib/NUnit/tools/lib/log4net.dll deleted file mode 100644 index 20a2e1c..0000000 Binary files a/lib/NUnit/tools/lib/log4net.dll and /dev/null differ diff --git a/lib/NUnit/tools/lib/nunit-console-runner.dll b/lib/NUnit/tools/lib/nunit-console-runner.dll deleted file mode 100644 index 1709ce7..0000000 Binary files a/lib/NUnit/tools/lib/nunit-console-runner.dll and /dev/null differ diff --git a/lib/NUnit/tools/lib/nunit-gui-runner.dll b/lib/NUnit/tools/lib/nunit-gui-runner.dll deleted file mode 100644 index 35efa73..0000000 Binary files a/lib/NUnit/tools/lib/nunit-gui-runner.dll and /dev/null differ diff --git a/lib/NUnit/tools/lib/nunit.core.dll b/lib/NUnit/tools/lib/nunit.core.dll deleted file mode 100644 index a1dd698..0000000 Binary files a/lib/NUnit/tools/lib/nunit.core.dll and /dev/null differ diff --git a/lib/NUnit/tools/lib/nunit.core.interfaces.dll b/lib/NUnit/tools/lib/nunit.core.interfaces.dll deleted file mode 100644 index 0ac8788..0000000 Binary files a/lib/NUnit/tools/lib/nunit.core.interfaces.dll and /dev/null differ diff --git a/lib/NUnit/tools/lib/nunit.fixtures.dll b/lib/NUnit/tools/lib/nunit.fixtures.dll deleted file mode 100644 index 8fd1932..0000000 Binary files a/lib/NUnit/tools/lib/nunit.fixtures.dll and /dev/null differ diff --git a/lib/NUnit/tools/lib/nunit.uiexception.dll b/lib/NUnit/tools/lib/nunit.uiexception.dll deleted file mode 100644 index 610c170..0000000 Binary files a/lib/NUnit/tools/lib/nunit.uiexception.dll and /dev/null differ diff --git a/lib/NUnit/tools/lib/nunit.uikit.dll b/lib/NUnit/tools/lib/nunit.uikit.dll deleted file mode 100644 index 9087db2..0000000 Binary files a/lib/NUnit/tools/lib/nunit.uikit.dll and /dev/null differ diff --git a/lib/NUnit/tools/lib/nunit.util.dll b/lib/NUnit/tools/lib/nunit.util.dll deleted file mode 100644 index 0b315c2..0000000 Binary files a/lib/NUnit/tools/lib/nunit.util.dll and /dev/null differ diff --git a/lib/NUnit/tools/nunit-agent-x86.exe b/lib/NUnit/tools/nunit-agent-x86.exe deleted file mode 100644 index ebcee1b..0000000 Binary files a/lib/NUnit/tools/nunit-agent-x86.exe and /dev/null differ diff --git a/lib/NUnit/tools/nunit-agent-x86.exe.config b/lib/NUnit/tools/nunit-agent-x86.exe.config deleted file mode 100644 index 84c2906..0000000 --- a/lib/NUnit/tools/nunit-agent-x86.exe.config +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/lib/NUnit/tools/nunit-agent.exe b/lib/NUnit/tools/nunit-agent.exe deleted file mode 100644 index ec41f32..0000000 Binary files a/lib/NUnit/tools/nunit-agent.exe and /dev/null differ diff --git a/lib/NUnit/tools/nunit-agent.exe.config b/lib/NUnit/tools/nunit-agent.exe.config deleted file mode 100644 index 84c2906..0000000 --- a/lib/NUnit/tools/nunit-agent.exe.config +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/lib/NUnit/tools/nunit-console-x86.exe b/lib/NUnit/tools/nunit-console-x86.exe deleted file mode 100644 index e08ac9c..0000000 Binary files a/lib/NUnit/tools/nunit-console-x86.exe and /dev/null differ diff --git a/lib/NUnit/tools/nunit-console-x86.exe.config b/lib/NUnit/tools/nunit-console-x86.exe.config deleted file mode 100644 index ce92b5b..0000000 --- a/lib/NUnit/tools/nunit-console-x86.exe.config +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/lib/NUnit/tools/nunit-console.exe b/lib/NUnit/tools/nunit-console.exe deleted file mode 100644 index 1544a9d..0000000 Binary files a/lib/NUnit/tools/nunit-console.exe and /dev/null differ diff --git a/lib/NUnit/tools/nunit-x86.exe b/lib/NUnit/tools/nunit-x86.exe deleted file mode 100644 index fd342c0..0000000 Binary files a/lib/NUnit/tools/nunit-x86.exe and /dev/null differ diff --git a/lib/NUnit/tools/nunit-x86.exe.config b/lib/NUnit/tools/nunit-x86.exe.config deleted file mode 100644 index 6c0320e..0000000 --- a/lib/NUnit/tools/nunit-x86.exe.config +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/lib/NUnit/tools/nunit.exe b/lib/NUnit/tools/nunit.exe deleted file mode 100644 index ad8b08a..0000000 Binary files a/lib/NUnit/tools/nunit.exe and /dev/null differ diff --git a/lib/NUnit/tools/nunit.exe.config b/lib/NUnit/tools/nunit.exe.config deleted file mode 100644 index 6c0320e..0000000 --- a/lib/NUnit/tools/nunit.exe.config +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/lib/NUnit/tools/nunit.framework.dll b/lib/NUnit/tools/nunit.framework.dll deleted file mode 100644 index 6856e51..0000000 Binary files a/lib/NUnit/tools/nunit.framework.dll and /dev/null differ diff --git a/lib/NUnit/tools/pnunit-agent.exe b/lib/NUnit/tools/pnunit-agent.exe deleted file mode 100644 index 7a555e1..0000000 Binary files a/lib/NUnit/tools/pnunit-agent.exe and /dev/null differ diff --git a/lib/NUnit/tools/pnunit-agent.exe.config b/lib/NUnit/tools/pnunit-agent.exe.config deleted file mode 100644 index 5ed5f7b..0000000 --- a/lib/NUnit/tools/pnunit-agent.exe.config +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/lib/NUnit/tools/pnunit-launcher.exe b/lib/NUnit/tools/pnunit-launcher.exe deleted file mode 100644 index c70e58e..0000000 Binary files a/lib/NUnit/tools/pnunit-launcher.exe and /dev/null differ diff --git a/lib/NUnit/tools/pnunit-launcher.exe.config b/lib/NUnit/tools/pnunit-launcher.exe.config deleted file mode 100644 index 5ed5f7b..0000000 --- a/lib/NUnit/tools/pnunit-launcher.exe.config +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/lib/NUnit/tools/pnunit.framework.dll b/lib/NUnit/tools/pnunit.framework.dll deleted file mode 100644 index 6c105d7..0000000 Binary files a/lib/NUnit/tools/pnunit.framework.dll and /dev/null differ diff --git a/lib/NUnit/tools/pnunit.tests.dll b/lib/NUnit/tools/pnunit.tests.dll deleted file mode 100644 index dce018a..0000000 Binary files a/lib/NUnit/tools/pnunit.tests.dll and /dev/null differ diff --git a/lib/NUnit/tools/runFile.exe b/lib/NUnit/tools/runFile.exe deleted file mode 100644 index a794458..0000000 Binary files a/lib/NUnit/tools/runFile.exe and /dev/null differ diff --git a/lib/NUnit/tools/runFile.exe.config b/lib/NUnit/tools/runFile.exe.config deleted file mode 100644 index 35909b4..0000000 --- a/lib/NUnit/tools/runFile.exe.config +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/NUnit/tools/runpnunit.bat b/lib/NUnit/tools/runpnunit.bat deleted file mode 100644 index 6efc8b4..0000000 --- a/lib/NUnit/tools/runpnunit.bat +++ /dev/null @@ -1,2 +0,0 @@ -start pnunit-agent agent.conf -pnunit-launcher test.conf \ No newline at end of file diff --git a/lib/NUnit/tools/test.conf b/lib/NUnit/tools/test.conf deleted file mode 100644 index a35e718..0000000 --- a/lib/NUnit/tools/test.conf +++ /dev/null @@ -1,24 +0,0 @@ - - - - - Testing - - - Testing - pnunit.tests.dll - TestLibraries.Testing.EqualTo19 - localhost:8080 - - ..\server - - - - - - - - - - - \ No newline at end of file diff --git a/lib/NuGet.exe b/lib/NuGet.exe deleted file mode 100644 index 8dd7e45..0000000 Binary files a/lib/NuGet.exe and /dev/null differ diff --git a/lib/StampVersion.License.txt b/lib/StampVersion.License.txt deleted file mode 100644 index 75b5248..0000000 --- a/lib/StampVersion.License.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/lib/StampVersion.exe b/lib/StampVersion.exe deleted file mode 100644 index 7017c9f..0000000 Binary files a/lib/StampVersion.exe and /dev/null differ diff --git a/lib/StatLight/StatLight.nupkg b/lib/StatLight/StatLight.nupkg deleted file mode 100644 index dc6b468..0000000 Binary files a/lib/StatLight/StatLight.nupkg and /dev/null differ diff --git a/lib/StatLight/tools/Ionic.Zip.Reduced.dll b/lib/StatLight/tools/Ionic.Zip.Reduced.dll deleted file mode 100644 index da07436..0000000 Binary files a/lib/StatLight/tools/Ionic.Zip.Reduced.dll and /dev/null differ diff --git a/lib/StatLight/tools/Microsoft.Silverlight.Testing.License.txt b/lib/StatLight/tools/Microsoft.Silverlight.Testing.License.txt deleted file mode 100644 index 46f9f58..0000000 --- a/lib/StatLight/tools/Microsoft.Silverlight.Testing.License.txt +++ /dev/null @@ -1,11 +0,0 @@ -MSDN CODE GALLERY BINARY LICENSE - -You are free to install, use, copy and distribute any number of copies of the software, in object code form, provided that you retain: - -• all copyright, patent, trademark, and attribution notices that are present in the software, -• this list of conditions, and -• the following disclaimer in the documentation and/or other materials provided with the software. - -The software is licensed “as-is.” You bear the risk of using it. No express warranties, guarantees or conditions are provided. To the extent permitted under your local laws, the implied warranties of merchantability, fitness for a particular purpose and non-infringement are excluded. - -This license does not grant you any rights to use any other party’s name, logo, or trademarks. All rights not specifically granted herein are reserved. \ No newline at end of file diff --git a/lib/StatLight/tools/StatLight.Client.For.April2010.xap b/lib/StatLight/tools/StatLight.Client.For.April2010.xap deleted file mode 100644 index 7534d41..0000000 Binary files a/lib/StatLight/tools/StatLight.Client.For.April2010.xap and /dev/null differ diff --git a/lib/StatLight/tools/StatLight.Client.For.Feb2011.xap b/lib/StatLight/tools/StatLight.Client.For.Feb2011.xap deleted file mode 100644 index 57b71b2..0000000 Binary files a/lib/StatLight/tools/StatLight.Client.For.Feb2011.xap and /dev/null differ diff --git a/lib/StatLight/tools/StatLight.Client.For.July2009.xap b/lib/StatLight/tools/StatLight.Client.For.July2009.xap deleted file mode 100644 index 63a37b5..0000000 Binary files a/lib/StatLight/tools/StatLight.Client.For.July2009.xap and /dev/null differ diff --git a/lib/StatLight/tools/StatLight.Client.For.June2011.xap b/lib/StatLight/tools/StatLight.Client.For.June2011.xap deleted file mode 100644 index 4330a09..0000000 Binary files a/lib/StatLight/tools/StatLight.Client.For.June2011.xap and /dev/null differ diff --git a/lib/StatLight/tools/StatLight.Client.For.March2010.xap b/lib/StatLight/tools/StatLight.Client.For.March2010.xap deleted file mode 100644 index 7314cb5..0000000 Binary files a/lib/StatLight/tools/StatLight.Client.For.March2010.xap and /dev/null differ diff --git a/lib/StatLight/tools/StatLight.Client.For.May2010.xap b/lib/StatLight/tools/StatLight.Client.For.May2010.xap deleted file mode 100644 index 01ba00b..0000000 Binary files a/lib/StatLight/tools/StatLight.Client.For.May2010.xap and /dev/null differ diff --git a/lib/StatLight/tools/StatLight.Client.For.November2009.xap b/lib/StatLight/tools/StatLight.Client.For.November2009.xap deleted file mode 100644 index e9f4a72..0000000 Binary files a/lib/StatLight/tools/StatLight.Client.For.November2009.xap and /dev/null differ diff --git a/lib/StatLight/tools/StatLight.Client.For.October2009.xap b/lib/StatLight/tools/StatLight.Client.For.October2009.xap deleted file mode 100644 index 5b089c5..0000000 Binary files a/lib/StatLight/tools/StatLight.Client.For.October2009.xap and /dev/null differ diff --git a/lib/StatLight/tools/StatLight.Client.For.UnitDrivenDecember2009.xap b/lib/StatLight/tools/StatLight.Client.For.UnitDrivenDecember2009.xap deleted file mode 100644 index 09a12f9..0000000 Binary files a/lib/StatLight/tools/StatLight.Client.For.UnitDrivenDecember2009.xap and /dev/null differ diff --git a/lib/StatLight/tools/StatLight.Client.For.XUnitContribApril2011.xap b/lib/StatLight/tools/StatLight.Client.For.XUnitContribApril2011.xap deleted file mode 100644 index 51fd64f..0000000 Binary files a/lib/StatLight/tools/StatLight.Client.For.XUnitContribApril2011.xap and /dev/null differ diff --git a/lib/StatLight/tools/StatLight.Core.dll b/lib/StatLight/tools/StatLight.Core.dll deleted file mode 100644 index bf019b8..0000000 Binary files a/lib/StatLight/tools/StatLight.Core.dll and /dev/null differ diff --git a/lib/StatLight/tools/StatLight.EULA.txt b/lib/StatLight/tools/StatLight.EULA.txt deleted file mode 100644 index fa08128..0000000 --- a/lib/StatLight/tools/StatLight.EULA.txt +++ /dev/null @@ -1,3 +0,0 @@ -See: - -http://statlight.codeplex.com/license \ No newline at end of file diff --git a/lib/StatLight/tools/StatLight.exe b/lib/StatLight/tools/StatLight.exe deleted file mode 100644 index 1f383a3..0000000 Binary files a/lib/StatLight/tools/StatLight.exe and /dev/null differ diff --git a/lib/protoc-license.txt b/lib/protoc-license.txt deleted file mode 100644 index c779cb0..0000000 --- a/lib/protoc-license.txt +++ /dev/null @@ -1,36 +0,0 @@ -protoc.exe was built from the original source at http://code.google.com/p/protobuf/ -The licence for this code is as follows: - -Copyright 2008, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -Code generated by the Protocol Buffer compiler is owned by the owner -of the input file used when generating it. This code is not -standalone and requires a support library to be linked with it. This -support library is itself covered by the above license. \ No newline at end of file diff --git a/lib/protoc.exe b/lib/protoc.exe deleted file mode 100644 index 2d8d4a5..0000000 Binary files a/lib/protoc.exe and /dev/null differ diff --git a/license.txt b/license.txt deleted file mode 100644 index 2715f7b..0000000 --- a/license.txt +++ /dev/null @@ -1,31 +0,0 @@ -Protocol Buffers - Google's data interchange format -Copyright 2008-2010 Google Inc. All rights reserved. -http://github.com/jskeet/dotnet-protobufs/ -Original C++/Java/Python code: -http://code.google.com/p/protobuf/ - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/mono/buildall.sh b/mono/buildall.sh deleted file mode 100755 index bdd0490..0000000 --- a/mono/buildall.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -# Adjust these to reflect the location of NUnit in your system, -# and how you want NUnit to run -NUNIT=~/protobuf/NUnit-2.5.0.9122/bin/net-2.0/nunit-console.exe -NUNIT_OPTIONS=-noshadow - -# The rest should be okay. - -SRC=../src -LIB=../lib -KEYFILE=../keys/Google.ProtocolBuffers.snk - -rm -rf bin -mkdir bin - -# Running the unit tests requires the dependencies are -# in the bin directory too -cp -f $LIB/{Rhino.Mocks.dll,nunit.framework.dll} bin - -echo Building main library -gmcs -target:library -out:bin/Google.ProtocolBuffers.dll `find $SRC/ProtocolBuffers -name '*.cs'` -keyfile:$KEYFILE - -echo Building main library tests -gmcs -target:library -out:bin/Google.ProtocolBuffers.Test.dll `find $SRC/ProtocolBuffers.Test -name '*.cs'` -keyfile:$KEYFILE -r:bin/Google.ProtocolBuffers.dll -r:$LIB/nunit.framework.dll -r:$LIB/Rhino.Mocks.dll - -echo Running main library tests -mono $NUNIT bin/Google.ProtocolBuffers.Test.dll $NUNIT_OPTIONS - -echo Building ProtoGen -gmcs -target:exe -out:bin/ProtoGen.exe `find $SRC/ProtoGen -name '*.cs'` -keyfile:$KEYFILE -r:bin/Google.ProtocolBuffers.dll - -echo Building ProtoGen tests -gmcs -target:library -out:bin/Google.ProtocolBuffers.ProtoGen.Test.dll `find $SRC/ProtoGen.Test -name '*.cs'` -keyfile:$KEYFILE -r:bin/Google.ProtocolBuffers.dll -r:$LIB/nunit.framework.dll -r:bin/ProtoGen.exe - -echo Running ProtoGen tests -mono $NUNIT bin/Google.ProtocolBuffers.ProtoGen.Test.dll $NUNIT_OPTIONS diff --git a/mono/generatesource.sh b/mono/generatesource.sh deleted file mode 100755 index 218449e..0000000 --- a/mono/generatesource.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -echo Compiling protobufs -rm -rf tmp -mkdir tmp -PROTOS_DIR=../protos - -./protoc --proto_path=$PROTOS_DIR --descriptor_set_out=tmp/compiled.pb \ - $PROTOS_DIR/google/protobuf/descriptor.proto \ - $PROTOS_DIR/google/protobuf/csharp_options.proto \ - $PROTOS_DIR/google/protobuf/unittest.proto \ - $PROTOS_DIR/google/protobuf/unittest_csharp_options.proto \ - $PROTOS_DIR/google/protobuf/unittest_custom_options.proto \ - $PROTOS_DIR/google/protobuf/unittest_embed_optimize_for.proto \ - $PROTOS_DIR/google/protobuf/unittest_import.proto \ - $PROTOS_DIR/google/protobuf/unittest_mset.proto \ - $PROTOS_DIR/google/protobuf/unittest_optimize_for.proto \ - $PROTOS_DIR/tutorial/addressbook.proto - -cd tmp -echo Generating new source -mono ../bin/ProtoGen.exe compiled.pb - -echo Copying source into place -cp DescriptorProtoFile.cs CSharpOptions.cs ../../src/ProtocolBuffers/DescriptorProtos -cp UnitTest*.cs ../../src/ProtocolBuffers.Test/TestProtos -cp AddressBookProtos.cs ../../src/AddressBook -cd .. -rm -rf tmp diff --git a/mono/readme.txt b/mono/readme.txt deleted file mode 100644 index ad873a5..0000000 --- a/mono/readme.txt +++ /dev/null @@ -1,91 +0,0 @@ -Getting started with Protocol Buffers on Mono ---------------------------------------------- - -Prerequisites: - -o Mono 2.4 or higher. Earlier versions of Mono had too - many issues with the weird and wonderful generic type - relationships in Protocol Buffers. (Even Mono 2.4 *did* - have a few compile-time problems, but I've worked round them.) - -o Some sort of Linux/Unix system - You can try running with Bash on Windows via MINGW32 or - something similar, but you're on your own :) It's easier - to build and test everything with .NET if you're on - Windows. - -o The native Protocol Buffers build for your system. - Get it from http://code.google.com/p/protobuf/ - After building it, copy the executable protoc - file into this directory. - -o The NUnit binaries from http://nunit.org - I generally just download the latest version, which - may not be the one which goes with nunit.framework.dll - in ../lib, but I've never found this to be a problem. - -Building the code with current sources --------------------------------------- - -1) Edit buildall.sh to tell it where to find nunit-console.exe - (and possibly change other options) - -2) Run buildall.sh from this directory. It should build the - main library code + tests and ProtoGen code + tests, running - each set of tests after building it. - -Note that currently one test is ignored in ServiceTest.cs. This -made the Mono VM blow up - I suspect it's some interaction with -Rhino which doesn't quite work on Mono 2.4. If you want to see a -truly nasty stack trace, just comment out the Ignore attribute in -ServiceTest.cs and rerun. - -The binaries will be produced in a bin directory under this one. The -build currently starts from scratch each time, cleaning out the bin -directory first. Once I've decided on a full NAnt or xbuild -strategy, I'll do something a little cleaner. - -Rebuilding sources for generated code -------------------------------------- - -1) Build the current code first. The bootstrapping issue is why - the generated source code is in the source repository :) See - the steps above. - -2) Run generatesource.sh from this directory. This will create a - temporary directory, compile the .proto files into a binary - format, then run ProtoGen to generate .cs files from the binary - format. It will copy these files to the right places in the tree, - and finally delete the temporary directory. - -3) Rebuild to test that your newly generated sources work. (Optionally - regenerate as well, and hash the generated files to check that - the new build generates the same code as the old build :) - -Running the code ----------------- - -Once you've built the binaries, you should be able to use them just -as if you'd built them with .NET. (And indeed, you should be able to -use binaries built with .NET as if you'd built them with Mono :) - -See the getting started guide for more information: -http://code.google.com/p/protobuf-csharp-port/wiki/GettingStarted - -FAQ (Frequently Anticipated Questions) --------------------------------------- - -Q) This build process sucks! Why aren't you doing X, Y, Z? -A) My Mono skills are limited. My NAnt skills are limited. My - MSBuild/xbuild skils are limited. My shell script skills are - limited. Any help is *very* welcome! - -Q) Why doesn't it build ProtoBench etc? -A) This is a first initial "release" I'll add more bits to - the build script. I'll be interested to see the results - of benchmarking it on Mono :) - -Any further questions or suggestions? Please email skeet@pobox.com -or leave a request at -http://code.google.com/p/protobuf-csharp-port/issues/list - diff --git a/protos/benchmarks/google_size.proto b/protos/benchmarks/google_size.proto deleted file mode 100644 index 1442ca2..0000000 --- a/protos/benchmarks/google_size.proto +++ /dev/null @@ -1,140 +0,0 @@ -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.ProtoBench"; -option (google.protobuf.csharp_file_options).umbrella_classname = "GoogleSizeProtoFile"; - -package benchmarks; - -option java_outer_classname = "GoogleSize"; -option optimize_for = CODE_SIZE; - -message SizeMessage1 { - required string field1 = 1; - optional string field9 = 9; - optional string field18 = 18; - optional bool field80 = 80 [default=false]; - optional bool field81 = 81 [default=true]; - required int32 field2 = 2; - required int32 field3 = 3; - optional int32 field280 = 280; - optional int32 field6 = 6 [default=0]; - optional int64 field22 = 22; - optional string field4 = 4; - repeated fixed64 field5 = 5; - optional bool field59 = 59 [default=false]; - optional string field7 = 7; - optional int32 field16 = 16; - optional int32 field130 = 130 [default=0]; - optional bool field12 = 12 [default=true]; - optional bool field17 = 17 [default=true]; - optional bool field13 = 13 [default=true]; - optional bool field14 = 14 [default=true]; - optional int32 field104 = 104 [default=0]; - optional int32 field100 = 100 [default=0]; - optional int32 field101 = 101 [default=0]; - optional string field102 = 102; - optional string field103 = 103; - optional int32 field29 = 29 [default=0]; - optional bool field30 = 30 [default=false]; - optional int32 field60 = 60 [default=-1]; - optional int32 field271 = 271 [default=-1]; - optional int32 field272 = 272 [default=-1]; - optional int32 field150 = 150; - optional int32 field23 = 23 [default=0]; - optional bool field24 = 24 [default=false]; - optional int32 field25 = 25 [default=0]; - optional SizeMessage1SubMessage field15 = 15; - optional bool field78 = 78; - optional int32 field67 = 67 [default=0]; - optional int32 field68 = 68; - optional int32 field128 = 128 [default=0]; - optional string field129 = 129 [default="xxxxxxxxxxxxxxxxxxxxx"]; - optional int32 field131 = 131 [default=0]; -} - -message SizeMessage1SubMessage { - optional int32 field1 = 1 [default=0]; - optional int32 field2 = 2 [default=0]; - optional int32 field3 = 3 [default=0]; - optional string field15 = 15; - optional bool field12 = 12 [default=true]; - optional int64 field13 = 13; - optional int64 field14 = 14; - optional int32 field16 = 16; - optional int32 field19 = 19 [default=2]; - optional bool field20 = 20 [default=true]; - optional bool field28 = 28 [default=true]; - optional fixed64 field21 = 21; - optional int32 field22 = 22; - optional bool field23 = 23 [ default=false ]; - optional bool field206 = 206 [default=false]; - optional fixed32 field203 = 203; - optional int32 field204 = 204; - optional string field205 = 205; - optional uint64 field207 = 207; - optional uint64 field300 = 300; -} - -message SizeMessage2 { - optional string field1 = 1; - optional int64 field3 = 3; - optional int64 field4 = 4; - optional int64 field30 = 30; - optional bool field75 = 75 [default=false]; - optional string field6 = 6; - optional bytes field2 = 2; - optional int32 field21 = 21 [default=0]; - optional int32 field71 = 71; - optional float field25 = 25; - optional int32 field109 = 109 [default=0]; - optional int32 field210 = 210 [default=0]; - optional int32 field211 = 211 [default=0]; - optional int32 field212 = 212 [default=0]; - optional int32 field213 = 213 [default=0]; - optional int32 field216 = 216 [default=0]; - optional int32 field217 = 217 [default=0]; - optional int32 field218 = 218 [default=0]; - optional int32 field220 = 220 [default=0]; - optional int32 field221 = 221 [default=0]; - optional float field222 = 222 [default=0.0]; - optional int32 field63 = 63; - - repeated group Group1 = 10 { - required float field11 = 11; - optional float field26 = 26; - optional string field12 = 12; - optional string field13 = 13; - repeated string field14 = 14; - required uint64 field15 = 15; - optional int32 field5 = 5; - optional string field27 = 27; - optional int32 field28 = 28; - optional string field29 = 29; - optional string field16 = 16; - repeated string field22 = 22; - repeated int32 field73 = 73; - optional int32 field20 = 20 [default=0]; - optional string field24 = 24; - optional SizeMessage2GroupedMessage field31 = 31; - } - repeated string field128 = 128; - optional int64 field131 = 131; - repeated string field127 = 127; - optional int32 field129 = 129; - repeated int64 field130 = 130; - optional bool field205 = 205 [default=false]; - optional bool field206 = 206 [default=false]; -} - -message SizeMessage2GroupedMessage { - optional float field1 = 1; - optional float field2 = 2; - optional float field3 = 3 [default=0.0]; - optional bool field4 = 4; - optional bool field5 = 5; - optional bool field6 = 6 [default=true]; - optional bool field7 = 7 [default=false]; - optional float field8 = 8; - optional bool field9 = 9; - optional float field10 = 10; - optional int64 field11 = 11; -} diff --git a/protos/benchmarks/google_speed.proto b/protos/benchmarks/google_speed.proto deleted file mode 100644 index 269eba8..0000000 --- a/protos/benchmarks/google_speed.proto +++ /dev/null @@ -1,140 +0,0 @@ -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.ProtoBench"; -option (google.protobuf.csharp_file_options).umbrella_classname = "GoogleSpeedProtoFile"; - -package benchmarks; - -option java_outer_classname = "GoogleSpeed"; -option optimize_for = SPEED; - -message SpeedMessage1 { - required string field1 = 1; - optional string field9 = 9; - optional string field18 = 18; - optional bool field80 = 80 [default=false]; - optional bool field81 = 81 [default=true]; - required int32 field2 = 2; - required int32 field3 = 3; - optional int32 field280 = 280; - optional int32 field6 = 6 [default=0]; - optional int64 field22 = 22; - optional string field4 = 4; - repeated fixed64 field5 = 5; - optional bool field59 = 59 [default=false]; - optional string field7 = 7; - optional int32 field16 = 16; - optional int32 field130 = 130 [default=0]; - optional bool field12 = 12 [default=true]; - optional bool field17 = 17 [default=true]; - optional bool field13 = 13 [default=true]; - optional bool field14 = 14 [default=true]; - optional int32 field104 = 104 [default=0]; - optional int32 field100 = 100 [default=0]; - optional int32 field101 = 101 [default=0]; - optional string field102 = 102; - optional string field103 = 103; - optional int32 field29 = 29 [default=0]; - optional bool field30 = 30 [default=false]; - optional int32 field60 = 60 [default=-1]; - optional int32 field271 = 271 [default=-1]; - optional int32 field272 = 272 [default=-1]; - optional int32 field150 = 150; - optional int32 field23 = 23 [default=0]; - optional bool field24 = 24 [default=false]; - optional int32 field25 = 25 [default=0]; - optional SpeedMessage1SubMessage field15 = 15; - optional bool field78 = 78; - optional int32 field67 = 67 [default=0]; - optional int32 field68 = 68; - optional int32 field128 = 128 [default=0]; - optional string field129 = 129 [default="xxxxxxxxxxxxxxxxxxxxx"]; - optional int32 field131 = 131 [default=0]; -} - -message SpeedMessage1SubMessage { - optional int32 field1 = 1 [default=0]; - optional int32 field2 = 2 [default=0]; - optional int32 field3 = 3 [default=0]; - optional string field15 = 15; - optional bool field12 = 12 [default=true]; - optional int64 field13 = 13; - optional int64 field14 = 14; - optional int32 field16 = 16; - optional int32 field19 = 19 [default=2]; - optional bool field20 = 20 [default=true]; - optional bool field28 = 28 [default=true]; - optional fixed64 field21 = 21; - optional int32 field22 = 22; - optional bool field23 = 23 [ default=false ]; - optional bool field206 = 206 [default=false]; - optional fixed32 field203 = 203; - optional int32 field204 = 204; - optional string field205 = 205; - optional uint64 field207 = 207; - optional uint64 field300 = 300; -} - -message SpeedMessage2 { - optional string field1 = 1; - optional int64 field3 = 3; - optional int64 field4 = 4; - optional int64 field30 = 30; - optional bool field75 = 75 [default=false]; - optional string field6 = 6; - optional bytes field2 = 2; - optional int32 field21 = 21 [default=0]; - optional int32 field71 = 71; - optional float field25 = 25; - optional int32 field109 = 109 [default=0]; - optional int32 field210 = 210 [default=0]; - optional int32 field211 = 211 [default=0]; - optional int32 field212 = 212 [default=0]; - optional int32 field213 = 213 [default=0]; - optional int32 field216 = 216 [default=0]; - optional int32 field217 = 217 [default=0]; - optional int32 field218 = 218 [default=0]; - optional int32 field220 = 220 [default=0]; - optional int32 field221 = 221 [default=0]; - optional float field222 = 222 [default=0.0]; - optional int32 field63 = 63; - - repeated group Group1 = 10 { - required float field11 = 11; - optional float field26 = 26; - optional string field12 = 12; - optional string field13 = 13; - repeated string field14 = 14; - required uint64 field15 = 15; - optional int32 field5 = 5; - optional string field27 = 27; - optional int32 field28 = 28; - optional string field29 = 29; - optional string field16 = 16; - repeated string field22 = 22; - repeated int32 field73 = 73; - optional int32 field20 = 20 [default=0]; - optional string field24 = 24; - optional SpeedMessage2GroupedMessage field31 = 31; - } - repeated string field128 = 128; - optional int64 field131 = 131; - repeated string field127 = 127; - optional int32 field129 = 129; - repeated int64 field130 = 130; - optional bool field205 = 205 [default=false]; - optional bool field206 = 206 [default=false]; -} - -message SpeedMessage2GroupedMessage { - optional float field1 = 1; - optional float field2 = 2; - optional float field3 = 3 [default=0.0]; - optional bool field4 = 4; - optional bool field5 = 5; - optional bool field6 = 6 [default=true]; - optional bool field7 = 7 [default=false]; - optional float field8 = 8; - optional bool field9 = 9; - optional float field10 = 10; - optional int64 field11 = 11; -} diff --git a/protos/extest/unittest_extras.proto b/protos/extest/unittest_extras.proto deleted file mode 100644 index 91f10fb..0000000 --- a/protos/extest/unittest_extras.proto +++ /dev/null @@ -1,37 +0,0 @@ -// Additional options required for C# generation. File from copyright -// line onwards is as per original distribution. -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestExtrasProtoFile"; -option (google.protobuf.csharp_file_options).add_serializable = true; - -package protobuf_unittest_extra; - -option java_package = "com.google.protobuf"; - -message TestUnpackedExtensions { - extensions 1 to max; -} - -extend TestUnpackedExtensions { - repeated int32 unpacked_int32_extension = 90; - repeated int64 unpacked_int64_extension = 91; - repeated uint32 unpacked_uint32_extension = 92; - repeated uint64 unpacked_uint64_extension = 93; - repeated sint32 unpacked_sint32_extension = 94; - repeated sint64 unpacked_sint64_extension = 95; - repeated fixed32 unpacked_fixed32_extension = 96; - repeated fixed64 unpacked_fixed64_extension = 97; - repeated sfixed32 unpacked_sfixed32_extension = 98; - repeated sfixed64 unpacked_sfixed64_extension = 99; - repeated float unpacked_float_extension = 100; - repeated double unpacked_double_extension = 101; - repeated bool unpacked_bool_extension = 102; - repeated UnpackedExtensionsForeignEnum unpacked_enum_extension = 103; -} - -enum UnpackedExtensionsForeignEnum { - FOREIGN_FOO = 4; - FOREIGN_BAR = 5; - FOREIGN_BAZ = 6; -} diff --git a/protos/extest/unittest_extras_full.proto b/protos/extest/unittest_extras_full.proto deleted file mode 100644 index a334bbf..0000000 --- a/protos/extest/unittest_extras_full.proto +++ /dev/null @@ -1,72 +0,0 @@ -// Additional options required for C# generation. File from copyright -// line onwards is as per original distribution. -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestExtrasFullProtoFile"; - -package protobuf_unittest_extra; - -option optimize_for = CODE_SIZE; - -option java_package = "com.google.protobuf"; - -message TestInteropPerson { - required string name = 1; - required int32 id = 2; - optional string email = 3; - repeated int32 codes = 10 [packed=true]; - - enum PhoneType { - MOBILE = 0; - HOME = 1; - WORK = 2; - } - - message PhoneNumber { - required string number = 1; - optional PhoneType type = 2 [default = HOME]; - } - - repeated PhoneNumber phone = 4; - - repeated group Addresses = 5 { - required string address = 1; - optional string address2 = 2; - required string city = 3; - required string state = 4; - required fixed32 zip = 5; - } - - extensions 100 to 199; -} - -message TestInteropEmployeeId { - required string number = 1; -} - -extend TestInteropPerson { - required TestInteropEmployeeId employee_id = 126; -} - -message TestMissingFieldsA { - required string name = 1; - required int32 id = 2; - optional string email = 3; - - message SubA { - required int32 count = 5; - repeated string values = 6; - } - optional SubA testA = 11; -} - -message TestMissingFieldsB { - required string name = 1; - required int32 id = 2; - optional string website = 4; - - message SubB { - repeated string values = 7; - } - optional SubB testB = 12; -} diff --git a/protos/extest/unittest_extras_lite.proto b/protos/extest/unittest_extras_lite.proto deleted file mode 100644 index ea1bcd2..0000000 --- a/protos/extest/unittest_extras_lite.proto +++ /dev/null @@ -1,117 +0,0 @@ -// Additional options required for C# generation. File from copyright -// line onwards is as per original distribution. -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestExtrasLiteProtoFile"; -option (google.protobuf.csharp_file_options).add_serializable = true; - -package protobuf_unittest_extra; - -option optimize_for = LITE_RUNTIME; - -option java_package = "com.google.protobuf"; - -message TestRequiredLite { - required int32 d = 1; - required ExtraEnum en = 2 [default = DEFAULT]; -} - -enum ExtraEnum { - DEFAULT = 10; - EXLITE_FOO = 7; - EXLITE_BAR = 8; - EXLITE_BAZ = 9; -} - -message TestInteropPersonLite { - required string name = 1; - required int32 id = 2; - optional string email = 3; - repeated int32 codes = 10 [packed=true]; - - enum PhoneType { - MOBILE = 0; - HOME = 1; - WORK = 2; - } - - message PhoneNumber { - required string number = 1; - optional PhoneType type = 2 [default = HOME]; - } - - repeated PhoneNumber phone = 4; - - repeated group Addresses = 5 { - required string address = 1; - optional string address2 = 2; - required string city = 3; - required string state = 4; - required fixed32 zip = 5; - } - - extensions 100 to 199; -} - -message TestInteropEmployeeIdLite { - required string number = 1; -} - -extend TestInteropPersonLite { - required TestInteropEmployeeIdLite employee_id_lite = 126; -} - -/* Removed from unittest_lite.proto and added back here */ - -message TestUnpackedExtensionsLite { - extensions 1 to max; -} - -message TestUnpackedTypesLite { - repeated int32 unpacked_int32 = 90; - repeated int64 unpacked_int64 = 91; - repeated uint32 unpacked_uint32 = 92; - repeated uint64 unpacked_uint64 = 93; - repeated sint32 unpacked_sint32 = 94; - repeated sint64 unpacked_sint64 = 95; - repeated fixed32 unpacked_fixed32 = 96; - repeated fixed64 unpacked_fixed64 = 97; - repeated sfixed32 unpacked_sfixed32 = 98; - repeated sfixed64 unpacked_sfixed64 = 99; - repeated float unpacked_float = 100; - repeated double unpacked_double = 101; - repeated bool unpacked_bool = 102; - repeated UnpackedTypesForeignEnumLite unpacked_enum = 103; -} - -extend TestUnpackedExtensionsLite { - repeated int32 unpacked_int32_extension_lite = 90; - repeated int64 unpacked_int64_extension_lite = 91; - repeated uint32 unpacked_uint32_extension_lite = 92; - repeated uint64 unpacked_uint64_extension_lite = 93; - repeated sint32 unpacked_sint32_extension_lite = 94; - repeated sint64 unpacked_sint64_extension_lite = 95; - repeated fixed32 unpacked_fixed32_extension_lite = 96; - repeated fixed64 unpacked_fixed64_extension_lite = 97; - repeated sfixed32 unpacked_sfixed32_extension_lite = 98; - repeated sfixed64 unpacked_sfixed64_extension_lite = 99; - repeated float unpacked_float_extension_lite = 100; - repeated double unpacked_double_extension_lite = 101; - repeated bool unpacked_bool_extension_lite = 102; - repeated UnpackedTypesForeignEnumLite unpacked_enum_extension_lite = 103; -} - -enum UnpackedTypesForeignEnumLite { - FOREIGN_LITE_FOO = 4; - FOREIGN_LITE_BAR = 5; - FOREIGN_LITE_BAZ = 6; -} - -message BucketOfBytes { - optional bytes value = 1; - -} -message BucketOfBytesEx { - optional bytes value = 1; - optional bytes value2 = 255; -} \ No newline at end of file diff --git a/protos/extest/unittest_extras_xmltest.proto b/protos/extest/unittest_extras_xmltest.proto deleted file mode 100644 index ab8088a..0000000 --- a/protos/extest/unittest_extras_xmltest.proto +++ /dev/null @@ -1,54 +0,0 @@ -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestXmlSerializerTestProtoFile"; -option (google.protobuf.csharp_file_options).add_serializable = true; - -package protobuf_unittest_extra; - -option optimize_for = SPEED; - -enum EnumOptions { - ONE = 0; - TWO = 1; - THREE = 2; -} - -message TestXmlChild { - repeated EnumOptions options = 3; - optional bytes binary = 4; -} - -message TestXmlNoFields { -} - -message TestXmlRescursive { - optional TestXmlRescursive child = 1; -} - -message TestXmlMessage { - - optional int64 number = 6; - repeated int32 numbers = 2; - optional string text = 3; - repeated string textlines = 700; - optional bool valid = 5; - - optional TestXmlChild child = 1; - repeated group Children = 401 { - repeated EnumOptions options = 3; - optional bytes binary = 4; - } - -extensions 100 to 199; -} - -message TestXmlExtension { - required int32 number = 1; -} - -extend TestXmlMessage { - optional EnumOptions extension_enum = 101; - optional string extension_text = 102; - repeated int32 extension_number = 103 [packed = true]; - optional TestXmlExtension extension_message = 199; -} diff --git a/protos/extest/unittest_generic_services.proto b/protos/extest/unittest_generic_services.proto deleted file mode 100644 index 3fe2e8e..0000000 --- a/protos/extest/unittest_generic_services.proto +++ /dev/null @@ -1,29 +0,0 @@ -// Additional options required for C# generation. File from copyright -// line onwards is as per original distribution. -import "google/protobuf/csharp_options.proto"; -import "google/protobuf/unittest.proto"; -import "google/protobuf/unittest_custom_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestGenericServices"; - -option (google.protobuf.csharp_file_options).service_generator_type = GENERIC; - -// We don't put this in a package within proto2 because we need to make sure -// that the generated code doesn't depend on being in the proto2 namespace. -package protobuf_unittest; - -option optimize_for = SPEED; - -service TestGenericService { - rpc Foo(FooRequest) returns (FooResponse); - rpc Bar(BarRequest) returns (BarResponse); -} - -service TestGenericServiceWithCustomOptions { - option (service_opt1) = -9876543210; - - rpc Foo(CustomOptionFooRequest) returns (CustomOptionFooResponse) { - option (method_opt1) = METHODOPT1_VAL2; - } -} - diff --git a/protos/extest/unittest_issues.proto b/protos/extest/unittest_issues.proto deleted file mode 100644 index cb80379..0000000 --- a/protos/extest/unittest_issues.proto +++ /dev/null @@ -1,137 +0,0 @@ -// These proto descriptors have at one time been reported as an issue or defect. -// They are kept here to replicate the issue, and continue to verify the fix. -import "google/protobuf/csharp_options.proto"; - -// Issue: Non-"Google.Protobuffers" namespace will ensure that protobuffer library types are qualified -option (google.protobuf.csharp_file_options).namespace = "UnitTest.Issues.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestExtrasIssuesProtoFile"; - -package unittest_issues; -option optimize_for = SPEED; - -// The following is a representative set of features -/* -enum EnumOptions { - ONE = 0; - TWO = 1; - THREE = 2; -} - -message TestBasicChild -{ - repeated EnumOptions options = 3; - optional bytes binary = 4; -} - -message TestBasicNoFields { -} - -message TestBasicRescursive { - optional TestBasicRescursive child = 1; -} - -message TestBasicMessage { - - optional int64 number = 6; - repeated int32 numbers = 2; - optional string text = 3; - repeated string textlines = 700; - optional bool valid = 5; - - optional TestBasicChild child = 1; - repeated group Children = 401 - { - repeated EnumOptions options = 3; - optional bytes binary = 4; - } - - extensions 100 to 199; -} - -message TestBasicExtension { - required int32 number = 1; -} - -extend TestBasicMessage { - optional EnumOptions extension_enum = 101; - optional string extension_text = 102; - repeated int32 extension_number = 103 [packed = true]; - optional TestBasicExtension extension_message = 199; -} - -// Issue for non-qualified type reference in new services generation -option (google.protobuf.csharp_file_options).service_generator_type = IRPCDISPATCH; - -service TestGenericService { - rpc Foo(TestBasicNoFields) returns (TestBasicMessage); - rpc Bar(TestBasicNoFields) returns (TestBasicMessage); -} -*/ -// Issue 13: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=13 - -message A { - optional int32 _A = 1; -} - -message B { - optional int32 B_ = 1; -} - -message AB { - optional int32 a_b = 1; -} - -// Similar issue with numeric names -message NumberField { - optional int32 _01 = 1; -} - -// Issue 28: Circular message dependencies result in null defaults for DefaultInstance - -message MyMessageAReferenceB { - required MyMessageBReferenceA value = 1; -} - -message MyMessageBReferenceA { - required MyMessageAReferenceB value = 1; -} - -// issue 19 - negative enum values - -enum NegativeEnum { - FiveBelow = -5; - MinusOne = -1; - Zero = 0; -} - -message NegativeEnumMessage { - optional NegativeEnum value = 1; - repeated NegativeEnum values = 2; - repeated NegativeEnum packed_values = 3 [packed=true]; -} - -// Issue 21: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=21 -// Decorate fields with [deprecated=true] as [System.Obsolete] - -message DeprecatedChild { -} - -enum DeprecatedEnum { - one = 1; -} - -message DeprecatedFieldsMessage { - optional int32 PrimitiveValue = 1 [deprecated = true]; - repeated int32 PrimitiveArray = 2 [deprecated = true]; - - optional DeprecatedChild MessageValue = 3 [deprecated = true]; - repeated DeprecatedChild MessageArray = 4 [deprecated = true]; - - optional DeprecatedEnum EnumValue = 5 [deprecated = true]; - repeated DeprecatedEnum EnumArray = 6 [deprecated = true]; -} - -// Issue 45: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=45 -message ItemField { - optional int32 item = 1; -} diff --git a/protos/extest/unittest_rpc_interop.proto b/protos/extest/unittest_rpc_interop.proto deleted file mode 100644 index dec5b87..0000000 --- a/protos/extest/unittest_rpc_interop.proto +++ /dev/null @@ -1,41 +0,0 @@ -// Additional options required for C# generation. File from copyright -// line onwards is as per original distribution. -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestRpcInterop"; - -option (google.protobuf.csharp_file_options).service_generator_type = IRPCDISPATCH; - -option optimize_for = SPEED; - -message SearchRequest { - repeated string Criteria = 1; -} - -message SearchResponse { - message ResultItem { - required string url = 1; - optional string name = 2; - } - - repeated ResultItem results = 1; -} - -message RefineSearchRequest { - repeated string Criteria = 1; - required SearchResponse previous_results = 2; -} - -service SearchService { - /* - Add this option to specify the GuidAttribute on the service interface - option (google.protobuf.csharp_service_options).interface_id = "{A65F0925-FD11-4f94-B166-89AC4F027205}"; - */ - rpc Search (SearchRequest) returns (SearchResponse) - /* - Add this option to specify the DispIdAttribute on the service interface - { option (google.protobuf.csharp_method_options).dispatch_id = 5; } - */ ; - - rpc RefineSearch (RefineSearchRequest) returns (SearchResponse); -} diff --git a/protos/extest/unittest_rpc_interop_lite.proto b/protos/extest/unittest_rpc_interop_lite.proto deleted file mode 100644 index 62d1c6a..0000000 --- a/protos/extest/unittest_rpc_interop_lite.proto +++ /dev/null @@ -1,42 +0,0 @@ -// Additional options required for C# generation. File from copyright -// line onwards is as per original distribution. -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestRpcInteropLite"; - -option (google.protobuf.csharp_file_options).service_generator_type = IRPCDISPATCH; - -option optimize_for = LITE_RUNTIME; -package unittest_rpc_interop_lite; - -message SearchRequest { - repeated string Criteria = 1; -} - -message SearchResponse { - message ResultItem { - required string url = 1; - optional string name = 2; - } - - repeated ResultItem results = 1; -} - -message RefineSearchRequest { - repeated string Criteria = 1; - required SearchResponse previous_results = 2; -} - -service SearchService { - /* - Add this option to specify the GuidAttribute on the service interface - option (google.protobuf.csharp_service_options).interface_id = "{A65F0925-FD11-4f94-B166-89AC4F027205}"; - */ - rpc Search (SearchRequest) returns (SearchResponse) - /* - Add this option to specify the DispIdAttribute on the service interface - { option (google.protobuf.csharp_method_options).dispatch_id = 5; } - */ ; - - rpc RefineSearch (RefineSearchRequest) returns (SearchResponse); -} diff --git a/protos/google/protobuf/compiler/plugin.proto b/protos/google/protobuf/compiler/plugin.proto deleted file mode 100644 index 866fba1..0000000 --- a/protos/google/protobuf/compiler/plugin.proto +++ /dev/null @@ -1,147 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// -// WARNING: The plugin interface is currently EXPERIMENTAL and is subject to -// change. -// -// protoc (aka the Protocol Compiler) can be extended via plugins. A plugin is -// just a program that reads a CodeGeneratorRequest from stdin and writes a -// CodeGeneratorResponse to stdout. -// -// Plugins written using C++ can use google/protobuf/compiler/plugin.h instead -// of dealing with the raw protocol defined here. -// -// A plugin executable needs only to be placed somewhere in the path. The -// plugin should be named "protoc-gen-$NAME", and will then be used when the -// flag "--${NAME}_out" is passed to protoc. - -package google.protobuf.compiler; -option java_package = "com.google.protobuf.compiler"; -option java_outer_classname = "PluginProtos"; - -import "google/protobuf/descriptor.proto"; - -// An encoded CodeGeneratorRequest is written to the plugin's stdin. -message CodeGeneratorRequest { - // The .proto files that were explicitly listed on the command-line. The - // code generator should generate code only for these files. Each file's - // descriptor will be included in proto_file, below. - repeated string file_to_generate = 1; - - // The generator parameter passed on the command-line. - optional string parameter = 2; - - // FileDescriptorProtos for all files in files_to_generate and everything - // they import. The files will appear in topological order, so each file - // appears before any file that imports it. - // - // protoc guarantees that all proto_files will be written after - // the fields above, even though this is not technically guaranteed by the - // protobuf wire format. This theoretically could allow a plugin to stream - // in the FileDescriptorProtos and handle them one by one rather than read - // the entire set into memory at once. However, as of this writing, this - // is not similarly optimized on protoc's end -- it will store all fields in - // memory at once before sending them to the plugin. - repeated FileDescriptorProto proto_file = 15; -} - -// The plugin writes an encoded CodeGeneratorResponse to stdout. -message CodeGeneratorResponse { - // Error message. If non-empty, code generation failed. The plugin process - // should exit with status code zero even if it reports an error in this way. - // - // This should be used to indicate errors in .proto files which prevent the - // code generator from generating correct code. Errors which indicate a - // problem in protoc itself -- such as the input CodeGeneratorRequest being - // unparseable -- should be reported by writing a message to stderr and - // exiting with a non-zero status code. - optional string error = 1; - - // Represents a single generated file. - message File { - // The file name, relative to the output directory. The name must not - // contain "." or ".." components and must be relative, not be absolute (so, - // the file cannot lie outside the output directory). "/" must be used as - // the path separator, not "\". - // - // If the name is omitted, the content will be appended to the previous - // file. This allows the generator to break large files into small chunks, - // and allows the generated text to be streamed back to protoc so that large - // files need not reside completely in memory at one time. Note that as of - // this writing protoc does not optimize for this -- it will read the entire - // CodeGeneratorResponse before writing files to disk. - optional string name = 1; - - // If non-empty, indicates that the named file should already exist, and the - // content here is to be inserted into that file at a defined insertion - // point. This feature allows a code generator to extend the output - // produced by another code generator. The original generator may provide - // insertion points by placing special annotations in the file that look - // like: - // @@protoc_insertion_point(NAME) - // The annotation can have arbitrary text before and after it on the line, - // which allows it to be placed in a comment. NAME should be replaced with - // an identifier naming the point -- this is what other generators will use - // as the insertion_point. Code inserted at this point will be placed - // immediately above the line containing the insertion point (thus multiple - // insertions to the same point will come out in the order they were added). - // The double-@ is intended to make it unlikely that the generated code - // could contain things that look like insertion points by accident. - // - // For example, the C++ code generator places the following line in the - // .pb.h files that it generates: - // // @@protoc_insertion_point(namespace_scope) - // This line appears within the scope of the file's package namespace, but - // outside of any particular class. Another plugin can then specify the - // insertion_point "namespace_scope" to generate additional classes or - // other declarations that should be placed in this scope. - // - // Note that if the line containing the insertion point begins with - // whitespace, the same whitespace will be added to every line of the - // inserted text. This is useful for languages like Python, where - // indentation matters. In these languages, the insertion point comment - // should be indented the same amount as any inserted code will need to be - // in order to work correctly in that context. - // - // The code generator that generates the initial file and the one which - // inserts into it must both run as part of a single invocation of protoc. - // Code generators are executed in the order in which they appear on the - // command line. - // - // If |insertion_point| is present, |name| must also be present. - optional string insertion_point = 2; - - // The file contents. - optional string content = 15; - } - repeated File file = 15; -} diff --git a/protos/google/protobuf/csharp_options.proto b/protos/google/protobuf/csharp_options.proto deleted file mode 100644 index f09b96a..0000000 --- a/protos/google/protobuf/csharp_options.proto +++ /dev/null @@ -1,115 +0,0 @@ -// Extra options for C# generator - -import "google/protobuf/descriptor.proto"; - -package google.protobuf; - -message CSharpFileOptions { - - // Namespace for generated classes; defaults to the package. - optional string namespace = 1; - - // Name of the "umbrella" class used for metadata about all - // the messages within this file. Default is based on the name - // of the file. - optional string umbrella_classname = 2; - - // Whether classes should be public (true) or internal (false) - optional bool public_classes = 3 [default = true]; - - // Whether to generate a single file for everything within the - // .proto file (false), or one file per message (true). - // This option is not currently honored; please log a feature - // request if you really want it. - optional bool multiple_files = 4; - - // Whether to nest messages within a single umbrella class (true) - // or create the umbrella class as a peer, with messages as - // top-level classes in the namespace (false) - optional bool nest_classes = 5; - - // Generate appropriate support for Code Contracts - // (Ongoing; support should improve over time) - optional bool code_contracts = 6; - - // Create subdirectories for namespaces, e.g. namespace "Foo.Bar" - // would generate files within [output directory]/Foo/Bar - optional bool expand_namespace_directories = 7; - - // Generate attributes indicating non-CLS-compliance - optional bool cls_compliance = 8 [default = true]; - - // Generate messages/builders with the [Serializable] attribute - optional bool add_serializable = 9 [default = false]; - - // Generates a private ctor for Message types - optional bool generate_private_ctor = 10 [default = true]; - - // The extension that should be appended to the umbrella_classname when creating files. - optional string file_extension = 221 [default = ".cs"]; - - // A nested namespace for the umbrella class. Helpful for name collisions caused by - // umbrella_classname conflicting with an existing type. This will be automatically - // set to 'Proto' if a collision is detected with types being generated. This value - // is ignored when nest_classes == true - optional string umbrella_namespace = 222; - - // The output path for the source file(s) generated - optional string output_directory = 223 [default = "."]; - - // Will ignore the type generations and remove dependencies for the descriptor proto - // files that declare their package to be "google.protobuf" - optional bool ignore_google_protobuf = 224 [default = false]; - - // Controls how services are generated, GENERIC is the deprecated original implementation - // INTERFACE generates service interfaces only, RPCINTEROP generates interfaces and - // implementations using the included Windows RPC interop libarary. - optional CSharpServiceType service_generator_type = 225 [default = NONE]; - - // Used to add the System.Runtime.CompilerServices.CompilerGeneratedAttribute and - // System.CodeDom.Compiler.GeneratedCodeAttribute attributes to generated code. - optional bool generated_code_attributes = 226 [default = false]; -} - -enum CSharpServiceType { - // Services are ignored by the generator - NONE = 0; - // Generates the original Java generic service implementations - GENERIC = 1; - // Generates an interface for the service and nothing else - INTERFACE = 2; - // Generates an interface for the service and client/server wrappers for the interface - IRPCDISPATCH = 3; -} - -extend FileOptions { - optional CSharpFileOptions csharp_file_options = 1000; -} - -extend FieldOptions { - optional CSharpFieldOptions csharp_field_options = 1000; -} - -message CSharpFieldOptions { - // Provides the ability to override the name of the property - // generated for this field. This is applied to all properties - // and methods to do with this field, including HasFoo, FooCount, - // FooList etc. - optional string property_name = 1; -} - -message CSharpServiceOptions { - optional string interface_id = 1; -} - -extend ServiceOptions { - optional CSharpServiceOptions csharp_service_options = 1000; -} - -message CSharpMethodOptions { - optional int32 dispatch_id = 1; -} - -extend MethodOptions { - optional CSharpMethodOptions csharp_method_options = 1000; -} \ No newline at end of file diff --git a/protos/google/protobuf/descriptor.proto b/protos/google/protobuf/descriptor.proto deleted file mode 100644 index 233f879..0000000 --- a/protos/google/protobuf/descriptor.proto +++ /dev/null @@ -1,533 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// The messages in this file describe the definitions found in .proto files. -// A valid .proto file can be translated directly to a FileDescriptorProto -// without any other information (e.g. without reading its imports). - - - -package google.protobuf; -option java_package = "com.google.protobuf"; -option java_outer_classname = "DescriptorProtos"; - -// descriptor.proto must be optimized for speed because reflection-based -// algorithms don't work during bootstrapping. -option optimize_for = SPEED; - -// The protocol compiler can output a FileDescriptorSet containing the .proto -// files it parses. -message FileDescriptorSet { - repeated FileDescriptorProto file = 1; -} - -// Describes a complete .proto file. -message FileDescriptorProto { - optional string name = 1; // file name, relative to root of source tree - optional string package = 2; // e.g. "foo", "foo.bar", etc. - - // Names of files imported by this file. - repeated string dependency = 3; - - // All top-level definitions in this file. - repeated DescriptorProto message_type = 4; - repeated EnumDescriptorProto enum_type = 5; - repeated ServiceDescriptorProto service = 6; - repeated FieldDescriptorProto extension = 7; - - optional FileOptions options = 8; - - // This field contains optional information about the original source code. - // You may safely remove this entire field whithout harming runtime - // functionality of the descriptors -- the information is needed only by - // development tools. - optional SourceCodeInfo source_code_info = 9; -} - -// Describes a message type. -message DescriptorProto { - optional string name = 1; - - repeated FieldDescriptorProto field = 2; - repeated FieldDescriptorProto extension = 6; - - repeated DescriptorProto nested_type = 3; - repeated EnumDescriptorProto enum_type = 4; - - message ExtensionRange { - optional int32 start = 1; - optional int32 end = 2; - } - repeated ExtensionRange extension_range = 5; - - optional MessageOptions options = 7; -} - -// Describes a field within a message. -message FieldDescriptorProto { - enum Type { - // 0 is reserved for errors. - // Order is weird for historical reasons. - TYPE_DOUBLE = 1; - TYPE_FLOAT = 2; - TYPE_INT64 = 3; // Not ZigZag encoded. Negative numbers - // take 10 bytes. Use TYPE_SINT64 if negative - // values are likely. - TYPE_UINT64 = 4; - TYPE_INT32 = 5; // Not ZigZag encoded. Negative numbers - // take 10 bytes. Use TYPE_SINT32 if negative - // values are likely. - TYPE_FIXED64 = 6; - TYPE_FIXED32 = 7; - TYPE_BOOL = 8; - TYPE_STRING = 9; - TYPE_GROUP = 10; // Tag-delimited aggregate. - TYPE_MESSAGE = 11; // Length-delimited aggregate. - - // New in version 2. - TYPE_BYTES = 12; - TYPE_UINT32 = 13; - TYPE_ENUM = 14; - TYPE_SFIXED32 = 15; - TYPE_SFIXED64 = 16; - TYPE_SINT32 = 17; // Uses ZigZag encoding. - TYPE_SINT64 = 18; // Uses ZigZag encoding. - }; - - enum Label { - // 0 is reserved for errors - LABEL_OPTIONAL = 1; - LABEL_REQUIRED = 2; - LABEL_REPEATED = 3; - // TODO(sanjay): Should we add LABEL_MAP? - }; - - optional string name = 1; - optional int32 number = 3; - optional Label label = 4; - - // If type_name is set, this need not be set. If both this and type_name - // are set, this must be either TYPE_ENUM or TYPE_MESSAGE. - optional Type type = 5; - - // For message and enum types, this is the name of the type. If the name - // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping - // rules are used to find the type (i.e. first the nested types within this - // message are searched, then within the parent, on up to the root - // namespace). - optional string type_name = 6; - - // For extensions, this is the name of the type being extended. It is - // resolved in the same manner as type_name. - optional string extendee = 2; - - // For numeric types, contains the original text representation of the value. - // For booleans, "true" or "false". - // For strings, contains the default text contents (not escaped in any way). - // For bytes, contains the C escaped value. All bytes >= 128 are escaped. - // TODO(kenton): Base-64 encode? - optional string default_value = 7; - - optional FieldOptions options = 8; -} - -// Describes an enum type. -message EnumDescriptorProto { - optional string name = 1; - - repeated EnumValueDescriptorProto value = 2; - - optional EnumOptions options = 3; -} - -// Describes a value within an enum. -message EnumValueDescriptorProto { - optional string name = 1; - optional int32 number = 2; - - optional EnumValueOptions options = 3; -} - -// Describes a service. -message ServiceDescriptorProto { - optional string name = 1; - repeated MethodDescriptorProto method = 2; - - optional ServiceOptions options = 3; -} - -// Describes a method of a service. -message MethodDescriptorProto { - optional string name = 1; - - // Input and output type names. These are resolved in the same way as - // FieldDescriptorProto.type_name, but must refer to a message type. - optional string input_type = 2; - optional string output_type = 3; - - optional MethodOptions options = 4; -} - -// =================================================================== -// Options - -// Each of the definitions above may have "options" attached. These are -// just annotations which may cause code to be generated slightly differently -// or may contain hints for code that manipulates protocol messages. -// -// Clients may define custom options as extensions of the *Options messages. -// These extensions may not yet be known at parsing time, so the parser cannot -// store the values in them. Instead it stores them in a field in the *Options -// message called uninterpreted_option. This field must have the same name -// across all *Options messages. We then use this field to populate the -// extensions when we build a descriptor, at which point all protos have been -// parsed and so all extensions are known. -// -// Extension numbers for custom options may be chosen as follows: -// * For options which will only be used within a single application or -// organization, or for experimental options, use field numbers 50000 -// through 99999. It is up to you to ensure that you do not use the -// same number for multiple options. -// * For options which will be published and used publicly by multiple -// independent entities, e-mail kenton@google.com to reserve extension -// numbers. Simply tell me how many you need and I'll send you back a -// set of numbers to use -- there's no need to explain how you intend to -// use them. If this turns out to be popular, a web service will be set up -// to automatically assign option numbers. - - -message FileOptions { - - // Sets the Java package where classes generated from this .proto will be - // placed. By default, the proto package is used, but this is often - // inappropriate because proto packages do not normally start with backwards - // domain names. - optional string java_package = 1; - - - // If set, all the classes from the .proto file are wrapped in a single - // outer class with the given name. This applies to both Proto1 - // (equivalent to the old "--one_java_file" option) and Proto2 (where - // a .proto always translates to a single class, but you may want to - // explicitly choose the class name). - optional string java_outer_classname = 8; - - // If set true, then the Java code generator will generate a separate .java - // file for each top-level message, enum, and service defined in the .proto - // file. Thus, these types will *not* be nested inside the outer class - // named by java_outer_classname. However, the outer class will still be - // generated to contain the file's getDescriptor() method as well as any - // top-level extensions defined in the file. - optional bool java_multiple_files = 10 [default=false]; - - // If set true, then the Java code generator will generate equals() and - // hashCode() methods for all messages defined in the .proto file. This is - // purely a speed optimization, as the AbstractMessage base class includes - // reflection-based implementations of these methods. - optional bool java_generate_equals_and_hash = 20 [default=false]; - - // Generated classes can be optimized for speed or code size. - enum OptimizeMode { - SPEED = 1; // Generate complete code for parsing, serialization, - // etc. - CODE_SIZE = 2; // Use ReflectionOps to implement these methods. - LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime. - } - optional OptimizeMode optimize_for = 9 [default=SPEED]; - - - - - // Should generic services be generated in each language? "Generic" services - // are not specific to any particular RPC system. They are generated by the - // main code generators in each language (without additional plugins). - // Generic services were the only kind of service generation supported by - // early versions of proto2. - // - // Generic services are now considered deprecated in favor of using plugins - // that generate code specific to your particular RPC system. Therefore, - // these default to false. Old code which depends on generic services should - // explicitly set them to true. - optional bool cc_generic_services = 16 [default=false]; - optional bool java_generic_services = 17 [default=false]; - optional bool py_generic_services = 18 [default=false]; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message MessageOptions { - // Set true to use the old proto1 MessageSet wire format for extensions. - // This is provided for backwards-compatibility with the MessageSet wire - // format. You should not use this for any other reason: It's less - // efficient, has fewer features, and is more complicated. - // - // The message must be defined exactly as follows: - // message Foo { - // option message_set_wire_format = true; - // extensions 4 to max; - // } - // Note that the message cannot have any defined fields; MessageSets only - // have extensions. - // - // All extensions of your type must be singular messages; e.g. they cannot - // be int32s, enums, or repeated messages. - // - // Because this is an option, the above two restrictions are not enforced by - // the protocol compiler. - optional bool message_set_wire_format = 1 [default=false]; - - // Disables the generation of the standard "descriptor()" accessor, which can - // conflict with a field of the same name. This is meant to make migration - // from proto1 easier; new code should avoid fields named "descriptor". - optional bool no_standard_descriptor_accessor = 2 [default=false]; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message FieldOptions { - // The ctype option instructs the C++ code generator to use a different - // representation of the field than it normally would. See the specific - // options below. This option is not yet implemented in the open source - // release -- sorry, we'll try to include it in a future version! - optional CType ctype = 1 [default = STRING]; - enum CType { - // Default mode. - STRING = 0; - - CORD = 1; - - STRING_PIECE = 2; - } - // The packed option can be enabled for repeated primitive fields to enable - // a more efficient representation on the wire. Rather than repeatedly - // writing the tag and type for each element, the entire array is encoded as - // a single length-delimited blob. - optional bool packed = 2; - - - // Is this field deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for accessors, or it will be completely ignored; in the very least, this - // is a formalization for deprecating fields. - optional bool deprecated = 3 [default=false]; - - // EXPERIMENTAL. DO NOT USE. - // For "map" fields, the name of the field in the enclosed type that - // is the key for this map. For example, suppose we have: - // message Item { - // required string name = 1; - // required string value = 2; - // } - // message Config { - // repeated Item items = 1 [experimental_map_key="name"]; - // } - // In this situation, the map key for Item will be set to "name". - // TODO: Fully-implement this, then remove the "experimental_" prefix. - optional string experimental_map_key = 9; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message EnumOptions { - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message EnumValueOptions { - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message ServiceOptions { - - // Note: Field numbers 1 through 32 are reserved for Google's internal RPC - // framework. We apologize for hoarding these numbers to ourselves, but - // we were already using them long before we decided to release Protocol - // Buffers. - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message MethodOptions { - - // Note: Field numbers 1 through 32 are reserved for Google's internal RPC - // framework. We apologize for hoarding these numbers to ourselves, but - // we were already using them long before we decided to release Protocol - // Buffers. - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -// A message representing a option the parser does not recognize. This only -// appears in options protos created by the compiler::Parser class. -// DescriptorPool resolves these when building Descriptor objects. Therefore, -// options protos in descriptor objects (e.g. returned by Descriptor::options(), -// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions -// in them. -message UninterpretedOption { - // The name of the uninterpreted option. Each string represents a segment in - // a dot-separated name. is_extension is true iff a segment represents an - // extension (denoted with parentheses in options specs in .proto files). - // E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents - // "foo.(bar.baz).qux". - message NamePart { - required string name_part = 1; - required bool is_extension = 2; - } - repeated NamePart name = 2; - - // The value of the uninterpreted option, in whatever type the tokenizer - // identified it as during parsing. Exactly one of these should be set. - optional string identifier_value = 3; - optional uint64 positive_int_value = 4; - optional int64 negative_int_value = 5; - optional double double_value = 6; - optional bytes string_value = 7; - optional string aggregate_value = 8; -} - -// =================================================================== -// Optional source code info - -// Encapsulates information about the original source file from which a -// FileDescriptorProto was generated. -message SourceCodeInfo { - // A Location identifies a piece of source code in a .proto file which - // corresponds to a particular definition. This information is intended - // to be useful to IDEs, code indexers, documentation generators, and similar - // tools. - // - // For example, say we have a file like: - // message Foo { - // optional string foo = 1; - // } - // Let's look at just the field definition: - // optional string foo = 1; - // ^ ^^ ^^ ^ ^^^ - // a bc de f ghi - // We have the following locations: - // span path represents - // [a,i) [ 4, 0, 2, 0 ] The whole field definition. - // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). - // [c,d) [ 4, 0, 2, 0, 5 ] The type (string). - // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). - // [g,h) [ 4, 0, 2, 0, 3 ] The number (1). - // - // Notes: - // - A location may refer to a repeated field itself (i.e. not to any - // particular index within it). This is used whenever a set of elements are - // logically enclosed in a single code segment. For example, an entire - // extend block (possibly containing multiple extension definitions) will - // have an outer location whose path refers to the "extensions" repeated - // field without an index. - // - Multiple locations may have the same path. This happens when a single - // logical declaration is spread out across multiple places. The most - // obvious example is the "extend" block again -- there may be multiple - // extend blocks in the same scope, each of which will have the same path. - // - A location's span is not always a subset of its parent's span. For - // example, the "extendee" of an extension declaration appears at the - // beginning of the "extend" block and is shared by all extensions within - // the block. - // - Just because a location's span is a subset of some other location's span - // does not mean that it is a descendent. For example, a "group" defines - // both a type and a field in a single declaration. Thus, the locations - // corresponding to the type and field and their components will overlap. - // - Code which tries to interpret locations should probably be designed to - // ignore those that it doesn't understand, as more types of locations could - // be recorded in the future. - repeated Location location = 1; - message Location { - // Identifies which part of the FileDescriptorProto was defined at this - // location. - // - // Each element is a field number or an index. They form a path from - // the root FileDescriptorProto to the place where the definition. For - // example, this path: - // [ 4, 3, 2, 7, 1 ] - // refers to: - // file.message_type(3) // 4, 3 - // .field(7) // 2, 7 - // .name() // 1 - // This is because FileDescriptorProto.message_type has field number 4: - // repeated DescriptorProto message_type = 4; - // and DescriptorProto.field has field number 2: - // repeated FieldDescriptorProto field = 2; - // and FieldDescriptorProto.name has field number 1: - // optional string name = 1; - // - // Thus, the above path gives the location of a field name. If we removed - // the last element: - // [ 4, 3, 2, 7 ] - // this path refers to the whole field declaration (from the beginning - // of the label to the terminating semicolon). - repeated int32 path = 1 [packed=true]; - - // Always has exactly three or four elements: start line, start column, - // end line (optional, otherwise assumed same as start line), end column. - // These are packed into a single field for efficiency. Note that line - // and column numbers are zero-based -- typically you will want to add - // 1 to each before displaying to a user. - repeated int32 span = 2 [packed=true]; - - // TODO(kenton): Record comments appearing before and after the - // declaration. - } -} diff --git a/protos/google/protobuf/unittest.proto b/protos/google/protobuf/unittest.proto deleted file mode 100644 index 7f05cf8..0000000 --- a/protos/google/protobuf/unittest.proto +++ /dev/null @@ -1,636 +0,0 @@ -// Additional options required for C# generation. File from copyright -// line onwards is as per original distribution. -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestProtoFile"; - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// A proto file we will use for unit testing. - - -// Some generic_services option(s) added automatically. -// See: http://go/proto2-generic-services-default -option cc_generic_services = true; // auto-added -option java_generic_services = true; // auto-added -option py_generic_services = true; // auto-added - -import "google/protobuf/unittest_import.proto"; - -// We don't put this in a package within proto2 because we need to make sure -// that the generated code doesn't depend on being in the proto2 namespace. -// In test_util.h we do "using namespace unittest = protobuf_unittest". -package protobuf_unittest; - -// Protos optimized for SPEED use a strict superset of the generated code -// of equivalent ones optimized for CODE_SIZE, so we should optimize all our -// tests for speed unless explicitly testing code size optimization. -option optimize_for = SPEED; - -option java_outer_classname = "UnittestProto"; - -// This proto includes every type of field in both singular and repeated -// forms. -message TestAllTypes { - message NestedMessage { - // The field name "b" fails to compile in proto1 because it conflicts with - // a local variable named "b" in one of the generated methods. Doh. - // This file needs to compile in proto1 to test backwards-compatibility. - optional int32 bb = 1; - } - - enum NestedEnum { - FOO = 1; - BAR = 2; - BAZ = 3; - } - - // Singular - optional int32 optional_int32 = 1; - optional int64 optional_int64 = 2; - optional uint32 optional_uint32 = 3; - optional uint64 optional_uint64 = 4; - optional sint32 optional_sint32 = 5; - optional sint64 optional_sint64 = 6; - optional fixed32 optional_fixed32 = 7; - optional fixed64 optional_fixed64 = 8; - optional sfixed32 optional_sfixed32 = 9; - optional sfixed64 optional_sfixed64 = 10; - optional float optional_float = 11; - optional double optional_double = 12; - optional bool optional_bool = 13; - optional string optional_string = 14; - optional bytes optional_bytes = 15; - - optional group OptionalGroup = 16 { - optional int32 a = 17; - } - - optional NestedMessage optional_nested_message = 18; - optional ForeignMessage optional_foreign_message = 19; - optional protobuf_unittest_import.ImportMessage optional_import_message = 20; - - optional NestedEnum optional_nested_enum = 21; - optional ForeignEnum optional_foreign_enum = 22; - optional protobuf_unittest_import.ImportEnum optional_import_enum = 23; - - optional string optional_string_piece = 24 [ctype=STRING_PIECE]; - optional string optional_cord = 25 [ctype=CORD]; - - // Repeated - repeated int32 repeated_int32 = 31; - repeated int64 repeated_int64 = 32; - repeated uint32 repeated_uint32 = 33; - repeated uint64 repeated_uint64 = 34; - repeated sint32 repeated_sint32 = 35; - repeated sint64 repeated_sint64 = 36; - repeated fixed32 repeated_fixed32 = 37; - repeated fixed64 repeated_fixed64 = 38; - repeated sfixed32 repeated_sfixed32 = 39; - repeated sfixed64 repeated_sfixed64 = 40; - repeated float repeated_float = 41; - repeated double repeated_double = 42; - repeated bool repeated_bool = 43; - repeated string repeated_string = 44; - repeated bytes repeated_bytes = 45; - - repeated group RepeatedGroup = 46 { - optional int32 a = 47; - } - - repeated NestedMessage repeated_nested_message = 48; - repeated ForeignMessage repeated_foreign_message = 49; - repeated protobuf_unittest_import.ImportMessage repeated_import_message = 50; - - repeated NestedEnum repeated_nested_enum = 51; - repeated ForeignEnum repeated_foreign_enum = 52; - repeated protobuf_unittest_import.ImportEnum repeated_import_enum = 53; - - repeated string repeated_string_piece = 54 [ctype=STRING_PIECE]; - repeated string repeated_cord = 55 [ctype=CORD]; - - // Singular with defaults - optional int32 default_int32 = 61 [default = 41 ]; - optional int64 default_int64 = 62 [default = 42 ]; - optional uint32 default_uint32 = 63 [default = 43 ]; - optional uint64 default_uint64 = 64 [default = 44 ]; - optional sint32 default_sint32 = 65 [default = -45 ]; - optional sint64 default_sint64 = 66 [default = 46 ]; - optional fixed32 default_fixed32 = 67 [default = 47 ]; - optional fixed64 default_fixed64 = 68 [default = 48 ]; - optional sfixed32 default_sfixed32 = 69 [default = 49 ]; - optional sfixed64 default_sfixed64 = 70 [default = -50 ]; - optional float default_float = 71 [default = 51.5 ]; - optional double default_double = 72 [default = 52e3 ]; - optional bool default_bool = 73 [default = true ]; - optional string default_string = 74 [default = "hello"]; - optional bytes default_bytes = 75 [default = "world"]; - - optional NestedEnum default_nested_enum = 81 [default = BAR ]; - optional ForeignEnum default_foreign_enum = 82 [default = FOREIGN_BAR]; - optional protobuf_unittest_import.ImportEnum - default_import_enum = 83 [default = IMPORT_BAR]; - - optional string default_string_piece = 84 [ctype=STRING_PIECE,default="abc"]; - optional string default_cord = 85 [ctype=CORD,default="123"]; -} - -message TestDeprecatedFields { - optional int32 deprecated_int32 = 1 [deprecated=true]; -} - -// Define these after TestAllTypes to make sure the compiler can handle -// that. -message ForeignMessage { - optional int32 c = 1; -} - -enum ForeignEnum { - FOREIGN_FOO = 4; - FOREIGN_BAR = 5; - FOREIGN_BAZ = 6; -} - -message TestAllExtensions { - extensions 1 to max; -} - -extend TestAllExtensions { - // Singular - optional int32 optional_int32_extension = 1; - optional int64 optional_int64_extension = 2; - optional uint32 optional_uint32_extension = 3; - optional uint64 optional_uint64_extension = 4; - optional sint32 optional_sint32_extension = 5; - optional sint64 optional_sint64_extension = 6; - optional fixed32 optional_fixed32_extension = 7; - optional fixed64 optional_fixed64_extension = 8; - optional sfixed32 optional_sfixed32_extension = 9; - optional sfixed64 optional_sfixed64_extension = 10; - optional float optional_float_extension = 11; - optional double optional_double_extension = 12; - optional bool optional_bool_extension = 13; - optional string optional_string_extension = 14; - optional bytes optional_bytes_extension = 15; - - optional group OptionalGroup_extension = 16 { - optional int32 a = 17; - } - - optional TestAllTypes.NestedMessage optional_nested_message_extension = 18; - optional ForeignMessage optional_foreign_message_extension = 19; - optional protobuf_unittest_import.ImportMessage - optional_import_message_extension = 20; - - optional TestAllTypes.NestedEnum optional_nested_enum_extension = 21; - optional ForeignEnum optional_foreign_enum_extension = 22; - optional protobuf_unittest_import.ImportEnum - optional_import_enum_extension = 23; - - optional string optional_string_piece_extension = 24 [ctype=STRING_PIECE]; - optional string optional_cord_extension = 25 [ctype=CORD]; - - // Repeated - repeated int32 repeated_int32_extension = 31; - repeated int64 repeated_int64_extension = 32; - repeated uint32 repeated_uint32_extension = 33; - repeated uint64 repeated_uint64_extension = 34; - repeated sint32 repeated_sint32_extension = 35; - repeated sint64 repeated_sint64_extension = 36; - repeated fixed32 repeated_fixed32_extension = 37; - repeated fixed64 repeated_fixed64_extension = 38; - repeated sfixed32 repeated_sfixed32_extension = 39; - repeated sfixed64 repeated_sfixed64_extension = 40; - repeated float repeated_float_extension = 41; - repeated double repeated_double_extension = 42; - repeated bool repeated_bool_extension = 43; - repeated string repeated_string_extension = 44; - repeated bytes repeated_bytes_extension = 45; - - repeated group RepeatedGroup_extension = 46 { - optional int32 a = 47; - } - - repeated TestAllTypes.NestedMessage repeated_nested_message_extension = 48; - repeated ForeignMessage repeated_foreign_message_extension = 49; - repeated protobuf_unittest_import.ImportMessage - repeated_import_message_extension = 50; - - repeated TestAllTypes.NestedEnum repeated_nested_enum_extension = 51; - repeated ForeignEnum repeated_foreign_enum_extension = 52; - repeated protobuf_unittest_import.ImportEnum - repeated_import_enum_extension = 53; - - repeated string repeated_string_piece_extension = 54 [ctype=STRING_PIECE]; - repeated string repeated_cord_extension = 55 [ctype=CORD]; - - // Singular with defaults - optional int32 default_int32_extension = 61 [default = 41 ]; - optional int64 default_int64_extension = 62 [default = 42 ]; - optional uint32 default_uint32_extension = 63 [default = 43 ]; - optional uint64 default_uint64_extension = 64 [default = 44 ]; - optional sint32 default_sint32_extension = 65 [default = -45 ]; - optional sint64 default_sint64_extension = 66 [default = 46 ]; - optional fixed32 default_fixed32_extension = 67 [default = 47 ]; - optional fixed64 default_fixed64_extension = 68 [default = 48 ]; - optional sfixed32 default_sfixed32_extension = 69 [default = 49 ]; - optional sfixed64 default_sfixed64_extension = 70 [default = -50 ]; - optional float default_float_extension = 71 [default = 51.5 ]; - optional double default_double_extension = 72 [default = 52e3 ]; - optional bool default_bool_extension = 73 [default = true ]; - optional string default_string_extension = 74 [default = "hello"]; - optional bytes default_bytes_extension = 75 [default = "world"]; - - optional TestAllTypes.NestedEnum - default_nested_enum_extension = 81 [default = BAR]; - optional ForeignEnum - default_foreign_enum_extension = 82 [default = FOREIGN_BAR]; - optional protobuf_unittest_import.ImportEnum - default_import_enum_extension = 83 [default = IMPORT_BAR]; - - optional string default_string_piece_extension = 84 [ctype=STRING_PIECE, - default="abc"]; - optional string default_cord_extension = 85 [ctype=CORD, default="123"]; -} - -message TestNestedExtension { - extend TestAllExtensions { - // Check for bug where string extensions declared in tested scope did not - // compile. - optional string test = 1002 [default="test"]; - } -} - -// We have separate messages for testing required fields because it's -// annoying to have to fill in required fields in TestProto in order to -// do anything with it. Note that we don't need to test every type of -// required filed because the code output is basically identical to -// optional fields for all types. -message TestRequired { - required int32 a = 1; - optional int32 dummy2 = 2; - required int32 b = 3; - - extend TestAllExtensions { - optional TestRequired single = 1000; - repeated TestRequired multi = 1001; - } - - // Pad the field count to 32 so that we can test that IsInitialized() - // properly checks multiple elements of has_bits_. - optional int32 dummy4 = 4; - optional int32 dummy5 = 5; - optional int32 dummy6 = 6; - optional int32 dummy7 = 7; - optional int32 dummy8 = 8; - optional int32 dummy9 = 9; - optional int32 dummy10 = 10; - optional int32 dummy11 = 11; - optional int32 dummy12 = 12; - optional int32 dummy13 = 13; - optional int32 dummy14 = 14; - optional int32 dummy15 = 15; - optional int32 dummy16 = 16; - optional int32 dummy17 = 17; - optional int32 dummy18 = 18; - optional int32 dummy19 = 19; - optional int32 dummy20 = 20; - optional int32 dummy21 = 21; - optional int32 dummy22 = 22; - optional int32 dummy23 = 23; - optional int32 dummy24 = 24; - optional int32 dummy25 = 25; - optional int32 dummy26 = 26; - optional int32 dummy27 = 27; - optional int32 dummy28 = 28; - optional int32 dummy29 = 29; - optional int32 dummy30 = 30; - optional int32 dummy31 = 31; - optional int32 dummy32 = 32; - - required int32 c = 33; -} - -message TestRequiredForeign { - optional TestRequired optional_message = 1; - repeated TestRequired repeated_message = 2; - optional int32 dummy = 3; -} - -// Test that we can use NestedMessage from outside TestAllTypes. -message TestForeignNested { - optional TestAllTypes.NestedMessage foreign_nested = 1; -} - -// TestEmptyMessage is used to test unknown field support. -message TestEmptyMessage { -} - -// Like above, but declare all field numbers as potential extensions. No -// actual extensions should ever be defined for this type. -message TestEmptyMessageWithExtensions { - extensions 1 to max; -} - -message TestMultipleExtensionRanges { - extensions 42; - extensions 4143 to 4243; - extensions 65536 to max; -} - -// Test that really large tag numbers don't break anything. -message TestReallyLargeTagNumber { - // The largest possible tag number is 2^28 - 1, since the wire format uses - // three bits to communicate wire type. - optional int32 a = 1; - optional int32 bb = 268435455; -} - -message TestRecursiveMessage { - optional TestRecursiveMessage a = 1; - optional int32 i = 2; -} - -// Test that mutual recursion works. -message TestMutualRecursionA { - optional TestMutualRecursionB bb = 1; -} - -message TestMutualRecursionB { - optional TestMutualRecursionA a = 1; - optional int32 optional_int32 = 2; -} - -// Test that groups have disjoint field numbers from their siblings and -// parents. This is NOT possible in proto1; only proto2. When attempting -// to compile with proto1, this will emit an error; so we only include it -// in protobuf_unittest_proto. -message TestDupFieldNumber { // NO_PROTO1 - optional int32 a = 1; // NO_PROTO1 - optional group Foo = 2 { optional int32 a = 1; } // NO_PROTO1 - optional group Bar = 3 { optional int32 a = 1; } // NO_PROTO1 -} // NO_PROTO1 - - -// Needed for a Python test. -message TestNestedMessageHasBits { - message NestedMessage { - repeated int32 nestedmessage_repeated_int32 = 1; - repeated ForeignMessage nestedmessage_repeated_foreignmessage = 2; - } - optional NestedMessage optional_nested_message = 1; -} - - -// Test an enum that has multiple values with the same number. -enum TestEnumWithDupValue { - FOO1 = 1; - BAR1 = 2; - BAZ = 3; - FOO2 = 1; - BAR2 = 2; -} - -// Test an enum with large, unordered values. -enum TestSparseEnum { - SPARSE_A = 123; - SPARSE_B = 62374; - SPARSE_C = 12589234; - SPARSE_D = -15; - SPARSE_E = -53452; - SPARSE_F = 0; - SPARSE_G = 2; -} - -// Test message with CamelCase field names. This violates Protocol Buffer -// standard style. -message TestCamelCaseFieldNames { - optional int32 PrimitiveField = 1; - optional string StringField = 2; - optional ForeignEnum EnumField = 3; - optional ForeignMessage MessageField = 4; - optional string StringPieceField = 5 [ctype=STRING_PIECE]; - optional string CordField = 6 [ctype=CORD]; - - repeated int32 RepeatedPrimitiveField = 7; - repeated string RepeatedStringField = 8; - repeated ForeignEnum RepeatedEnumField = 9; - repeated ForeignMessage RepeatedMessageField = 10; - repeated string RepeatedStringPieceField = 11 [ctype=STRING_PIECE]; - repeated string RepeatedCordField = 12 [ctype=CORD]; -} - - -// We list fields out of order, to ensure that we're using field number and not -// field index to determine serialization order. -message TestFieldOrderings { - optional string my_string = 11; - extensions 2 to 10; - optional int64 my_int = 1; - extensions 12 to 100; - optional float my_float = 101; -} - - -extend TestFieldOrderings { - optional string my_extension_string = 50; - optional int32 my_extension_int = 5; -} - - -message TestExtremeDefaultValues { - optional bytes escaped_bytes = 1 [default = "\0\001\a\b\f\n\r\t\v\\\'\"\xfe"]; - optional uint32 large_uint32 = 2 [default = 0xFFFFFFFF]; - optional uint64 large_uint64 = 3 [default = 0xFFFFFFFFFFFFFFFF]; - optional int32 small_int32 = 4 [default = -0x7FFFFFFF]; - optional int64 small_int64 = 5 [default = -0x7FFFFFFFFFFFFFFF]; - - // The default value here is UTF-8 for "\u1234". (We could also just type - // the UTF-8 text directly into this text file rather than escape it, but - // lots of people use editors that would be confused by this.) - optional string utf8_string = 6 [default = "\341\210\264"]; - - // Tests for single-precision floating-point values. - optional float zero_float = 7 [default = 0]; - optional float one_float = 8 [default = 1]; - optional float small_float = 9 [default = 1.5]; - optional float negative_one_float = 10 [default = -1]; - optional float negative_float = 11 [default = -1.5]; - // Using exponents - optional float large_float = 12 [default = 2E8]; - optional float small_negative_float = 13 [default = -8e-28]; - - // Text for nonfinite floating-point values. - optional double inf_double = 14 [default = inf]; - optional double neg_inf_double = 15 [default = -inf]; - optional double nan_double = 16 [default = nan]; - optional float inf_float = 17 [default = inf]; - optional float neg_inf_float = 18 [default = -inf]; - optional float nan_float = 19 [default = nan]; - - // Tests for C++ trigraphs. - // Trigraphs should be escaped in C++ generated files, but they should not be - // escaped for other languages. - // Note that in .proto file, "\?" is a valid way to escape ? in string - // literals. - optional string cpp_trigraph = 20 [default = "? \? ?? \?? \??? ??/ ?\?-"]; -} - -message SparseEnumMessage { - optional TestSparseEnum sparse_enum = 1; -} - -// Test String and Bytes: string is for valid UTF-8 strings -message OneString { - optional string data = 1; -} - -message OneBytes { - optional bytes data = 1; -} - -// Test messages for packed fields - -message TestPackedTypes { - repeated int32 packed_int32 = 90 [packed = true]; - repeated int64 packed_int64 = 91 [packed = true]; - repeated uint32 packed_uint32 = 92 [packed = true]; - repeated uint64 packed_uint64 = 93 [packed = true]; - repeated sint32 packed_sint32 = 94 [packed = true]; - repeated sint64 packed_sint64 = 95 [packed = true]; - repeated fixed32 packed_fixed32 = 96 [packed = true]; - repeated fixed64 packed_fixed64 = 97 [packed = true]; - repeated sfixed32 packed_sfixed32 = 98 [packed = true]; - repeated sfixed64 packed_sfixed64 = 99 [packed = true]; - repeated float packed_float = 100 [packed = true]; - repeated double packed_double = 101 [packed = true]; - repeated bool packed_bool = 102 [packed = true]; - repeated ForeignEnum packed_enum = 103 [packed = true]; -} - -// A message with the same fields as TestPackedTypes, but without packing. Used -// to test packed <-> unpacked wire compatibility. -message TestUnpackedTypes { - repeated int32 unpacked_int32 = 90 [packed = false]; - repeated int64 unpacked_int64 = 91 [packed = false]; - repeated uint32 unpacked_uint32 = 92 [packed = false]; - repeated uint64 unpacked_uint64 = 93 [packed = false]; - repeated sint32 unpacked_sint32 = 94 [packed = false]; - repeated sint64 unpacked_sint64 = 95 [packed = false]; - repeated fixed32 unpacked_fixed32 = 96 [packed = false]; - repeated fixed64 unpacked_fixed64 = 97 [packed = false]; - repeated sfixed32 unpacked_sfixed32 = 98 [packed = false]; - repeated sfixed64 unpacked_sfixed64 = 99 [packed = false]; - repeated float unpacked_float = 100 [packed = false]; - repeated double unpacked_double = 101 [packed = false]; - repeated bool unpacked_bool = 102 [packed = false]; - repeated ForeignEnum unpacked_enum = 103 [packed = false]; -} - -message TestPackedExtensions { - extensions 1 to max; -} - -extend TestPackedExtensions { - repeated int32 packed_int32_extension = 90 [packed = true]; - repeated int64 packed_int64_extension = 91 [packed = true]; - repeated uint32 packed_uint32_extension = 92 [packed = true]; - repeated uint64 packed_uint64_extension = 93 [packed = true]; - repeated sint32 packed_sint32_extension = 94 [packed = true]; - repeated sint64 packed_sint64_extension = 95 [packed = true]; - repeated fixed32 packed_fixed32_extension = 96 [packed = true]; - repeated fixed64 packed_fixed64_extension = 97 [packed = true]; - repeated sfixed32 packed_sfixed32_extension = 98 [packed = true]; - repeated sfixed64 packed_sfixed64_extension = 99 [packed = true]; - repeated float packed_float_extension = 100 [packed = true]; - repeated double packed_double_extension = 101 [packed = true]; - repeated bool packed_bool_extension = 102 [packed = true]; - repeated ForeignEnum packed_enum_extension = 103 [packed = true]; -} - -// Used by ExtensionSetTest/DynamicExtensions. The test actually builds -// a set of extensions to TestAllExtensions dynamically, based on the fields -// of this message type. -message TestDynamicExtensions { - enum DynamicEnumType { - DYNAMIC_FOO = 2200; - DYNAMIC_BAR = 2201; - DYNAMIC_BAZ = 2202; - } - message DynamicMessageType { - optional int32 dynamic_field = 2100; - } - - optional fixed32 scalar_extension = 2000; - optional ForeignEnum enum_extension = 2001; - optional DynamicEnumType dynamic_enum_extension = 2002; - - optional ForeignMessage message_extension = 2003; - optional DynamicMessageType dynamic_message_extension = 2004; - - repeated string repeated_extension = 2005; - repeated sint32 packed_extension = 2006 [packed = true]; -} - -message TestRepeatedScalarDifferentTagSizes { - // Parsing repeated fixed size values used to fail. This message needs to be - // used in order to get a tag of the right size; all of the repeated fields - // in TestAllTypes didn't trigger the check. - repeated fixed32 repeated_fixed32 = 12; - // Check for a varint type, just for good measure. - repeated int32 repeated_int32 = 13; - - // These have two-byte tags. - repeated fixed64 repeated_fixed64 = 2046; - repeated int64 repeated_int64 = 2047; - - // Three byte tags. - repeated float repeated_float = 262142; - repeated uint64 repeated_uint64 = 262143; -} - - -// Test that RPC services work. -message FooRequest {} -message FooResponse {} - -service TestService { - rpc Foo(FooRequest) returns (FooResponse); - rpc Bar(BarRequest) returns (BarResponse); -} - - -message BarRequest {} -message BarResponse {} diff --git a/protos/google/protobuf/unittest_csharp_options.proto b/protos/google/protobuf/unittest_csharp_options.proto deleted file mode 100644 index 3769329..0000000 --- a/protos/google/protobuf/unittest_csharp_options.proto +++ /dev/null @@ -1,52 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: jonskeet@google.com (Jon Skeet) -// -// A proto file for unit testing the custom C# options - -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestCSharpOptionsProtoFile"; -//option (google.protobuf.csharp_file_options).nest_classes = true; - -package protobuf_unittest; - -message OptionsMessage { - - // Will be left as Normal - optional string normal = 1; - - // Will be converted to OptionsMessage_ - optional string options_message = 2; - - // Will be converted to CustomName - optional string customized = 3 [(google.protobuf.csharp_field_options).property_name = "CustomName"]; -} diff --git a/protos/google/protobuf/unittest_custom_options.proto b/protos/google/protobuf/unittest_custom_options.proto deleted file mode 100644 index 201fb32..0000000 --- a/protos/google/protobuf/unittest_custom_options.proto +++ /dev/null @@ -1,372 +0,0 @@ -// Additional options required for C# generation. File from copyright -// line onwards is as per original distribution. -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestCustomOptionsProtoFile"; - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: benjy@google.com (Benjy Weinberger) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// A proto file used to test the "custom options" feature of proto2. - - -// Some generic_services option(s) added automatically. -// See: http://go/proto2-generic-services-default -option cc_generic_services = true; // auto-added -option java_generic_services = true; // auto-added -option py_generic_services = true; - -// A custom file option (defined below). -option (file_opt1) = 9876543210; - -import "google/protobuf/descriptor.proto"; - -// We don't put this in a package within proto2 because we need to make sure -// that the generated code doesn't depend on being in the proto2 namespace. -package protobuf_unittest; - - -// Some simple test custom options of various types. - -extend google.protobuf.FileOptions { - optional uint64 file_opt1 = 7736974; -} - -extend google.protobuf.MessageOptions { - optional int32 message_opt1 = 7739036; -} - -extend google.protobuf.FieldOptions { - optional fixed64 field_opt1 = 7740936; - // This is useful for testing that we correctly register default values for - // extension options. - optional int32 field_opt2 = 7753913 [default=42]; -} - -extend google.protobuf.EnumOptions { - optional sfixed32 enum_opt1 = 7753576; -} - -extend google.protobuf.EnumValueOptions { - optional int32 enum_value_opt1 = 1560678; -} - -extend google.protobuf.ServiceOptions { - optional sint64 service_opt1 = 7887650; -} - -enum MethodOpt1 { - METHODOPT1_VAL1 = 1; - METHODOPT1_VAL2 = 2; -} - -extend google.protobuf.MethodOptions { - optional MethodOpt1 method_opt1 = 7890860; -} - -// A test message with custom options at all possible locations (and also some -// regular options, to make sure they interact nicely). -message TestMessageWithCustomOptions { - option message_set_wire_format = false; - - option (message_opt1) = -56; - - optional string field1 = 1 [ctype=CORD, - (field_opt1)=8765432109]; - - enum AnEnum { - option (enum_opt1) = -789; - - ANENUM_VAL1 = 1; - ANENUM_VAL2 = 2 [(enum_value_opt1) = 123]; - } -} - - -// A test RPC service with custom options at all possible locations (and also -// some regular options, to make sure they interact nicely). -message CustomOptionFooRequest { -} - -message CustomOptionFooResponse { -} - -service TestServiceWithCustomOptions { - option (service_opt1) = -9876543210; - - rpc Foo(CustomOptionFooRequest) returns (CustomOptionFooResponse) { - option (method_opt1) = METHODOPT1_VAL2; - } -} - - - -// Options of every possible field type, so we can test them all exhaustively. - -message DummyMessageContainingEnum { - enum TestEnumType { - TEST_OPTION_ENUM_TYPE1 = 22; - TEST_OPTION_ENUM_TYPE2 = -23; - } -} - -message DummyMessageInvalidAsOptionType { -} - -extend google.protobuf.MessageOptions { - optional bool bool_opt = 7706090; - optional int32 int32_opt = 7705709; - optional int64 int64_opt = 7705542; - optional uint32 uint32_opt = 7704880; - optional uint64 uint64_opt = 7702367; - optional sint32 sint32_opt = 7701568; - optional sint64 sint64_opt = 7700863; - optional fixed32 fixed32_opt = 7700307; - optional fixed64 fixed64_opt = 7700194; - optional sfixed32 sfixed32_opt = 7698645; - optional sfixed64 sfixed64_opt = 7685475; - optional float float_opt = 7675390; - optional double double_opt = 7673293; - optional string string_opt = 7673285; - optional bytes bytes_opt = 7673238; - optional DummyMessageContainingEnum.TestEnumType enum_opt = 7673233; - optional DummyMessageInvalidAsOptionType message_type_opt = 7665967; -} - -message CustomOptionMinIntegerValues { - option (bool_opt) = false; - option (int32_opt) = -0x80000000; - option (int64_opt) = -0x8000000000000000; - option (uint32_opt) = 0; - option (uint64_opt) = 0; - option (sint32_opt) = -0x80000000; - option (sint64_opt) = -0x8000000000000000; - option (fixed32_opt) = 0; - option (fixed64_opt) = 0; - option (sfixed32_opt) = -0x80000000; - option (sfixed64_opt) = -0x8000000000000000; -} - -message CustomOptionMaxIntegerValues { - option (bool_opt) = true; - option (int32_opt) = 0x7FFFFFFF; - option (int64_opt) = 0x7FFFFFFFFFFFFFFF; - option (uint32_opt) = 0xFFFFFFFF; - option (uint64_opt) = 0xFFFFFFFFFFFFFFFF; - option (sint32_opt) = 0x7FFFFFFF; - option (sint64_opt) = 0x7FFFFFFFFFFFFFFF; - option (fixed32_opt) = 0xFFFFFFFF; - option (fixed64_opt) = 0xFFFFFFFFFFFFFFFF; - option (sfixed32_opt) = 0x7FFFFFFF; - option (sfixed64_opt) = 0x7FFFFFFFFFFFFFFF; -} - -message CustomOptionOtherValues { - option (int32_opt) = -100; // To test sign-extension. - option (float_opt) = 12.3456789; - option (double_opt) = 1.234567890123456789; - option (string_opt) = "Hello, \"World\""; - option (bytes_opt) = "Hello\0World"; - option (enum_opt) = TEST_OPTION_ENUM_TYPE2; -} - -message SettingRealsFromPositiveInts { - option (float_opt) = 12; - option (double_opt) = 154; -} - -message SettingRealsFromNegativeInts { - option (float_opt) = -12; - option (double_opt) = -154; -} - -// Options of complex message types, themselves combined and extended in -// various ways. - -message ComplexOptionType1 { - optional int32 foo = 1; - optional int32 foo2 = 2; - optional int32 foo3 = 3; - - extensions 100 to max; -} - -message ComplexOptionType2 { - optional ComplexOptionType1 bar = 1; - optional int32 baz = 2; - - message ComplexOptionType4 { - optional int32 waldo = 1; - - extend google.protobuf.MessageOptions { - optional ComplexOptionType4 complex_opt4 = 7633546; - } - } - - optional ComplexOptionType4 fred = 3; - - extensions 100 to max; -} - -message ComplexOptionType3 { - optional int32 qux = 1; - - optional group ComplexOptionType5 = 2 { - optional int32 plugh = 3; - } -} - -extend ComplexOptionType1 { - optional int32 quux = 7663707; - optional ComplexOptionType3 corge = 7663442; -} - -extend ComplexOptionType2 { - optional int32 grault = 7650927; - optional ComplexOptionType1 garply = 7649992; -} - -extend google.protobuf.MessageOptions { - optional protobuf_unittest.ComplexOptionType1 complex_opt1 = 7646756; - optional ComplexOptionType2 complex_opt2 = 7636949; - optional ComplexOptionType3 complex_opt3 = 7636463; - optional group ComplexOpt6 = 7595468 { - optional int32 xyzzy = 7593951; - } -} - -// Note that we try various different ways of naming the same extension. -message VariousComplexOptions { - option (.protobuf_unittest.complex_opt1).foo = 42; - option (protobuf_unittest.complex_opt1).(.protobuf_unittest.quux) = 324; - option (.protobuf_unittest.complex_opt1).(protobuf_unittest.corge).qux = 876; - option (complex_opt2).baz = 987; - option (complex_opt2).(grault) = 654; - option (complex_opt2).bar.foo = 743; - option (complex_opt2).bar.(quux) = 1999; - option (complex_opt2).bar.(protobuf_unittest.corge).qux = 2008; - option (complex_opt2).(garply).foo = 741; - option (complex_opt2).(garply).(.protobuf_unittest.quux) = 1998; - option (complex_opt2).(protobuf_unittest.garply).(corge).qux = 2121; - option (ComplexOptionType2.ComplexOptionType4.complex_opt4).waldo = 1971; - option (complex_opt2).fred.waldo = 321; - option (protobuf_unittest.complex_opt3).qux = 9; - option (complex_opt3).complexoptiontype5.plugh = 22; - option (complexopt6).xyzzy = 24; -} - -// ------------------------------------------------------ -// Definitions for testing aggregate option parsing. -// See descriptor_unittest.cc. - -message AggregateMessageSet { - option message_set_wire_format = true; - extensions 4 to max; -} - -message AggregateMessageSetElement { - extend AggregateMessageSet { - optional AggregateMessageSetElement message_set_extension = 15447542; - } - optional string s = 1; -} - -// A helper type used to test aggregate option parsing -message Aggregate { - optional int32 i = 1; - optional string s = 2; - - // A nested object - optional Aggregate sub = 3; - - // To test the parsing of extensions inside aggregate values - optional google.protobuf.FileOptions file = 4; - extend google.protobuf.FileOptions { - optional Aggregate nested = 15476903; - } - - // An embedded message set - optional AggregateMessageSet mset = 5; -} - -// Allow Aggregate to be used as an option at all possible locations -// in the .proto grammer. -extend google.protobuf.FileOptions { optional Aggregate fileopt = 15478479; } -extend google.protobuf.MessageOptions { optional Aggregate msgopt = 15480088; } -extend google.protobuf.FieldOptions { optional Aggregate fieldopt = 15481374; } -extend google.protobuf.EnumOptions { optional Aggregate enumopt_renamed = 15483218; } -extend google.protobuf.EnumValueOptions { optional Aggregate enumvalopt = 15486921; } -extend google.protobuf.ServiceOptions { optional Aggregate serviceopt = 15497145; } -extend google.protobuf.MethodOptions { optional Aggregate methodopt = 15512713; } - -// Try using AggregateOption at different points in the proto grammar -option (fileopt) = { - s: 'FileAnnotation' - // Also test the handling of comments - /* of both types */ i: 100 - - sub { s: 'NestedFileAnnotation' } - - // Include a google.protobuf.FileOptions and recursively extend it with - // another fileopt. - file { - [protobuf_unittest.fileopt] { - s:'FileExtensionAnnotation' - } - } - - // A message set inside an option value - mset { - [protobuf_unittest.AggregateMessageSetElement.message_set_extension] { - s: 'EmbeddedMessageSetElement' - } - } -}; - -message AggregateMessage { - option (msgopt) = { i:101 s:'MessageAnnotation' }; - optional int32 fieldname = 1 [(fieldopt) = { s:'FieldAnnotation' }]; -} - -service AggregateService { - option (serviceopt) = { s:'ServiceAnnotation' }; - rpc Method (AggregateMessage) returns (AggregateMessage) { - option (methodopt) = { s:'MethodAnnotation' }; - } -} - -enum AggregateEnum { - option (enumopt_renamed) = { s:'EnumAnnotation' }; - VALUE = 1 [(enumvalopt) = { s:'EnumValueAnnotation' }]; -} diff --git a/protos/google/protobuf/unittest_embed_optimize_for.proto b/protos/google/protobuf/unittest_embed_optimize_for.proto deleted file mode 100644 index 5625538..0000000 --- a/protos/google/protobuf/unittest_embed_optimize_for.proto +++ /dev/null @@ -1,56 +0,0 @@ -// Additional options required for C# generation. File from copyright -// line onwards is as per original distribution. -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestEmbedOptimizeForProtoFile"; - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// A proto file which imports a proto file that uses optimize_for = CODE_SIZE. - -import "google/protobuf/unittest_optimize_for.proto"; - -package protobuf_unittest; - -// We optimize for speed here, but we are importing a proto that is optimized -// for code size. -option optimize_for = SPEED; - -message TestEmbedOptimizedForSize { - // Test that embedding a message which has optimize_for = CODE_SIZE into - // one optimized for speed works. - optional TestOptimizedForSize optional_message = 1; - repeated TestOptimizedForSize repeated_message = 2; -} diff --git a/protos/google/protobuf/unittest_empty.proto b/protos/google/protobuf/unittest_empty.proto deleted file mode 100644 index f6b532a..0000000 --- a/protos/google/protobuf/unittest_empty.proto +++ /dev/null @@ -1,43 +0,0 @@ -// Additional options required for C# generation. File from copyright -// line onwards is as per original distribution. -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestEmptyProtoFile"; - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// This file intentionally left blank. (At one point this wouldn't compile -// correctly.) - diff --git a/protos/google/protobuf/unittest_enormous_descriptor.proto b/protos/google/protobuf/unittest_enormous_descriptor.proto deleted file mode 100644 index fa97778..0000000 --- a/protos/google/protobuf/unittest_enormous_descriptor.proto +++ /dev/null @@ -1,1052 +0,0 @@ -// Additional options required for C# generation. File from copyright -// line onwards is as per original distribution. -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestEnormousDescriptorProtoFile"; - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// A proto file that has an extremely large descriptor. Used to test that -// descriptors over 64k don't break the string literal length limit in Java. - - -package google.protobuf; -option java_package = "com.google.protobuf"; - -// Avoid generating insanely long methods. -option optimize_for = CODE_SIZE; - -message TestEnormousDescriptor { - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_1 = 1 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_2 = 2 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_3 = 3 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_4 = 4 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_5 = 5 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_6 = 6 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_7 = 7 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_8 = 8 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_9 = 9 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_10 = 10 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_11 = 11 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_12 = 12 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_13 = 13 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_14 = 14 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_15 = 15 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_16 = 16 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_17 = 17 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_18 = 18 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_19 = 19 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_20 = 20 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_21 = 21 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_22 = 22 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_23 = 23 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_24 = 24 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_25 = 25 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_26 = 26 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_27 = 27 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_28 = 28 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_29 = 29 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_30 = 30 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_31 = 31 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_32 = 32 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_33 = 33 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_34 = 34 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_35 = 35 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_36 = 36 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_37 = 37 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_38 = 38 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_39 = 39 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_40 = 40 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_41 = 41 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_42 = 42 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_43 = 43 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_44 = 44 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_45 = 45 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_46 = 46 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_47 = 47 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_48 = 48 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_49 = 49 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_50 = 50 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_51 = 51 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_52 = 52 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_53 = 53 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_54 = 54 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_55 = 55 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_56 = 56 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_57 = 57 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_58 = 58 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_59 = 59 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_60 = 60 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_61 = 61 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_62 = 62 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_63 = 63 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_64 = 64 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_65 = 65 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_66 = 66 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_67 = 67 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_68 = 68 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_69 = 69 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_70 = 70 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_71 = 71 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_72 = 72 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_73 = 73 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_74 = 74 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_75 = 75 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_76 = 76 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_77 = 77 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_78 = 78 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_79 = 79 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_80 = 80 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_81 = 81 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_82 = 82 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_83 = 83 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_84 = 84 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_85 = 85 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_86 = 86 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_87 = 87 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_88 = 88 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_89 = 89 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_90 = 90 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_91 = 91 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_92 = 92 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_93 = 93 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_94 = 94 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_95 = 95 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_96 = 96 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_97 = 97 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_98 = 98 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_99 = 99 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_100 = 100 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_101 = 101 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_102 = 102 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_103 = 103 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_104 = 104 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_105 = 105 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_106 = 106 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_107 = 107 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_108 = 108 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_109 = 109 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_110 = 110 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_111 = 111 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_112 = 112 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_113 = 113 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_114 = 114 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_115 = 115 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_116 = 116 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_117 = 117 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_118 = 118 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_119 = 119 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_120 = 120 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_121 = 121 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_122 = 122 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_123 = 123 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_124 = 124 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_125 = 125 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_126 = 126 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_127 = 127 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_128 = 128 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_129 = 129 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_130 = 130 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_131 = 131 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_132 = 132 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_133 = 133 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_134 = 134 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_135 = 135 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_136 = 136 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_137 = 137 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_138 = 138 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_139 = 139 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_140 = 140 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_141 = 141 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_142 = 142 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_143 = 143 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_144 = 144 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_145 = 145 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_146 = 146 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_147 = 147 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_148 = 148 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_149 = 149 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_150 = 150 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_151 = 151 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_152 = 152 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_153 = 153 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_154 = 154 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_155 = 155 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_156 = 156 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_157 = 157 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_158 = 158 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_159 = 159 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_160 = 160 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_161 = 161 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_162 = 162 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_163 = 163 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_164 = 164 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_165 = 165 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_166 = 166 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_167 = 167 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_168 = 168 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_169 = 169 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_170 = 170 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_171 = 171 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_172 = 172 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_173 = 173 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_174 = 174 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_175 = 175 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_176 = 176 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_177 = 177 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_178 = 178 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_179 = 179 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_180 = 180 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_181 = 181 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_182 = 182 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_183 = 183 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_184 = 184 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_185 = 185 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_186 = 186 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_187 = 187 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_188 = 188 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_189 = 189 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_190 = 190 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_191 = 191 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_192 = 192 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_193 = 193 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_194 = 194 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_195 = 195 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_196 = 196 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_197 = 197 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_198 = 198 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_199 = 199 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_200 = 200 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_201 = 201 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_202 = 202 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_203 = 203 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_204 = 204 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_205 = 205 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_206 = 206 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_207 = 207 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_208 = 208 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_209 = 209 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_210 = 210 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_211 = 211 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_212 = 212 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_213 = 213 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_214 = 214 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_215 = 215 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_216 = 216 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_217 = 217 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_218 = 218 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_219 = 219 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_220 = 220 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_221 = 221 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_222 = 222 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_223 = 223 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_224 = 224 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_225 = 225 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_226 = 226 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_227 = 227 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_228 = 228 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_229 = 229 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_230 = 230 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_231 = 231 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_232 = 232 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_233 = 233 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_234 = 234 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_235 = 235 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_236 = 236 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_237 = 237 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_238 = 238 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_239 = 239 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_240 = 240 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_241 = 241 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_242 = 242 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_243 = 243 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_244 = 244 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_245 = 245 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_246 = 246 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_247 = 247 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_248 = 248 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_249 = 249 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_250 = 250 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_251 = 251 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_252 = 252 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_253 = 253 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_254 = 254 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_255 = 255 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_256 = 256 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_257 = 257 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_258 = 258 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_259 = 259 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_260 = 260 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_261 = 261 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_262 = 262 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_263 = 263 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_264 = 264 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_265 = 265 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_266 = 266 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_267 = 267 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_268 = 268 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_269 = 269 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_270 = 270 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_271 = 271 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_272 = 272 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_273 = 273 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_274 = 274 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_275 = 275 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_276 = 276 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_277 = 277 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_278 = 278 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_279 = 279 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_280 = 280 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_281 = 281 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_282 = 282 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_283 = 283 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_284 = 284 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_285 = 285 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_286 = 286 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_287 = 287 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_288 = 288 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_289 = 289 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_290 = 290 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_291 = 291 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_292 = 292 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_293 = 293 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_294 = 294 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_295 = 295 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_296 = 296 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_297 = 297 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_298 = 298 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_299 = 299 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_300 = 300 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_301 = 301 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_302 = 302 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_303 = 303 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_304 = 304 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_305 = 305 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_306 = 306 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_307 = 307 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_308 = 308 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_309 = 309 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_310 = 310 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_311 = 311 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_312 = 312 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_313 = 313 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_314 = 314 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_315 = 315 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_316 = 316 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_317 = 317 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_318 = 318 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_319 = 319 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_320 = 320 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_321 = 321 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_322 = 322 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_323 = 323 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_324 = 324 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_325 = 325 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_326 = 326 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_327 = 327 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_328 = 328 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_329 = 329 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_330 = 330 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_331 = 331 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_332 = 332 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_333 = 333 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_334 = 334 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_335 = 335 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_336 = 336 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_337 = 337 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_338 = 338 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_339 = 339 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_340 = 340 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_341 = 341 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_342 = 342 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_343 = 343 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_344 = 344 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_345 = 345 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_346 = 346 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_347 = 347 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_348 = 348 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_349 = 349 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_350 = 350 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_351 = 351 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_352 = 352 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_353 = 353 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_354 = 354 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_355 = 355 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_356 = 356 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_357 = 357 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_358 = 358 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_359 = 359 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_360 = 360 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_361 = 361 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_362 = 362 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_363 = 363 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_364 = 364 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_365 = 365 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_366 = 366 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_367 = 367 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_368 = 368 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_369 = 369 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_370 = 370 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_371 = 371 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_372 = 372 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_373 = 373 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_374 = 374 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_375 = 375 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_376 = 376 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_377 = 377 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_378 = 378 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_379 = 379 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_380 = 380 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_381 = 381 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_382 = 382 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_383 = 383 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_384 = 384 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_385 = 385 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_386 = 386 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_387 = 387 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_388 = 388 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_389 = 389 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_390 = 390 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_391 = 391 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_392 = 392 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_393 = 393 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_394 = 394 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_395 = 395 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_396 = 396 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_397 = 397 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_398 = 398 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_399 = 399 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_400 = 400 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_401 = 401 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_402 = 402 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_403 = 403 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_404 = 404 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_405 = 405 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_406 = 406 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_407 = 407 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_408 = 408 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_409 = 409 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_410 = 410 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_411 = 411 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_412 = 412 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_413 = 413 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_414 = 414 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_415 = 415 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_416 = 416 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_417 = 417 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_418 = 418 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_419 = 419 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_420 = 420 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_421 = 421 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_422 = 422 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_423 = 423 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_424 = 424 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_425 = 425 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_426 = 426 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_427 = 427 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_428 = 428 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_429 = 429 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_430 = 430 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_431 = 431 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_432 = 432 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_433 = 433 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_434 = 434 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_435 = 435 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_436 = 436 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_437 = 437 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_438 = 438 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_439 = 439 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_440 = 440 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_441 = 441 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_442 = 442 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_443 = 443 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_444 = 444 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_445 = 445 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_446 = 446 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_447 = 447 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_448 = 448 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_449 = 449 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_450 = 450 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_451 = 451 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_452 = 452 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_453 = 453 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_454 = 454 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_455 = 455 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_456 = 456 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_457 = 457 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_458 = 458 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_459 = 459 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_460 = 460 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_461 = 461 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_462 = 462 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_463 = 463 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_464 = 464 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_465 = 465 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_466 = 466 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_467 = 467 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_468 = 468 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_469 = 469 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_470 = 470 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_471 = 471 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_472 = 472 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_473 = 473 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_474 = 474 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_475 = 475 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_476 = 476 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_477 = 477 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_478 = 478 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_479 = 479 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_480 = 480 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_481 = 481 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_482 = 482 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_483 = 483 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_484 = 484 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_485 = 485 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_486 = 486 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_487 = 487 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_488 = 488 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_489 = 489 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_490 = 490 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_491 = 491 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_492 = 492 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_493 = 493 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_494 = 494 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_495 = 495 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_496 = 496 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_497 = 497 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_498 = 498 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_499 = 499 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_500 = 500 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_501 = 501 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_502 = 502 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_503 = 503 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_504 = 504 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_505 = 505 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_506 = 506 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_507 = 507 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_508 = 508 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_509 = 509 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_510 = 510 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_511 = 511 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_512 = 512 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_513 = 513 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_514 = 514 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_515 = 515 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_516 = 516 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_517 = 517 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_518 = 518 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_519 = 519 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_520 = 520 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_521 = 521 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_522 = 522 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_523 = 523 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_524 = 524 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_525 = 525 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_526 = 526 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_527 = 527 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_528 = 528 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_529 = 529 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_530 = 530 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_531 = 531 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_532 = 532 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_533 = 533 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_534 = 534 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_535 = 535 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_536 = 536 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_537 = 537 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_538 = 538 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_539 = 539 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_540 = 540 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_541 = 541 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_542 = 542 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_543 = 543 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_544 = 544 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_545 = 545 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_546 = 546 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_547 = 547 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_548 = 548 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_549 = 549 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_550 = 550 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_551 = 551 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_552 = 552 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_553 = 553 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_554 = 554 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_555 = 555 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_556 = 556 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_557 = 557 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_558 = 558 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_559 = 559 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_560 = 560 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_561 = 561 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_562 = 562 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_563 = 563 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_564 = 564 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_565 = 565 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_566 = 566 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_567 = 567 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_568 = 568 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_569 = 569 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_570 = 570 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_571 = 571 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_572 = 572 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_573 = 573 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_574 = 574 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_575 = 575 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_576 = 576 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_577 = 577 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_578 = 578 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_579 = 579 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_580 = 580 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_581 = 581 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_582 = 582 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_583 = 583 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_584 = 584 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_585 = 585 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_586 = 586 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_587 = 587 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_588 = 588 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_589 = 589 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_590 = 590 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_591 = 591 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_592 = 592 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_593 = 593 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_594 = 594 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_595 = 595 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_596 = 596 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_597 = 597 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_598 = 598 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_599 = 599 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_600 = 600 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_601 = 601 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_602 = 602 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_603 = 603 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_604 = 604 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_605 = 605 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_606 = 606 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_607 = 607 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_608 = 608 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_609 = 609 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_610 = 610 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_611 = 611 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_612 = 612 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_613 = 613 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_614 = 614 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_615 = 615 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_616 = 616 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_617 = 617 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_618 = 618 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_619 = 619 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_620 = 620 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_621 = 621 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_622 = 622 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_623 = 623 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_624 = 624 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_625 = 625 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_626 = 626 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_627 = 627 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_628 = 628 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_629 = 629 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_630 = 630 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_631 = 631 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_632 = 632 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_633 = 633 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_634 = 634 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_635 = 635 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_636 = 636 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_637 = 637 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_638 = 638 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_639 = 639 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_640 = 640 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_641 = 641 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_642 = 642 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_643 = 643 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_644 = 644 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_645 = 645 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_646 = 646 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_647 = 647 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_648 = 648 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_649 = 649 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_650 = 650 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_651 = 651 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_652 = 652 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_653 = 653 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_654 = 654 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_655 = 655 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_656 = 656 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_657 = 657 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_658 = 658 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_659 = 659 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_660 = 660 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_661 = 661 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_662 = 662 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_663 = 663 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_664 = 664 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_665 = 665 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_666 = 666 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_667 = 667 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_668 = 668 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_669 = 669 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_670 = 670 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_671 = 671 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_672 = 672 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_673 = 673 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_674 = 674 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_675 = 675 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_676 = 676 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_677 = 677 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_678 = 678 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_679 = 679 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_680 = 680 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_681 = 681 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_682 = 682 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_683 = 683 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_684 = 684 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_685 = 685 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_686 = 686 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_687 = 687 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_688 = 688 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_689 = 689 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_690 = 690 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_691 = 691 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_692 = 692 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_693 = 693 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_694 = 694 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_695 = 695 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_696 = 696 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_697 = 697 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_698 = 698 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_699 = 699 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_700 = 700 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_701 = 701 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_702 = 702 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_703 = 703 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_704 = 704 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_705 = 705 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_706 = 706 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_707 = 707 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_708 = 708 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_709 = 709 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_710 = 710 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_711 = 711 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_712 = 712 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_713 = 713 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_714 = 714 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_715 = 715 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_716 = 716 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_717 = 717 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_718 = 718 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_719 = 719 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_720 = 720 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_721 = 721 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_722 = 722 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_723 = 723 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_724 = 724 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_725 = 725 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_726 = 726 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_727 = 727 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_728 = 728 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_729 = 729 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_730 = 730 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_731 = 731 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_732 = 732 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_733 = 733 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_734 = 734 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_735 = 735 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_736 = 736 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_737 = 737 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_738 = 738 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_739 = 739 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_740 = 740 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_741 = 741 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_742 = 742 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_743 = 743 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_744 = 744 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_745 = 745 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_746 = 746 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_747 = 747 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_748 = 748 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_749 = 749 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_750 = 750 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_751 = 751 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_752 = 752 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_753 = 753 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_754 = 754 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_755 = 755 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_756 = 756 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_757 = 757 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_758 = 758 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_759 = 759 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_760 = 760 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_761 = 761 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_762 = 762 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_763 = 763 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_764 = 764 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_765 = 765 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_766 = 766 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_767 = 767 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_768 = 768 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_769 = 769 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_770 = 770 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_771 = 771 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_772 = 772 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_773 = 773 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_774 = 774 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_775 = 775 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_776 = 776 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_777 = 777 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_778 = 778 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_779 = 779 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_780 = 780 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_781 = 781 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_782 = 782 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_783 = 783 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_784 = 784 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_785 = 785 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_786 = 786 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_787 = 787 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_788 = 788 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_789 = 789 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_790 = 790 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_791 = 791 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_792 = 792 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_793 = 793 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_794 = 794 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_795 = 795 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_796 = 796 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_797 = 797 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_798 = 798 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_799 = 799 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_800 = 800 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_801 = 801 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_802 = 802 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_803 = 803 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_804 = 804 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_805 = 805 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_806 = 806 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_807 = 807 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_808 = 808 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_809 = 809 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_810 = 810 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_811 = 811 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_812 = 812 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_813 = 813 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_814 = 814 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_815 = 815 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_816 = 816 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_817 = 817 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_818 = 818 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_819 = 819 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_820 = 820 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_821 = 821 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_822 = 822 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_823 = 823 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_824 = 824 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_825 = 825 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_826 = 826 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_827 = 827 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_828 = 828 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_829 = 829 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_830 = 830 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_831 = 831 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_832 = 832 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_833 = 833 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_834 = 834 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_835 = 835 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_836 = 836 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_837 = 837 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_838 = 838 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_839 = 839 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_840 = 840 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_841 = 841 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_842 = 842 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_843 = 843 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_844 = 844 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_845 = 845 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_846 = 846 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_847 = 847 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_848 = 848 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_849 = 849 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_850 = 850 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_851 = 851 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_852 = 852 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_853 = 853 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_854 = 854 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_855 = 855 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_856 = 856 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_857 = 857 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_858 = 858 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_859 = 859 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_860 = 860 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_861 = 861 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_862 = 862 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_863 = 863 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_864 = 864 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_865 = 865 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_866 = 866 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_867 = 867 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_868 = 868 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_869 = 869 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_870 = 870 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_871 = 871 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_872 = 872 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_873 = 873 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_874 = 874 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_875 = 875 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_876 = 876 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_877 = 877 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_878 = 878 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_879 = 879 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_880 = 880 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_881 = 881 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_882 = 882 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_883 = 883 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_884 = 884 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_885 = 885 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_886 = 886 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_887 = 887 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_888 = 888 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_889 = 889 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_890 = 890 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_891 = 891 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_892 = 892 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_893 = 893 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_894 = 894 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_895 = 895 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_896 = 896 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_897 = 897 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_898 = 898 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_899 = 899 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_900 = 900 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_901 = 901 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_902 = 902 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_903 = 903 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_904 = 904 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_905 = 905 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_906 = 906 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_907 = 907 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_908 = 908 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_909 = 909 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_910 = 910 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_911 = 911 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_912 = 912 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_913 = 913 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_914 = 914 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_915 = 915 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_916 = 916 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_917 = 917 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_918 = 918 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_919 = 919 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_920 = 920 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_921 = 921 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_922 = 922 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_923 = 923 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_924 = 924 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_925 = 925 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_926 = 926 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_927 = 927 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_928 = 928 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_929 = 929 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_930 = 930 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_931 = 931 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_932 = 932 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_933 = 933 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_934 = 934 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_935 = 935 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_936 = 936 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_937 = 937 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_938 = 938 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_939 = 939 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_940 = 940 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_941 = 941 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_942 = 942 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_943 = 943 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_944 = 944 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_945 = 945 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_946 = 946 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_947 = 947 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_948 = 948 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_949 = 949 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_950 = 950 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_951 = 951 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_952 = 952 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_953 = 953 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_954 = 954 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_955 = 955 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_956 = 956 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_957 = 957 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_958 = 958 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_959 = 959 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_960 = 960 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_961 = 961 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_962 = 962 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_963 = 963 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_964 = 964 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_965 = 965 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_966 = 966 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_967 = 967 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_968 = 968 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_969 = 969 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_970 = 970 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_971 = 971 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_972 = 972 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_973 = 973 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_974 = 974 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_975 = 975 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_976 = 976 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_977 = 977 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_978 = 978 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_979 = 979 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_980 = 980 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_981 = 981 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_982 = 982 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_983 = 983 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_984 = 984 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_985 = 985 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_986 = 986 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_987 = 987 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_988 = 988 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_989 = 989 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_990 = 990 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_991 = 991 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_992 = 992 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_993 = 993 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_994 = 994 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_995 = 995 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_996 = 996 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_997 = 997 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_998 = 998 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_999 = 999 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; - optional string long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_1000 = 1000 [default="long default value is also loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"]; -} diff --git a/protos/google/protobuf/unittest_import.proto b/protos/google/protobuf/unittest_import.proto deleted file mode 100644 index aa68c86..0000000 --- a/protos/google/protobuf/unittest_import.proto +++ /dev/null @@ -1,67 +0,0 @@ -// Additional options required for C# generation. File from copyright -// line onwards is as per original distribution. -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestImportProtoFile"; - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// A proto file which is imported by unittest.proto to test importing. - - -// We don't put this in a package within proto2 because we need to make sure -// that the generated code doesn't depend on being in the proto2 namespace. -// In test_util.h we do -// "using namespace unittest_import = protobuf_unittest_import". -package protobuf_unittest_import; - -option optimize_for = SPEED; - -// Excercise the java_package option. -option java_package = "com.google.protobuf.test"; - -// Do not set a java_outer_classname here to verify that Proto2 works without -// one. - -message ImportMessage { - optional int32 d = 1; -} - -enum ImportEnum { - IMPORT_FOO = 7; - IMPORT_BAR = 8; - IMPORT_BAZ = 9; -} - diff --git a/protos/google/protobuf/unittest_import_lite.proto b/protos/google/protobuf/unittest_import_lite.proto deleted file mode 100644 index d8755d0..0000000 --- a/protos/google/protobuf/unittest_import_lite.proto +++ /dev/null @@ -1,55 +0,0 @@ -// Additional options required for C# generation. File from copyright -// line onwards is as per original distribution. -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestImportLiteProtoFile"; - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// -// This is like unittest_import.proto but with optimize_for = LITE_RUNTIME. - -package protobuf_unittest_import; - -option optimize_for = LITE_RUNTIME; - -option java_package = "com.google.protobuf"; - -message ImportMessageLite { - optional int32 d = 1; -} - -enum ImportEnumLite { - IMPORT_LITE_FOO = 7; - IMPORT_LITE_BAR = 8; - IMPORT_LITE_BAZ = 9; -} diff --git a/protos/google/protobuf/unittest_lite.proto b/protos/google/protobuf/unittest_lite.proto deleted file mode 100644 index 823fa1d..0000000 --- a/protos/google/protobuf/unittest_lite.proto +++ /dev/null @@ -1,318 +0,0 @@ -// Additional options required for C# generation. File from copyright -// line onwards is as per original distribution. -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestLiteProtoFile"; - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// -// This is like unittest.proto but with optimize_for = LITE_RUNTIME. - -package protobuf_unittest; - -import "google/protobuf/unittest_import_lite.proto"; - -option optimize_for = LITE_RUNTIME; - -option java_package = "com.google.protobuf"; - -// Same as TestAllTypes but with the lite runtime. -message TestAllTypesLite { - message NestedMessage { - optional int32 bb = 1; - } - - enum NestedEnum { - FOO = 1; - BAR = 2; - BAZ = 3; - } - - // Singular - optional int32 optional_int32 = 1; - optional int64 optional_int64 = 2; - optional uint32 optional_uint32 = 3; - optional uint64 optional_uint64 = 4; - optional sint32 optional_sint32 = 5; - optional sint64 optional_sint64 = 6; - optional fixed32 optional_fixed32 = 7; - optional fixed64 optional_fixed64 = 8; - optional sfixed32 optional_sfixed32 = 9; - optional sfixed64 optional_sfixed64 = 10; - optional float optional_float = 11; - optional double optional_double = 12; - optional bool optional_bool = 13; - optional string optional_string = 14; - optional bytes optional_bytes = 15; - - optional group OptionalGroup = 16 { - optional int32 a = 17; - } - - optional NestedMessage optional_nested_message = 18; - optional ForeignMessageLite optional_foreign_message = 19; - optional protobuf_unittest_import.ImportMessageLite - optional_import_message = 20; - - optional NestedEnum optional_nested_enum = 21; - optional ForeignEnumLite optional_foreign_enum = 22; - optional protobuf_unittest_import.ImportEnumLite optional_import_enum = 23; - - optional string optional_string_piece = 24 [ctype=STRING_PIECE]; - optional string optional_cord = 25 [ctype=CORD]; - - // Repeated - repeated int32 repeated_int32 = 31; - repeated int64 repeated_int64 = 32; - repeated uint32 repeated_uint32 = 33; - repeated uint64 repeated_uint64 = 34; - repeated sint32 repeated_sint32 = 35; - repeated sint64 repeated_sint64 = 36; - repeated fixed32 repeated_fixed32 = 37; - repeated fixed64 repeated_fixed64 = 38; - repeated sfixed32 repeated_sfixed32 = 39; - repeated sfixed64 repeated_sfixed64 = 40; - repeated float repeated_float = 41; - repeated double repeated_double = 42; - repeated bool repeated_bool = 43; - repeated string repeated_string = 44; - repeated bytes repeated_bytes = 45; - - repeated group RepeatedGroup = 46 { - optional int32 a = 47; - } - - repeated NestedMessage repeated_nested_message = 48; - repeated ForeignMessageLite repeated_foreign_message = 49; - repeated protobuf_unittest_import.ImportMessageLite - repeated_import_message = 50; - - repeated NestedEnum repeated_nested_enum = 51; - repeated ForeignEnumLite repeated_foreign_enum = 52; - repeated protobuf_unittest_import.ImportEnumLite repeated_import_enum = 53; - - repeated string repeated_string_piece = 54 [ctype=STRING_PIECE]; - repeated string repeated_cord = 55 [ctype=CORD]; - - // Singular with defaults - optional int32 default_int32 = 61 [default = 41 ]; - optional int64 default_int64 = 62 [default = 42 ]; - optional uint32 default_uint32 = 63 [default = 43 ]; - optional uint64 default_uint64 = 64 [default = 44 ]; - optional sint32 default_sint32 = 65 [default = -45 ]; - optional sint64 default_sint64 = 66 [default = 46 ]; - optional fixed32 default_fixed32 = 67 [default = 47 ]; - optional fixed64 default_fixed64 = 68 [default = 48 ]; - optional sfixed32 default_sfixed32 = 69 [default = 49 ]; - optional sfixed64 default_sfixed64 = 70 [default = -50 ]; - optional float default_float = 71 [default = 51.5 ]; - optional double default_double = 72 [default = 52e3 ]; - optional bool default_bool = 73 [default = true ]; - optional string default_string = 74 [default = "hello"]; - optional bytes default_bytes = 75 [default = "world"]; - - optional NestedEnum default_nested_enum = 81 [default = BAR]; - optional ForeignEnumLite default_foreign_enum = 82 - [default = FOREIGN_LITE_BAR]; - optional protobuf_unittest_import.ImportEnumLite - default_import_enum = 83 [default = IMPORT_LITE_BAR]; - - optional string default_string_piece = 84 [ctype=STRING_PIECE,default="abc"]; - optional string default_cord = 85 [ctype=CORD,default="123"]; -} - -message ForeignMessageLite { - optional int32 c = 1; -} - -enum ForeignEnumLite { - FOREIGN_LITE_FOO = 4; - FOREIGN_LITE_BAR = 5; - FOREIGN_LITE_BAZ = 6; -} - -message TestPackedTypesLite { - repeated int32 packed_int32 = 90 [packed = true]; - repeated int64 packed_int64 = 91 [packed = true]; - repeated uint32 packed_uint32 = 92 [packed = true]; - repeated uint64 packed_uint64 = 93 [packed = true]; - repeated sint32 packed_sint32 = 94 [packed = true]; - repeated sint64 packed_sint64 = 95 [packed = true]; - repeated fixed32 packed_fixed32 = 96 [packed = true]; - repeated fixed64 packed_fixed64 = 97 [packed = true]; - repeated sfixed32 packed_sfixed32 = 98 [packed = true]; - repeated sfixed64 packed_sfixed64 = 99 [packed = true]; - repeated float packed_float = 100 [packed = true]; - repeated double packed_double = 101 [packed = true]; - repeated bool packed_bool = 102 [packed = true]; - repeated ForeignEnumLite packed_enum = 103 [packed = true]; -} - -message TestAllExtensionsLite { - extensions 1 to max; -} - -extend TestAllExtensionsLite { - // Singular - optional int32 optional_int32_extension_lite = 1; - optional int64 optional_int64_extension_lite = 2; - optional uint32 optional_uint32_extension_lite = 3; - optional uint64 optional_uint64_extension_lite = 4; - optional sint32 optional_sint32_extension_lite = 5; - optional sint64 optional_sint64_extension_lite = 6; - optional fixed32 optional_fixed32_extension_lite = 7; - optional fixed64 optional_fixed64_extension_lite = 8; - optional sfixed32 optional_sfixed32_extension_lite = 9; - optional sfixed64 optional_sfixed64_extension_lite = 10; - optional float optional_float_extension_lite = 11; - optional double optional_double_extension_lite = 12; - optional bool optional_bool_extension_lite = 13; - optional string optional_string_extension_lite = 14; - optional bytes optional_bytes_extension_lite = 15; - - optional group OptionalGroup_extension_lite = 16 { - optional int32 a = 17; - } - - optional TestAllTypesLite.NestedMessage optional_nested_message_extension_lite - = 18; - optional ForeignMessageLite optional_foreign_message_extension_lite = 19; - optional protobuf_unittest_import.ImportMessageLite - optional_import_message_extension_lite = 20; - - optional TestAllTypesLite.NestedEnum optional_nested_enum_extension_lite = 21; - optional ForeignEnumLite optional_foreign_enum_extension_lite = 22; - optional protobuf_unittest_import.ImportEnumLite - optional_import_enum_extension_lite = 23; - - optional string optional_string_piece_extension_lite = 24 - [ctype=STRING_PIECE]; - optional string optional_cord_extension_lite = 25 [ctype=CORD]; - - // Repeated - repeated int32 repeated_int32_extension_lite = 31; - repeated int64 repeated_int64_extension_lite = 32; - repeated uint32 repeated_uint32_extension_lite = 33; - repeated uint64 repeated_uint64_extension_lite = 34; - repeated sint32 repeated_sint32_extension_lite = 35; - repeated sint64 repeated_sint64_extension_lite = 36; - repeated fixed32 repeated_fixed32_extension_lite = 37; - repeated fixed64 repeated_fixed64_extension_lite = 38; - repeated sfixed32 repeated_sfixed32_extension_lite = 39; - repeated sfixed64 repeated_sfixed64_extension_lite = 40; - repeated float repeated_float_extension_lite = 41; - repeated double repeated_double_extension_lite = 42; - repeated bool repeated_bool_extension_lite = 43; - repeated string repeated_string_extension_lite = 44; - repeated bytes repeated_bytes_extension_lite = 45; - - repeated group RepeatedGroup_extension_lite = 46 { - optional int32 a = 47; - } - - repeated TestAllTypesLite.NestedMessage repeated_nested_message_extension_lite - = 48; - repeated ForeignMessageLite repeated_foreign_message_extension_lite = 49; - repeated protobuf_unittest_import.ImportMessageLite - repeated_import_message_extension_lite = 50; - - repeated TestAllTypesLite.NestedEnum repeated_nested_enum_extension_lite = 51; - repeated ForeignEnumLite repeated_foreign_enum_extension_lite = 52; - repeated protobuf_unittest_import.ImportEnumLite - repeated_import_enum_extension_lite = 53; - - repeated string repeated_string_piece_extension_lite = 54 - [ctype=STRING_PIECE]; - repeated string repeated_cord_extension_lite = 55 [ctype=CORD]; - - // Singular with defaults - optional int32 default_int32_extension_lite = 61 [default = 41 ]; - optional int64 default_int64_extension_lite = 62 [default = 42 ]; - optional uint32 default_uint32_extension_lite = 63 [default = 43 ]; - optional uint64 default_uint64_extension_lite = 64 [default = 44 ]; - optional sint32 default_sint32_extension_lite = 65 [default = -45 ]; - optional sint64 default_sint64_extension_lite = 66 [default = 46 ]; - optional fixed32 default_fixed32_extension_lite = 67 [default = 47 ]; - optional fixed64 default_fixed64_extension_lite = 68 [default = 48 ]; - optional sfixed32 default_sfixed32_extension_lite = 69 [default = 49 ]; - optional sfixed64 default_sfixed64_extension_lite = 70 [default = -50 ]; - optional float default_float_extension_lite = 71 [default = 51.5 ]; - optional double default_double_extension_lite = 72 [default = 52e3 ]; - optional bool default_bool_extension_lite = 73 [default = true ]; - optional string default_string_extension_lite = 74 [default = "hello"]; - optional bytes default_bytes_extension_lite = 75 [default = "world"]; - - optional TestAllTypesLite.NestedEnum - default_nested_enum_extension_lite = 81 [default = BAR]; - optional ForeignEnumLite - default_foreign_enum_extension_lite = 82 [default = FOREIGN_LITE_BAR]; - optional protobuf_unittest_import.ImportEnumLite - default_import_enum_extension_lite = 83 [default = IMPORT_LITE_BAR]; - - optional string default_string_piece_extension_lite = 84 [ctype=STRING_PIECE, - default="abc"]; - optional string default_cord_extension_lite = 85 [ctype=CORD, default="123"]; -} - -message TestPackedExtensionsLite { - extensions 1 to max; -} - -extend TestPackedExtensionsLite { - repeated int32 packed_int32_extension_lite = 90 [packed = true]; - repeated int64 packed_int64_extension_lite = 91 [packed = true]; - repeated uint32 packed_uint32_extension_lite = 92 [packed = true]; - repeated uint64 packed_uint64_extension_lite = 93 [packed = true]; - repeated sint32 packed_sint32_extension_lite = 94 [packed = true]; - repeated sint64 packed_sint64_extension_lite = 95 [packed = true]; - repeated fixed32 packed_fixed32_extension_lite = 96 [packed = true]; - repeated fixed64 packed_fixed64_extension_lite = 97 [packed = true]; - repeated sfixed32 packed_sfixed32_extension_lite = 98 [packed = true]; - repeated sfixed64 packed_sfixed64_extension_lite = 99 [packed = true]; - repeated float packed_float_extension_lite = 100 [packed = true]; - repeated double packed_double_extension_lite = 101 [packed = true]; - repeated bool packed_bool_extension_lite = 102 [packed = true]; - repeated ForeignEnumLite packed_enum_extension_lite = 103 [packed = true]; -} - -message TestNestedExtensionLite { - extend TestAllExtensionsLite { - optional int32 nested_extension = 12345; - } -} - -// Test that deprecated fields work. We only verify that they compile (at one -// point this failed). -message TestDeprecatedLite { - optional int32 deprecated_field = 1 [deprecated = true]; -} diff --git a/protos/google/protobuf/unittest_lite_imports_nonlite.proto b/protos/google/protobuf/unittest_lite_imports_nonlite.proto deleted file mode 100644 index 8f18f4d..0000000 --- a/protos/google/protobuf/unittest_lite_imports_nonlite.proto +++ /dev/null @@ -1,49 +0,0 @@ -// Additional options required for C# generation. File from copyright -// line onwards is as per original distribution. -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestLiteImportNonLiteProtoFile"; - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// -// Tests that a "lite" message can import a regular message. - -package protobuf_unittest; - -import "google/protobuf/unittest.proto"; - -option optimize_for = LITE_RUNTIME; - -message TestLiteImportsNonlite { - optional TestAllTypes message = 1; -} diff --git a/protos/google/protobuf/unittest_mset.proto b/protos/google/protobuf/unittest_mset.proto deleted file mode 100644 index 8c74ef4..0000000 --- a/protos/google/protobuf/unittest_mset.proto +++ /dev/null @@ -1,78 +0,0 @@ -// Additional options required for C# generation. File from copyright -// line onwards is as per original distribution. -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestMessageSetProtoFile"; - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// This file contains messages for testing message_set_wire_format. - -package protobuf_unittest; - -option optimize_for = SPEED; - -// A message with message_set_wire_format. -message TestMessageSet { - option message_set_wire_format = true; - extensions 4 to max; -} - -message TestMessageSetContainer { - optional TestMessageSet message_set = 1; -} - -message TestMessageSetExtension1 { - extend TestMessageSet { - optional TestMessageSetExtension1 message_set_extension = 1545008; - } - optional int32 i = 15; -} - -message TestMessageSetExtension2 { - extend TestMessageSet { - optional TestMessageSetExtension2 message_set_extension = 1547769; - } - optional string str = 25; -} - -// MessageSet wire format is equivalent to this. -message RawMessageSet { - repeated group Item = 1 { - required int32 type_id = 2; - required bytes message = 3; - } -} - diff --git a/protos/google/protobuf/unittest_no_generic_services.proto b/protos/google/protobuf/unittest_no_generic_services.proto deleted file mode 100644 index 5ab533b..0000000 --- a/protos/google/protobuf/unittest_no_generic_services.proto +++ /dev/null @@ -1,58 +0,0 @@ -// Additional options required for C# generation. File from copyright -// line onwards is as per original distribution. -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos.NoGenericService"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestNoGenericServicesProtoFile"; - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) - -package google.protobuf.no_generic_services_test; - -// *_generic_services are false by default. - -message TestMessage { - optional int32 a = 1; - extensions 1000 to max; -} - -enum TestEnum { - FOO = 1; -} - -extend TestMessage { - optional int32 test_extension = 1000; -} - -service TestService { - rpc Foo(TestMessage) returns(TestMessage); -} diff --git a/protos/google/protobuf/unittest_optimize_for.proto b/protos/google/protobuf/unittest_optimize_for.proto deleted file mode 100644 index 99efad6..0000000 --- a/protos/google/protobuf/unittest_optimize_for.proto +++ /dev/null @@ -1,67 +0,0 @@ -// Additional options required for C# generation. File from copyright -// line onwards is as per original distribution. -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestOptimizeForProtoFile"; - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// A proto file which uses optimize_for = CODE_SIZE. - -import "google/protobuf/unittest.proto"; - -package protobuf_unittest; - -option optimize_for = CODE_SIZE; - -message TestOptimizedForSize { - optional int32 i = 1; - optional ForeignMessage msg = 19; - - extensions 1000 to max; - - extend TestOptimizedForSize { - optional int32 test_extension = 1234; - optional TestRequiredOptimizedForSize test_extension2 = 1235; - } -} - -message TestRequiredOptimizedForSize { - required int32 x = 1; -} - -message TestOptionalOptimizedForSize { - optional TestRequiredOptimizedForSize o = 1; -} diff --git a/protos/google/test/google_size.proto b/protos/google/test/google_size.proto deleted file mode 100644 index 2e777df..0000000 --- a/protos/google/test/google_size.proto +++ /dev/null @@ -1,140 +0,0 @@ -package unittest_google_size; - -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestGoogleSizeProtoFile"; - -option java_outer_classname = "GoogleSize"; -option optimize_for = CODE_SIZE; - -message SizeMessage1 { - required string field1 = 1; - optional string field9 = 9; - optional string field18 = 18; - optional bool field80 = 80 [default=false]; - optional bool field81 = 81 [default=true]; - required int32 field2 = 2; - required int32 field3 = 3; - optional int32 field280 = 280; - optional int32 field6 = 6 [default=0]; - optional int64 field22 = 22; - optional string field4 = 4; - repeated fixed64 field5 = 5; - optional bool field59 = 59 [default=false]; - optional string field7 = 7; - optional int32 field16 = 16; - optional int32 field130 = 130 [default=0]; - optional bool field12 = 12 [default=true]; - optional bool field17 = 17 [default=true]; - optional bool field13 = 13 [default=true]; - optional bool field14 = 14 [default=true]; - optional int32 field104 = 104 [default=0]; - optional int32 field100 = 100 [default=0]; - optional int32 field101 = 101 [default=0]; - optional string field102 = 102; - optional string field103 = 103; - optional int32 field29 = 29 [default=0]; - optional bool field30 = 30 [default=false]; - optional int32 field60 = 60 [default=-1]; - optional int32 field271 = 271 [default=-1]; - optional int32 field272 = 272 [default=-1]; - optional int32 field150 = 150; - optional int32 field23 = 23 [default=0]; - optional bool field24 = 24 [default=false]; - optional int32 field25 = 25 [default=0]; - optional SizeMessage1SubMessage field15 = 15; - optional bool field78 = 78; - optional int32 field67 = 67 [default=0]; - optional int32 field68 = 68; - optional int32 field128 = 128 [default=0]; - optional string field129 = 129 [default="xxxxxxxxxxxxxxxxxxxxx"]; - optional int32 field131 = 131 [default=0]; -} - -message SizeMessage1SubMessage { - optional int32 field1 = 1 [default=0]; - optional int32 field2 = 2 [default=0]; - optional int32 field3 = 3 [default=0]; - optional string field15 = 15; - optional bool field12 = 12 [default=true]; - optional int64 field13 = 13; - optional int64 field14 = 14; - optional int32 field16 = 16; - optional int32 field19 = 19 [default=2]; - optional bool field20 = 20 [default=true]; - optional bool field28 = 28 [default=true]; - optional fixed64 field21 = 21; - optional int32 field22 = 22; - optional bool field23 = 23 [ default=false ]; - optional bool field206 = 206 [default=false]; - optional fixed32 field203 = 203; - optional int32 field204 = 204; - optional string field205 = 205; - optional uint64 field207 = 207; - optional uint64 field300 = 300; -} - -message SizeMessage2 { - optional string field1 = 1; - optional int64 field3 = 3; - optional int64 field4 = 4; - optional int64 field30 = 30; - optional bool field75 = 75 [default=false]; - optional string field6 = 6; - optional bytes field2 = 2; - optional int32 field21 = 21 [default=0]; - optional int32 field71 = 71; - optional float field25 = 25; - optional int32 field109 = 109 [default=0]; - optional int32 field210 = 210 [default=0]; - optional int32 field211 = 211 [default=0]; - optional int32 field212 = 212 [default=0]; - optional int32 field213 = 213 [default=0]; - optional int32 field216 = 216 [default=0]; - optional int32 field217 = 217 [default=0]; - optional int32 field218 = 218 [default=0]; - optional int32 field220 = 220 [default=0]; - optional int32 field221 = 221 [default=0]; - optional float field222 = 222 [default=0.0]; - optional int32 field63 = 63; - - repeated group Group1 = 10 { - required float field11 = 11; - optional float field26 = 26; - optional string field12 = 12; - optional string field13 = 13; - repeated string field14 = 14; - required uint64 field15 = 15; - optional int32 field5 = 5; - optional string field27 = 27; - optional int32 field28 = 28; - optional string field29 = 29; - optional string field16 = 16; - repeated string field22 = 22; - repeated int32 field73 = 73; - optional int32 field20 = 20 [default=0]; - optional string field24 = 24; - optional SizeMessage2GroupedMessage field31 = 31; - } - repeated string field128 = 128; - optional int64 field131 = 131; - repeated string field127 = 127; - optional int32 field129 = 129; - repeated int64 field130 = 130; - optional bool field205 = 205 [default=false]; - optional bool field206 = 206 [default=false]; -} - -message SizeMessage2GroupedMessage { - optional float field1 = 1; - optional float field2 = 2; - optional float field3 = 3 [default=0.0]; - optional bool field4 = 4; - optional bool field5 = 5; - optional bool field6 = 6 [default=true]; - optional bool field7 = 7 [default=false]; - optional float field8 = 8; - optional bool field9 = 9; - optional float field10 = 10; - optional int64 field11 = 11; -} diff --git a/protos/google/test/google_speed.proto b/protos/google/test/google_speed.proto deleted file mode 100644 index eef2a07..0000000 --- a/protos/google/test/google_speed.proto +++ /dev/null @@ -1,140 +0,0 @@ -package unittest_google_speed; - -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; -option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestGoogleSpeedProtoFile"; - -option java_outer_classname = "GoogleSpeed"; -option optimize_for = SPEED; - -message SpeedMessage1 { - required string field1 = 1; - optional string field9 = 9; - optional string field18 = 18; - optional bool field80 = 80 [default=false]; - optional bool field81 = 81 [default=true]; - required int32 field2 = 2; - required int32 field3 = 3; - optional int32 field280 = 280; - optional int32 field6 = 6 [default=0]; - optional int64 field22 = 22; - optional string field4 = 4; - repeated fixed64 field5 = 5; - optional bool field59 = 59 [default=false]; - optional string field7 = 7; - optional int32 field16 = 16; - optional int32 field130 = 130 [default=0]; - optional bool field12 = 12 [default=true]; - optional bool field17 = 17 [default=true]; - optional bool field13 = 13 [default=true]; - optional bool field14 = 14 [default=true]; - optional int32 field104 = 104 [default=0]; - optional int32 field100 = 100 [default=0]; - optional int32 field101 = 101 [default=0]; - optional string field102 = 102; - optional string field103 = 103; - optional int32 field29 = 29 [default=0]; - optional bool field30 = 30 [default=false]; - optional int32 field60 = 60 [default=-1]; - optional int32 field271 = 271 [default=-1]; - optional int32 field272 = 272 [default=-1]; - optional int32 field150 = 150; - optional int32 field23 = 23 [default=0]; - optional bool field24 = 24 [default=false]; - optional int32 field25 = 25 [default=0]; - optional SpeedMessage1SubMessage field15 = 15; - optional bool field78 = 78; - optional int32 field67 = 67 [default=0]; - optional int32 field68 = 68; - optional int32 field128 = 128 [default=0]; - optional string field129 = 129 [default="xxxxxxxxxxxxxxxxxxxxx"]; - optional int32 field131 = 131 [default=0]; -} - -message SpeedMessage1SubMessage { - optional int32 field1 = 1 [default=0]; - optional int32 field2 = 2 [default=0]; - optional int32 field3 = 3 [default=0]; - optional string field15 = 15; - optional bool field12 = 12 [default=true]; - optional int64 field13 = 13; - optional int64 field14 = 14; - optional int32 field16 = 16; - optional int32 field19 = 19 [default=2]; - optional bool field20 = 20 [default=true]; - optional bool field28 = 28 [default=true]; - optional fixed64 field21 = 21; - optional int32 field22 = 22; - optional bool field23 = 23 [ default=false ]; - optional bool field206 = 206 [default=false]; - optional fixed32 field203 = 203; - optional int32 field204 = 204; - optional string field205 = 205; - optional uint64 field207 = 207; - optional uint64 field300 = 300; -} - -message SpeedMessage2 { - optional string field1 = 1; - optional int64 field3 = 3; - optional int64 field4 = 4; - optional int64 field30 = 30; - optional bool field75 = 75 [default=false]; - optional string field6 = 6; - optional bytes field2 = 2; - optional int32 field21 = 21 [default=0]; - optional int32 field71 = 71; - optional float field25 = 25; - optional int32 field109 = 109 [default=0]; - optional int32 field210 = 210 [default=0]; - optional int32 field211 = 211 [default=0]; - optional int32 field212 = 212 [default=0]; - optional int32 field213 = 213 [default=0]; - optional int32 field216 = 216 [default=0]; - optional int32 field217 = 217 [default=0]; - optional int32 field218 = 218 [default=0]; - optional int32 field220 = 220 [default=0]; - optional int32 field221 = 221 [default=0]; - optional float field222 = 222 [default=0.0]; - optional int32 field63 = 63; - - repeated group Group1 = 10 { - required float field11 = 11; - optional float field26 = 26; - optional string field12 = 12; - optional string field13 = 13; - repeated string field14 = 14; - required uint64 field15 = 15; - optional int32 field5 = 5; - optional string field27 = 27; - optional int32 field28 = 28; - optional string field29 = 29; - optional string field16 = 16; - repeated string field22 = 22; - repeated int32 field73 = 73; - optional int32 field20 = 20 [default=0]; - optional string field24 = 24; - optional SpeedMessage2GroupedMessage field31 = 31; - } - repeated string field128 = 128; - optional int64 field131 = 131; - repeated string field127 = 127; - optional int32 field129 = 129; - repeated int64 field130 = 130; - optional bool field205 = 205 [default=false]; - optional bool field206 = 206 [default=false]; -} - -message SpeedMessage2GroupedMessage { - optional float field1 = 1; - optional float field2 = 2; - optional float field3 = 3 [default=0.0]; - optional bool field4 = 4; - optional bool field5 = 5; - optional bool field6 = 6 [default=true]; - optional bool field7 = 7 [default=false]; - optional float field8 = 8; - optional bool field9 = 9; - optional float field10 = 10; - optional int64 field11 = 11; -} diff --git a/protos/npp.language.xml b/protos/npp.language.xml deleted file mode 100644 index c612218..0000000 --- a/protos/npp.language.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - [00]00 - { - } - = - 1option 1package 1import 2; 0// - message enum service extend - required optional repeated extensions to rpc returns - double float int32 int64 uint32 uint64 sint32 sint64 fixed32 fixed64 sfixed32 sfixed64 bool string bytes - - - - - - - - - - - - - - - - - - - - diff --git a/protos/tutorial/addressbook.proto b/protos/tutorial/addressbook.proto deleted file mode 100644 index 5abe35c..0000000 --- a/protos/tutorial/addressbook.proto +++ /dev/null @@ -1,31 +0,0 @@ -package tutorial; - -import "google/protobuf/csharp_options.proto"; -option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.Examples.AddressBook"; -option (google.protobuf.csharp_file_options).umbrella_classname = "AddressBookProtos"; - -option optimize_for = SPEED; - -message Person { - required string name = 1; - required int32 id = 2; // Unique ID number for this person. - optional string email = 3; - - enum PhoneType { - MOBILE = 0; - HOME = 1; - WORK = 2; - } - - message PhoneNumber { - required string number = 1; - optional PhoneType type = 2 [default = HOME]; - } - - repeated PhoneNumber phone = 4; -} - -// Our address book file is just one of these. -message AddressBook { - repeated Person person = 1; -} diff --git a/src/AddressBook/AddPerson.cs b/src/AddressBook/AddPerson.cs deleted file mode 100644 index 462b0c5..0000000 --- a/src/AddressBook/AddPerson.cs +++ /dev/null @@ -1,136 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.IO; - -namespace Google.ProtocolBuffers.Examples.AddressBook -{ - internal class AddPerson - { - /// - /// Builds a person based on user input - /// - private static Person PromptForAddress(TextReader input, TextWriter output) - { - Person.Builder person = Person.CreateBuilder(); - - output.Write("Enter person ID: "); - person.Id = int.Parse(input.ReadLine()); - - output.Write("Enter name: "); - person.Name = input.ReadLine(); - - output.Write("Enter email address (blank for none): "); - string email = input.ReadLine(); - if (email.Length > 0) - { - person.Email = email; - } - - while (true) - { - output.Write("Enter a phone number (or leave blank to finish): "); - string number = input.ReadLine(); - if (number.Length == 0) - { - break; - } - - Person.Types.PhoneNumber.Builder phoneNumber = - Person.Types.PhoneNumber.CreateBuilder().SetNumber(number); - - output.Write("Is this a mobile, home, or work phone? "); - String type = input.ReadLine(); - switch (type) - { - case "mobile": - phoneNumber.Type = Person.Types.PhoneType.MOBILE; - break; - case "home": - phoneNumber.Type = Person.Types.PhoneType.HOME; - break; - case "work": - phoneNumber.Type = Person.Types.PhoneType.WORK; - break; - default: - output.Write("Unknown phone type. Using default."); - break; - } - - person.AddPhone(phoneNumber); - } - return person.Build(); - } - - /// - /// Entry point - loads an existing addressbook or creates a new one, - /// then writes it back to the file. - /// - public static int Main(string[] args) - { - if (args.Length != 1) - { - Console.Error.WriteLine("Usage: AddPerson ADDRESS_BOOK_FILE"); - return -1; - } - - AddressBook.Builder addressBook = AddressBook.CreateBuilder(); - - if (File.Exists(args[0])) - { - using (Stream file = File.OpenRead(args[0])) - { - addressBook.MergeFrom(file); - } - } - else - { - Console.WriteLine("{0}: File not found. Creating a new file.", args[0]); - } - - // Add an address. - addressBook.AddPerson(PromptForAddress(Console.In, Console.Out)); - - // Write the new address book back to disk. - using (Stream output = File.OpenWrite(args[0])) - { - addressBook.Build().WriteTo(output); - } - return 0; - } - } -} \ No newline at end of file diff --git a/src/AddressBook/AddressBook.csproj b/src/AddressBook/AddressBook.csproj deleted file mode 100644 index 5d27ee7..0000000 --- a/src/AddressBook/AddressBook.csproj +++ /dev/null @@ -1,75 +0,0 @@ - - - - CLIENTPROFILE - NET35 - Debug - AnyCPU - 9.0.30729 - 2.0 - {A31F5FB2-4FF3-432A-B35B-5CD203606311} - Exe - Properties - Google.ProtocolBuffers.Examples.AddressBook - AddressBook - v3.5 - 512 - Google.ProtocolBuffers.Examples.AddressBook.Program - - - true - full - false - bin\NET35\Debug - obj\NET35\Debug\ - DEBUG;TRACE - prompt - 4 - true - true - Off - - - pdbonly - true - bin\NET35\Release - obj\NET35\Release\ - TRACE - prompt - 4 - true - true - Off - - - - - - - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - - - - \ No newline at end of file diff --git a/src/AddressBook/AddressBookProtos.cs b/src/AddressBook/AddressBookProtos.cs deleted file mode 100644 index 23276dd..0000000 --- a/src/AddressBook/AddressBookProtos.cs +++ /dev/null @@ -1,1160 +0,0 @@ -// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.Examples.AddressBook { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class AddressBookProtos { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_tutorial_Person__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_tutorial_Person__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_tutorial_Person_PhoneNumber__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_tutorial_Person_PhoneNumber__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_tutorial_AddressBook__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_tutorial_AddressBook__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static AddressBookProtos() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "Chp0dXRvcmlhbC9hZGRyZXNzYm9vay5wcm90bxIIdHV0b3JpYWwaJGdvb2ds", - "ZS9wcm90b2J1Zi9jc2hhcnBfb3B0aW9ucy5wcm90byLaAQoGUGVyc29uEgwK", - "BG5hbWUYASACKAkSCgoCaWQYAiACKAUSDQoFZW1haWwYAyABKAkSKwoFcGhv", - "bmUYBCADKAsyHC50dXRvcmlhbC5QZXJzb24uUGhvbmVOdW1iZXIaTQoLUGhv", - "bmVOdW1iZXISDgoGbnVtYmVyGAEgAigJEi4KBHR5cGUYAiABKA4yGi50dXRv", - "cmlhbC5QZXJzb24uUGhvbmVUeXBlOgRIT01FIisKCVBob25lVHlwZRIKCgZN", - "T0JJTEUQABIICgRIT01FEAESCAoEV09SSxACIi8KC0FkZHJlc3NCb29rEiAK", - "BnBlcnNvbhgBIAMoCzIQLnR1dG9yaWFsLlBlcnNvbkJFSAHCPkAKK0dvb2ds", - "ZS5Qcm90b2NvbEJ1ZmZlcnMuRXhhbXBsZXMuQWRkcmVzc0Jvb2sSEUFkZHJl", - "c3NCb29rUHJvdG9z")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_tutorial_Person__Descriptor = Descriptor.MessageTypes[0]; - internal__static_tutorial_Person__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_tutorial_Person__Descriptor, - new string[] { "Name", "Id", "Email", "Phone", }); - internal__static_tutorial_Person_PhoneNumber__Descriptor = internal__static_tutorial_Person__Descriptor.NestedTypes[0]; - internal__static_tutorial_Person_PhoneNumber__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_tutorial_Person_PhoneNumber__Descriptor, - new string[] { "Number", "Type", }); - internal__static_tutorial_AddressBook__Descriptor = Descriptor.MessageTypes[1]; - internal__static_tutorial_AddressBook__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_tutorial_AddressBook__Descriptor, - new string[] { "Person", }); - pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); - RegisterAllExtensions(registry); - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.RegisterAllExtensions(registry); - return registry; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, - }, assigner); - } - #endregion - - } - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Person : pb::GeneratedMessage { - private Person() { } - private static readonly Person defaultInstance = new Person().MakeReadOnly(); - private static readonly string[] _personFieldNames = new string[] { "email", "id", "name", "phone" }; - private static readonly uint[] _personFieldTags = new uint[] { 26, 16, 10, 34 }; - public static Person DefaultInstance { - get { return defaultInstance; } - } - - public override Person DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override Person ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.Examples.AddressBook.AddressBookProtos.internal__static_tutorial_Person__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.Examples.AddressBook.AddressBookProtos.internal__static_tutorial_Person__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - public enum PhoneType { - MOBILE = 0, - HOME = 1, - WORK = 2, - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class PhoneNumber : pb::GeneratedMessage { - private PhoneNumber() { } - private static readonly PhoneNumber defaultInstance = new PhoneNumber().MakeReadOnly(); - private static readonly string[] _phoneNumberFieldNames = new string[] { "number", "type" }; - private static readonly uint[] _phoneNumberFieldTags = new uint[] { 10, 16 }; - public static PhoneNumber DefaultInstance { - get { return defaultInstance; } - } - - public override PhoneNumber DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override PhoneNumber ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.Examples.AddressBook.AddressBookProtos.internal__static_tutorial_Person_PhoneNumber__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.Examples.AddressBook.AddressBookProtos.internal__static_tutorial_Person_PhoneNumber__FieldAccessorTable; } - } - - public const int NumberFieldNumber = 1; - private bool hasNumber; - private string number_ = ""; - public bool HasNumber { - get { return hasNumber; } - } - public string Number { - get { return number_; } - } - - public const int TypeFieldNumber = 2; - private bool hasType; - private global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneType type_ = global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneType.HOME; - public bool HasType { - get { return hasType; } - } - public global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneType Type { - get { return type_; } - } - - public override bool IsInitialized { - get { - if (!hasNumber) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _phoneNumberFieldNames; - if (hasNumber) { - output.WriteString(1, field_names[0], Number); - } - if (hasType) { - output.WriteEnum(2, field_names[1], (int) Type, Type); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasNumber) { - size += pb::CodedOutputStream.ComputeStringSize(1, Number); - } - if (hasType) { - size += pb::CodedOutputStream.ComputeEnumSize(2, (int) Type); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static PhoneNumber ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static PhoneNumber ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static PhoneNumber ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static PhoneNumber ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static PhoneNumber ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static PhoneNumber ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static PhoneNumber ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static PhoneNumber ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static PhoneNumber ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static PhoneNumber ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private PhoneNumber MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(PhoneNumber prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(PhoneNumber cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private PhoneNumber result; - - private PhoneNumber PrepareBuilder() { - if (resultIsReadOnly) { - PhoneNumber original = result; - result = new PhoneNumber(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override PhoneNumber MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber.Descriptor; } - } - - public override PhoneNumber DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber.DefaultInstance; } - } - - public override PhoneNumber BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is PhoneNumber) { - return MergeFrom((PhoneNumber) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(PhoneNumber other) { - if (other == global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasNumber) { - Number = other.Number; - } - if (other.HasType) { - Type = other.Type; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_phoneNumberFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _phoneNumberFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasNumber = input.ReadString(ref result.number_); - break; - } - case 16: { - object unknown; - if(input.ReadEnum(ref result.type_, out unknown)) { - result.hasType = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(2, (ulong)(int)unknown); - } - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasNumber { - get { return result.hasNumber; } - } - public string Number { - get { return result.Number; } - set { SetNumber(value); } - } - public Builder SetNumber(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasNumber = true; - result.number_ = value; - return this; - } - public Builder ClearNumber() { - PrepareBuilder(); - result.hasNumber = false; - result.number_ = ""; - return this; - } - - public bool HasType { - get { return result.hasType; } - } - public global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneType Type { - get { return result.Type; } - set { SetType(value); } - } - public Builder SetType(global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneType value) { - PrepareBuilder(); - result.hasType = true; - result.type_ = value; - return this; - } - public Builder ClearType() { - PrepareBuilder(); - result.hasType = false; - result.type_ = global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneType.HOME; - return this; - } - } - static PhoneNumber() { - object.ReferenceEquals(global::Google.ProtocolBuffers.Examples.AddressBook.AddressBookProtos.Descriptor, null); - } - } - - } - #endregion - - public const int NameFieldNumber = 1; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public const int IdFieldNumber = 2; - private bool hasId; - private int id_; - public bool HasId { - get { return hasId; } - } - public int Id { - get { return id_; } - } - - public const int EmailFieldNumber = 3; - private bool hasEmail; - private string email_ = ""; - public bool HasEmail { - get { return hasEmail; } - } - public string Email { - get { return email_; } - } - - public const int PhoneFieldNumber = 4; - private pbc::PopsicleList phone_ = new pbc::PopsicleList(); - public scg::IList PhoneList { - get { return phone_; } - } - public int PhoneCount { - get { return phone_.Count; } - } - public global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber GetPhone(int index) { - return phone_[index]; - } - - public override bool IsInitialized { - get { - if (!hasName) return false; - if (!hasId) return false; - foreach (global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber element in PhoneList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _personFieldNames; - if (hasName) { - output.WriteString(1, field_names[2], Name); - } - if (hasId) { - output.WriteInt32(2, field_names[1], Id); - } - if (hasEmail) { - output.WriteString(3, field_names[0], Email); - } - if (phone_.Count > 0) { - output.WriteMessageArray(4, field_names[3], phone_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasName) { - size += pb::CodedOutputStream.ComputeStringSize(1, Name); - } - if (hasId) { - size += pb::CodedOutputStream.ComputeInt32Size(2, Id); - } - if (hasEmail) { - size += pb::CodedOutputStream.ComputeStringSize(3, Email); - } - foreach (global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber element in PhoneList) { - size += pb::CodedOutputStream.ComputeMessageSize(4, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static Person ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Person ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Person ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Person ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Person ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Person ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Person ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Person ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Person ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Person ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private Person MakeReadOnly() { - phone_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Person prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(Person cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private Person result; - - private Person PrepareBuilder() { - if (resultIsReadOnly) { - Person original = result; - result = new Person(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override Person MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.Examples.AddressBook.Person.Descriptor; } - } - - public override Person DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.Examples.AddressBook.Person.DefaultInstance; } - } - - public override Person BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Person) { - return MergeFrom((Person) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Person other) { - if (other == global::Google.ProtocolBuffers.Examples.AddressBook.Person.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasName) { - Name = other.Name; - } - if (other.HasId) { - Id = other.Id; - } - if (other.HasEmail) { - Email = other.Email; - } - if (other.phone_.Count != 0) { - result.phone_.Add(other.phone_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_personFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _personFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasName = input.ReadString(ref result.name_); - break; - } - case 16: { - result.hasId = input.ReadInt32(ref result.id_); - break; - } - case 26: { - result.hasEmail = input.ReadString(ref result.email_); - break; - } - case 34: { - input.ReadMessageArray(tag, field_name, result.phone_, global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber.DefaultInstance, extensionRegistry); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasName { - get { return result.hasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - PrepareBuilder(); - result.hasName = false; - result.name_ = ""; - return this; - } - - public bool HasId { - get { return result.hasId; } - } - public int Id { - get { return result.Id; } - set { SetId(value); } - } - public Builder SetId(int value) { - PrepareBuilder(); - result.hasId = true; - result.id_ = value; - return this; - } - public Builder ClearId() { - PrepareBuilder(); - result.hasId = false; - result.id_ = 0; - return this; - } - - public bool HasEmail { - get { return result.hasEmail; } - } - public string Email { - get { return result.Email; } - set { SetEmail(value); } - } - public Builder SetEmail(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasEmail = true; - result.email_ = value; - return this; - } - public Builder ClearEmail() { - PrepareBuilder(); - result.hasEmail = false; - result.email_ = ""; - return this; - } - - public pbc::IPopsicleList PhoneList { - get { return PrepareBuilder().phone_; } - } - public int PhoneCount { - get { return result.PhoneCount; } - } - public global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber GetPhone(int index) { - return result.GetPhone(index); - } - public Builder SetPhone(int index, global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.phone_[index] = value; - return this; - } - public Builder SetPhone(int index, global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.phone_[index] = builderForValue.Build(); - return this; - } - public Builder AddPhone(global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.phone_.Add(value); - return this; - } - public Builder AddPhone(global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.phone_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangePhone(scg::IEnumerable values) { - PrepareBuilder(); - result.phone_.Add(values); - return this; - } - public Builder ClearPhone() { - PrepareBuilder(); - result.phone_.Clear(); - return this; - } - } - static Person() { - object.ReferenceEquals(global::Google.ProtocolBuffers.Examples.AddressBook.AddressBookProtos.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class AddressBook : pb::GeneratedMessage { - private AddressBook() { } - private static readonly AddressBook defaultInstance = new AddressBook().MakeReadOnly(); - private static readonly string[] _addressBookFieldNames = new string[] { "person" }; - private static readonly uint[] _addressBookFieldTags = new uint[] { 10 }; - public static AddressBook DefaultInstance { - get { return defaultInstance; } - } - - public override AddressBook DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override AddressBook ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.Examples.AddressBook.AddressBookProtos.internal__static_tutorial_AddressBook__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.Examples.AddressBook.AddressBookProtos.internal__static_tutorial_AddressBook__FieldAccessorTable; } - } - - public const int PersonFieldNumber = 1; - private pbc::PopsicleList person_ = new pbc::PopsicleList(); - public scg::IList PersonList { - get { return person_; } - } - public int PersonCount { - get { return person_.Count; } - } - public global::Google.ProtocolBuffers.Examples.AddressBook.Person GetPerson(int index) { - return person_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.Examples.AddressBook.Person element in PersonList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _addressBookFieldNames; - if (person_.Count > 0) { - output.WriteMessageArray(1, field_names[0], person_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::Google.ProtocolBuffers.Examples.AddressBook.Person element in PersonList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static AddressBook ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static AddressBook ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static AddressBook ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static AddressBook ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static AddressBook ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static AddressBook ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static AddressBook ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static AddressBook ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static AddressBook ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static AddressBook ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private AddressBook MakeReadOnly() { - person_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(AddressBook prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(AddressBook cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private AddressBook result; - - private AddressBook PrepareBuilder() { - if (resultIsReadOnly) { - AddressBook original = result; - result = new AddressBook(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override AddressBook MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.Examples.AddressBook.AddressBook.Descriptor; } - } - - public override AddressBook DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.Examples.AddressBook.AddressBook.DefaultInstance; } - } - - public override AddressBook BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is AddressBook) { - return MergeFrom((AddressBook) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(AddressBook other) { - if (other == global::Google.ProtocolBuffers.Examples.AddressBook.AddressBook.DefaultInstance) return this; - PrepareBuilder(); - if (other.person_.Count != 0) { - result.person_.Add(other.person_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_addressBookFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _addressBookFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - input.ReadMessageArray(tag, field_name, result.person_, global::Google.ProtocolBuffers.Examples.AddressBook.Person.DefaultInstance, extensionRegistry); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public pbc::IPopsicleList PersonList { - get { return PrepareBuilder().person_; } - } - public int PersonCount { - get { return result.PersonCount; } - } - public global::Google.ProtocolBuffers.Examples.AddressBook.Person GetPerson(int index) { - return result.GetPerson(index); - } - public Builder SetPerson(int index, global::Google.ProtocolBuffers.Examples.AddressBook.Person value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.person_[index] = value; - return this; - } - public Builder SetPerson(int index, global::Google.ProtocolBuffers.Examples.AddressBook.Person.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.person_[index] = builderForValue.Build(); - return this; - } - public Builder AddPerson(global::Google.ProtocolBuffers.Examples.AddressBook.Person value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.person_.Add(value); - return this; - } - public Builder AddPerson(global::Google.ProtocolBuffers.Examples.AddressBook.Person.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.person_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangePerson(scg::IEnumerable values) { - PrepareBuilder(); - result.person_.Add(values); - return this; - } - public Builder ClearPerson() { - PrepareBuilder(); - result.person_.Clear(); - return this; - } - } - static AddressBook() { - object.ReferenceEquals(global::Google.ProtocolBuffers.Examples.AddressBook.AddressBookProtos.Descriptor, null); - } - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/AddressBook/ListPeople.cs b/src/AddressBook/ListPeople.cs deleted file mode 100644 index fe6f52d..0000000 --- a/src/AddressBook/ListPeople.cs +++ /dev/null @@ -1,103 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.IO; - -namespace Google.ProtocolBuffers.Examples.AddressBook -{ - internal class ListPeople - { - /// - /// Iterates though all people in the AddressBook and prints info about them. - /// - private static void Print(AddressBook addressBook) - { - foreach (Person person in addressBook.PersonList) - { - Console.WriteLine("Person ID: {0}", person.Id); - Console.WriteLine(" Name: {0}", person.Name); - if (person.HasEmail) - { - Console.WriteLine(" E-mail address: {0}", person.Email); - } - - foreach (Person.Types.PhoneNumber phoneNumber in person.PhoneList) - { - switch (phoneNumber.Type) - { - case Person.Types.PhoneType.MOBILE: - Console.Write(" Mobile phone #: "); - break; - case Person.Types.PhoneType.HOME: - Console.Write(" Home phone #: "); - break; - case Person.Types.PhoneType.WORK: - Console.Write(" Work phone #: "); - break; - } - Console.WriteLine(phoneNumber.Number); - } - } - } - - /// - /// Entry point - loads the addressbook and then displays it. - /// - public static int Main(string[] args) - { - if (args.Length != 1) - { - Console.Error.WriteLine("Usage: ListPeople ADDRESS_BOOK_FILE"); - return 1; - } - - if (!File.Exists(args[0])) - { - Console.WriteLine("{0} doesn't exist. Add a person to create the file first.", args[0]); - return 0; - } - - // Read the existing address book. - using (Stream stream = File.OpenRead(args[0])) - { - AddressBook addressBook = AddressBook.ParseFrom(stream); - Print(addressBook); - } - return 0; - } - } -} \ No newline at end of file diff --git a/src/AddressBook/Program.cs b/src/AddressBook/Program.cs deleted file mode 100644 index e0d6d49..0000000 --- a/src/AddressBook/Program.cs +++ /dev/null @@ -1,99 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; - -namespace Google.ProtocolBuffers.Examples.AddressBook -{ - /// - /// Entry point. Repeatedly prompts user for an action to take, delegating actual behaviour - /// to individual actions. Each action has its own Main method, so that it can be used as an - /// invidual complete program. - /// - internal class Program - { - private static int Main(string[] args) - { - if (args.Length > 1) - { - Console.Error.WriteLine("Usage: AddressBook [file]"); - Console.Error.WriteLine("If the filename isn't specified, \"addressbook.data\" is used instead."); - return 1; - } - string addressBookFile = args.Length > 0 ? args[0] : "addressbook.data"; - - bool stopping = false; - while (!stopping) - { - Console.WriteLine("Options:"); - Console.WriteLine(" L: List contents"); - Console.WriteLine(" A: Add new person"); - Console.WriteLine(" Q: Quit"); - Console.Write("Action? "); - Console.Out.Flush(); - char choice = Console.ReadKey().KeyChar; - Console.WriteLine(); - try - { - switch (choice) - { - case 'A': - case 'a': - AddPerson.Main(new string[] {addressBookFile}); - break; - case 'L': - case 'l': - ListPeople.Main(new string[] {addressBookFile}); - break; - case 'Q': - case 'q': - stopping = true; - break; - default: - Console.WriteLine("Unknown option: {0}", choice); - break; - } - } - catch (Exception e) - { - Console.WriteLine("Exception executing action: {0}", e); - } - Console.WriteLine(); - } - return 0; - } - } -} \ No newline at end of file diff --git a/src/AddressBook/Properties/AssemblyInfo.cs b/src/AddressBook/Properties/AssemblyInfo.cs deleted file mode 100644 index e9c40dc..0000000 --- a/src/AddressBook/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. - -[assembly: AssemblyTitle("AddressBook")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("AddressBook")] -[assembly: AssemblyCopyright("Copyright © 2008")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("2.4.1.555")] - -[assembly: AssemblyVersion("2.4.1.555")] -[assembly: AssemblyFileVersion("2.4.1.555")] \ No newline at end of file diff --git a/src/AddressBook/SampleUsage.cs b/src/AddressBook/SampleUsage.cs deleted file mode 100644 index 084b165..0000000 --- a/src/AddressBook/SampleUsage.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using System.IO; - -namespace Google.ProtocolBuffers.Examples.AddressBook -{ - internal class SampleUsage - { - private static void Main() - { - byte[] bytes; - //Create a builder to start building a message - Person.Builder newContact = Person.CreateBuilder(); - //Set the primitive properties - newContact.SetId(1) - .SetName("Foo") - .SetEmail("foo@bar"); - //Now add an item to a list (repeating) field - newContact.AddPhone( - //Create the child message inline - Person.Types.PhoneNumber.CreateBuilder().SetNumber("555-1212").Build() - ); - //Now build the final message: - Person person = newContact.Build(); - //The builder is no longer valid (at least not now, scheduled for 2.4): - newContact = null; - using (MemoryStream stream = new MemoryStream()) - { - //Save the person to a stream - person.WriteTo(stream); - bytes = stream.ToArray(); - } - //Create another builder, merge the byte[], and build the message: - Person copy = Person.CreateBuilder().MergeFrom(bytes).Build(); - - //A more streamlined approach might look like this: - bytes = AddressBook.CreateBuilder().AddPerson(copy).Build().ToByteArray(); - //And read the address book back again - AddressBook restored = AddressBook.CreateBuilder().MergeFrom(bytes).Build(); - //The message performs a deep-comparison on equality: - if (restored.PersonCount != 1 || !person.Equals(restored.PersonList[0])) - throw new ApplicationException("There is a bad person in here!"); - } - } -} \ No newline at end of file diff --git a/src/AddressBook/app.config b/src/AddressBook/app.config deleted file mode 100644 index 0df7832..0000000 --- a/src/AddressBook/app.config +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/ProtoBench/Program.cs b/src/ProtoBench/Program.cs deleted file mode 100644 index 820fc12..0000000 --- a/src/ProtoBench/Program.cs +++ /dev/null @@ -1,538 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Runtime.Serialization.Json; -using System.Text; -using System.Threading; -using System.Xml; -using Google.ProtocolBuffers.Serialization; -using Google.ProtocolBuffers.TestProtos; - -namespace Google.ProtocolBuffers.ProtoBench -{ - /// - /// Simple benchmarking of arbitrary messages. - /// - public sealed class Program - { - private static TimeSpan MinSampleTime = TimeSpan.FromSeconds(2); - private static TimeSpan TargetTime = TimeSpan.FromSeconds(30); - private static bool Verbose = false, FastTest = false, OtherFormats = false; - // Avoid a .NET 3.5 dependency - private delegate void Action(); - - private delegate void BenchmarkTest(string name, long dataSize, Action action); - - private static BenchmarkTest RunBenchmark; - - private static string _logFile; - static void WriteLine(string format, params object[] arg) - { - if (arg.Length > 0) format = String.Format(format, arg); - Console.Out.WriteLine(format); - if (!String.IsNullOrEmpty(_logFile)) - File.AppendAllText(_logFile, format + Environment.NewLine); - } - - [STAThread] - public static int Main(string[] args) - { - List temp = new List(args); - - Verbose = temp.Remove("/verbose") || temp.Remove("-verbose"); - OtherFormats = temp.Remove("/formats") || temp.Remove("-formats"); - - foreach (string arg in temp) - { - if (arg.StartsWith("/log:", StringComparison.OrdinalIgnoreCase) || arg.StartsWith("-log:", StringComparison.OrdinalIgnoreCase)) - { - _logFile = arg.Substring(5); - if (!String.IsNullOrEmpty(_logFile)) - File.AppendAllText(_logFile, Environment.NewLine + "Started benchmarks at " + DateTime.Now + Environment.NewLine); - temp.Remove(arg); - break; - } - } - - if (true == (FastTest = (temp.Remove("/fast") || temp.Remove("-fast")))) - { - TargetTime = TimeSpan.FromSeconds(10); - } - - RunBenchmark = BenchmarkV1; - if (temp.Remove("/v2") || temp.Remove("-v2")) - { - Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.RealTime; - Process.GetCurrentProcess().ProcessorAffinity = new IntPtr(1); - RunBenchmark = BenchmarkV2; - } - if (temp.Remove("/all") || temp.Remove("-all")) - { - if (FastTest) - { - TargetTime = TimeSpan.FromSeconds(5); - } - foreach (KeyValuePair item in MakeTests()) - { - temp.Add(item.Key); - temp.Add(item.Value); - } - } - args = temp.ToArray(); - - if (args.Length < 2 || (args.Length%2) != 0) - { - Console.Error.WriteLine("Usage: ProtoBench [/fast] "); - Console.Error.WriteLine("The descriptor type name is the fully-qualified message name,"); - Console.Error.WriteLine( - "including assembly - e.g. Google.ProtocolBuffers.BenchmarkProtos.Message1,ProtoBench"); - Console.Error.WriteLine("(You can specify multiple pairs of descriptor type name and input data.)"); - return 1; - } - - bool success = true; - for (int i = 0; i < args.Length; i += 2) - { - success &= RunTest(args[i], args[i + 1], null); - } - return success ? 0 : 1; - } - - /// - /// Runs a single test. Error messages are displayed to Console.Error, and the return value indicates - /// general success/failure. - /// - public static bool RunTest(string typeName, string file, byte[] inputData) - { - WriteLine("Benchmarking {0} with file {1}", typeName, file); - IMessage defaultMessage; - try - { - defaultMessage = MessageUtil.GetDefaultMessage(typeName); - } - catch (ArgumentException e) - { - Console.Error.WriteLine(e.Message); - return false; - } - try - { - ExtensionRegistry registry = ExtensionRegistry.Empty; - inputData = inputData ?? File.ReadAllBytes(file); - MemoryStream inputStream = new MemoryStream(inputData); - ByteString inputString = ByteString.CopyFrom(inputData); - IMessage sampleMessage = - defaultMessage.WeakCreateBuilderForType().WeakMergeFrom(inputString, registry).WeakBuild(); - - IDictionary dictionary = null; - byte[] jsonBytes = null, xmlBytes = null; /*no pun intended, well... maybe for xml*/ - if (OtherFormats) - { - using (MemoryStream temp = new MemoryStream()) - { - XmlFormatWriter.CreateInstance(temp).WriteMessage(sampleMessage); - xmlBytes = temp.ToArray(); - } - using (MemoryStream temp = new MemoryStream()) - { - JsonFormatWriter.CreateInstance(temp).WriteMessage(sampleMessage); - jsonBytes = temp.ToArray(); - } - dictionary = new Dictionary(StringComparer.Ordinal); - new DictionaryWriter(dictionary).WriteMessage(sampleMessage); - } - - //Serializers - if (!FastTest) - { - RunBenchmark("Serialize to byte string", inputData.Length, () => sampleMessage.ToByteString()); - } - RunBenchmark("Serialize to byte array", inputData.Length, () => sampleMessage.ToByteArray()); - if (!FastTest) - { - RunBenchmark("Serialize to memory stream", inputData.Length, - () => sampleMessage.WriteTo(new MemoryStream())); - } - - if (OtherFormats) - { - RunBenchmark("Serialize to xml", xmlBytes.Length, - () => - { - XmlFormatWriter.CreateInstance(new MemoryStream(), Encoding.UTF8).WriteMessage(sampleMessage); - }); - RunBenchmark("Serialize to json", jsonBytes.Length, - () => { JsonFormatWriter.CreateInstance().WriteMessage(sampleMessage); }); - RunBenchmark("Serialize to json via xml", jsonBytes.Length, - () => - XmlFormatWriter.CreateInstance( - JsonReaderWriterFactory.CreateJsonWriter(new MemoryStream(), Encoding.UTF8)) - .SetOptions(XmlWriterOptions.OutputJsonTypes) - .WriteMessage(sampleMessage) - ); - - RunBenchmark("Serialize to dictionary", sampleMessage.SerializedSize, - () => new DictionaryWriter().WriteMessage(sampleMessage)); - } - //Deserializers - if (!FastTest) - { - RunBenchmark("Deserialize from byte string", inputData.Length, - () => defaultMessage.WeakCreateBuilderForType() - .WeakMergeFrom(inputString, registry) - .WeakBuild() - ); - } - - RunBenchmark("Deserialize from byte array", inputData.Length, - () => defaultMessage.WeakCreateBuilderForType() - .WeakMergeFrom(CodedInputStream.CreateInstance(inputData), registry) - .WeakBuild() - ); - if (!FastTest) - { - RunBenchmark("Deserialize from memory stream", inputData.Length, - () => - { - inputStream.Position = 0; - defaultMessage.WeakCreateBuilderForType().WeakMergeFrom( - CodedInputStream.CreateInstance(inputStream), registry) - .WeakBuild(); - }); - } - - if (OtherFormats) - { - RunBenchmark("Deserialize from xml", xmlBytes.Length, - () => - XmlFormatReader.CreateInstance(xmlBytes).Merge( - defaultMessage.WeakCreateBuilderForType()).WeakBuild()); - RunBenchmark("Deserialize from json", jsonBytes.Length, - () => - JsonFormatReader.CreateInstance(jsonBytes).Merge( - defaultMessage.WeakCreateBuilderForType()).WeakBuild()); - RunBenchmark("Deserialize from json via xml", jsonBytes.Length, - () => - XmlFormatReader.CreateInstance(JsonReaderWriterFactory.CreateJsonReader(jsonBytes, XmlDictionaryReaderQuotas.Max)) - .SetOptions(XmlReaderOptions.ReadNestedArrays).Merge( - defaultMessage.WeakCreateBuilderForType()).WeakBuild()); - - RunBenchmark("Deserialize from dictionary", sampleMessage.SerializedSize, - () => - new DictionaryReader(dictionary).Merge(defaultMessage.WeakCreateBuilderForType()). - WeakBuild()); - } - WriteLine(String.Empty); - return true; - } - catch (Exception e) - { - Console.Error.WriteLine("Error: {0}", e.Message); - Console.Error.WriteLine(); - Console.Error.WriteLine("Detailed exception information: {0}", e); - return false; - } - } - - private static void BenchmarkV2(string name, long dataSize, Action action) - { - Thread.BeginThreadAffinity(); - TimeSpan elapsed = TimeSpan.Zero; - long runs = 0; - long totalCount = 0; - double best = double.MinValue, worst = double.MaxValue; - - action(); - // Run it progressively more times until we've got a reasonable sample - - int iterations = 100; - elapsed = TimeAction(action, iterations); - while (elapsed.TotalMilliseconds < 1000) - { - elapsed += TimeAction(action, iterations); - iterations *= 2; - } - - TimeSpan target = TimeSpan.FromSeconds(1); - - elapsed = TimeAction(action, iterations); - iterations = (int) ((target.Ticks*iterations)/(double) elapsed.Ticks); - elapsed = TimeAction(action, iterations); - iterations = (int) ((target.Ticks*iterations)/(double) elapsed.Ticks); - elapsed = TimeAction(action, iterations); - iterations = (int) ((target.Ticks*iterations)/(double) elapsed.Ticks); - - double first = (iterations*dataSize)/(elapsed.TotalSeconds*1024*1024); - if (Verbose) - { - WriteLine("Round ---: Count = {1,6}, Bps = {2,8:f3}", 0, iterations, first); - } - elapsed = TimeSpan.Zero; - int max = (int) TargetTime.TotalSeconds; - - while (runs < max) - { - TimeSpan cycle = TimeAction(action, iterations); - // Accumulate and scale for next cycle. - - double bps = (iterations*dataSize)/(cycle.TotalSeconds*1024*1024); - if (Verbose) - { - WriteLine("Round {1,3}: Count = {2,6}, Bps = {3,8:f3}", - 0, runs, iterations, bps); - } - - best = Math.Max(best, bps); - worst = Math.Min(worst, bps); - - runs++; - elapsed += cycle; - totalCount += iterations; - iterations = (int) ((target.Ticks*totalCount)/(double) elapsed.Ticks); - } - - Thread.EndThreadAffinity(); - WriteLine( - "{1}: averages {2} per {3:f3}s for {4} runs; avg: {5:f3}mbps; best: {6:f3}mbps; worst: {7:f3}mbps", - 0, name, totalCount/runs, elapsed.TotalSeconds/runs, runs, - (totalCount*dataSize)/(elapsed.TotalSeconds*1024*1024), best, worst); - } - - private static void BenchmarkV1(string name, long dataSize, Action action) - { - // Make sure it's JITted - action(); - // Run it progressively more times until we've got a reasonable sample - - int iterations = 1; - TimeSpan elapsed = TimeAction(action, iterations); - while (elapsed < MinSampleTime) - { - iterations *= 2; - elapsed = TimeAction(action, iterations); - } - // Upscale the sample to the target time. Do this in floating point arithmetic - // to avoid overflow issues. - iterations = (int) ((TargetTime.Ticks/(double) elapsed.Ticks)*iterations); - elapsed = TimeAction(action, iterations); - WriteLine("{0}: {1} iterations in {2:f3}s; {3:f3}MB/s", - name, iterations, elapsed.TotalSeconds, - (iterations*dataSize)/(elapsed.TotalSeconds*1024*1024)); - } - - private static TimeSpan TimeAction(Action action, int iterations) - { - GC.Collect(); - GC.GetTotalMemory(true); - GC.WaitForPendingFinalizers(); - - Stopwatch sw = Stopwatch.StartNew(); - for (int i = 0; i < iterations; i++) - { - action(); - } - sw.Stop(); - return sw.Elapsed; - } - - private static IEnumerable> MakeTests() - { - //Aggregate Tests - yield return MakeWorkItem("all-types", MakeTestAllTypes()); - yield return MakeWorkItem("repeated-100", MakeRepeatedTestAllTypes(100)); - yield return MakeWorkItem("packed-100", MakeTestPackedTypes(100)); - - //Discrete Tests - foreach (KeyValuePair> item in MakeTestAllTypes()) - { - yield return MakeWorkItem(item.Key, new[] {item}); - } - - foreach (KeyValuePair> item in MakeRepeatedTestAllTypes(100)) - { - yield return MakeWorkItem(item.Key, new[] {item}); - } - - foreach (KeyValuePair> item in MakeTestPackedTypes(100)) - { - yield return MakeWorkItem(item.Key, new[] {item}); - } - } - - private static IEnumerable>> MakeTestAllTypes() - { - // Many of the raw type serializers below perform poorly due to the numerous fields defined - // in TestAllTypes. - - //single values - yield return MakeItem("int32", 1, x => x.SetOptionalInt32(1001)); - yield return MakeItem("int64", 1, x => x.SetOptionalInt64(1001)); - yield return MakeItem("uint32", 1, x => x.SetOptionalUint32(1001)); - yield return MakeItem("uint64", 1, x => x.SetOptionalUint64(1001)); - yield return MakeItem("sint32", 1, x => x.SetOptionalSint32(-1001)); - yield return MakeItem("sint64", 1, x => x.SetOptionalSint64(-1001)); - yield return MakeItem("fixed32", 1, x => x.SetOptionalFixed32(1001)); - yield return MakeItem("fixed64", 1, x => x.SetOptionalFixed64(1001)); - yield return MakeItem("sfixed32", 1, x => x.SetOptionalSfixed32(-1001)); - yield return MakeItem("sfixed64", 1, x => x.SetOptionalSfixed64(-1001)); - yield return MakeItem("float", 1, x => x.SetOptionalFloat(1001.1001f)); - yield return MakeItem("double", 1, x => x.SetOptionalDouble(1001.1001)); - yield return MakeItem("bool", 1, x => x.SetOptionalBool(true)); - yield return MakeItem("string", 1, x => x.SetOptionalString("this is a string value")) - ; - yield return - MakeItem("bytes", 1, - x => - x.SetOptionalBytes(ByteString.CopyFromUtf8("this is an array of bytes"))) - ; - yield return - MakeItem("group", 1, - x => - x.SetOptionalGroup( - new TestAllTypes.Types.OptionalGroup.Builder().SetA(1001))); - yield return - MakeItem("message", 1, - x => - x.SetOptionalNestedMessage( - new TestAllTypes.Types.NestedMessage.Builder().SetBb(1001))); - yield return - MakeItem("enum", 1, - x => x.SetOptionalNestedEnum(TestAllTypes.Types.NestedEnum.FOO)); - } - - private static IEnumerable>> MakeRepeatedTestAllTypes(int size) - { - //repeated values - yield return MakeItem("repeated-int32", size, x => x.AddRepeatedInt32(1001)); - yield return MakeItem("repeated-int64", size, x => x.AddRepeatedInt64(1001)); - yield return MakeItem("repeated-uint32", size, x => x.AddRepeatedUint32(1001)); - yield return MakeItem("repeated-uint64", size, x => x.AddRepeatedUint64(1001)); - yield return MakeItem("repeated-sint32", size, x => x.AddRepeatedSint32(-1001)); - yield return MakeItem("repeated-sint64", size, x => x.AddRepeatedSint64(-1001)); - yield return MakeItem("repeated-fixed32", size, x => x.AddRepeatedFixed32(1001)); - yield return MakeItem("repeated-fixed64", size, x => x.AddRepeatedFixed64(1001)); - yield return MakeItem("repeated-sfixed32", size, x => x.AddRepeatedSfixed32(-1001)); - yield return MakeItem("repeated-sfixed64", size, x => x.AddRepeatedSfixed64(-1001)); - yield return MakeItem("repeated-float", size, x => x.AddRepeatedFloat(1001.1001f)); - yield return MakeItem("repeated-double", size, x => x.AddRepeatedDouble(1001.1001)); - yield return MakeItem("repeated-bool", size, x => x.AddRepeatedBool(true)); - yield return - MakeItem("repeated-string", size, - x => x.AddRepeatedString("this is a string value")); - yield return - MakeItem("repeated-bytes", size, - x => - x.AddRepeatedBytes(ByteString.CopyFromUtf8("this is an array of bytes"))) - ; - yield return - MakeItem("repeated-group", size, - x => - x.AddRepeatedGroup( - new TestAllTypes.Types.RepeatedGroup.Builder().SetA(1001))); - yield return - MakeItem("repeated-message", size, - x => - x.AddRepeatedNestedMessage( - new TestAllTypes.Types.NestedMessage.Builder().SetBb(1001))); - yield return - MakeItem("repeated-enum", size, - x => x.AddRepeatedNestedEnum(TestAllTypes.Types.NestedEnum.FOO)); - } - - private static IEnumerable>> MakeTestPackedTypes(int size) - { - //packed values - yield return MakeItem("packed-int32", size, x => x.AddPackedInt32(1001)); - yield return MakeItem("packed-int64", size, x => x.AddPackedInt64(1001)); - yield return MakeItem("packed-uint32", size, x => x.AddPackedUint32(1001)); - yield return MakeItem("packed-uint64", size, x => x.AddPackedUint64(1001)); - yield return MakeItem("packed-sint32", size, x => x.AddPackedSint32(-1001)); - yield return MakeItem("packed-sint64", size, x => x.AddPackedSint64(-1001)); - yield return MakeItem("packed-fixed32", size, x => x.AddPackedFixed32(1001)); - yield return MakeItem("packed-fixed64", size, x => x.AddPackedFixed64(1001)); - yield return MakeItem("packed-sfixed32", size, x => x.AddPackedSfixed32(-1001)); - yield return MakeItem("packed-sfixed64", size, x => x.AddPackedSfixed64(-1001)); - yield return MakeItem("packed-float", size, x => x.AddPackedFloat(1001.1001f)); - yield return MakeItem("packed-double", size, x => x.AddPackedDouble(1001.1001)); - yield return MakeItem("packed-bool", size, x => x.AddPackedBool(true)); - yield return - MakeItem("packed-enum", size, x => x.AddPackedEnum(ForeignEnum.FOREIGN_FOO)); - } - - private static KeyValuePair> MakeItem(string name, int repeated, Action build) - where T : IBuilderLite, new() - { - if (repeated == 1) - { - return new KeyValuePair>(name, build); - } - - return new KeyValuePair>( - String.Format("{0}[{1}]", name, repeated), - x => - { - for (int i = 0; i < repeated; i++) - { - build(x); - } - } - ); - } - - private static KeyValuePair MakeWorkItem(string name, - IEnumerable>> - builders) where T : IBuilderLite, new() - { - T builder = new T(); - - foreach (KeyValuePair> item in builders) - { - item.Value(builder); - } - - IMessageLite msg = builder.WeakBuild(); - string fname = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "unittest_" + name + ".dat"); - File.WriteAllBytes(fname, msg.ToByteArray()); - return - new KeyValuePair( - String.Format("{0},{1}", msg.GetType().FullName, msg.GetType().Assembly.GetName().Name), fname); - } - } -} \ No newline at end of file diff --git a/src/ProtoBench/Properties/AssemblyInfo.cs b/src/ProtoBench/Properties/AssemblyInfo.cs deleted file mode 100644 index 8600c13..0000000 --- a/src/ProtoBench/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. - -[assembly: AssemblyTitle("ProtoBench")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ProtoBench")] -[assembly: AssemblyCopyright("Copyright © 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -[assembly: CLSCompliant(true)] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("2.4.1.555")] - -[assembly: AssemblyVersion("2.4.1.555")] -[assembly: AssemblyFileVersion("2.4.1.555")] \ No newline at end of file diff --git a/src/ProtoBench/ProtoBench.csproj b/src/ProtoBench/ProtoBench.csproj deleted file mode 100644 index 9df4774..0000000 --- a/src/ProtoBench/ProtoBench.csproj +++ /dev/null @@ -1,88 +0,0 @@ - - - - CLIENTPROFILE - NET35 - Debug - AnyCPU - 9.0.30729 - 2.0 - {C7A4A435-2813-41C8-AA87-BD914BA5223D} - Exe - Properties - Google.ProtocolBuffers.ProtoBench - ProtoBench - v3.5 - 512 - - - true - full - false - bin\NET35\Debug - obj\NET35\Debug\ - DEBUG;TRACE - prompt - 4 - true - true - Off - - - pdbonly - true - bin\NET35\Release - obj\NET35\Release\ - TRACE - prompt - 4 - true - true - Off - - - - - - - - - - - - - - - - - - - - - {231391AF-449C-4a39-986C-AD7F270F4750} - ProtocolBuffers.Serialization - True - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - True - - - - - Always - - - Always - - - - - \ No newline at end of file diff --git a/src/ProtoBench/TestProtos/GoogleSizeProtoFile.cs b/src/ProtoBench/TestProtos/GoogleSizeProtoFile.cs deleted file mode 100644 index aa6c507..0000000 --- a/src/ProtoBench/TestProtos/GoogleSizeProtoFile.cs +++ /dev/null @@ -1,4572 +0,0 @@ -// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.ProtoBench { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class GoogleSizeProtoFile { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_benchmarks_SizeMessage1__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_benchmarks_SizeMessage1__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_benchmarks_SizeMessage1SubMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_benchmarks_SizeMessage1SubMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_benchmarks_SizeMessage2__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_benchmarks_SizeMessage2__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_benchmarks_SizeMessage2_Group1__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_benchmarks_SizeMessage2_Group1__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_benchmarks_SizeMessage2GroupedMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_benchmarks_SizeMessage2GroupedMessage__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static GoogleSizeProtoFile() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "ChxiZW5jaG1hcmtzL2dvb2dsZV9zaXplLnByb3RvEgpiZW5jaG1hcmtzGiRn", - "b29nbGUvcHJvdG9idWYvY3NoYXJwX29wdGlvbnMucHJvdG8i9gYKDFNpemVN", - "ZXNzYWdlMRIOCgZmaWVsZDEYASACKAkSDgoGZmllbGQ5GAkgASgJEg8KB2Zp", - "ZWxkMTgYEiABKAkSFgoHZmllbGQ4MBhQIAEoCDoFZmFsc2USFQoHZmllbGQ4", - "MRhRIAEoCDoEdHJ1ZRIOCgZmaWVsZDIYAiACKAUSDgoGZmllbGQzGAMgAigF", - "EhEKCGZpZWxkMjgwGJgCIAEoBRIRCgZmaWVsZDYYBiABKAU6ATASDwoHZmll", - "bGQyMhgWIAEoAxIOCgZmaWVsZDQYBCABKAkSDgoGZmllbGQ1GAUgAygGEhYK", - "B2ZpZWxkNTkYOyABKAg6BWZhbHNlEg4KBmZpZWxkNxgHIAEoCRIPCgdmaWVs", - "ZDE2GBAgASgFEhQKCGZpZWxkMTMwGIIBIAEoBToBMBIVCgdmaWVsZDEyGAwg", - "ASgIOgR0cnVlEhUKB2ZpZWxkMTcYESABKAg6BHRydWUSFQoHZmllbGQxMxgN", - "IAEoCDoEdHJ1ZRIVCgdmaWVsZDE0GA4gASgIOgR0cnVlEhMKCGZpZWxkMTA0", - "GGggASgFOgEwEhMKCGZpZWxkMTAwGGQgASgFOgEwEhMKCGZpZWxkMTAxGGUg", - "ASgFOgEwEhAKCGZpZWxkMTAyGGYgASgJEhAKCGZpZWxkMTAzGGcgASgJEhIK", - "B2ZpZWxkMjkYHSABKAU6ATASFgoHZmllbGQzMBgeIAEoCDoFZmFsc2USEwoH", - "ZmllbGQ2MBg8IAEoBToCLTESFQoIZmllbGQyNzEYjwIgASgFOgItMRIVCghm", - "aWVsZDI3MhiQAiABKAU6Ai0xEhEKCGZpZWxkMTUwGJYBIAEoBRISCgdmaWVs", - "ZDIzGBcgASgFOgEwEhYKB2ZpZWxkMjQYGCABKAg6BWZhbHNlEhIKB2ZpZWxk", - "MjUYGSABKAU6ATASMwoHZmllbGQxNRgPIAEoCzIiLmJlbmNobWFya3MuU2l6", - "ZU1lc3NhZ2UxU3ViTWVzc2FnZRIPCgdmaWVsZDc4GE4gASgIEhIKB2ZpZWxk", - "NjcYQyABKAU6ATASDwoHZmllbGQ2OBhEIAEoBRIUCghmaWVsZDEyOBiAASAB", - "KAU6ATASKAoIZmllbGQxMjkYgQEgASgJOhV4eHh4eHh4eHh4eHh4eHh4eHh4", - "eHgSFAoIZmllbGQxMzEYgwEgASgFOgEwIqEDChZTaXplTWVzc2FnZTFTdWJN", - "ZXNzYWdlEhEKBmZpZWxkMRgBIAEoBToBMBIRCgZmaWVsZDIYAiABKAU6ATAS", - "EQoGZmllbGQzGAMgASgFOgEwEg8KB2ZpZWxkMTUYDyABKAkSFQoHZmllbGQx", - "MhgMIAEoCDoEdHJ1ZRIPCgdmaWVsZDEzGA0gASgDEg8KB2ZpZWxkMTQYDiAB", - "KAMSDwoHZmllbGQxNhgQIAEoBRISCgdmaWVsZDE5GBMgASgFOgEyEhUKB2Zp", - "ZWxkMjAYFCABKAg6BHRydWUSFQoHZmllbGQyOBgcIAEoCDoEdHJ1ZRIPCgdm", - "aWVsZDIxGBUgASgGEg8KB2ZpZWxkMjIYFiABKAUSFgoHZmllbGQyMxgXIAEo", - "CDoFZmFsc2USGAoIZmllbGQyMDYYzgEgASgIOgVmYWxzZRIRCghmaWVsZDIw", - "MxjLASABKAcSEQoIZmllbGQyMDQYzAEgASgFEhEKCGZpZWxkMjA1GM0BIAEo", - "CRIRCghmaWVsZDIwNxjPASABKAQSEQoIZmllbGQzMDAYrAIgASgEIscHCgxT", - "aXplTWVzc2FnZTISDgoGZmllbGQxGAEgASgJEg4KBmZpZWxkMxgDIAEoAxIO", - "CgZmaWVsZDQYBCABKAMSDwoHZmllbGQzMBgeIAEoAxIWCgdmaWVsZDc1GEsg", - "ASgIOgVmYWxzZRIOCgZmaWVsZDYYBiABKAkSDgoGZmllbGQyGAIgASgMEhIK", - "B2ZpZWxkMjEYFSABKAU6ATASDwoHZmllbGQ3MRhHIAEoBRIPCgdmaWVsZDI1", - "GBkgASgCEhMKCGZpZWxkMTA5GG0gASgFOgEwEhQKCGZpZWxkMjEwGNIBIAEo", - "BToBMBIUCghmaWVsZDIxMRjTASABKAU6ATASFAoIZmllbGQyMTIY1AEgASgF", - "OgEwEhQKCGZpZWxkMjEzGNUBIAEoBToBMBIUCghmaWVsZDIxNhjYASABKAU6", - "ATASFAoIZmllbGQyMTcY2QEgASgFOgEwEhQKCGZpZWxkMjE4GNoBIAEoBToB", - "MBIUCghmaWVsZDIyMBjcASABKAU6ATASFAoIZmllbGQyMjEY3QEgASgFOgEw", - "EhQKCGZpZWxkMjIyGN4BIAEoAjoBMBIPCgdmaWVsZDYzGD8gASgFEi8KBmdy", - "b3VwMRgKIAMoCjIfLmJlbmNobWFya3MuU2l6ZU1lc3NhZ2UyLkdyb3VwMRIR", - "CghmaWVsZDEyOBiAASADKAkSEQoIZmllbGQxMzEYgwEgASgDEhAKCGZpZWxk", - "MTI3GH8gAygJEhEKCGZpZWxkMTI5GIEBIAEoBRIRCghmaWVsZDEzMBiCASAD", - "KAMSGAoIZmllbGQyMDUYzQEgASgIOgVmYWxzZRIYCghmaWVsZDIwNhjOASAB", - "KAg6BWZhbHNlGsICCgZHcm91cDESDwoHZmllbGQxMRgLIAIoAhIPCgdmaWVs", - "ZDI2GBogASgCEg8KB2ZpZWxkMTIYDCABKAkSDwoHZmllbGQxMxgNIAEoCRIP", - "CgdmaWVsZDE0GA4gAygJEg8KB2ZpZWxkMTUYDyACKAQSDgoGZmllbGQ1GAUg", - "ASgFEg8KB2ZpZWxkMjcYGyABKAkSDwoHZmllbGQyOBgcIAEoBRIPCgdmaWVs", - "ZDI5GB0gASgJEg8KB2ZpZWxkMTYYECABKAkSDwoHZmllbGQyMhgWIAMoCRIP", - "CgdmaWVsZDczGEkgAygFEhIKB2ZpZWxkMjAYFCABKAU6ATASDwoHZmllbGQy", - "NBgYIAEoCRI3CgdmaWVsZDMxGB8gASgLMiYuYmVuY2htYXJrcy5TaXplTWVz", - "c2FnZTJHcm91cGVkTWVzc2FnZSLeAQoaU2l6ZU1lc3NhZ2UyR3JvdXBlZE1l", - "c3NhZ2USDgoGZmllbGQxGAEgASgCEg4KBmZpZWxkMhgCIAEoAhIRCgZmaWVs", - "ZDMYAyABKAI6ATASDgoGZmllbGQ0GAQgASgIEg4KBmZpZWxkNRgFIAEoCBIU", - "CgZmaWVsZDYYBiABKAg6BHRydWUSFQoGZmllbGQ3GAcgASgIOgVmYWxzZRIO", - "CgZmaWVsZDgYCCABKAISDgoGZmllbGQ5GAkgASgIEg8KB2ZpZWxkMTAYCiAB", - "KAISDwoHZmllbGQxMRgLIAEoA0JJQgpHb29nbGVTaXplSALCPjgKIUdvb2ds", - "ZS5Qcm90b2NvbEJ1ZmZlcnMuUHJvdG9CZW5jaBITR29vZ2xlU2l6ZVByb3Rv", - "RmlsZQ==")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_benchmarks_SizeMessage1__Descriptor = Descriptor.MessageTypes[0]; - internal__static_benchmarks_SizeMessage1__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_benchmarks_SizeMessage1__Descriptor, - new string[] { "Field1", "Field9", "Field18", "Field80", "Field81", "Field2", "Field3", "Field280", "Field6", "Field22", "Field4", "Field5", "Field59", "Field7", "Field16", "Field130", "Field12", "Field17", "Field13", "Field14", "Field104", "Field100", "Field101", "Field102", "Field103", "Field29", "Field30", "Field60", "Field271", "Field272", "Field150", "Field23", "Field24", "Field25", "Field15", "Field78", "Field67", "Field68", "Field128", "Field129", "Field131", }); - internal__static_benchmarks_SizeMessage1SubMessage__Descriptor = Descriptor.MessageTypes[1]; - internal__static_benchmarks_SizeMessage1SubMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_benchmarks_SizeMessage1SubMessage__Descriptor, - new string[] { "Field1", "Field2", "Field3", "Field15", "Field12", "Field13", "Field14", "Field16", "Field19", "Field20", "Field28", "Field21", "Field22", "Field23", "Field206", "Field203", "Field204", "Field205", "Field207", "Field300", }); - internal__static_benchmarks_SizeMessage2__Descriptor = Descriptor.MessageTypes[2]; - internal__static_benchmarks_SizeMessage2__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_benchmarks_SizeMessage2__Descriptor, - new string[] { "Field1", "Field3", "Field4", "Field30", "Field75", "Field6", "Field2", "Field21", "Field71", "Field25", "Field109", "Field210", "Field211", "Field212", "Field213", "Field216", "Field217", "Field218", "Field220", "Field221", "Field222", "Field63", "Group1", "Field128", "Field131", "Field127", "Field129", "Field130", "Field205", "Field206", }); - internal__static_benchmarks_SizeMessage2_Group1__Descriptor = internal__static_benchmarks_SizeMessage2__Descriptor.NestedTypes[0]; - internal__static_benchmarks_SizeMessage2_Group1__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_benchmarks_SizeMessage2_Group1__Descriptor, - new string[] { "Field11", "Field26", "Field12", "Field13", "Field14", "Field15", "Field5", "Field27", "Field28", "Field29", "Field16", "Field22", "Field73", "Field20", "Field24", "Field31", }); - internal__static_benchmarks_SizeMessage2GroupedMessage__Descriptor = Descriptor.MessageTypes[3]; - internal__static_benchmarks_SizeMessage2GroupedMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_benchmarks_SizeMessage2GroupedMessage__Descriptor, - new string[] { "Field1", "Field2", "Field3", "Field4", "Field5", "Field6", "Field7", "Field8", "Field9", "Field10", "Field11", }); - pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); - RegisterAllExtensions(registry); - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.RegisterAllExtensions(registry); - return registry; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, - }, assigner); - } - #endregion - - } - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class SizeMessage1 : pb::GeneratedMessage { - private SizeMessage1() { } - private static readonly SizeMessage1 defaultInstance = new SizeMessage1().MakeReadOnly(); - public static SizeMessage1 DefaultInstance { - get { return defaultInstance; } - } - - public override SizeMessage1 DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override SizeMessage1 ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.ProtoBench.GoogleSizeProtoFile.internal__static_benchmarks_SizeMessage1__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.ProtoBench.GoogleSizeProtoFile.internal__static_benchmarks_SizeMessage1__FieldAccessorTable; } - } - - public const int Field1FieldNumber = 1; - private bool hasField1; - private string field1_ = ""; - public bool HasField1 { - get { return hasField1; } - } - public string Field1 { - get { return field1_; } - } - - public const int Field9FieldNumber = 9; - private bool hasField9; - private string field9_ = ""; - public bool HasField9 { - get { return hasField9; } - } - public string Field9 { - get { return field9_; } - } - - public const int Field18FieldNumber = 18; - private bool hasField18; - private string field18_ = ""; - public bool HasField18 { - get { return hasField18; } - } - public string Field18 { - get { return field18_; } - } - - public const int Field80FieldNumber = 80; - private bool hasField80; - private bool field80_; - public bool HasField80 { - get { return hasField80; } - } - public bool Field80 { - get { return field80_; } - } - - public const int Field81FieldNumber = 81; - private bool hasField81; - private bool field81_ = true; - public bool HasField81 { - get { return hasField81; } - } - public bool Field81 { - get { return field81_; } - } - - public const int Field2FieldNumber = 2; - private bool hasField2; - private int field2_; - public bool HasField2 { - get { return hasField2; } - } - public int Field2 { - get { return field2_; } - } - - public const int Field3FieldNumber = 3; - private bool hasField3; - private int field3_; - public bool HasField3 { - get { return hasField3; } - } - public int Field3 { - get { return field3_; } - } - - public const int Field280FieldNumber = 280; - private bool hasField280; - private int field280_; - public bool HasField280 { - get { return hasField280; } - } - public int Field280 { - get { return field280_; } - } - - public const int Field6FieldNumber = 6; - private bool hasField6; - private int field6_; - public bool HasField6 { - get { return hasField6; } - } - public int Field6 { - get { return field6_; } - } - - public const int Field22FieldNumber = 22; - private bool hasField22; - private long field22_; - public bool HasField22 { - get { return hasField22; } - } - public long Field22 { - get { return field22_; } - } - - public const int Field4FieldNumber = 4; - private bool hasField4; - private string field4_ = ""; - public bool HasField4 { - get { return hasField4; } - } - public string Field4 { - get { return field4_; } - } - - public const int Field5FieldNumber = 5; - private pbc::PopsicleList field5_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList Field5List { - get { return pbc::Lists.AsReadOnly(field5_); } - } - public int Field5Count { - get { return field5_.Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetField5(int index) { - return field5_[index]; - } - - public const int Field59FieldNumber = 59; - private bool hasField59; - private bool field59_; - public bool HasField59 { - get { return hasField59; } - } - public bool Field59 { - get { return field59_; } - } - - public const int Field7FieldNumber = 7; - private bool hasField7; - private string field7_ = ""; - public bool HasField7 { - get { return hasField7; } - } - public string Field7 { - get { return field7_; } - } - - public const int Field16FieldNumber = 16; - private bool hasField16; - private int field16_; - public bool HasField16 { - get { return hasField16; } - } - public int Field16 { - get { return field16_; } - } - - public const int Field130FieldNumber = 130; - private bool hasField130; - private int field130_; - public bool HasField130 { - get { return hasField130; } - } - public int Field130 { - get { return field130_; } - } - - public const int Field12FieldNumber = 12; - private bool hasField12; - private bool field12_ = true; - public bool HasField12 { - get { return hasField12; } - } - public bool Field12 { - get { return field12_; } - } - - public const int Field17FieldNumber = 17; - private bool hasField17; - private bool field17_ = true; - public bool HasField17 { - get { return hasField17; } - } - public bool Field17 { - get { return field17_; } - } - - public const int Field13FieldNumber = 13; - private bool hasField13; - private bool field13_ = true; - public bool HasField13 { - get { return hasField13; } - } - public bool Field13 { - get { return field13_; } - } - - public const int Field14FieldNumber = 14; - private bool hasField14; - private bool field14_ = true; - public bool HasField14 { - get { return hasField14; } - } - public bool Field14 { - get { return field14_; } - } - - public const int Field104FieldNumber = 104; - private bool hasField104; - private int field104_; - public bool HasField104 { - get { return hasField104; } - } - public int Field104 { - get { return field104_; } - } - - public const int Field100FieldNumber = 100; - private bool hasField100; - private int field100_; - public bool HasField100 { - get { return hasField100; } - } - public int Field100 { - get { return field100_; } - } - - public const int Field101FieldNumber = 101; - private bool hasField101; - private int field101_; - public bool HasField101 { - get { return hasField101; } - } - public int Field101 { - get { return field101_; } - } - - public const int Field102FieldNumber = 102; - private bool hasField102; - private string field102_ = ""; - public bool HasField102 { - get { return hasField102; } - } - public string Field102 { - get { return field102_; } - } - - public const int Field103FieldNumber = 103; - private bool hasField103; - private string field103_ = ""; - public bool HasField103 { - get { return hasField103; } - } - public string Field103 { - get { return field103_; } - } - - public const int Field29FieldNumber = 29; - private bool hasField29; - private int field29_; - public bool HasField29 { - get { return hasField29; } - } - public int Field29 { - get { return field29_; } - } - - public const int Field30FieldNumber = 30; - private bool hasField30; - private bool field30_; - public bool HasField30 { - get { return hasField30; } - } - public bool Field30 { - get { return field30_; } - } - - public const int Field60FieldNumber = 60; - private bool hasField60; - private int field60_ = -1; - public bool HasField60 { - get { return hasField60; } - } - public int Field60 { - get { return field60_; } - } - - public const int Field271FieldNumber = 271; - private bool hasField271; - private int field271_ = -1; - public bool HasField271 { - get { return hasField271; } - } - public int Field271 { - get { return field271_; } - } - - public const int Field272FieldNumber = 272; - private bool hasField272; - private int field272_ = -1; - public bool HasField272 { - get { return hasField272; } - } - public int Field272 { - get { return field272_; } - } - - public const int Field150FieldNumber = 150; - private bool hasField150; - private int field150_; - public bool HasField150 { - get { return hasField150; } - } - public int Field150 { - get { return field150_; } - } - - public const int Field23FieldNumber = 23; - private bool hasField23; - private int field23_; - public bool HasField23 { - get { return hasField23; } - } - public int Field23 { - get { return field23_; } - } - - public const int Field24FieldNumber = 24; - private bool hasField24; - private bool field24_; - public bool HasField24 { - get { return hasField24; } - } - public bool Field24 { - get { return field24_; } - } - - public const int Field25FieldNumber = 25; - private bool hasField25; - private int field25_; - public bool HasField25 { - get { return hasField25; } - } - public int Field25 { - get { return field25_; } - } - - public const int Field15FieldNumber = 15; - private bool hasField15; - private global::Google.ProtocolBuffers.ProtoBench.SizeMessage1SubMessage field15_; - public bool HasField15 { - get { return hasField15; } - } - public global::Google.ProtocolBuffers.ProtoBench.SizeMessage1SubMessage Field15 { - get { return field15_ ?? global::Google.ProtocolBuffers.ProtoBench.SizeMessage1SubMessage.DefaultInstance; } - } - - public const int Field78FieldNumber = 78; - private bool hasField78; - private bool field78_; - public bool HasField78 { - get { return hasField78; } - } - public bool Field78 { - get { return field78_; } - } - - public const int Field67FieldNumber = 67; - private bool hasField67; - private int field67_; - public bool HasField67 { - get { return hasField67; } - } - public int Field67 { - get { return field67_; } - } - - public const int Field68FieldNumber = 68; - private bool hasField68; - private int field68_; - public bool HasField68 { - get { return hasField68; } - } - public int Field68 { - get { return field68_; } - } - - public const int Field128FieldNumber = 128; - private bool hasField128; - private int field128_; - public bool HasField128 { - get { return hasField128; } - } - public int Field128 { - get { return field128_; } - } - - public const int Field129FieldNumber = 129; - private bool hasField129; - private string field129_ = "xxxxxxxxxxxxxxxxxxxxx"; - public bool HasField129 { - get { return hasField129; } - } - public string Field129 { - get { return field129_; } - } - - public const int Field131FieldNumber = 131; - private bool hasField131; - private int field131_; - public bool HasField131 { - get { return hasField131; } - } - public int Field131 { - get { return field131_; } - } - - public static SizeMessage1 ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SizeMessage1 ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SizeMessage1 ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SizeMessage1 ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SizeMessage1 ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SizeMessage1 ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SizeMessage1 ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SizeMessage1 ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SizeMessage1 ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SizeMessage1 ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private SizeMessage1 MakeReadOnly() { - field5_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SizeMessage1 prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(SizeMessage1 cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private SizeMessage1 result; - - private SizeMessage1 PrepareBuilder() { - if (resultIsReadOnly) { - SizeMessage1 original = result; - result = new SizeMessage1(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override SizeMessage1 MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.ProtoBench.SizeMessage1.Descriptor; } - } - - public override SizeMessage1 DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.ProtoBench.SizeMessage1.DefaultInstance; } - } - - public override SizeMessage1 BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - - public bool HasField1 { - get { return result.hasField1; } - } - public string Field1 { - get { return result.Field1; } - set { SetField1(value); } - } - public Builder SetField1(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField1 = true; - result.field1_ = value; - return this; - } - public Builder ClearField1() { - PrepareBuilder(); - result.hasField1 = false; - result.field1_ = ""; - return this; - } - - public bool HasField9 { - get { return result.hasField9; } - } - public string Field9 { - get { return result.Field9; } - set { SetField9(value); } - } - public Builder SetField9(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField9 = true; - result.field9_ = value; - return this; - } - public Builder ClearField9() { - PrepareBuilder(); - result.hasField9 = false; - result.field9_ = ""; - return this; - } - - public bool HasField18 { - get { return result.hasField18; } - } - public string Field18 { - get { return result.Field18; } - set { SetField18(value); } - } - public Builder SetField18(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField18 = true; - result.field18_ = value; - return this; - } - public Builder ClearField18() { - PrepareBuilder(); - result.hasField18 = false; - result.field18_ = ""; - return this; - } - - public bool HasField80 { - get { return result.hasField80; } - } - public bool Field80 { - get { return result.Field80; } - set { SetField80(value); } - } - public Builder SetField80(bool value) { - PrepareBuilder(); - result.hasField80 = true; - result.field80_ = value; - return this; - } - public Builder ClearField80() { - PrepareBuilder(); - result.hasField80 = false; - result.field80_ = false; - return this; - } - - public bool HasField81 { - get { return result.hasField81; } - } - public bool Field81 { - get { return result.Field81; } - set { SetField81(value); } - } - public Builder SetField81(bool value) { - PrepareBuilder(); - result.hasField81 = true; - result.field81_ = value; - return this; - } - public Builder ClearField81() { - PrepareBuilder(); - result.hasField81 = false; - result.field81_ = true; - return this; - } - - public bool HasField2 { - get { return result.hasField2; } - } - public int Field2 { - get { return result.Field2; } - set { SetField2(value); } - } - public Builder SetField2(int value) { - PrepareBuilder(); - result.hasField2 = true; - result.field2_ = value; - return this; - } - public Builder ClearField2() { - PrepareBuilder(); - result.hasField2 = false; - result.field2_ = 0; - return this; - } - - public bool HasField3 { - get { return result.hasField3; } - } - public int Field3 { - get { return result.Field3; } - set { SetField3(value); } - } - public Builder SetField3(int value) { - PrepareBuilder(); - result.hasField3 = true; - result.field3_ = value; - return this; - } - public Builder ClearField3() { - PrepareBuilder(); - result.hasField3 = false; - result.field3_ = 0; - return this; - } - - public bool HasField280 { - get { return result.hasField280; } - } - public int Field280 { - get { return result.Field280; } - set { SetField280(value); } - } - public Builder SetField280(int value) { - PrepareBuilder(); - result.hasField280 = true; - result.field280_ = value; - return this; - } - public Builder ClearField280() { - PrepareBuilder(); - result.hasField280 = false; - result.field280_ = 0; - return this; - } - - public bool HasField6 { - get { return result.hasField6; } - } - public int Field6 { - get { return result.Field6; } - set { SetField6(value); } - } - public Builder SetField6(int value) { - PrepareBuilder(); - result.hasField6 = true; - result.field6_ = value; - return this; - } - public Builder ClearField6() { - PrepareBuilder(); - result.hasField6 = false; - result.field6_ = 0; - return this; - } - - public bool HasField22 { - get { return result.hasField22; } - } - public long Field22 { - get { return result.Field22; } - set { SetField22(value); } - } - public Builder SetField22(long value) { - PrepareBuilder(); - result.hasField22 = true; - result.field22_ = value; - return this; - } - public Builder ClearField22() { - PrepareBuilder(); - result.hasField22 = false; - result.field22_ = 0L; - return this; - } - - public bool HasField4 { - get { return result.hasField4; } - } - public string Field4 { - get { return result.Field4; } - set { SetField4(value); } - } - public Builder SetField4(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField4 = true; - result.field4_ = value; - return this; - } - public Builder ClearField4() { - PrepareBuilder(); - result.hasField4 = false; - result.field4_ = ""; - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList Field5List { - get { return PrepareBuilder().field5_; } - } - public int Field5Count { - get { return result.Field5Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetField5(int index) { - return result.GetField5(index); - } - [global::System.CLSCompliant(false)] - public Builder SetField5(int index, ulong value) { - PrepareBuilder(); - result.field5_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddField5(ulong value) { - PrepareBuilder(); - result.field5_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeField5(scg::IEnumerable values) { - PrepareBuilder(); - result.field5_.Add(values); - return this; - } - public Builder ClearField5() { - PrepareBuilder(); - result.field5_.Clear(); - return this; - } - - public bool HasField59 { - get { return result.hasField59; } - } - public bool Field59 { - get { return result.Field59; } - set { SetField59(value); } - } - public Builder SetField59(bool value) { - PrepareBuilder(); - result.hasField59 = true; - result.field59_ = value; - return this; - } - public Builder ClearField59() { - PrepareBuilder(); - result.hasField59 = false; - result.field59_ = false; - return this; - } - - public bool HasField7 { - get { return result.hasField7; } - } - public string Field7 { - get { return result.Field7; } - set { SetField7(value); } - } - public Builder SetField7(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField7 = true; - result.field7_ = value; - return this; - } - public Builder ClearField7() { - PrepareBuilder(); - result.hasField7 = false; - result.field7_ = ""; - return this; - } - - public bool HasField16 { - get { return result.hasField16; } - } - public int Field16 { - get { return result.Field16; } - set { SetField16(value); } - } - public Builder SetField16(int value) { - PrepareBuilder(); - result.hasField16 = true; - result.field16_ = value; - return this; - } - public Builder ClearField16() { - PrepareBuilder(); - result.hasField16 = false; - result.field16_ = 0; - return this; - } - - public bool HasField130 { - get { return result.hasField130; } - } - public int Field130 { - get { return result.Field130; } - set { SetField130(value); } - } - public Builder SetField130(int value) { - PrepareBuilder(); - result.hasField130 = true; - result.field130_ = value; - return this; - } - public Builder ClearField130() { - PrepareBuilder(); - result.hasField130 = false; - result.field130_ = 0; - return this; - } - - public bool HasField12 { - get { return result.hasField12; } - } - public bool Field12 { - get { return result.Field12; } - set { SetField12(value); } - } - public Builder SetField12(bool value) { - PrepareBuilder(); - result.hasField12 = true; - result.field12_ = value; - return this; - } - public Builder ClearField12() { - PrepareBuilder(); - result.hasField12 = false; - result.field12_ = true; - return this; - } - - public bool HasField17 { - get { return result.hasField17; } - } - public bool Field17 { - get { return result.Field17; } - set { SetField17(value); } - } - public Builder SetField17(bool value) { - PrepareBuilder(); - result.hasField17 = true; - result.field17_ = value; - return this; - } - public Builder ClearField17() { - PrepareBuilder(); - result.hasField17 = false; - result.field17_ = true; - return this; - } - - public bool HasField13 { - get { return result.hasField13; } - } - public bool Field13 { - get { return result.Field13; } - set { SetField13(value); } - } - public Builder SetField13(bool value) { - PrepareBuilder(); - result.hasField13 = true; - result.field13_ = value; - return this; - } - public Builder ClearField13() { - PrepareBuilder(); - result.hasField13 = false; - result.field13_ = true; - return this; - } - - public bool HasField14 { - get { return result.hasField14; } - } - public bool Field14 { - get { return result.Field14; } - set { SetField14(value); } - } - public Builder SetField14(bool value) { - PrepareBuilder(); - result.hasField14 = true; - result.field14_ = value; - return this; - } - public Builder ClearField14() { - PrepareBuilder(); - result.hasField14 = false; - result.field14_ = true; - return this; - } - - public bool HasField104 { - get { return result.hasField104; } - } - public int Field104 { - get { return result.Field104; } - set { SetField104(value); } - } - public Builder SetField104(int value) { - PrepareBuilder(); - result.hasField104 = true; - result.field104_ = value; - return this; - } - public Builder ClearField104() { - PrepareBuilder(); - result.hasField104 = false; - result.field104_ = 0; - return this; - } - - public bool HasField100 { - get { return result.hasField100; } - } - public int Field100 { - get { return result.Field100; } - set { SetField100(value); } - } - public Builder SetField100(int value) { - PrepareBuilder(); - result.hasField100 = true; - result.field100_ = value; - return this; - } - public Builder ClearField100() { - PrepareBuilder(); - result.hasField100 = false; - result.field100_ = 0; - return this; - } - - public bool HasField101 { - get { return result.hasField101; } - } - public int Field101 { - get { return result.Field101; } - set { SetField101(value); } - } - public Builder SetField101(int value) { - PrepareBuilder(); - result.hasField101 = true; - result.field101_ = value; - return this; - } - public Builder ClearField101() { - PrepareBuilder(); - result.hasField101 = false; - result.field101_ = 0; - return this; - } - - public bool HasField102 { - get { return result.hasField102; } - } - public string Field102 { - get { return result.Field102; } - set { SetField102(value); } - } - public Builder SetField102(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField102 = true; - result.field102_ = value; - return this; - } - public Builder ClearField102() { - PrepareBuilder(); - result.hasField102 = false; - result.field102_ = ""; - return this; - } - - public bool HasField103 { - get { return result.hasField103; } - } - public string Field103 { - get { return result.Field103; } - set { SetField103(value); } - } - public Builder SetField103(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField103 = true; - result.field103_ = value; - return this; - } - public Builder ClearField103() { - PrepareBuilder(); - result.hasField103 = false; - result.field103_ = ""; - return this; - } - - public bool HasField29 { - get { return result.hasField29; } - } - public int Field29 { - get { return result.Field29; } - set { SetField29(value); } - } - public Builder SetField29(int value) { - PrepareBuilder(); - result.hasField29 = true; - result.field29_ = value; - return this; - } - public Builder ClearField29() { - PrepareBuilder(); - result.hasField29 = false; - result.field29_ = 0; - return this; - } - - public bool HasField30 { - get { return result.hasField30; } - } - public bool Field30 { - get { return result.Field30; } - set { SetField30(value); } - } - public Builder SetField30(bool value) { - PrepareBuilder(); - result.hasField30 = true; - result.field30_ = value; - return this; - } - public Builder ClearField30() { - PrepareBuilder(); - result.hasField30 = false; - result.field30_ = false; - return this; - } - - public bool HasField60 { - get { return result.hasField60; } - } - public int Field60 { - get { return result.Field60; } - set { SetField60(value); } - } - public Builder SetField60(int value) { - PrepareBuilder(); - result.hasField60 = true; - result.field60_ = value; - return this; - } - public Builder ClearField60() { - PrepareBuilder(); - result.hasField60 = false; - result.field60_ = -1; - return this; - } - - public bool HasField271 { - get { return result.hasField271; } - } - public int Field271 { - get { return result.Field271; } - set { SetField271(value); } - } - public Builder SetField271(int value) { - PrepareBuilder(); - result.hasField271 = true; - result.field271_ = value; - return this; - } - public Builder ClearField271() { - PrepareBuilder(); - result.hasField271 = false; - result.field271_ = -1; - return this; - } - - public bool HasField272 { - get { return result.hasField272; } - } - public int Field272 { - get { return result.Field272; } - set { SetField272(value); } - } - public Builder SetField272(int value) { - PrepareBuilder(); - result.hasField272 = true; - result.field272_ = value; - return this; - } - public Builder ClearField272() { - PrepareBuilder(); - result.hasField272 = false; - result.field272_ = -1; - return this; - } - - public bool HasField150 { - get { return result.hasField150; } - } - public int Field150 { - get { return result.Field150; } - set { SetField150(value); } - } - public Builder SetField150(int value) { - PrepareBuilder(); - result.hasField150 = true; - result.field150_ = value; - return this; - } - public Builder ClearField150() { - PrepareBuilder(); - result.hasField150 = false; - result.field150_ = 0; - return this; - } - - public bool HasField23 { - get { return result.hasField23; } - } - public int Field23 { - get { return result.Field23; } - set { SetField23(value); } - } - public Builder SetField23(int value) { - PrepareBuilder(); - result.hasField23 = true; - result.field23_ = value; - return this; - } - public Builder ClearField23() { - PrepareBuilder(); - result.hasField23 = false; - result.field23_ = 0; - return this; - } - - public bool HasField24 { - get { return result.hasField24; } - } - public bool Field24 { - get { return result.Field24; } - set { SetField24(value); } - } - public Builder SetField24(bool value) { - PrepareBuilder(); - result.hasField24 = true; - result.field24_ = value; - return this; - } - public Builder ClearField24() { - PrepareBuilder(); - result.hasField24 = false; - result.field24_ = false; - return this; - } - - public bool HasField25 { - get { return result.hasField25; } - } - public int Field25 { - get { return result.Field25; } - set { SetField25(value); } - } - public Builder SetField25(int value) { - PrepareBuilder(); - result.hasField25 = true; - result.field25_ = value; - return this; - } - public Builder ClearField25() { - PrepareBuilder(); - result.hasField25 = false; - result.field25_ = 0; - return this; - } - - public bool HasField15 { - get { return result.hasField15; } - } - public global::Google.ProtocolBuffers.ProtoBench.SizeMessage1SubMessage Field15 { - get { return result.Field15; } - set { SetField15(value); } - } - public Builder SetField15(global::Google.ProtocolBuffers.ProtoBench.SizeMessage1SubMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField15 = true; - result.field15_ = value; - return this; - } - public Builder SetField15(global::Google.ProtocolBuffers.ProtoBench.SizeMessage1SubMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasField15 = true; - result.field15_ = builderForValue.Build(); - return this; - } - public Builder MergeField15(global::Google.ProtocolBuffers.ProtoBench.SizeMessage1SubMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasField15 && - result.field15_ != global::Google.ProtocolBuffers.ProtoBench.SizeMessage1SubMessage.DefaultInstance) { - result.field15_ = global::Google.ProtocolBuffers.ProtoBench.SizeMessage1SubMessage.CreateBuilder(result.field15_).MergeFrom(value).BuildPartial(); - } else { - result.field15_ = value; - } - result.hasField15 = true; - return this; - } - public Builder ClearField15() { - PrepareBuilder(); - result.hasField15 = false; - result.field15_ = null; - return this; - } - - public bool HasField78 { - get { return result.hasField78; } - } - public bool Field78 { - get { return result.Field78; } - set { SetField78(value); } - } - public Builder SetField78(bool value) { - PrepareBuilder(); - result.hasField78 = true; - result.field78_ = value; - return this; - } - public Builder ClearField78() { - PrepareBuilder(); - result.hasField78 = false; - result.field78_ = false; - return this; - } - - public bool HasField67 { - get { return result.hasField67; } - } - public int Field67 { - get { return result.Field67; } - set { SetField67(value); } - } - public Builder SetField67(int value) { - PrepareBuilder(); - result.hasField67 = true; - result.field67_ = value; - return this; - } - public Builder ClearField67() { - PrepareBuilder(); - result.hasField67 = false; - result.field67_ = 0; - return this; - } - - public bool HasField68 { - get { return result.hasField68; } - } - public int Field68 { - get { return result.Field68; } - set { SetField68(value); } - } - public Builder SetField68(int value) { - PrepareBuilder(); - result.hasField68 = true; - result.field68_ = value; - return this; - } - public Builder ClearField68() { - PrepareBuilder(); - result.hasField68 = false; - result.field68_ = 0; - return this; - } - - public bool HasField128 { - get { return result.hasField128; } - } - public int Field128 { - get { return result.Field128; } - set { SetField128(value); } - } - public Builder SetField128(int value) { - PrepareBuilder(); - result.hasField128 = true; - result.field128_ = value; - return this; - } - public Builder ClearField128() { - PrepareBuilder(); - result.hasField128 = false; - result.field128_ = 0; - return this; - } - - public bool HasField129 { - get { return result.hasField129; } - } - public string Field129 { - get { return result.Field129; } - set { SetField129(value); } - } - public Builder SetField129(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField129 = true; - result.field129_ = value; - return this; - } - public Builder ClearField129() { - PrepareBuilder(); - result.hasField129 = false; - result.field129_ = "xxxxxxxxxxxxxxxxxxxxx"; - return this; - } - - public bool HasField131 { - get { return result.hasField131; } - } - public int Field131 { - get { return result.Field131; } - set { SetField131(value); } - } - public Builder SetField131(int value) { - PrepareBuilder(); - result.hasField131 = true; - result.field131_ = value; - return this; - } - public Builder ClearField131() { - PrepareBuilder(); - result.hasField131 = false; - result.field131_ = 0; - return this; - } - } - static SizeMessage1() { - object.ReferenceEquals(global::Google.ProtocolBuffers.ProtoBench.GoogleSizeProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class SizeMessage1SubMessage : pb::GeneratedMessage { - private SizeMessage1SubMessage() { } - private static readonly SizeMessage1SubMessage defaultInstance = new SizeMessage1SubMessage().MakeReadOnly(); - public static SizeMessage1SubMessage DefaultInstance { - get { return defaultInstance; } - } - - public override SizeMessage1SubMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override SizeMessage1SubMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.ProtoBench.GoogleSizeProtoFile.internal__static_benchmarks_SizeMessage1SubMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.ProtoBench.GoogleSizeProtoFile.internal__static_benchmarks_SizeMessage1SubMessage__FieldAccessorTable; } - } - - public const int Field1FieldNumber = 1; - private bool hasField1; - private int field1_; - public bool HasField1 { - get { return hasField1; } - } - public int Field1 { - get { return field1_; } - } - - public const int Field2FieldNumber = 2; - private bool hasField2; - private int field2_; - public bool HasField2 { - get { return hasField2; } - } - public int Field2 { - get { return field2_; } - } - - public const int Field3FieldNumber = 3; - private bool hasField3; - private int field3_; - public bool HasField3 { - get { return hasField3; } - } - public int Field3 { - get { return field3_; } - } - - public const int Field15FieldNumber = 15; - private bool hasField15; - private string field15_ = ""; - public bool HasField15 { - get { return hasField15; } - } - public string Field15 { - get { return field15_; } - } - - public const int Field12FieldNumber = 12; - private bool hasField12; - private bool field12_ = true; - public bool HasField12 { - get { return hasField12; } - } - public bool Field12 { - get { return field12_; } - } - - public const int Field13FieldNumber = 13; - private bool hasField13; - private long field13_; - public bool HasField13 { - get { return hasField13; } - } - public long Field13 { - get { return field13_; } - } - - public const int Field14FieldNumber = 14; - private bool hasField14; - private long field14_; - public bool HasField14 { - get { return hasField14; } - } - public long Field14 { - get { return field14_; } - } - - public const int Field16FieldNumber = 16; - private bool hasField16; - private int field16_; - public bool HasField16 { - get { return hasField16; } - } - public int Field16 { - get { return field16_; } - } - - public const int Field19FieldNumber = 19; - private bool hasField19; - private int field19_ = 2; - public bool HasField19 { - get { return hasField19; } - } - public int Field19 { - get { return field19_; } - } - - public const int Field20FieldNumber = 20; - private bool hasField20; - private bool field20_ = true; - public bool HasField20 { - get { return hasField20; } - } - public bool Field20 { - get { return field20_; } - } - - public const int Field28FieldNumber = 28; - private bool hasField28; - private bool field28_ = true; - public bool HasField28 { - get { return hasField28; } - } - public bool Field28 { - get { return field28_; } - } - - public const int Field21FieldNumber = 21; - private bool hasField21; - private ulong field21_; - public bool HasField21 { - get { return hasField21; } - } - [global::System.CLSCompliant(false)] - public ulong Field21 { - get { return field21_; } - } - - public const int Field22FieldNumber = 22; - private bool hasField22; - private int field22_; - public bool HasField22 { - get { return hasField22; } - } - public int Field22 { - get { return field22_; } - } - - public const int Field23FieldNumber = 23; - private bool hasField23; - private bool field23_; - public bool HasField23 { - get { return hasField23; } - } - public bool Field23 { - get { return field23_; } - } - - public const int Field206FieldNumber = 206; - private bool hasField206; - private bool field206_; - public bool HasField206 { - get { return hasField206; } - } - public bool Field206 { - get { return field206_; } - } - - public const int Field203FieldNumber = 203; - private bool hasField203; - private uint field203_; - public bool HasField203 { - get { return hasField203; } - } - [global::System.CLSCompliant(false)] - public uint Field203 { - get { return field203_; } - } - - public const int Field204FieldNumber = 204; - private bool hasField204; - private int field204_; - public bool HasField204 { - get { return hasField204; } - } - public int Field204 { - get { return field204_; } - } - - public const int Field205FieldNumber = 205; - private bool hasField205; - private string field205_ = ""; - public bool HasField205 { - get { return hasField205; } - } - public string Field205 { - get { return field205_; } - } - - public const int Field207FieldNumber = 207; - private bool hasField207; - private ulong field207_; - public bool HasField207 { - get { return hasField207; } - } - [global::System.CLSCompliant(false)] - public ulong Field207 { - get { return field207_; } - } - - public const int Field300FieldNumber = 300; - private bool hasField300; - private ulong field300_; - public bool HasField300 { - get { return hasField300; } - } - [global::System.CLSCompliant(false)] - public ulong Field300 { - get { return field300_; } - } - - public static SizeMessage1SubMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SizeMessage1SubMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SizeMessage1SubMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SizeMessage1SubMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SizeMessage1SubMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SizeMessage1SubMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SizeMessage1SubMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SizeMessage1SubMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SizeMessage1SubMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SizeMessage1SubMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private SizeMessage1SubMessage MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SizeMessage1SubMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(SizeMessage1SubMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private SizeMessage1SubMessage result; - - private SizeMessage1SubMessage PrepareBuilder() { - if (resultIsReadOnly) { - SizeMessage1SubMessage original = result; - result = new SizeMessage1SubMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override SizeMessage1SubMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.ProtoBench.SizeMessage1SubMessage.Descriptor; } - } - - public override SizeMessage1SubMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.ProtoBench.SizeMessage1SubMessage.DefaultInstance; } - } - - public override SizeMessage1SubMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - - public bool HasField1 { - get { return result.hasField1; } - } - public int Field1 { - get { return result.Field1; } - set { SetField1(value); } - } - public Builder SetField1(int value) { - PrepareBuilder(); - result.hasField1 = true; - result.field1_ = value; - return this; - } - public Builder ClearField1() { - PrepareBuilder(); - result.hasField1 = false; - result.field1_ = 0; - return this; - } - - public bool HasField2 { - get { return result.hasField2; } - } - public int Field2 { - get { return result.Field2; } - set { SetField2(value); } - } - public Builder SetField2(int value) { - PrepareBuilder(); - result.hasField2 = true; - result.field2_ = value; - return this; - } - public Builder ClearField2() { - PrepareBuilder(); - result.hasField2 = false; - result.field2_ = 0; - return this; - } - - public bool HasField3 { - get { return result.hasField3; } - } - public int Field3 { - get { return result.Field3; } - set { SetField3(value); } - } - public Builder SetField3(int value) { - PrepareBuilder(); - result.hasField3 = true; - result.field3_ = value; - return this; - } - public Builder ClearField3() { - PrepareBuilder(); - result.hasField3 = false; - result.field3_ = 0; - return this; - } - - public bool HasField15 { - get { return result.hasField15; } - } - public string Field15 { - get { return result.Field15; } - set { SetField15(value); } - } - public Builder SetField15(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField15 = true; - result.field15_ = value; - return this; - } - public Builder ClearField15() { - PrepareBuilder(); - result.hasField15 = false; - result.field15_ = ""; - return this; - } - - public bool HasField12 { - get { return result.hasField12; } - } - public bool Field12 { - get { return result.Field12; } - set { SetField12(value); } - } - public Builder SetField12(bool value) { - PrepareBuilder(); - result.hasField12 = true; - result.field12_ = value; - return this; - } - public Builder ClearField12() { - PrepareBuilder(); - result.hasField12 = false; - result.field12_ = true; - return this; - } - - public bool HasField13 { - get { return result.hasField13; } - } - public long Field13 { - get { return result.Field13; } - set { SetField13(value); } - } - public Builder SetField13(long value) { - PrepareBuilder(); - result.hasField13 = true; - result.field13_ = value; - return this; - } - public Builder ClearField13() { - PrepareBuilder(); - result.hasField13 = false; - result.field13_ = 0L; - return this; - } - - public bool HasField14 { - get { return result.hasField14; } - } - public long Field14 { - get { return result.Field14; } - set { SetField14(value); } - } - public Builder SetField14(long value) { - PrepareBuilder(); - result.hasField14 = true; - result.field14_ = value; - return this; - } - public Builder ClearField14() { - PrepareBuilder(); - result.hasField14 = false; - result.field14_ = 0L; - return this; - } - - public bool HasField16 { - get { return result.hasField16; } - } - public int Field16 { - get { return result.Field16; } - set { SetField16(value); } - } - public Builder SetField16(int value) { - PrepareBuilder(); - result.hasField16 = true; - result.field16_ = value; - return this; - } - public Builder ClearField16() { - PrepareBuilder(); - result.hasField16 = false; - result.field16_ = 0; - return this; - } - - public bool HasField19 { - get { return result.hasField19; } - } - public int Field19 { - get { return result.Field19; } - set { SetField19(value); } - } - public Builder SetField19(int value) { - PrepareBuilder(); - result.hasField19 = true; - result.field19_ = value; - return this; - } - public Builder ClearField19() { - PrepareBuilder(); - result.hasField19 = false; - result.field19_ = 2; - return this; - } - - public bool HasField20 { - get { return result.hasField20; } - } - public bool Field20 { - get { return result.Field20; } - set { SetField20(value); } - } - public Builder SetField20(bool value) { - PrepareBuilder(); - result.hasField20 = true; - result.field20_ = value; - return this; - } - public Builder ClearField20() { - PrepareBuilder(); - result.hasField20 = false; - result.field20_ = true; - return this; - } - - public bool HasField28 { - get { return result.hasField28; } - } - public bool Field28 { - get { return result.Field28; } - set { SetField28(value); } - } - public Builder SetField28(bool value) { - PrepareBuilder(); - result.hasField28 = true; - result.field28_ = value; - return this; - } - public Builder ClearField28() { - PrepareBuilder(); - result.hasField28 = false; - result.field28_ = true; - return this; - } - - public bool HasField21 { - get { return result.hasField21; } - } - [global::System.CLSCompliant(false)] - public ulong Field21 { - get { return result.Field21; } - set { SetField21(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetField21(ulong value) { - PrepareBuilder(); - result.hasField21 = true; - result.field21_ = value; - return this; - } - public Builder ClearField21() { - PrepareBuilder(); - result.hasField21 = false; - result.field21_ = 0; - return this; - } - - public bool HasField22 { - get { return result.hasField22; } - } - public int Field22 { - get { return result.Field22; } - set { SetField22(value); } - } - public Builder SetField22(int value) { - PrepareBuilder(); - result.hasField22 = true; - result.field22_ = value; - return this; - } - public Builder ClearField22() { - PrepareBuilder(); - result.hasField22 = false; - result.field22_ = 0; - return this; - } - - public bool HasField23 { - get { return result.hasField23; } - } - public bool Field23 { - get { return result.Field23; } - set { SetField23(value); } - } - public Builder SetField23(bool value) { - PrepareBuilder(); - result.hasField23 = true; - result.field23_ = value; - return this; - } - public Builder ClearField23() { - PrepareBuilder(); - result.hasField23 = false; - result.field23_ = false; - return this; - } - - public bool HasField206 { - get { return result.hasField206; } - } - public bool Field206 { - get { return result.Field206; } - set { SetField206(value); } - } - public Builder SetField206(bool value) { - PrepareBuilder(); - result.hasField206 = true; - result.field206_ = value; - return this; - } - public Builder ClearField206() { - PrepareBuilder(); - result.hasField206 = false; - result.field206_ = false; - return this; - } - - public bool HasField203 { - get { return result.hasField203; } - } - [global::System.CLSCompliant(false)] - public uint Field203 { - get { return result.Field203; } - set { SetField203(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetField203(uint value) { - PrepareBuilder(); - result.hasField203 = true; - result.field203_ = value; - return this; - } - public Builder ClearField203() { - PrepareBuilder(); - result.hasField203 = false; - result.field203_ = 0; - return this; - } - - public bool HasField204 { - get { return result.hasField204; } - } - public int Field204 { - get { return result.Field204; } - set { SetField204(value); } - } - public Builder SetField204(int value) { - PrepareBuilder(); - result.hasField204 = true; - result.field204_ = value; - return this; - } - public Builder ClearField204() { - PrepareBuilder(); - result.hasField204 = false; - result.field204_ = 0; - return this; - } - - public bool HasField205 { - get { return result.hasField205; } - } - public string Field205 { - get { return result.Field205; } - set { SetField205(value); } - } - public Builder SetField205(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField205 = true; - result.field205_ = value; - return this; - } - public Builder ClearField205() { - PrepareBuilder(); - result.hasField205 = false; - result.field205_ = ""; - return this; - } - - public bool HasField207 { - get { return result.hasField207; } - } - [global::System.CLSCompliant(false)] - public ulong Field207 { - get { return result.Field207; } - set { SetField207(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetField207(ulong value) { - PrepareBuilder(); - result.hasField207 = true; - result.field207_ = value; - return this; - } - public Builder ClearField207() { - PrepareBuilder(); - result.hasField207 = false; - result.field207_ = 0UL; - return this; - } - - public bool HasField300 { - get { return result.hasField300; } - } - [global::System.CLSCompliant(false)] - public ulong Field300 { - get { return result.Field300; } - set { SetField300(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetField300(ulong value) { - PrepareBuilder(); - result.hasField300 = true; - result.field300_ = value; - return this; - } - public Builder ClearField300() { - PrepareBuilder(); - result.hasField300 = false; - result.field300_ = 0UL; - return this; - } - } - static SizeMessage1SubMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.ProtoBench.GoogleSizeProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class SizeMessage2 : pb::GeneratedMessage { - private SizeMessage2() { } - private static readonly SizeMessage2 defaultInstance = new SizeMessage2().MakeReadOnly(); - public static SizeMessage2 DefaultInstance { - get { return defaultInstance; } - } - - public override SizeMessage2 DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override SizeMessage2 ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.ProtoBench.GoogleSizeProtoFile.internal__static_benchmarks_SizeMessage2__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.ProtoBench.GoogleSizeProtoFile.internal__static_benchmarks_SizeMessage2__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Group1 : pb::GeneratedMessage { - private Group1() { } - private static readonly Group1 defaultInstance = new Group1().MakeReadOnly(); - public static Group1 DefaultInstance { - get { return defaultInstance; } - } - - public override Group1 DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override Group1 ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.ProtoBench.GoogleSizeProtoFile.internal__static_benchmarks_SizeMessage2_Group1__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.ProtoBench.GoogleSizeProtoFile.internal__static_benchmarks_SizeMessage2_Group1__FieldAccessorTable; } - } - - public const int Field11FieldNumber = 11; - private bool hasField11; - private float field11_; - public bool HasField11 { - get { return hasField11; } - } - public float Field11 { - get { return field11_; } - } - - public const int Field26FieldNumber = 26; - private bool hasField26; - private float field26_; - public bool HasField26 { - get { return hasField26; } - } - public float Field26 { - get { return field26_; } - } - - public const int Field12FieldNumber = 12; - private bool hasField12; - private string field12_ = ""; - public bool HasField12 { - get { return hasField12; } - } - public string Field12 { - get { return field12_; } - } - - public const int Field13FieldNumber = 13; - private bool hasField13; - private string field13_ = ""; - public bool HasField13 { - get { return hasField13; } - } - public string Field13 { - get { return field13_; } - } - - public const int Field14FieldNumber = 14; - private pbc::PopsicleList field14_ = new pbc::PopsicleList(); - public scg::IList Field14List { - get { return pbc::Lists.AsReadOnly(field14_); } - } - public int Field14Count { - get { return field14_.Count; } - } - public string GetField14(int index) { - return field14_[index]; - } - - public const int Field15FieldNumber = 15; - private bool hasField15; - private ulong field15_; - public bool HasField15 { - get { return hasField15; } - } - [global::System.CLSCompliant(false)] - public ulong Field15 { - get { return field15_; } - } - - public const int Field5FieldNumber = 5; - private bool hasField5; - private int field5_; - public bool HasField5 { - get { return hasField5; } - } - public int Field5 { - get { return field5_; } - } - - public const int Field27FieldNumber = 27; - private bool hasField27; - private string field27_ = ""; - public bool HasField27 { - get { return hasField27; } - } - public string Field27 { - get { return field27_; } - } - - public const int Field28FieldNumber = 28; - private bool hasField28; - private int field28_; - public bool HasField28 { - get { return hasField28; } - } - public int Field28 { - get { return field28_; } - } - - public const int Field29FieldNumber = 29; - private bool hasField29; - private string field29_ = ""; - public bool HasField29 { - get { return hasField29; } - } - public string Field29 { - get { return field29_; } - } - - public const int Field16FieldNumber = 16; - private bool hasField16; - private string field16_ = ""; - public bool HasField16 { - get { return hasField16; } - } - public string Field16 { - get { return field16_; } - } - - public const int Field22FieldNumber = 22; - private pbc::PopsicleList field22_ = new pbc::PopsicleList(); - public scg::IList Field22List { - get { return pbc::Lists.AsReadOnly(field22_); } - } - public int Field22Count { - get { return field22_.Count; } - } - public string GetField22(int index) { - return field22_[index]; - } - - public const int Field73FieldNumber = 73; - private pbc::PopsicleList field73_ = new pbc::PopsicleList(); - public scg::IList Field73List { - get { return pbc::Lists.AsReadOnly(field73_); } - } - public int Field73Count { - get { return field73_.Count; } - } - public int GetField73(int index) { - return field73_[index]; - } - - public const int Field20FieldNumber = 20; - private bool hasField20; - private int field20_; - public bool HasField20 { - get { return hasField20; } - } - public int Field20 { - get { return field20_; } - } - - public const int Field24FieldNumber = 24; - private bool hasField24; - private string field24_ = ""; - public bool HasField24 { - get { return hasField24; } - } - public string Field24 { - get { return field24_; } - } - - public const int Field31FieldNumber = 31; - private bool hasField31; - private global::Google.ProtocolBuffers.ProtoBench.SizeMessage2GroupedMessage field31_; - public bool HasField31 { - get { return hasField31; } - } - public global::Google.ProtocolBuffers.ProtoBench.SizeMessage2GroupedMessage Field31 { - get { return field31_ ?? global::Google.ProtocolBuffers.ProtoBench.SizeMessage2GroupedMessage.DefaultInstance; } - } - - public static Group1 ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Group1 ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Group1 ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Group1 ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Group1 ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Group1 ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Group1 ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Group1 ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Group1 ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Group1 ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private Group1 MakeReadOnly() { - field14_.MakeReadOnly(); - field22_.MakeReadOnly(); - field73_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Group1 prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(Group1 cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private Group1 result; - - private Group1 PrepareBuilder() { - if (resultIsReadOnly) { - Group1 original = result; - result = new Group1(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override Group1 MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.ProtoBench.SizeMessage2.Types.Group1.Descriptor; } - } - - public override Group1 DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.ProtoBench.SizeMessage2.Types.Group1.DefaultInstance; } - } - - public override Group1 BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - - public bool HasField11 { - get { return result.hasField11; } - } - public float Field11 { - get { return result.Field11; } - set { SetField11(value); } - } - public Builder SetField11(float value) { - PrepareBuilder(); - result.hasField11 = true; - result.field11_ = value; - return this; - } - public Builder ClearField11() { - PrepareBuilder(); - result.hasField11 = false; - result.field11_ = 0F; - return this; - } - - public bool HasField26 { - get { return result.hasField26; } - } - public float Field26 { - get { return result.Field26; } - set { SetField26(value); } - } - public Builder SetField26(float value) { - PrepareBuilder(); - result.hasField26 = true; - result.field26_ = value; - return this; - } - public Builder ClearField26() { - PrepareBuilder(); - result.hasField26 = false; - result.field26_ = 0F; - return this; - } - - public bool HasField12 { - get { return result.hasField12; } - } - public string Field12 { - get { return result.Field12; } - set { SetField12(value); } - } - public Builder SetField12(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField12 = true; - result.field12_ = value; - return this; - } - public Builder ClearField12() { - PrepareBuilder(); - result.hasField12 = false; - result.field12_ = ""; - return this; - } - - public bool HasField13 { - get { return result.hasField13; } - } - public string Field13 { - get { return result.Field13; } - set { SetField13(value); } - } - public Builder SetField13(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField13 = true; - result.field13_ = value; - return this; - } - public Builder ClearField13() { - PrepareBuilder(); - result.hasField13 = false; - result.field13_ = ""; - return this; - } - - public pbc::IPopsicleList Field14List { - get { return PrepareBuilder().field14_; } - } - public int Field14Count { - get { return result.Field14Count; } - } - public string GetField14(int index) { - return result.GetField14(index); - } - public Builder SetField14(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.field14_[index] = value; - return this; - } - public Builder AddField14(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.field14_.Add(value); - return this; - } - public Builder AddRangeField14(scg::IEnumerable values) { - PrepareBuilder(); - result.field14_.Add(values); - return this; - } - public Builder ClearField14() { - PrepareBuilder(); - result.field14_.Clear(); - return this; - } - - public bool HasField15 { - get { return result.hasField15; } - } - [global::System.CLSCompliant(false)] - public ulong Field15 { - get { return result.Field15; } - set { SetField15(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetField15(ulong value) { - PrepareBuilder(); - result.hasField15 = true; - result.field15_ = value; - return this; - } - public Builder ClearField15() { - PrepareBuilder(); - result.hasField15 = false; - result.field15_ = 0UL; - return this; - } - - public bool HasField5 { - get { return result.hasField5; } - } - public int Field5 { - get { return result.Field5; } - set { SetField5(value); } - } - public Builder SetField5(int value) { - PrepareBuilder(); - result.hasField5 = true; - result.field5_ = value; - return this; - } - public Builder ClearField5() { - PrepareBuilder(); - result.hasField5 = false; - result.field5_ = 0; - return this; - } - - public bool HasField27 { - get { return result.hasField27; } - } - public string Field27 { - get { return result.Field27; } - set { SetField27(value); } - } - public Builder SetField27(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField27 = true; - result.field27_ = value; - return this; - } - public Builder ClearField27() { - PrepareBuilder(); - result.hasField27 = false; - result.field27_ = ""; - return this; - } - - public bool HasField28 { - get { return result.hasField28; } - } - public int Field28 { - get { return result.Field28; } - set { SetField28(value); } - } - public Builder SetField28(int value) { - PrepareBuilder(); - result.hasField28 = true; - result.field28_ = value; - return this; - } - public Builder ClearField28() { - PrepareBuilder(); - result.hasField28 = false; - result.field28_ = 0; - return this; - } - - public bool HasField29 { - get { return result.hasField29; } - } - public string Field29 { - get { return result.Field29; } - set { SetField29(value); } - } - public Builder SetField29(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField29 = true; - result.field29_ = value; - return this; - } - public Builder ClearField29() { - PrepareBuilder(); - result.hasField29 = false; - result.field29_ = ""; - return this; - } - - public bool HasField16 { - get { return result.hasField16; } - } - public string Field16 { - get { return result.Field16; } - set { SetField16(value); } - } - public Builder SetField16(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField16 = true; - result.field16_ = value; - return this; - } - public Builder ClearField16() { - PrepareBuilder(); - result.hasField16 = false; - result.field16_ = ""; - return this; - } - - public pbc::IPopsicleList Field22List { - get { return PrepareBuilder().field22_; } - } - public int Field22Count { - get { return result.Field22Count; } - } - public string GetField22(int index) { - return result.GetField22(index); - } - public Builder SetField22(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.field22_[index] = value; - return this; - } - public Builder AddField22(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.field22_.Add(value); - return this; - } - public Builder AddRangeField22(scg::IEnumerable values) { - PrepareBuilder(); - result.field22_.Add(values); - return this; - } - public Builder ClearField22() { - PrepareBuilder(); - result.field22_.Clear(); - return this; - } - - public pbc::IPopsicleList Field73List { - get { return PrepareBuilder().field73_; } - } - public int Field73Count { - get { return result.Field73Count; } - } - public int GetField73(int index) { - return result.GetField73(index); - } - public Builder SetField73(int index, int value) { - PrepareBuilder(); - result.field73_[index] = value; - return this; - } - public Builder AddField73(int value) { - PrepareBuilder(); - result.field73_.Add(value); - return this; - } - public Builder AddRangeField73(scg::IEnumerable values) { - PrepareBuilder(); - result.field73_.Add(values); - return this; - } - public Builder ClearField73() { - PrepareBuilder(); - result.field73_.Clear(); - return this; - } - - public bool HasField20 { - get { return result.hasField20; } - } - public int Field20 { - get { return result.Field20; } - set { SetField20(value); } - } - public Builder SetField20(int value) { - PrepareBuilder(); - result.hasField20 = true; - result.field20_ = value; - return this; - } - public Builder ClearField20() { - PrepareBuilder(); - result.hasField20 = false; - result.field20_ = 0; - return this; - } - - public bool HasField24 { - get { return result.hasField24; } - } - public string Field24 { - get { return result.Field24; } - set { SetField24(value); } - } - public Builder SetField24(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField24 = true; - result.field24_ = value; - return this; - } - public Builder ClearField24() { - PrepareBuilder(); - result.hasField24 = false; - result.field24_ = ""; - return this; - } - - public bool HasField31 { - get { return result.hasField31; } - } - public global::Google.ProtocolBuffers.ProtoBench.SizeMessage2GroupedMessage Field31 { - get { return result.Field31; } - set { SetField31(value); } - } - public Builder SetField31(global::Google.ProtocolBuffers.ProtoBench.SizeMessage2GroupedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField31 = true; - result.field31_ = value; - return this; - } - public Builder SetField31(global::Google.ProtocolBuffers.ProtoBench.SizeMessage2GroupedMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasField31 = true; - result.field31_ = builderForValue.Build(); - return this; - } - public Builder MergeField31(global::Google.ProtocolBuffers.ProtoBench.SizeMessage2GroupedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasField31 && - result.field31_ != global::Google.ProtocolBuffers.ProtoBench.SizeMessage2GroupedMessage.DefaultInstance) { - result.field31_ = global::Google.ProtocolBuffers.ProtoBench.SizeMessage2GroupedMessage.CreateBuilder(result.field31_).MergeFrom(value).BuildPartial(); - } else { - result.field31_ = value; - } - result.hasField31 = true; - return this; - } - public Builder ClearField31() { - PrepareBuilder(); - result.hasField31 = false; - result.field31_ = null; - return this; - } - } - static Group1() { - object.ReferenceEquals(global::Google.ProtocolBuffers.ProtoBench.GoogleSizeProtoFile.Descriptor, null); - } - } - - } - #endregion - - public const int Field1FieldNumber = 1; - private bool hasField1; - private string field1_ = ""; - public bool HasField1 { - get { return hasField1; } - } - public string Field1 { - get { return field1_; } - } - - public const int Field3FieldNumber = 3; - private bool hasField3; - private long field3_; - public bool HasField3 { - get { return hasField3; } - } - public long Field3 { - get { return field3_; } - } - - public const int Field4FieldNumber = 4; - private bool hasField4; - private long field4_; - public bool HasField4 { - get { return hasField4; } - } - public long Field4 { - get { return field4_; } - } - - public const int Field30FieldNumber = 30; - private bool hasField30; - private long field30_; - public bool HasField30 { - get { return hasField30; } - } - public long Field30 { - get { return field30_; } - } - - public const int Field75FieldNumber = 75; - private bool hasField75; - private bool field75_; - public bool HasField75 { - get { return hasField75; } - } - public bool Field75 { - get { return field75_; } - } - - public const int Field6FieldNumber = 6; - private bool hasField6; - private string field6_ = ""; - public bool HasField6 { - get { return hasField6; } - } - public string Field6 { - get { return field6_; } - } - - public const int Field2FieldNumber = 2; - private bool hasField2; - private pb::ByteString field2_ = pb::ByteString.Empty; - public bool HasField2 { - get { return hasField2; } - } - public pb::ByteString Field2 { - get { return field2_; } - } - - public const int Field21FieldNumber = 21; - private bool hasField21; - private int field21_; - public bool HasField21 { - get { return hasField21; } - } - public int Field21 { - get { return field21_; } - } - - public const int Field71FieldNumber = 71; - private bool hasField71; - private int field71_; - public bool HasField71 { - get { return hasField71; } - } - public int Field71 { - get { return field71_; } - } - - public const int Field25FieldNumber = 25; - private bool hasField25; - private float field25_; - public bool HasField25 { - get { return hasField25; } - } - public float Field25 { - get { return field25_; } - } - - public const int Field109FieldNumber = 109; - private bool hasField109; - private int field109_; - public bool HasField109 { - get { return hasField109; } - } - public int Field109 { - get { return field109_; } - } - - public const int Field210FieldNumber = 210; - private bool hasField210; - private int field210_; - public bool HasField210 { - get { return hasField210; } - } - public int Field210 { - get { return field210_; } - } - - public const int Field211FieldNumber = 211; - private bool hasField211; - private int field211_; - public bool HasField211 { - get { return hasField211; } - } - public int Field211 { - get { return field211_; } - } - - public const int Field212FieldNumber = 212; - private bool hasField212; - private int field212_; - public bool HasField212 { - get { return hasField212; } - } - public int Field212 { - get { return field212_; } - } - - public const int Field213FieldNumber = 213; - private bool hasField213; - private int field213_; - public bool HasField213 { - get { return hasField213; } - } - public int Field213 { - get { return field213_; } - } - - public const int Field216FieldNumber = 216; - private bool hasField216; - private int field216_; - public bool HasField216 { - get { return hasField216; } - } - public int Field216 { - get { return field216_; } - } - - public const int Field217FieldNumber = 217; - private bool hasField217; - private int field217_; - public bool HasField217 { - get { return hasField217; } - } - public int Field217 { - get { return field217_; } - } - - public const int Field218FieldNumber = 218; - private bool hasField218; - private int field218_; - public bool HasField218 { - get { return hasField218; } - } - public int Field218 { - get { return field218_; } - } - - public const int Field220FieldNumber = 220; - private bool hasField220; - private int field220_; - public bool HasField220 { - get { return hasField220; } - } - public int Field220 { - get { return field220_; } - } - - public const int Field221FieldNumber = 221; - private bool hasField221; - private int field221_; - public bool HasField221 { - get { return hasField221; } - } - public int Field221 { - get { return field221_; } - } - - public const int Field222FieldNumber = 222; - private bool hasField222; - private float field222_; - public bool HasField222 { - get { return hasField222; } - } - public float Field222 { - get { return field222_; } - } - - public const int Field63FieldNumber = 63; - private bool hasField63; - private int field63_; - public bool HasField63 { - get { return hasField63; } - } - public int Field63 { - get { return field63_; } - } - - public const int Group1FieldNumber = 10; - private pbc::PopsicleList group1_ = new pbc::PopsicleList(); - public scg::IList Group1List { - get { return group1_; } - } - public int Group1Count { - get { return group1_.Count; } - } - public global::Google.ProtocolBuffers.ProtoBench.SizeMessage2.Types.Group1 GetGroup1(int index) { - return group1_[index]; - } - - public const int Field128FieldNumber = 128; - private pbc::PopsicleList field128_ = new pbc::PopsicleList(); - public scg::IList Field128List { - get { return pbc::Lists.AsReadOnly(field128_); } - } - public int Field128Count { - get { return field128_.Count; } - } - public string GetField128(int index) { - return field128_[index]; - } - - public const int Field131FieldNumber = 131; - private bool hasField131; - private long field131_; - public bool HasField131 { - get { return hasField131; } - } - public long Field131 { - get { return field131_; } - } - - public const int Field127FieldNumber = 127; - private pbc::PopsicleList field127_ = new pbc::PopsicleList(); - public scg::IList Field127List { - get { return pbc::Lists.AsReadOnly(field127_); } - } - public int Field127Count { - get { return field127_.Count; } - } - public string GetField127(int index) { - return field127_[index]; - } - - public const int Field129FieldNumber = 129; - private bool hasField129; - private int field129_; - public bool HasField129 { - get { return hasField129; } - } - public int Field129 { - get { return field129_; } - } - - public const int Field130FieldNumber = 130; - private pbc::PopsicleList field130_ = new pbc::PopsicleList(); - public scg::IList Field130List { - get { return pbc::Lists.AsReadOnly(field130_); } - } - public int Field130Count { - get { return field130_.Count; } - } - public long GetField130(int index) { - return field130_[index]; - } - - public const int Field205FieldNumber = 205; - private bool hasField205; - private bool field205_; - public bool HasField205 { - get { return hasField205; } - } - public bool Field205 { - get { return field205_; } - } - - public const int Field206FieldNumber = 206; - private bool hasField206; - private bool field206_; - public bool HasField206 { - get { return hasField206; } - } - public bool Field206 { - get { return field206_; } - } - - public static SizeMessage2 ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SizeMessage2 ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SizeMessage2 ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SizeMessage2 ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SizeMessage2 ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SizeMessage2 ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SizeMessage2 ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SizeMessage2 ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SizeMessage2 ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SizeMessage2 ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private SizeMessage2 MakeReadOnly() { - group1_.MakeReadOnly(); - field128_.MakeReadOnly(); - field127_.MakeReadOnly(); - field130_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SizeMessage2 prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(SizeMessage2 cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private SizeMessage2 result; - - private SizeMessage2 PrepareBuilder() { - if (resultIsReadOnly) { - SizeMessage2 original = result; - result = new SizeMessage2(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override SizeMessage2 MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.ProtoBench.SizeMessage2.Descriptor; } - } - - public override SizeMessage2 DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.ProtoBench.SizeMessage2.DefaultInstance; } - } - - public override SizeMessage2 BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - - public bool HasField1 { - get { return result.hasField1; } - } - public string Field1 { - get { return result.Field1; } - set { SetField1(value); } - } - public Builder SetField1(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField1 = true; - result.field1_ = value; - return this; - } - public Builder ClearField1() { - PrepareBuilder(); - result.hasField1 = false; - result.field1_ = ""; - return this; - } - - public bool HasField3 { - get { return result.hasField3; } - } - public long Field3 { - get { return result.Field3; } - set { SetField3(value); } - } - public Builder SetField3(long value) { - PrepareBuilder(); - result.hasField3 = true; - result.field3_ = value; - return this; - } - public Builder ClearField3() { - PrepareBuilder(); - result.hasField3 = false; - result.field3_ = 0L; - return this; - } - - public bool HasField4 { - get { return result.hasField4; } - } - public long Field4 { - get { return result.Field4; } - set { SetField4(value); } - } - public Builder SetField4(long value) { - PrepareBuilder(); - result.hasField4 = true; - result.field4_ = value; - return this; - } - public Builder ClearField4() { - PrepareBuilder(); - result.hasField4 = false; - result.field4_ = 0L; - return this; - } - - public bool HasField30 { - get { return result.hasField30; } - } - public long Field30 { - get { return result.Field30; } - set { SetField30(value); } - } - public Builder SetField30(long value) { - PrepareBuilder(); - result.hasField30 = true; - result.field30_ = value; - return this; - } - public Builder ClearField30() { - PrepareBuilder(); - result.hasField30 = false; - result.field30_ = 0L; - return this; - } - - public bool HasField75 { - get { return result.hasField75; } - } - public bool Field75 { - get { return result.Field75; } - set { SetField75(value); } - } - public Builder SetField75(bool value) { - PrepareBuilder(); - result.hasField75 = true; - result.field75_ = value; - return this; - } - public Builder ClearField75() { - PrepareBuilder(); - result.hasField75 = false; - result.field75_ = false; - return this; - } - - public bool HasField6 { - get { return result.hasField6; } - } - public string Field6 { - get { return result.Field6; } - set { SetField6(value); } - } - public Builder SetField6(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField6 = true; - result.field6_ = value; - return this; - } - public Builder ClearField6() { - PrepareBuilder(); - result.hasField6 = false; - result.field6_ = ""; - return this; - } - - public bool HasField2 { - get { return result.hasField2; } - } - public pb::ByteString Field2 { - get { return result.Field2; } - set { SetField2(value); } - } - public Builder SetField2(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField2 = true; - result.field2_ = value; - return this; - } - public Builder ClearField2() { - PrepareBuilder(); - result.hasField2 = false; - result.field2_ = pb::ByteString.Empty; - return this; - } - - public bool HasField21 { - get { return result.hasField21; } - } - public int Field21 { - get { return result.Field21; } - set { SetField21(value); } - } - public Builder SetField21(int value) { - PrepareBuilder(); - result.hasField21 = true; - result.field21_ = value; - return this; - } - public Builder ClearField21() { - PrepareBuilder(); - result.hasField21 = false; - result.field21_ = 0; - return this; - } - - public bool HasField71 { - get { return result.hasField71; } - } - public int Field71 { - get { return result.Field71; } - set { SetField71(value); } - } - public Builder SetField71(int value) { - PrepareBuilder(); - result.hasField71 = true; - result.field71_ = value; - return this; - } - public Builder ClearField71() { - PrepareBuilder(); - result.hasField71 = false; - result.field71_ = 0; - return this; - } - - public bool HasField25 { - get { return result.hasField25; } - } - public float Field25 { - get { return result.Field25; } - set { SetField25(value); } - } - public Builder SetField25(float value) { - PrepareBuilder(); - result.hasField25 = true; - result.field25_ = value; - return this; - } - public Builder ClearField25() { - PrepareBuilder(); - result.hasField25 = false; - result.field25_ = 0F; - return this; - } - - public bool HasField109 { - get { return result.hasField109; } - } - public int Field109 { - get { return result.Field109; } - set { SetField109(value); } - } - public Builder SetField109(int value) { - PrepareBuilder(); - result.hasField109 = true; - result.field109_ = value; - return this; - } - public Builder ClearField109() { - PrepareBuilder(); - result.hasField109 = false; - result.field109_ = 0; - return this; - } - - public bool HasField210 { - get { return result.hasField210; } - } - public int Field210 { - get { return result.Field210; } - set { SetField210(value); } - } - public Builder SetField210(int value) { - PrepareBuilder(); - result.hasField210 = true; - result.field210_ = value; - return this; - } - public Builder ClearField210() { - PrepareBuilder(); - result.hasField210 = false; - result.field210_ = 0; - return this; - } - - public bool HasField211 { - get { return result.hasField211; } - } - public int Field211 { - get { return result.Field211; } - set { SetField211(value); } - } - public Builder SetField211(int value) { - PrepareBuilder(); - result.hasField211 = true; - result.field211_ = value; - return this; - } - public Builder ClearField211() { - PrepareBuilder(); - result.hasField211 = false; - result.field211_ = 0; - return this; - } - - public bool HasField212 { - get { return result.hasField212; } - } - public int Field212 { - get { return result.Field212; } - set { SetField212(value); } - } - public Builder SetField212(int value) { - PrepareBuilder(); - result.hasField212 = true; - result.field212_ = value; - return this; - } - public Builder ClearField212() { - PrepareBuilder(); - result.hasField212 = false; - result.field212_ = 0; - return this; - } - - public bool HasField213 { - get { return result.hasField213; } - } - public int Field213 { - get { return result.Field213; } - set { SetField213(value); } - } - public Builder SetField213(int value) { - PrepareBuilder(); - result.hasField213 = true; - result.field213_ = value; - return this; - } - public Builder ClearField213() { - PrepareBuilder(); - result.hasField213 = false; - result.field213_ = 0; - return this; - } - - public bool HasField216 { - get { return result.hasField216; } - } - public int Field216 { - get { return result.Field216; } - set { SetField216(value); } - } - public Builder SetField216(int value) { - PrepareBuilder(); - result.hasField216 = true; - result.field216_ = value; - return this; - } - public Builder ClearField216() { - PrepareBuilder(); - result.hasField216 = false; - result.field216_ = 0; - return this; - } - - public bool HasField217 { - get { return result.hasField217; } - } - public int Field217 { - get { return result.Field217; } - set { SetField217(value); } - } - public Builder SetField217(int value) { - PrepareBuilder(); - result.hasField217 = true; - result.field217_ = value; - return this; - } - public Builder ClearField217() { - PrepareBuilder(); - result.hasField217 = false; - result.field217_ = 0; - return this; - } - - public bool HasField218 { - get { return result.hasField218; } - } - public int Field218 { - get { return result.Field218; } - set { SetField218(value); } - } - public Builder SetField218(int value) { - PrepareBuilder(); - result.hasField218 = true; - result.field218_ = value; - return this; - } - public Builder ClearField218() { - PrepareBuilder(); - result.hasField218 = false; - result.field218_ = 0; - return this; - } - - public bool HasField220 { - get { return result.hasField220; } - } - public int Field220 { - get { return result.Field220; } - set { SetField220(value); } - } - public Builder SetField220(int value) { - PrepareBuilder(); - result.hasField220 = true; - result.field220_ = value; - return this; - } - public Builder ClearField220() { - PrepareBuilder(); - result.hasField220 = false; - result.field220_ = 0; - return this; - } - - public bool HasField221 { - get { return result.hasField221; } - } - public int Field221 { - get { return result.Field221; } - set { SetField221(value); } - } - public Builder SetField221(int value) { - PrepareBuilder(); - result.hasField221 = true; - result.field221_ = value; - return this; - } - public Builder ClearField221() { - PrepareBuilder(); - result.hasField221 = false; - result.field221_ = 0; - return this; - } - - public bool HasField222 { - get { return result.hasField222; } - } - public float Field222 { - get { return result.Field222; } - set { SetField222(value); } - } - public Builder SetField222(float value) { - PrepareBuilder(); - result.hasField222 = true; - result.field222_ = value; - return this; - } - public Builder ClearField222() { - PrepareBuilder(); - result.hasField222 = false; - result.field222_ = 0F; - return this; - } - - public bool HasField63 { - get { return result.hasField63; } - } - public int Field63 { - get { return result.Field63; } - set { SetField63(value); } - } - public Builder SetField63(int value) { - PrepareBuilder(); - result.hasField63 = true; - result.field63_ = value; - return this; - } - public Builder ClearField63() { - PrepareBuilder(); - result.hasField63 = false; - result.field63_ = 0; - return this; - } - - public pbc::IPopsicleList Group1List { - get { return PrepareBuilder().group1_; } - } - public int Group1Count { - get { return result.Group1Count; } - } - public global::Google.ProtocolBuffers.ProtoBench.SizeMessage2.Types.Group1 GetGroup1(int index) { - return result.GetGroup1(index); - } - public Builder SetGroup1(int index, global::Google.ProtocolBuffers.ProtoBench.SizeMessage2.Types.Group1 value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.group1_[index] = value; - return this; - } - public Builder SetGroup1(int index, global::Google.ProtocolBuffers.ProtoBench.SizeMessage2.Types.Group1.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.group1_[index] = builderForValue.Build(); - return this; - } - public Builder AddGroup1(global::Google.ProtocolBuffers.ProtoBench.SizeMessage2.Types.Group1 value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.group1_.Add(value); - return this; - } - public Builder AddGroup1(global::Google.ProtocolBuffers.ProtoBench.SizeMessage2.Types.Group1.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.group1_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeGroup1(scg::IEnumerable values) { - PrepareBuilder(); - result.group1_.Add(values); - return this; - } - public Builder ClearGroup1() { - PrepareBuilder(); - result.group1_.Clear(); - return this; - } - - public pbc::IPopsicleList Field128List { - get { return PrepareBuilder().field128_; } - } - public int Field128Count { - get { return result.Field128Count; } - } - public string GetField128(int index) { - return result.GetField128(index); - } - public Builder SetField128(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.field128_[index] = value; - return this; - } - public Builder AddField128(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.field128_.Add(value); - return this; - } - public Builder AddRangeField128(scg::IEnumerable values) { - PrepareBuilder(); - result.field128_.Add(values); - return this; - } - public Builder ClearField128() { - PrepareBuilder(); - result.field128_.Clear(); - return this; - } - - public bool HasField131 { - get { return result.hasField131; } - } - public long Field131 { - get { return result.Field131; } - set { SetField131(value); } - } - public Builder SetField131(long value) { - PrepareBuilder(); - result.hasField131 = true; - result.field131_ = value; - return this; - } - public Builder ClearField131() { - PrepareBuilder(); - result.hasField131 = false; - result.field131_ = 0L; - return this; - } - - public pbc::IPopsicleList Field127List { - get { return PrepareBuilder().field127_; } - } - public int Field127Count { - get { return result.Field127Count; } - } - public string GetField127(int index) { - return result.GetField127(index); - } - public Builder SetField127(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.field127_[index] = value; - return this; - } - public Builder AddField127(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.field127_.Add(value); - return this; - } - public Builder AddRangeField127(scg::IEnumerable values) { - PrepareBuilder(); - result.field127_.Add(values); - return this; - } - public Builder ClearField127() { - PrepareBuilder(); - result.field127_.Clear(); - return this; - } - - public bool HasField129 { - get { return result.hasField129; } - } - public int Field129 { - get { return result.Field129; } - set { SetField129(value); } - } - public Builder SetField129(int value) { - PrepareBuilder(); - result.hasField129 = true; - result.field129_ = value; - return this; - } - public Builder ClearField129() { - PrepareBuilder(); - result.hasField129 = false; - result.field129_ = 0; - return this; - } - - public pbc::IPopsicleList Field130List { - get { return PrepareBuilder().field130_; } - } - public int Field130Count { - get { return result.Field130Count; } - } - public long GetField130(int index) { - return result.GetField130(index); - } - public Builder SetField130(int index, long value) { - PrepareBuilder(); - result.field130_[index] = value; - return this; - } - public Builder AddField130(long value) { - PrepareBuilder(); - result.field130_.Add(value); - return this; - } - public Builder AddRangeField130(scg::IEnumerable values) { - PrepareBuilder(); - result.field130_.Add(values); - return this; - } - public Builder ClearField130() { - PrepareBuilder(); - result.field130_.Clear(); - return this; - } - - public bool HasField205 { - get { return result.hasField205; } - } - public bool Field205 { - get { return result.Field205; } - set { SetField205(value); } - } - public Builder SetField205(bool value) { - PrepareBuilder(); - result.hasField205 = true; - result.field205_ = value; - return this; - } - public Builder ClearField205() { - PrepareBuilder(); - result.hasField205 = false; - result.field205_ = false; - return this; - } - - public bool HasField206 { - get { return result.hasField206; } - } - public bool Field206 { - get { return result.Field206; } - set { SetField206(value); } - } - public Builder SetField206(bool value) { - PrepareBuilder(); - result.hasField206 = true; - result.field206_ = value; - return this; - } - public Builder ClearField206() { - PrepareBuilder(); - result.hasField206 = false; - result.field206_ = false; - return this; - } - } - static SizeMessage2() { - object.ReferenceEquals(global::Google.ProtocolBuffers.ProtoBench.GoogleSizeProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class SizeMessage2GroupedMessage : pb::GeneratedMessage { - private SizeMessage2GroupedMessage() { } - private static readonly SizeMessage2GroupedMessage defaultInstance = new SizeMessage2GroupedMessage().MakeReadOnly(); - public static SizeMessage2GroupedMessage DefaultInstance { - get { return defaultInstance; } - } - - public override SizeMessage2GroupedMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override SizeMessage2GroupedMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.ProtoBench.GoogleSizeProtoFile.internal__static_benchmarks_SizeMessage2GroupedMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.ProtoBench.GoogleSizeProtoFile.internal__static_benchmarks_SizeMessage2GroupedMessage__FieldAccessorTable; } - } - - public const int Field1FieldNumber = 1; - private bool hasField1; - private float field1_; - public bool HasField1 { - get { return hasField1; } - } - public float Field1 { - get { return field1_; } - } - - public const int Field2FieldNumber = 2; - private bool hasField2; - private float field2_; - public bool HasField2 { - get { return hasField2; } - } - public float Field2 { - get { return field2_; } - } - - public const int Field3FieldNumber = 3; - private bool hasField3; - private float field3_; - public bool HasField3 { - get { return hasField3; } - } - public float Field3 { - get { return field3_; } - } - - public const int Field4FieldNumber = 4; - private bool hasField4; - private bool field4_; - public bool HasField4 { - get { return hasField4; } - } - public bool Field4 { - get { return field4_; } - } - - public const int Field5FieldNumber = 5; - private bool hasField5; - private bool field5_; - public bool HasField5 { - get { return hasField5; } - } - public bool Field5 { - get { return field5_; } - } - - public const int Field6FieldNumber = 6; - private bool hasField6; - private bool field6_ = true; - public bool HasField6 { - get { return hasField6; } - } - public bool Field6 { - get { return field6_; } - } - - public const int Field7FieldNumber = 7; - private bool hasField7; - private bool field7_; - public bool HasField7 { - get { return hasField7; } - } - public bool Field7 { - get { return field7_; } - } - - public const int Field8FieldNumber = 8; - private bool hasField8; - private float field8_; - public bool HasField8 { - get { return hasField8; } - } - public float Field8 { - get { return field8_; } - } - - public const int Field9FieldNumber = 9; - private bool hasField9; - private bool field9_; - public bool HasField9 { - get { return hasField9; } - } - public bool Field9 { - get { return field9_; } - } - - public const int Field10FieldNumber = 10; - private bool hasField10; - private float field10_; - public bool HasField10 { - get { return hasField10; } - } - public float Field10 { - get { return field10_; } - } - - public const int Field11FieldNumber = 11; - private bool hasField11; - private long field11_; - public bool HasField11 { - get { return hasField11; } - } - public long Field11 { - get { return field11_; } - } - - public static SizeMessage2GroupedMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SizeMessage2GroupedMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SizeMessage2GroupedMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SizeMessage2GroupedMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SizeMessage2GroupedMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SizeMessage2GroupedMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SizeMessage2GroupedMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SizeMessage2GroupedMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SizeMessage2GroupedMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SizeMessage2GroupedMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private SizeMessage2GroupedMessage MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SizeMessage2GroupedMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(SizeMessage2GroupedMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private SizeMessage2GroupedMessage result; - - private SizeMessage2GroupedMessage PrepareBuilder() { - if (resultIsReadOnly) { - SizeMessage2GroupedMessage original = result; - result = new SizeMessage2GroupedMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override SizeMessage2GroupedMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.ProtoBench.SizeMessage2GroupedMessage.Descriptor; } - } - - public override SizeMessage2GroupedMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.ProtoBench.SizeMessage2GroupedMessage.DefaultInstance; } - } - - public override SizeMessage2GroupedMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - - public bool HasField1 { - get { return result.hasField1; } - } - public float Field1 { - get { return result.Field1; } - set { SetField1(value); } - } - public Builder SetField1(float value) { - PrepareBuilder(); - result.hasField1 = true; - result.field1_ = value; - return this; - } - public Builder ClearField1() { - PrepareBuilder(); - result.hasField1 = false; - result.field1_ = 0F; - return this; - } - - public bool HasField2 { - get { return result.hasField2; } - } - public float Field2 { - get { return result.Field2; } - set { SetField2(value); } - } - public Builder SetField2(float value) { - PrepareBuilder(); - result.hasField2 = true; - result.field2_ = value; - return this; - } - public Builder ClearField2() { - PrepareBuilder(); - result.hasField2 = false; - result.field2_ = 0F; - return this; - } - - public bool HasField3 { - get { return result.hasField3; } - } - public float Field3 { - get { return result.Field3; } - set { SetField3(value); } - } - public Builder SetField3(float value) { - PrepareBuilder(); - result.hasField3 = true; - result.field3_ = value; - return this; - } - public Builder ClearField3() { - PrepareBuilder(); - result.hasField3 = false; - result.field3_ = 0F; - return this; - } - - public bool HasField4 { - get { return result.hasField4; } - } - public bool Field4 { - get { return result.Field4; } - set { SetField4(value); } - } - public Builder SetField4(bool value) { - PrepareBuilder(); - result.hasField4 = true; - result.field4_ = value; - return this; - } - public Builder ClearField4() { - PrepareBuilder(); - result.hasField4 = false; - result.field4_ = false; - return this; - } - - public bool HasField5 { - get { return result.hasField5; } - } - public bool Field5 { - get { return result.Field5; } - set { SetField5(value); } - } - public Builder SetField5(bool value) { - PrepareBuilder(); - result.hasField5 = true; - result.field5_ = value; - return this; - } - public Builder ClearField5() { - PrepareBuilder(); - result.hasField5 = false; - result.field5_ = false; - return this; - } - - public bool HasField6 { - get { return result.hasField6; } - } - public bool Field6 { - get { return result.Field6; } - set { SetField6(value); } - } - public Builder SetField6(bool value) { - PrepareBuilder(); - result.hasField6 = true; - result.field6_ = value; - return this; - } - public Builder ClearField6() { - PrepareBuilder(); - result.hasField6 = false; - result.field6_ = true; - return this; - } - - public bool HasField7 { - get { return result.hasField7; } - } - public bool Field7 { - get { return result.Field7; } - set { SetField7(value); } - } - public Builder SetField7(bool value) { - PrepareBuilder(); - result.hasField7 = true; - result.field7_ = value; - return this; - } - public Builder ClearField7() { - PrepareBuilder(); - result.hasField7 = false; - result.field7_ = false; - return this; - } - - public bool HasField8 { - get { return result.hasField8; } - } - public float Field8 { - get { return result.Field8; } - set { SetField8(value); } - } - public Builder SetField8(float value) { - PrepareBuilder(); - result.hasField8 = true; - result.field8_ = value; - return this; - } - public Builder ClearField8() { - PrepareBuilder(); - result.hasField8 = false; - result.field8_ = 0F; - return this; - } - - public bool HasField9 { - get { return result.hasField9; } - } - public bool Field9 { - get { return result.Field9; } - set { SetField9(value); } - } - public Builder SetField9(bool value) { - PrepareBuilder(); - result.hasField9 = true; - result.field9_ = value; - return this; - } - public Builder ClearField9() { - PrepareBuilder(); - result.hasField9 = false; - result.field9_ = false; - return this; - } - - public bool HasField10 { - get { return result.hasField10; } - } - public float Field10 { - get { return result.Field10; } - set { SetField10(value); } - } - public Builder SetField10(float value) { - PrepareBuilder(); - result.hasField10 = true; - result.field10_ = value; - return this; - } - public Builder ClearField10() { - PrepareBuilder(); - result.hasField10 = false; - result.field10_ = 0F; - return this; - } - - public bool HasField11 { - get { return result.hasField11; } - } - public long Field11 { - get { return result.Field11; } - set { SetField11(value); } - } - public Builder SetField11(long value) { - PrepareBuilder(); - result.hasField11 = true; - result.field11_ = value; - return this; - } - public Builder ClearField11() { - PrepareBuilder(); - result.hasField11 = false; - result.field11_ = 0L; - return this; - } - } - static SizeMessage2GroupedMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.ProtoBench.GoogleSizeProtoFile.Descriptor, null); - } - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/ProtoBench/TestProtos/GoogleSpeedProtoFile.cs b/src/ProtoBench/TestProtos/GoogleSpeedProtoFile.cs deleted file mode 100644 index 3a18950..0000000 --- a/src/ProtoBench/TestProtos/GoogleSpeedProtoFile.cs +++ /dev/null @@ -1,6637 +0,0 @@ -// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.ProtoBench { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class GoogleSpeedProtoFile { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_benchmarks_SpeedMessage1__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_benchmarks_SpeedMessage1__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_benchmarks_SpeedMessage1SubMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_benchmarks_SpeedMessage1SubMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_benchmarks_SpeedMessage2__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_benchmarks_SpeedMessage2__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_benchmarks_SpeedMessage2_Group1__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_benchmarks_SpeedMessage2_Group1__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_benchmarks_SpeedMessage2GroupedMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_benchmarks_SpeedMessage2GroupedMessage__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static GoogleSpeedProtoFile() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "Ch1iZW5jaG1hcmtzL2dvb2dsZV9zcGVlZC5wcm90bxIKYmVuY2htYXJrcxok", - "Z29vZ2xlL3Byb3RvYnVmL2NzaGFycF9vcHRpb25zLnByb3RvIvgGCg1TcGVl", - "ZE1lc3NhZ2UxEg4KBmZpZWxkMRgBIAIoCRIOCgZmaWVsZDkYCSABKAkSDwoH", - "ZmllbGQxOBgSIAEoCRIWCgdmaWVsZDgwGFAgASgIOgVmYWxzZRIVCgdmaWVs", - "ZDgxGFEgASgIOgR0cnVlEg4KBmZpZWxkMhgCIAIoBRIOCgZmaWVsZDMYAyAC", - "KAUSEQoIZmllbGQyODAYmAIgASgFEhEKBmZpZWxkNhgGIAEoBToBMBIPCgdm", - "aWVsZDIyGBYgASgDEg4KBmZpZWxkNBgEIAEoCRIOCgZmaWVsZDUYBSADKAYS", - "FgoHZmllbGQ1ORg7IAEoCDoFZmFsc2USDgoGZmllbGQ3GAcgASgJEg8KB2Zp", - "ZWxkMTYYECABKAUSFAoIZmllbGQxMzAYggEgASgFOgEwEhUKB2ZpZWxkMTIY", - "DCABKAg6BHRydWUSFQoHZmllbGQxNxgRIAEoCDoEdHJ1ZRIVCgdmaWVsZDEz", - "GA0gASgIOgR0cnVlEhUKB2ZpZWxkMTQYDiABKAg6BHRydWUSEwoIZmllbGQx", - "MDQYaCABKAU6ATASEwoIZmllbGQxMDAYZCABKAU6ATASEwoIZmllbGQxMDEY", - "ZSABKAU6ATASEAoIZmllbGQxMDIYZiABKAkSEAoIZmllbGQxMDMYZyABKAkS", - "EgoHZmllbGQyORgdIAEoBToBMBIWCgdmaWVsZDMwGB4gASgIOgVmYWxzZRIT", - "CgdmaWVsZDYwGDwgASgFOgItMRIVCghmaWVsZDI3MRiPAiABKAU6Ai0xEhUK", - "CGZpZWxkMjcyGJACIAEoBToCLTESEQoIZmllbGQxNTAYlgEgASgFEhIKB2Zp", - "ZWxkMjMYFyABKAU6ATASFgoHZmllbGQyNBgYIAEoCDoFZmFsc2USEgoHZmll", - "bGQyNRgZIAEoBToBMBI0CgdmaWVsZDE1GA8gASgLMiMuYmVuY2htYXJrcy5T", - "cGVlZE1lc3NhZ2UxU3ViTWVzc2FnZRIPCgdmaWVsZDc4GE4gASgIEhIKB2Zp", - "ZWxkNjcYQyABKAU6ATASDwoHZmllbGQ2OBhEIAEoBRIUCghmaWVsZDEyOBiA", - "ASABKAU6ATASKAoIZmllbGQxMjkYgQEgASgJOhV4eHh4eHh4eHh4eHh4eHh4", - "eHh4eHgSFAoIZmllbGQxMzEYgwEgASgFOgEwIqIDChdTcGVlZE1lc3NhZ2Ux", - "U3ViTWVzc2FnZRIRCgZmaWVsZDEYASABKAU6ATASEQoGZmllbGQyGAIgASgF", - "OgEwEhEKBmZpZWxkMxgDIAEoBToBMBIPCgdmaWVsZDE1GA8gASgJEhUKB2Zp", - "ZWxkMTIYDCABKAg6BHRydWUSDwoHZmllbGQxMxgNIAEoAxIPCgdmaWVsZDE0", - "GA4gASgDEg8KB2ZpZWxkMTYYECABKAUSEgoHZmllbGQxORgTIAEoBToBMhIV", - "CgdmaWVsZDIwGBQgASgIOgR0cnVlEhUKB2ZpZWxkMjgYHCABKAg6BHRydWUS", - "DwoHZmllbGQyMRgVIAEoBhIPCgdmaWVsZDIyGBYgASgFEhYKB2ZpZWxkMjMY", - "FyABKAg6BWZhbHNlEhgKCGZpZWxkMjA2GM4BIAEoCDoFZmFsc2USEQoIZmll", - "bGQyMDMYywEgASgHEhEKCGZpZWxkMjA0GMwBIAEoBRIRCghmaWVsZDIwNRjN", - "ASABKAkSEQoIZmllbGQyMDcYzwEgASgEEhEKCGZpZWxkMzAwGKwCIAEoBCLK", - "BwoNU3BlZWRNZXNzYWdlMhIOCgZmaWVsZDEYASABKAkSDgoGZmllbGQzGAMg", - "ASgDEg4KBmZpZWxkNBgEIAEoAxIPCgdmaWVsZDMwGB4gASgDEhYKB2ZpZWxk", - "NzUYSyABKAg6BWZhbHNlEg4KBmZpZWxkNhgGIAEoCRIOCgZmaWVsZDIYAiAB", - "KAwSEgoHZmllbGQyMRgVIAEoBToBMBIPCgdmaWVsZDcxGEcgASgFEg8KB2Zp", - "ZWxkMjUYGSABKAISEwoIZmllbGQxMDkYbSABKAU6ATASFAoIZmllbGQyMTAY", - "0gEgASgFOgEwEhQKCGZpZWxkMjExGNMBIAEoBToBMBIUCghmaWVsZDIxMhjU", - "ASABKAU6ATASFAoIZmllbGQyMTMY1QEgASgFOgEwEhQKCGZpZWxkMjE2GNgB", - "IAEoBToBMBIUCghmaWVsZDIxNxjZASABKAU6ATASFAoIZmllbGQyMTgY2gEg", - "ASgFOgEwEhQKCGZpZWxkMjIwGNwBIAEoBToBMBIUCghmaWVsZDIyMRjdASAB", - "KAU6ATASFAoIZmllbGQyMjIY3gEgASgCOgEwEg8KB2ZpZWxkNjMYPyABKAUS", - "MAoGZ3JvdXAxGAogAygKMiAuYmVuY2htYXJrcy5TcGVlZE1lc3NhZ2UyLkdy", - "b3VwMRIRCghmaWVsZDEyOBiAASADKAkSEQoIZmllbGQxMzEYgwEgASgDEhAK", - "CGZpZWxkMTI3GH8gAygJEhEKCGZpZWxkMTI5GIEBIAEoBRIRCghmaWVsZDEz", - "MBiCASADKAMSGAoIZmllbGQyMDUYzQEgASgIOgVmYWxzZRIYCghmaWVsZDIw", - "NhjOASABKAg6BWZhbHNlGsMCCgZHcm91cDESDwoHZmllbGQxMRgLIAIoAhIP", - "CgdmaWVsZDI2GBogASgCEg8KB2ZpZWxkMTIYDCABKAkSDwoHZmllbGQxMxgN", - "IAEoCRIPCgdmaWVsZDE0GA4gAygJEg8KB2ZpZWxkMTUYDyACKAQSDgoGZmll", - "bGQ1GAUgASgFEg8KB2ZpZWxkMjcYGyABKAkSDwoHZmllbGQyOBgcIAEoBRIP", - "CgdmaWVsZDI5GB0gASgJEg8KB2ZpZWxkMTYYECABKAkSDwoHZmllbGQyMhgW", - "IAMoCRIPCgdmaWVsZDczGEkgAygFEhIKB2ZpZWxkMjAYFCABKAU6ATASDwoH", - "ZmllbGQyNBgYIAEoCRI4CgdmaWVsZDMxGB8gASgLMicuYmVuY2htYXJrcy5T", - "cGVlZE1lc3NhZ2UyR3JvdXBlZE1lc3NhZ2Ui3wEKG1NwZWVkTWVzc2FnZTJH", - "cm91cGVkTWVzc2FnZRIOCgZmaWVsZDEYASABKAISDgoGZmllbGQyGAIgASgC", - "EhEKBmZpZWxkMxgDIAEoAjoBMBIOCgZmaWVsZDQYBCABKAgSDgoGZmllbGQ1", - "GAUgASgIEhQKBmZpZWxkNhgGIAEoCDoEdHJ1ZRIVCgZmaWVsZDcYByABKAg6", - "BWZhbHNlEg4KBmZpZWxkOBgIIAEoAhIOCgZmaWVsZDkYCSABKAgSDwoHZmll", - "bGQxMBgKIAEoAhIPCgdmaWVsZDExGAsgASgDQktCC0dvb2dsZVNwZWVkSAHC", - "PjkKIUdvb2dsZS5Qcm90b2NvbEJ1ZmZlcnMuUHJvdG9CZW5jaBIUR29vZ2xl", - "U3BlZWRQcm90b0ZpbGU=")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_benchmarks_SpeedMessage1__Descriptor = Descriptor.MessageTypes[0]; - internal__static_benchmarks_SpeedMessage1__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_benchmarks_SpeedMessage1__Descriptor, - new string[] { "Field1", "Field9", "Field18", "Field80", "Field81", "Field2", "Field3", "Field280", "Field6", "Field22", "Field4", "Field5", "Field59", "Field7", "Field16", "Field130", "Field12", "Field17", "Field13", "Field14", "Field104", "Field100", "Field101", "Field102", "Field103", "Field29", "Field30", "Field60", "Field271", "Field272", "Field150", "Field23", "Field24", "Field25", "Field15", "Field78", "Field67", "Field68", "Field128", "Field129", "Field131", }); - internal__static_benchmarks_SpeedMessage1SubMessage__Descriptor = Descriptor.MessageTypes[1]; - internal__static_benchmarks_SpeedMessage1SubMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_benchmarks_SpeedMessage1SubMessage__Descriptor, - new string[] { "Field1", "Field2", "Field3", "Field15", "Field12", "Field13", "Field14", "Field16", "Field19", "Field20", "Field28", "Field21", "Field22", "Field23", "Field206", "Field203", "Field204", "Field205", "Field207", "Field300", }); - internal__static_benchmarks_SpeedMessage2__Descriptor = Descriptor.MessageTypes[2]; - internal__static_benchmarks_SpeedMessage2__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_benchmarks_SpeedMessage2__Descriptor, - new string[] { "Field1", "Field3", "Field4", "Field30", "Field75", "Field6", "Field2", "Field21", "Field71", "Field25", "Field109", "Field210", "Field211", "Field212", "Field213", "Field216", "Field217", "Field218", "Field220", "Field221", "Field222", "Field63", "Group1", "Field128", "Field131", "Field127", "Field129", "Field130", "Field205", "Field206", }); - internal__static_benchmarks_SpeedMessage2_Group1__Descriptor = internal__static_benchmarks_SpeedMessage2__Descriptor.NestedTypes[0]; - internal__static_benchmarks_SpeedMessage2_Group1__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_benchmarks_SpeedMessage2_Group1__Descriptor, - new string[] { "Field11", "Field26", "Field12", "Field13", "Field14", "Field15", "Field5", "Field27", "Field28", "Field29", "Field16", "Field22", "Field73", "Field20", "Field24", "Field31", }); - internal__static_benchmarks_SpeedMessage2GroupedMessage__Descriptor = Descriptor.MessageTypes[3]; - internal__static_benchmarks_SpeedMessage2GroupedMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_benchmarks_SpeedMessage2GroupedMessage__Descriptor, - new string[] { "Field1", "Field2", "Field3", "Field4", "Field5", "Field6", "Field7", "Field8", "Field9", "Field10", "Field11", }); - pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); - RegisterAllExtensions(registry); - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.RegisterAllExtensions(registry); - return registry; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, - }, assigner); - } - #endregion - - } - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class SpeedMessage1 : pb::GeneratedMessage { - private SpeedMessage1() { } - private static readonly SpeedMessage1 defaultInstance = new SpeedMessage1().MakeReadOnly(); - private static readonly string[] _speedMessage1FieldNames = new string[] { "field1", "field100", "field101", "field102", "field103", "field104", "field12", "field128", "field129", "field13", "field130", "field131", "field14", "field15", "field150", "field16", "field17", "field18", "field2", "field22", "field23", "field24", "field25", "field271", "field272", "field280", "field29", "field3", "field30", "field4", "field5", "field59", "field6", "field60", "field67", "field68", "field7", "field78", "field80", "field81", "field9" }; - private static readonly uint[] _speedMessage1FieldTags = new uint[] { 10, 800, 808, 818, 826, 832, 96, 1024, 1034, 104, 1040, 1048, 112, 122, 1200, 128, 136, 146, 16, 176, 184, 192, 200, 2168, 2176, 2240, 232, 24, 240, 34, 41, 472, 48, 480, 536, 544, 58, 624, 640, 648, 74 }; - public static SpeedMessage1 DefaultInstance { - get { return defaultInstance; } - } - - public override SpeedMessage1 DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override SpeedMessage1 ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.ProtoBench.GoogleSpeedProtoFile.internal__static_benchmarks_SpeedMessage1__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.ProtoBench.GoogleSpeedProtoFile.internal__static_benchmarks_SpeedMessage1__FieldAccessorTable; } - } - - public const int Field1FieldNumber = 1; - private bool hasField1; - private string field1_ = ""; - public bool HasField1 { - get { return hasField1; } - } - public string Field1 { - get { return field1_; } - } - - public const int Field9FieldNumber = 9; - private bool hasField9; - private string field9_ = ""; - public bool HasField9 { - get { return hasField9; } - } - public string Field9 { - get { return field9_; } - } - - public const int Field18FieldNumber = 18; - private bool hasField18; - private string field18_ = ""; - public bool HasField18 { - get { return hasField18; } - } - public string Field18 { - get { return field18_; } - } - - public const int Field80FieldNumber = 80; - private bool hasField80; - private bool field80_; - public bool HasField80 { - get { return hasField80; } - } - public bool Field80 { - get { return field80_; } - } - - public const int Field81FieldNumber = 81; - private bool hasField81; - private bool field81_ = true; - public bool HasField81 { - get { return hasField81; } - } - public bool Field81 { - get { return field81_; } - } - - public const int Field2FieldNumber = 2; - private bool hasField2; - private int field2_; - public bool HasField2 { - get { return hasField2; } - } - public int Field2 { - get { return field2_; } - } - - public const int Field3FieldNumber = 3; - private bool hasField3; - private int field3_; - public bool HasField3 { - get { return hasField3; } - } - public int Field3 { - get { return field3_; } - } - - public const int Field280FieldNumber = 280; - private bool hasField280; - private int field280_; - public bool HasField280 { - get { return hasField280; } - } - public int Field280 { - get { return field280_; } - } - - public const int Field6FieldNumber = 6; - private bool hasField6; - private int field6_; - public bool HasField6 { - get { return hasField6; } - } - public int Field6 { - get { return field6_; } - } - - public const int Field22FieldNumber = 22; - private bool hasField22; - private long field22_; - public bool HasField22 { - get { return hasField22; } - } - public long Field22 { - get { return field22_; } - } - - public const int Field4FieldNumber = 4; - private bool hasField4; - private string field4_ = ""; - public bool HasField4 { - get { return hasField4; } - } - public string Field4 { - get { return field4_; } - } - - public const int Field5FieldNumber = 5; - private pbc::PopsicleList field5_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList Field5List { - get { return pbc::Lists.AsReadOnly(field5_); } - } - public int Field5Count { - get { return field5_.Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetField5(int index) { - return field5_[index]; - } - - public const int Field59FieldNumber = 59; - private bool hasField59; - private bool field59_; - public bool HasField59 { - get { return hasField59; } - } - public bool Field59 { - get { return field59_; } - } - - public const int Field7FieldNumber = 7; - private bool hasField7; - private string field7_ = ""; - public bool HasField7 { - get { return hasField7; } - } - public string Field7 { - get { return field7_; } - } - - public const int Field16FieldNumber = 16; - private bool hasField16; - private int field16_; - public bool HasField16 { - get { return hasField16; } - } - public int Field16 { - get { return field16_; } - } - - public const int Field130FieldNumber = 130; - private bool hasField130; - private int field130_; - public bool HasField130 { - get { return hasField130; } - } - public int Field130 { - get { return field130_; } - } - - public const int Field12FieldNumber = 12; - private bool hasField12; - private bool field12_ = true; - public bool HasField12 { - get { return hasField12; } - } - public bool Field12 { - get { return field12_; } - } - - public const int Field17FieldNumber = 17; - private bool hasField17; - private bool field17_ = true; - public bool HasField17 { - get { return hasField17; } - } - public bool Field17 { - get { return field17_; } - } - - public const int Field13FieldNumber = 13; - private bool hasField13; - private bool field13_ = true; - public bool HasField13 { - get { return hasField13; } - } - public bool Field13 { - get { return field13_; } - } - - public const int Field14FieldNumber = 14; - private bool hasField14; - private bool field14_ = true; - public bool HasField14 { - get { return hasField14; } - } - public bool Field14 { - get { return field14_; } - } - - public const int Field104FieldNumber = 104; - private bool hasField104; - private int field104_; - public bool HasField104 { - get { return hasField104; } - } - public int Field104 { - get { return field104_; } - } - - public const int Field100FieldNumber = 100; - private bool hasField100; - private int field100_; - public bool HasField100 { - get { return hasField100; } - } - public int Field100 { - get { return field100_; } - } - - public const int Field101FieldNumber = 101; - private bool hasField101; - private int field101_; - public bool HasField101 { - get { return hasField101; } - } - public int Field101 { - get { return field101_; } - } - - public const int Field102FieldNumber = 102; - private bool hasField102; - private string field102_ = ""; - public bool HasField102 { - get { return hasField102; } - } - public string Field102 { - get { return field102_; } - } - - public const int Field103FieldNumber = 103; - private bool hasField103; - private string field103_ = ""; - public bool HasField103 { - get { return hasField103; } - } - public string Field103 { - get { return field103_; } - } - - public const int Field29FieldNumber = 29; - private bool hasField29; - private int field29_; - public bool HasField29 { - get { return hasField29; } - } - public int Field29 { - get { return field29_; } - } - - public const int Field30FieldNumber = 30; - private bool hasField30; - private bool field30_; - public bool HasField30 { - get { return hasField30; } - } - public bool Field30 { - get { return field30_; } - } - - public const int Field60FieldNumber = 60; - private bool hasField60; - private int field60_ = -1; - public bool HasField60 { - get { return hasField60; } - } - public int Field60 { - get { return field60_; } - } - - public const int Field271FieldNumber = 271; - private bool hasField271; - private int field271_ = -1; - public bool HasField271 { - get { return hasField271; } - } - public int Field271 { - get { return field271_; } - } - - public const int Field272FieldNumber = 272; - private bool hasField272; - private int field272_ = -1; - public bool HasField272 { - get { return hasField272; } - } - public int Field272 { - get { return field272_; } - } - - public const int Field150FieldNumber = 150; - private bool hasField150; - private int field150_; - public bool HasField150 { - get { return hasField150; } - } - public int Field150 { - get { return field150_; } - } - - public const int Field23FieldNumber = 23; - private bool hasField23; - private int field23_; - public bool HasField23 { - get { return hasField23; } - } - public int Field23 { - get { return field23_; } - } - - public const int Field24FieldNumber = 24; - private bool hasField24; - private bool field24_; - public bool HasField24 { - get { return hasField24; } - } - public bool Field24 { - get { return field24_; } - } - - public const int Field25FieldNumber = 25; - private bool hasField25; - private int field25_; - public bool HasField25 { - get { return hasField25; } - } - public int Field25 { - get { return field25_; } - } - - public const int Field15FieldNumber = 15; - private bool hasField15; - private global::Google.ProtocolBuffers.ProtoBench.SpeedMessage1SubMessage field15_; - public bool HasField15 { - get { return hasField15; } - } - public global::Google.ProtocolBuffers.ProtoBench.SpeedMessage1SubMessage Field15 { - get { return field15_ ?? global::Google.ProtocolBuffers.ProtoBench.SpeedMessage1SubMessage.DefaultInstance; } - } - - public const int Field78FieldNumber = 78; - private bool hasField78; - private bool field78_; - public bool HasField78 { - get { return hasField78; } - } - public bool Field78 { - get { return field78_; } - } - - public const int Field67FieldNumber = 67; - private bool hasField67; - private int field67_; - public bool HasField67 { - get { return hasField67; } - } - public int Field67 { - get { return field67_; } - } - - public const int Field68FieldNumber = 68; - private bool hasField68; - private int field68_; - public bool HasField68 { - get { return hasField68; } - } - public int Field68 { - get { return field68_; } - } - - public const int Field128FieldNumber = 128; - private bool hasField128; - private int field128_; - public bool HasField128 { - get { return hasField128; } - } - public int Field128 { - get { return field128_; } - } - - public const int Field129FieldNumber = 129; - private bool hasField129; - private string field129_ = "xxxxxxxxxxxxxxxxxxxxx"; - public bool HasField129 { - get { return hasField129; } - } - public string Field129 { - get { return field129_; } - } - - public const int Field131FieldNumber = 131; - private bool hasField131; - private int field131_; - public bool HasField131 { - get { return hasField131; } - } - public int Field131 { - get { return field131_; } - } - - public override bool IsInitialized { - get { - if (!hasField1) return false; - if (!hasField2) return false; - if (!hasField3) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _speedMessage1FieldNames; - if (hasField1) { - output.WriteString(1, field_names[0], Field1); - } - if (hasField2) { - output.WriteInt32(2, field_names[18], Field2); - } - if (hasField3) { - output.WriteInt32(3, field_names[27], Field3); - } - if (hasField4) { - output.WriteString(4, field_names[29], Field4); - } - if (field5_.Count > 0) { - output.WriteFixed64Array(5, field_names[30], field5_); - } - if (hasField6) { - output.WriteInt32(6, field_names[32], Field6); - } - if (hasField7) { - output.WriteString(7, field_names[36], Field7); - } - if (hasField9) { - output.WriteString(9, field_names[40], Field9); - } - if (hasField12) { - output.WriteBool(12, field_names[6], Field12); - } - if (hasField13) { - output.WriteBool(13, field_names[9], Field13); - } - if (hasField14) { - output.WriteBool(14, field_names[12], Field14); - } - if (hasField15) { - output.WriteMessage(15, field_names[13], Field15); - } - if (hasField16) { - output.WriteInt32(16, field_names[15], Field16); - } - if (hasField17) { - output.WriteBool(17, field_names[16], Field17); - } - if (hasField18) { - output.WriteString(18, field_names[17], Field18); - } - if (hasField22) { - output.WriteInt64(22, field_names[19], Field22); - } - if (hasField23) { - output.WriteInt32(23, field_names[20], Field23); - } - if (hasField24) { - output.WriteBool(24, field_names[21], Field24); - } - if (hasField25) { - output.WriteInt32(25, field_names[22], Field25); - } - if (hasField29) { - output.WriteInt32(29, field_names[26], Field29); - } - if (hasField30) { - output.WriteBool(30, field_names[28], Field30); - } - if (hasField59) { - output.WriteBool(59, field_names[31], Field59); - } - if (hasField60) { - output.WriteInt32(60, field_names[33], Field60); - } - if (hasField67) { - output.WriteInt32(67, field_names[34], Field67); - } - if (hasField68) { - output.WriteInt32(68, field_names[35], Field68); - } - if (hasField78) { - output.WriteBool(78, field_names[37], Field78); - } - if (hasField80) { - output.WriteBool(80, field_names[38], Field80); - } - if (hasField81) { - output.WriteBool(81, field_names[39], Field81); - } - if (hasField100) { - output.WriteInt32(100, field_names[1], Field100); - } - if (hasField101) { - output.WriteInt32(101, field_names[2], Field101); - } - if (hasField102) { - output.WriteString(102, field_names[3], Field102); - } - if (hasField103) { - output.WriteString(103, field_names[4], Field103); - } - if (hasField104) { - output.WriteInt32(104, field_names[5], Field104); - } - if (hasField128) { - output.WriteInt32(128, field_names[7], Field128); - } - if (hasField129) { - output.WriteString(129, field_names[8], Field129); - } - if (hasField130) { - output.WriteInt32(130, field_names[10], Field130); - } - if (hasField131) { - output.WriteInt32(131, field_names[11], Field131); - } - if (hasField150) { - output.WriteInt32(150, field_names[14], Field150); - } - if (hasField271) { - output.WriteInt32(271, field_names[23], Field271); - } - if (hasField272) { - output.WriteInt32(272, field_names[24], Field272); - } - if (hasField280) { - output.WriteInt32(280, field_names[25], Field280); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasField1) { - size += pb::CodedOutputStream.ComputeStringSize(1, Field1); - } - if (hasField9) { - size += pb::CodedOutputStream.ComputeStringSize(9, Field9); - } - if (hasField18) { - size += pb::CodedOutputStream.ComputeStringSize(18, Field18); - } - if (hasField80) { - size += pb::CodedOutputStream.ComputeBoolSize(80, Field80); - } - if (hasField81) { - size += pb::CodedOutputStream.ComputeBoolSize(81, Field81); - } - if (hasField2) { - size += pb::CodedOutputStream.ComputeInt32Size(2, Field2); - } - if (hasField3) { - size += pb::CodedOutputStream.ComputeInt32Size(3, Field3); - } - if (hasField280) { - size += pb::CodedOutputStream.ComputeInt32Size(280, Field280); - } - if (hasField6) { - size += pb::CodedOutputStream.ComputeInt32Size(6, Field6); - } - if (hasField22) { - size += pb::CodedOutputStream.ComputeInt64Size(22, Field22); - } - if (hasField4) { - size += pb::CodedOutputStream.ComputeStringSize(4, Field4); - } - { - int dataSize = 0; - dataSize = 8 * field5_.Count; - size += dataSize; - size += 1 * field5_.Count; - } - if (hasField59) { - size += pb::CodedOutputStream.ComputeBoolSize(59, Field59); - } - if (hasField7) { - size += pb::CodedOutputStream.ComputeStringSize(7, Field7); - } - if (hasField16) { - size += pb::CodedOutputStream.ComputeInt32Size(16, Field16); - } - if (hasField130) { - size += pb::CodedOutputStream.ComputeInt32Size(130, Field130); - } - if (hasField12) { - size += pb::CodedOutputStream.ComputeBoolSize(12, Field12); - } - if (hasField17) { - size += pb::CodedOutputStream.ComputeBoolSize(17, Field17); - } - if (hasField13) { - size += pb::CodedOutputStream.ComputeBoolSize(13, Field13); - } - if (hasField14) { - size += pb::CodedOutputStream.ComputeBoolSize(14, Field14); - } - if (hasField104) { - size += pb::CodedOutputStream.ComputeInt32Size(104, Field104); - } - if (hasField100) { - size += pb::CodedOutputStream.ComputeInt32Size(100, Field100); - } - if (hasField101) { - size += pb::CodedOutputStream.ComputeInt32Size(101, Field101); - } - if (hasField102) { - size += pb::CodedOutputStream.ComputeStringSize(102, Field102); - } - if (hasField103) { - size += pb::CodedOutputStream.ComputeStringSize(103, Field103); - } - if (hasField29) { - size += pb::CodedOutputStream.ComputeInt32Size(29, Field29); - } - if (hasField30) { - size += pb::CodedOutputStream.ComputeBoolSize(30, Field30); - } - if (hasField60) { - size += pb::CodedOutputStream.ComputeInt32Size(60, Field60); - } - if (hasField271) { - size += pb::CodedOutputStream.ComputeInt32Size(271, Field271); - } - if (hasField272) { - size += pb::CodedOutputStream.ComputeInt32Size(272, Field272); - } - if (hasField150) { - size += pb::CodedOutputStream.ComputeInt32Size(150, Field150); - } - if (hasField23) { - size += pb::CodedOutputStream.ComputeInt32Size(23, Field23); - } - if (hasField24) { - size += pb::CodedOutputStream.ComputeBoolSize(24, Field24); - } - if (hasField25) { - size += pb::CodedOutputStream.ComputeInt32Size(25, Field25); - } - if (hasField15) { - size += pb::CodedOutputStream.ComputeMessageSize(15, Field15); - } - if (hasField78) { - size += pb::CodedOutputStream.ComputeBoolSize(78, Field78); - } - if (hasField67) { - size += pb::CodedOutputStream.ComputeInt32Size(67, Field67); - } - if (hasField68) { - size += pb::CodedOutputStream.ComputeInt32Size(68, Field68); - } - if (hasField128) { - size += pb::CodedOutputStream.ComputeInt32Size(128, Field128); - } - if (hasField129) { - size += pb::CodedOutputStream.ComputeStringSize(129, Field129); - } - if (hasField131) { - size += pb::CodedOutputStream.ComputeInt32Size(131, Field131); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static SpeedMessage1 ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SpeedMessage1 ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SpeedMessage1 ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SpeedMessage1 ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SpeedMessage1 ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SpeedMessage1 ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SpeedMessage1 ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SpeedMessage1 ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SpeedMessage1 ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SpeedMessage1 ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private SpeedMessage1 MakeReadOnly() { - field5_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SpeedMessage1 prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(SpeedMessage1 cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private SpeedMessage1 result; - - private SpeedMessage1 PrepareBuilder() { - if (resultIsReadOnly) { - SpeedMessage1 original = result; - result = new SpeedMessage1(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override SpeedMessage1 MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.ProtoBench.SpeedMessage1.Descriptor; } - } - - public override SpeedMessage1 DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.ProtoBench.SpeedMessage1.DefaultInstance; } - } - - public override SpeedMessage1 BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SpeedMessage1) { - return MergeFrom((SpeedMessage1) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SpeedMessage1 other) { - if (other == global::Google.ProtocolBuffers.ProtoBench.SpeedMessage1.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasField1) { - Field1 = other.Field1; - } - if (other.HasField9) { - Field9 = other.Field9; - } - if (other.HasField18) { - Field18 = other.Field18; - } - if (other.HasField80) { - Field80 = other.Field80; - } - if (other.HasField81) { - Field81 = other.Field81; - } - if (other.HasField2) { - Field2 = other.Field2; - } - if (other.HasField3) { - Field3 = other.Field3; - } - if (other.HasField280) { - Field280 = other.Field280; - } - if (other.HasField6) { - Field6 = other.Field6; - } - if (other.HasField22) { - Field22 = other.Field22; - } - if (other.HasField4) { - Field4 = other.Field4; - } - if (other.field5_.Count != 0) { - result.field5_.Add(other.field5_); - } - if (other.HasField59) { - Field59 = other.Field59; - } - if (other.HasField7) { - Field7 = other.Field7; - } - if (other.HasField16) { - Field16 = other.Field16; - } - if (other.HasField130) { - Field130 = other.Field130; - } - if (other.HasField12) { - Field12 = other.Field12; - } - if (other.HasField17) { - Field17 = other.Field17; - } - if (other.HasField13) { - Field13 = other.Field13; - } - if (other.HasField14) { - Field14 = other.Field14; - } - if (other.HasField104) { - Field104 = other.Field104; - } - if (other.HasField100) { - Field100 = other.Field100; - } - if (other.HasField101) { - Field101 = other.Field101; - } - if (other.HasField102) { - Field102 = other.Field102; - } - if (other.HasField103) { - Field103 = other.Field103; - } - if (other.HasField29) { - Field29 = other.Field29; - } - if (other.HasField30) { - Field30 = other.Field30; - } - if (other.HasField60) { - Field60 = other.Field60; - } - if (other.HasField271) { - Field271 = other.Field271; - } - if (other.HasField272) { - Field272 = other.Field272; - } - if (other.HasField150) { - Field150 = other.Field150; - } - if (other.HasField23) { - Field23 = other.Field23; - } - if (other.HasField24) { - Field24 = other.Field24; - } - if (other.HasField25) { - Field25 = other.Field25; - } - if (other.HasField15) { - MergeField15(other.Field15); - } - if (other.HasField78) { - Field78 = other.Field78; - } - if (other.HasField67) { - Field67 = other.Field67; - } - if (other.HasField68) { - Field68 = other.Field68; - } - if (other.HasField128) { - Field128 = other.Field128; - } - if (other.HasField129) { - Field129 = other.Field129; - } - if (other.HasField131) { - Field131 = other.Field131; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_speedMessage1FieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _speedMessage1FieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasField1 = input.ReadString(ref result.field1_); - break; - } - case 16: { - result.hasField2 = input.ReadInt32(ref result.field2_); - break; - } - case 24: { - result.hasField3 = input.ReadInt32(ref result.field3_); - break; - } - case 34: { - result.hasField4 = input.ReadString(ref result.field4_); - break; - } - case 42: - case 41: { - input.ReadFixed64Array(tag, field_name, result.field5_); - break; - } - case 48: { - result.hasField6 = input.ReadInt32(ref result.field6_); - break; - } - case 58: { - result.hasField7 = input.ReadString(ref result.field7_); - break; - } - case 74: { - result.hasField9 = input.ReadString(ref result.field9_); - break; - } - case 96: { - result.hasField12 = input.ReadBool(ref result.field12_); - break; - } - case 104: { - result.hasField13 = input.ReadBool(ref result.field13_); - break; - } - case 112: { - result.hasField14 = input.ReadBool(ref result.field14_); - break; - } - case 122: { - global::Google.ProtocolBuffers.ProtoBench.SpeedMessage1SubMessage.Builder subBuilder = global::Google.ProtocolBuffers.ProtoBench.SpeedMessage1SubMessage.CreateBuilder(); - if (result.hasField15) { - subBuilder.MergeFrom(Field15); - } - input.ReadMessage(subBuilder, extensionRegistry); - Field15 = subBuilder.BuildPartial(); - break; - } - case 128: { - result.hasField16 = input.ReadInt32(ref result.field16_); - break; - } - case 136: { - result.hasField17 = input.ReadBool(ref result.field17_); - break; - } - case 146: { - result.hasField18 = input.ReadString(ref result.field18_); - break; - } - case 176: { - result.hasField22 = input.ReadInt64(ref result.field22_); - break; - } - case 184: { - result.hasField23 = input.ReadInt32(ref result.field23_); - break; - } - case 192: { - result.hasField24 = input.ReadBool(ref result.field24_); - break; - } - case 200: { - result.hasField25 = input.ReadInt32(ref result.field25_); - break; - } - case 232: { - result.hasField29 = input.ReadInt32(ref result.field29_); - break; - } - case 240: { - result.hasField30 = input.ReadBool(ref result.field30_); - break; - } - case 472: { - result.hasField59 = input.ReadBool(ref result.field59_); - break; - } - case 480: { - result.hasField60 = input.ReadInt32(ref result.field60_); - break; - } - case 536: { - result.hasField67 = input.ReadInt32(ref result.field67_); - break; - } - case 544: { - result.hasField68 = input.ReadInt32(ref result.field68_); - break; - } - case 624: { - result.hasField78 = input.ReadBool(ref result.field78_); - break; - } - case 640: { - result.hasField80 = input.ReadBool(ref result.field80_); - break; - } - case 648: { - result.hasField81 = input.ReadBool(ref result.field81_); - break; - } - case 800: { - result.hasField100 = input.ReadInt32(ref result.field100_); - break; - } - case 808: { - result.hasField101 = input.ReadInt32(ref result.field101_); - break; - } - case 818: { - result.hasField102 = input.ReadString(ref result.field102_); - break; - } - case 826: { - result.hasField103 = input.ReadString(ref result.field103_); - break; - } - case 832: { - result.hasField104 = input.ReadInt32(ref result.field104_); - break; - } - case 1024: { - result.hasField128 = input.ReadInt32(ref result.field128_); - break; - } - case 1034: { - result.hasField129 = input.ReadString(ref result.field129_); - break; - } - case 1040: { - result.hasField130 = input.ReadInt32(ref result.field130_); - break; - } - case 1048: { - result.hasField131 = input.ReadInt32(ref result.field131_); - break; - } - case 1200: { - result.hasField150 = input.ReadInt32(ref result.field150_); - break; - } - case 2168: { - result.hasField271 = input.ReadInt32(ref result.field271_); - break; - } - case 2176: { - result.hasField272 = input.ReadInt32(ref result.field272_); - break; - } - case 2240: { - result.hasField280 = input.ReadInt32(ref result.field280_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasField1 { - get { return result.hasField1; } - } - public string Field1 { - get { return result.Field1; } - set { SetField1(value); } - } - public Builder SetField1(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField1 = true; - result.field1_ = value; - return this; - } - public Builder ClearField1() { - PrepareBuilder(); - result.hasField1 = false; - result.field1_ = ""; - return this; - } - - public bool HasField9 { - get { return result.hasField9; } - } - public string Field9 { - get { return result.Field9; } - set { SetField9(value); } - } - public Builder SetField9(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField9 = true; - result.field9_ = value; - return this; - } - public Builder ClearField9() { - PrepareBuilder(); - result.hasField9 = false; - result.field9_ = ""; - return this; - } - - public bool HasField18 { - get { return result.hasField18; } - } - public string Field18 { - get { return result.Field18; } - set { SetField18(value); } - } - public Builder SetField18(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField18 = true; - result.field18_ = value; - return this; - } - public Builder ClearField18() { - PrepareBuilder(); - result.hasField18 = false; - result.field18_ = ""; - return this; - } - - public bool HasField80 { - get { return result.hasField80; } - } - public bool Field80 { - get { return result.Field80; } - set { SetField80(value); } - } - public Builder SetField80(bool value) { - PrepareBuilder(); - result.hasField80 = true; - result.field80_ = value; - return this; - } - public Builder ClearField80() { - PrepareBuilder(); - result.hasField80 = false; - result.field80_ = false; - return this; - } - - public bool HasField81 { - get { return result.hasField81; } - } - public bool Field81 { - get { return result.Field81; } - set { SetField81(value); } - } - public Builder SetField81(bool value) { - PrepareBuilder(); - result.hasField81 = true; - result.field81_ = value; - return this; - } - public Builder ClearField81() { - PrepareBuilder(); - result.hasField81 = false; - result.field81_ = true; - return this; - } - - public bool HasField2 { - get { return result.hasField2; } - } - public int Field2 { - get { return result.Field2; } - set { SetField2(value); } - } - public Builder SetField2(int value) { - PrepareBuilder(); - result.hasField2 = true; - result.field2_ = value; - return this; - } - public Builder ClearField2() { - PrepareBuilder(); - result.hasField2 = false; - result.field2_ = 0; - return this; - } - - public bool HasField3 { - get { return result.hasField3; } - } - public int Field3 { - get { return result.Field3; } - set { SetField3(value); } - } - public Builder SetField3(int value) { - PrepareBuilder(); - result.hasField3 = true; - result.field3_ = value; - return this; - } - public Builder ClearField3() { - PrepareBuilder(); - result.hasField3 = false; - result.field3_ = 0; - return this; - } - - public bool HasField280 { - get { return result.hasField280; } - } - public int Field280 { - get { return result.Field280; } - set { SetField280(value); } - } - public Builder SetField280(int value) { - PrepareBuilder(); - result.hasField280 = true; - result.field280_ = value; - return this; - } - public Builder ClearField280() { - PrepareBuilder(); - result.hasField280 = false; - result.field280_ = 0; - return this; - } - - public bool HasField6 { - get { return result.hasField6; } - } - public int Field6 { - get { return result.Field6; } - set { SetField6(value); } - } - public Builder SetField6(int value) { - PrepareBuilder(); - result.hasField6 = true; - result.field6_ = value; - return this; - } - public Builder ClearField6() { - PrepareBuilder(); - result.hasField6 = false; - result.field6_ = 0; - return this; - } - - public bool HasField22 { - get { return result.hasField22; } - } - public long Field22 { - get { return result.Field22; } - set { SetField22(value); } - } - public Builder SetField22(long value) { - PrepareBuilder(); - result.hasField22 = true; - result.field22_ = value; - return this; - } - public Builder ClearField22() { - PrepareBuilder(); - result.hasField22 = false; - result.field22_ = 0L; - return this; - } - - public bool HasField4 { - get { return result.hasField4; } - } - public string Field4 { - get { return result.Field4; } - set { SetField4(value); } - } - public Builder SetField4(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField4 = true; - result.field4_ = value; - return this; - } - public Builder ClearField4() { - PrepareBuilder(); - result.hasField4 = false; - result.field4_ = ""; - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList Field5List { - get { return PrepareBuilder().field5_; } - } - public int Field5Count { - get { return result.Field5Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetField5(int index) { - return result.GetField5(index); - } - [global::System.CLSCompliant(false)] - public Builder SetField5(int index, ulong value) { - PrepareBuilder(); - result.field5_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddField5(ulong value) { - PrepareBuilder(); - result.field5_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeField5(scg::IEnumerable values) { - PrepareBuilder(); - result.field5_.Add(values); - return this; - } - public Builder ClearField5() { - PrepareBuilder(); - result.field5_.Clear(); - return this; - } - - public bool HasField59 { - get { return result.hasField59; } - } - public bool Field59 { - get { return result.Field59; } - set { SetField59(value); } - } - public Builder SetField59(bool value) { - PrepareBuilder(); - result.hasField59 = true; - result.field59_ = value; - return this; - } - public Builder ClearField59() { - PrepareBuilder(); - result.hasField59 = false; - result.field59_ = false; - return this; - } - - public bool HasField7 { - get { return result.hasField7; } - } - public string Field7 { - get { return result.Field7; } - set { SetField7(value); } - } - public Builder SetField7(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField7 = true; - result.field7_ = value; - return this; - } - public Builder ClearField7() { - PrepareBuilder(); - result.hasField7 = false; - result.field7_ = ""; - return this; - } - - public bool HasField16 { - get { return result.hasField16; } - } - public int Field16 { - get { return result.Field16; } - set { SetField16(value); } - } - public Builder SetField16(int value) { - PrepareBuilder(); - result.hasField16 = true; - result.field16_ = value; - return this; - } - public Builder ClearField16() { - PrepareBuilder(); - result.hasField16 = false; - result.field16_ = 0; - return this; - } - - public bool HasField130 { - get { return result.hasField130; } - } - public int Field130 { - get { return result.Field130; } - set { SetField130(value); } - } - public Builder SetField130(int value) { - PrepareBuilder(); - result.hasField130 = true; - result.field130_ = value; - return this; - } - public Builder ClearField130() { - PrepareBuilder(); - result.hasField130 = false; - result.field130_ = 0; - return this; - } - - public bool HasField12 { - get { return result.hasField12; } - } - public bool Field12 { - get { return result.Field12; } - set { SetField12(value); } - } - public Builder SetField12(bool value) { - PrepareBuilder(); - result.hasField12 = true; - result.field12_ = value; - return this; - } - public Builder ClearField12() { - PrepareBuilder(); - result.hasField12 = false; - result.field12_ = true; - return this; - } - - public bool HasField17 { - get { return result.hasField17; } - } - public bool Field17 { - get { return result.Field17; } - set { SetField17(value); } - } - public Builder SetField17(bool value) { - PrepareBuilder(); - result.hasField17 = true; - result.field17_ = value; - return this; - } - public Builder ClearField17() { - PrepareBuilder(); - result.hasField17 = false; - result.field17_ = true; - return this; - } - - public bool HasField13 { - get { return result.hasField13; } - } - public bool Field13 { - get { return result.Field13; } - set { SetField13(value); } - } - public Builder SetField13(bool value) { - PrepareBuilder(); - result.hasField13 = true; - result.field13_ = value; - return this; - } - public Builder ClearField13() { - PrepareBuilder(); - result.hasField13 = false; - result.field13_ = true; - return this; - } - - public bool HasField14 { - get { return result.hasField14; } - } - public bool Field14 { - get { return result.Field14; } - set { SetField14(value); } - } - public Builder SetField14(bool value) { - PrepareBuilder(); - result.hasField14 = true; - result.field14_ = value; - return this; - } - public Builder ClearField14() { - PrepareBuilder(); - result.hasField14 = false; - result.field14_ = true; - return this; - } - - public bool HasField104 { - get { return result.hasField104; } - } - public int Field104 { - get { return result.Field104; } - set { SetField104(value); } - } - public Builder SetField104(int value) { - PrepareBuilder(); - result.hasField104 = true; - result.field104_ = value; - return this; - } - public Builder ClearField104() { - PrepareBuilder(); - result.hasField104 = false; - result.field104_ = 0; - return this; - } - - public bool HasField100 { - get { return result.hasField100; } - } - public int Field100 { - get { return result.Field100; } - set { SetField100(value); } - } - public Builder SetField100(int value) { - PrepareBuilder(); - result.hasField100 = true; - result.field100_ = value; - return this; - } - public Builder ClearField100() { - PrepareBuilder(); - result.hasField100 = false; - result.field100_ = 0; - return this; - } - - public bool HasField101 { - get { return result.hasField101; } - } - public int Field101 { - get { return result.Field101; } - set { SetField101(value); } - } - public Builder SetField101(int value) { - PrepareBuilder(); - result.hasField101 = true; - result.field101_ = value; - return this; - } - public Builder ClearField101() { - PrepareBuilder(); - result.hasField101 = false; - result.field101_ = 0; - return this; - } - - public bool HasField102 { - get { return result.hasField102; } - } - public string Field102 { - get { return result.Field102; } - set { SetField102(value); } - } - public Builder SetField102(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField102 = true; - result.field102_ = value; - return this; - } - public Builder ClearField102() { - PrepareBuilder(); - result.hasField102 = false; - result.field102_ = ""; - return this; - } - - public bool HasField103 { - get { return result.hasField103; } - } - public string Field103 { - get { return result.Field103; } - set { SetField103(value); } - } - public Builder SetField103(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField103 = true; - result.field103_ = value; - return this; - } - public Builder ClearField103() { - PrepareBuilder(); - result.hasField103 = false; - result.field103_ = ""; - return this; - } - - public bool HasField29 { - get { return result.hasField29; } - } - public int Field29 { - get { return result.Field29; } - set { SetField29(value); } - } - public Builder SetField29(int value) { - PrepareBuilder(); - result.hasField29 = true; - result.field29_ = value; - return this; - } - public Builder ClearField29() { - PrepareBuilder(); - result.hasField29 = false; - result.field29_ = 0; - return this; - } - - public bool HasField30 { - get { return result.hasField30; } - } - public bool Field30 { - get { return result.Field30; } - set { SetField30(value); } - } - public Builder SetField30(bool value) { - PrepareBuilder(); - result.hasField30 = true; - result.field30_ = value; - return this; - } - public Builder ClearField30() { - PrepareBuilder(); - result.hasField30 = false; - result.field30_ = false; - return this; - } - - public bool HasField60 { - get { return result.hasField60; } - } - public int Field60 { - get { return result.Field60; } - set { SetField60(value); } - } - public Builder SetField60(int value) { - PrepareBuilder(); - result.hasField60 = true; - result.field60_ = value; - return this; - } - public Builder ClearField60() { - PrepareBuilder(); - result.hasField60 = false; - result.field60_ = -1; - return this; - } - - public bool HasField271 { - get { return result.hasField271; } - } - public int Field271 { - get { return result.Field271; } - set { SetField271(value); } - } - public Builder SetField271(int value) { - PrepareBuilder(); - result.hasField271 = true; - result.field271_ = value; - return this; - } - public Builder ClearField271() { - PrepareBuilder(); - result.hasField271 = false; - result.field271_ = -1; - return this; - } - - public bool HasField272 { - get { return result.hasField272; } - } - public int Field272 { - get { return result.Field272; } - set { SetField272(value); } - } - public Builder SetField272(int value) { - PrepareBuilder(); - result.hasField272 = true; - result.field272_ = value; - return this; - } - public Builder ClearField272() { - PrepareBuilder(); - result.hasField272 = false; - result.field272_ = -1; - return this; - } - - public bool HasField150 { - get { return result.hasField150; } - } - public int Field150 { - get { return result.Field150; } - set { SetField150(value); } - } - public Builder SetField150(int value) { - PrepareBuilder(); - result.hasField150 = true; - result.field150_ = value; - return this; - } - public Builder ClearField150() { - PrepareBuilder(); - result.hasField150 = false; - result.field150_ = 0; - return this; - } - - public bool HasField23 { - get { return result.hasField23; } - } - public int Field23 { - get { return result.Field23; } - set { SetField23(value); } - } - public Builder SetField23(int value) { - PrepareBuilder(); - result.hasField23 = true; - result.field23_ = value; - return this; - } - public Builder ClearField23() { - PrepareBuilder(); - result.hasField23 = false; - result.field23_ = 0; - return this; - } - - public bool HasField24 { - get { return result.hasField24; } - } - public bool Field24 { - get { return result.Field24; } - set { SetField24(value); } - } - public Builder SetField24(bool value) { - PrepareBuilder(); - result.hasField24 = true; - result.field24_ = value; - return this; - } - public Builder ClearField24() { - PrepareBuilder(); - result.hasField24 = false; - result.field24_ = false; - return this; - } - - public bool HasField25 { - get { return result.hasField25; } - } - public int Field25 { - get { return result.Field25; } - set { SetField25(value); } - } - public Builder SetField25(int value) { - PrepareBuilder(); - result.hasField25 = true; - result.field25_ = value; - return this; - } - public Builder ClearField25() { - PrepareBuilder(); - result.hasField25 = false; - result.field25_ = 0; - return this; - } - - public bool HasField15 { - get { return result.hasField15; } - } - public global::Google.ProtocolBuffers.ProtoBench.SpeedMessage1SubMessage Field15 { - get { return result.Field15; } - set { SetField15(value); } - } - public Builder SetField15(global::Google.ProtocolBuffers.ProtoBench.SpeedMessage1SubMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField15 = true; - result.field15_ = value; - return this; - } - public Builder SetField15(global::Google.ProtocolBuffers.ProtoBench.SpeedMessage1SubMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasField15 = true; - result.field15_ = builderForValue.Build(); - return this; - } - public Builder MergeField15(global::Google.ProtocolBuffers.ProtoBench.SpeedMessage1SubMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasField15 && - result.field15_ != global::Google.ProtocolBuffers.ProtoBench.SpeedMessage1SubMessage.DefaultInstance) { - result.field15_ = global::Google.ProtocolBuffers.ProtoBench.SpeedMessage1SubMessage.CreateBuilder(result.field15_).MergeFrom(value).BuildPartial(); - } else { - result.field15_ = value; - } - result.hasField15 = true; - return this; - } - public Builder ClearField15() { - PrepareBuilder(); - result.hasField15 = false; - result.field15_ = null; - return this; - } - - public bool HasField78 { - get { return result.hasField78; } - } - public bool Field78 { - get { return result.Field78; } - set { SetField78(value); } - } - public Builder SetField78(bool value) { - PrepareBuilder(); - result.hasField78 = true; - result.field78_ = value; - return this; - } - public Builder ClearField78() { - PrepareBuilder(); - result.hasField78 = false; - result.field78_ = false; - return this; - } - - public bool HasField67 { - get { return result.hasField67; } - } - public int Field67 { - get { return result.Field67; } - set { SetField67(value); } - } - public Builder SetField67(int value) { - PrepareBuilder(); - result.hasField67 = true; - result.field67_ = value; - return this; - } - public Builder ClearField67() { - PrepareBuilder(); - result.hasField67 = false; - result.field67_ = 0; - return this; - } - - public bool HasField68 { - get { return result.hasField68; } - } - public int Field68 { - get { return result.Field68; } - set { SetField68(value); } - } - public Builder SetField68(int value) { - PrepareBuilder(); - result.hasField68 = true; - result.field68_ = value; - return this; - } - public Builder ClearField68() { - PrepareBuilder(); - result.hasField68 = false; - result.field68_ = 0; - return this; - } - - public bool HasField128 { - get { return result.hasField128; } - } - public int Field128 { - get { return result.Field128; } - set { SetField128(value); } - } - public Builder SetField128(int value) { - PrepareBuilder(); - result.hasField128 = true; - result.field128_ = value; - return this; - } - public Builder ClearField128() { - PrepareBuilder(); - result.hasField128 = false; - result.field128_ = 0; - return this; - } - - public bool HasField129 { - get { return result.hasField129; } - } - public string Field129 { - get { return result.Field129; } - set { SetField129(value); } - } - public Builder SetField129(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField129 = true; - result.field129_ = value; - return this; - } - public Builder ClearField129() { - PrepareBuilder(); - result.hasField129 = false; - result.field129_ = "xxxxxxxxxxxxxxxxxxxxx"; - return this; - } - - public bool HasField131 { - get { return result.hasField131; } - } - public int Field131 { - get { return result.Field131; } - set { SetField131(value); } - } - public Builder SetField131(int value) { - PrepareBuilder(); - result.hasField131 = true; - result.field131_ = value; - return this; - } - public Builder ClearField131() { - PrepareBuilder(); - result.hasField131 = false; - result.field131_ = 0; - return this; - } - } - static SpeedMessage1() { - object.ReferenceEquals(global::Google.ProtocolBuffers.ProtoBench.GoogleSpeedProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class SpeedMessage1SubMessage : pb::GeneratedMessage { - private SpeedMessage1SubMessage() { } - private static readonly SpeedMessage1SubMessage defaultInstance = new SpeedMessage1SubMessage().MakeReadOnly(); - private static readonly string[] _speedMessage1SubMessageFieldNames = new string[] { "field1", "field12", "field13", "field14", "field15", "field16", "field19", "field2", "field20", "field203", "field204", "field205", "field206", "field207", "field21", "field22", "field23", "field28", "field3", "field300" }; - private static readonly uint[] _speedMessage1SubMessageFieldTags = new uint[] { 8, 96, 104, 112, 122, 128, 152, 16, 160, 1629, 1632, 1642, 1648, 1656, 169, 176, 184, 224, 24, 2400 }; - public static SpeedMessage1SubMessage DefaultInstance { - get { return defaultInstance; } - } - - public override SpeedMessage1SubMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override SpeedMessage1SubMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.ProtoBench.GoogleSpeedProtoFile.internal__static_benchmarks_SpeedMessage1SubMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.ProtoBench.GoogleSpeedProtoFile.internal__static_benchmarks_SpeedMessage1SubMessage__FieldAccessorTable; } - } - - public const int Field1FieldNumber = 1; - private bool hasField1; - private int field1_; - public bool HasField1 { - get { return hasField1; } - } - public int Field1 { - get { return field1_; } - } - - public const int Field2FieldNumber = 2; - private bool hasField2; - private int field2_; - public bool HasField2 { - get { return hasField2; } - } - public int Field2 { - get { return field2_; } - } - - public const int Field3FieldNumber = 3; - private bool hasField3; - private int field3_; - public bool HasField3 { - get { return hasField3; } - } - public int Field3 { - get { return field3_; } - } - - public const int Field15FieldNumber = 15; - private bool hasField15; - private string field15_ = ""; - public bool HasField15 { - get { return hasField15; } - } - public string Field15 { - get { return field15_; } - } - - public const int Field12FieldNumber = 12; - private bool hasField12; - private bool field12_ = true; - public bool HasField12 { - get { return hasField12; } - } - public bool Field12 { - get { return field12_; } - } - - public const int Field13FieldNumber = 13; - private bool hasField13; - private long field13_; - public bool HasField13 { - get { return hasField13; } - } - public long Field13 { - get { return field13_; } - } - - public const int Field14FieldNumber = 14; - private bool hasField14; - private long field14_; - public bool HasField14 { - get { return hasField14; } - } - public long Field14 { - get { return field14_; } - } - - public const int Field16FieldNumber = 16; - private bool hasField16; - private int field16_; - public bool HasField16 { - get { return hasField16; } - } - public int Field16 { - get { return field16_; } - } - - public const int Field19FieldNumber = 19; - private bool hasField19; - private int field19_ = 2; - public bool HasField19 { - get { return hasField19; } - } - public int Field19 { - get { return field19_; } - } - - public const int Field20FieldNumber = 20; - private bool hasField20; - private bool field20_ = true; - public bool HasField20 { - get { return hasField20; } - } - public bool Field20 { - get { return field20_; } - } - - public const int Field28FieldNumber = 28; - private bool hasField28; - private bool field28_ = true; - public bool HasField28 { - get { return hasField28; } - } - public bool Field28 { - get { return field28_; } - } - - public const int Field21FieldNumber = 21; - private bool hasField21; - private ulong field21_; - public bool HasField21 { - get { return hasField21; } - } - [global::System.CLSCompliant(false)] - public ulong Field21 { - get { return field21_; } - } - - public const int Field22FieldNumber = 22; - private bool hasField22; - private int field22_; - public bool HasField22 { - get { return hasField22; } - } - public int Field22 { - get { return field22_; } - } - - public const int Field23FieldNumber = 23; - private bool hasField23; - private bool field23_; - public bool HasField23 { - get { return hasField23; } - } - public bool Field23 { - get { return field23_; } - } - - public const int Field206FieldNumber = 206; - private bool hasField206; - private bool field206_; - public bool HasField206 { - get { return hasField206; } - } - public bool Field206 { - get { return field206_; } - } - - public const int Field203FieldNumber = 203; - private bool hasField203; - private uint field203_; - public bool HasField203 { - get { return hasField203; } - } - [global::System.CLSCompliant(false)] - public uint Field203 { - get { return field203_; } - } - - public const int Field204FieldNumber = 204; - private bool hasField204; - private int field204_; - public bool HasField204 { - get { return hasField204; } - } - public int Field204 { - get { return field204_; } - } - - public const int Field205FieldNumber = 205; - private bool hasField205; - private string field205_ = ""; - public bool HasField205 { - get { return hasField205; } - } - public string Field205 { - get { return field205_; } - } - - public const int Field207FieldNumber = 207; - private bool hasField207; - private ulong field207_; - public bool HasField207 { - get { return hasField207; } - } - [global::System.CLSCompliant(false)] - public ulong Field207 { - get { return field207_; } - } - - public const int Field300FieldNumber = 300; - private bool hasField300; - private ulong field300_; - public bool HasField300 { - get { return hasField300; } - } - [global::System.CLSCompliant(false)] - public ulong Field300 { - get { return field300_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _speedMessage1SubMessageFieldNames; - if (hasField1) { - output.WriteInt32(1, field_names[0], Field1); - } - if (hasField2) { - output.WriteInt32(2, field_names[7], Field2); - } - if (hasField3) { - output.WriteInt32(3, field_names[18], Field3); - } - if (hasField12) { - output.WriteBool(12, field_names[1], Field12); - } - if (hasField13) { - output.WriteInt64(13, field_names[2], Field13); - } - if (hasField14) { - output.WriteInt64(14, field_names[3], Field14); - } - if (hasField15) { - output.WriteString(15, field_names[4], Field15); - } - if (hasField16) { - output.WriteInt32(16, field_names[5], Field16); - } - if (hasField19) { - output.WriteInt32(19, field_names[6], Field19); - } - if (hasField20) { - output.WriteBool(20, field_names[8], Field20); - } - if (hasField21) { - output.WriteFixed64(21, field_names[14], Field21); - } - if (hasField22) { - output.WriteInt32(22, field_names[15], Field22); - } - if (hasField23) { - output.WriteBool(23, field_names[16], Field23); - } - if (hasField28) { - output.WriteBool(28, field_names[17], Field28); - } - if (hasField203) { - output.WriteFixed32(203, field_names[9], Field203); - } - if (hasField204) { - output.WriteInt32(204, field_names[10], Field204); - } - if (hasField205) { - output.WriteString(205, field_names[11], Field205); - } - if (hasField206) { - output.WriteBool(206, field_names[12], Field206); - } - if (hasField207) { - output.WriteUInt64(207, field_names[13], Field207); - } - if (hasField300) { - output.WriteUInt64(300, field_names[19], Field300); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasField1) { - size += pb::CodedOutputStream.ComputeInt32Size(1, Field1); - } - if (hasField2) { - size += pb::CodedOutputStream.ComputeInt32Size(2, Field2); - } - if (hasField3) { - size += pb::CodedOutputStream.ComputeInt32Size(3, Field3); - } - if (hasField15) { - size += pb::CodedOutputStream.ComputeStringSize(15, Field15); - } - if (hasField12) { - size += pb::CodedOutputStream.ComputeBoolSize(12, Field12); - } - if (hasField13) { - size += pb::CodedOutputStream.ComputeInt64Size(13, Field13); - } - if (hasField14) { - size += pb::CodedOutputStream.ComputeInt64Size(14, Field14); - } - if (hasField16) { - size += pb::CodedOutputStream.ComputeInt32Size(16, Field16); - } - if (hasField19) { - size += pb::CodedOutputStream.ComputeInt32Size(19, Field19); - } - if (hasField20) { - size += pb::CodedOutputStream.ComputeBoolSize(20, Field20); - } - if (hasField28) { - size += pb::CodedOutputStream.ComputeBoolSize(28, Field28); - } - if (hasField21) { - size += pb::CodedOutputStream.ComputeFixed64Size(21, Field21); - } - if (hasField22) { - size += pb::CodedOutputStream.ComputeInt32Size(22, Field22); - } - if (hasField23) { - size += pb::CodedOutputStream.ComputeBoolSize(23, Field23); - } - if (hasField206) { - size += pb::CodedOutputStream.ComputeBoolSize(206, Field206); - } - if (hasField203) { - size += pb::CodedOutputStream.ComputeFixed32Size(203, Field203); - } - if (hasField204) { - size += pb::CodedOutputStream.ComputeInt32Size(204, Field204); - } - if (hasField205) { - size += pb::CodedOutputStream.ComputeStringSize(205, Field205); - } - if (hasField207) { - size += pb::CodedOutputStream.ComputeUInt64Size(207, Field207); - } - if (hasField300) { - size += pb::CodedOutputStream.ComputeUInt64Size(300, Field300); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static SpeedMessage1SubMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SpeedMessage1SubMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SpeedMessage1SubMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SpeedMessage1SubMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SpeedMessage1SubMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SpeedMessage1SubMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SpeedMessage1SubMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SpeedMessage1SubMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SpeedMessage1SubMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SpeedMessage1SubMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private SpeedMessage1SubMessage MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SpeedMessage1SubMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(SpeedMessage1SubMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private SpeedMessage1SubMessage result; - - private SpeedMessage1SubMessage PrepareBuilder() { - if (resultIsReadOnly) { - SpeedMessage1SubMessage original = result; - result = new SpeedMessage1SubMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override SpeedMessage1SubMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.ProtoBench.SpeedMessage1SubMessage.Descriptor; } - } - - public override SpeedMessage1SubMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.ProtoBench.SpeedMessage1SubMessage.DefaultInstance; } - } - - public override SpeedMessage1SubMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SpeedMessage1SubMessage) { - return MergeFrom((SpeedMessage1SubMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SpeedMessage1SubMessage other) { - if (other == global::Google.ProtocolBuffers.ProtoBench.SpeedMessage1SubMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasField1) { - Field1 = other.Field1; - } - if (other.HasField2) { - Field2 = other.Field2; - } - if (other.HasField3) { - Field3 = other.Field3; - } - if (other.HasField15) { - Field15 = other.Field15; - } - if (other.HasField12) { - Field12 = other.Field12; - } - if (other.HasField13) { - Field13 = other.Field13; - } - if (other.HasField14) { - Field14 = other.Field14; - } - if (other.HasField16) { - Field16 = other.Field16; - } - if (other.HasField19) { - Field19 = other.Field19; - } - if (other.HasField20) { - Field20 = other.Field20; - } - if (other.HasField28) { - Field28 = other.Field28; - } - if (other.HasField21) { - Field21 = other.Field21; - } - if (other.HasField22) { - Field22 = other.Field22; - } - if (other.HasField23) { - Field23 = other.Field23; - } - if (other.HasField206) { - Field206 = other.Field206; - } - if (other.HasField203) { - Field203 = other.Field203; - } - if (other.HasField204) { - Field204 = other.Field204; - } - if (other.HasField205) { - Field205 = other.Field205; - } - if (other.HasField207) { - Field207 = other.Field207; - } - if (other.HasField300) { - Field300 = other.Field300; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_speedMessage1SubMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _speedMessage1SubMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasField1 = input.ReadInt32(ref result.field1_); - break; - } - case 16: { - result.hasField2 = input.ReadInt32(ref result.field2_); - break; - } - case 24: { - result.hasField3 = input.ReadInt32(ref result.field3_); - break; - } - case 96: { - result.hasField12 = input.ReadBool(ref result.field12_); - break; - } - case 104: { - result.hasField13 = input.ReadInt64(ref result.field13_); - break; - } - case 112: { - result.hasField14 = input.ReadInt64(ref result.field14_); - break; - } - case 122: { - result.hasField15 = input.ReadString(ref result.field15_); - break; - } - case 128: { - result.hasField16 = input.ReadInt32(ref result.field16_); - break; - } - case 152: { - result.hasField19 = input.ReadInt32(ref result.field19_); - break; - } - case 160: { - result.hasField20 = input.ReadBool(ref result.field20_); - break; - } - case 169: { - result.hasField21 = input.ReadFixed64(ref result.field21_); - break; - } - case 176: { - result.hasField22 = input.ReadInt32(ref result.field22_); - break; - } - case 184: { - result.hasField23 = input.ReadBool(ref result.field23_); - break; - } - case 224: { - result.hasField28 = input.ReadBool(ref result.field28_); - break; - } - case 1629: { - result.hasField203 = input.ReadFixed32(ref result.field203_); - break; - } - case 1632: { - result.hasField204 = input.ReadInt32(ref result.field204_); - break; - } - case 1642: { - result.hasField205 = input.ReadString(ref result.field205_); - break; - } - case 1648: { - result.hasField206 = input.ReadBool(ref result.field206_); - break; - } - case 1656: { - result.hasField207 = input.ReadUInt64(ref result.field207_); - break; - } - case 2400: { - result.hasField300 = input.ReadUInt64(ref result.field300_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasField1 { - get { return result.hasField1; } - } - public int Field1 { - get { return result.Field1; } - set { SetField1(value); } - } - public Builder SetField1(int value) { - PrepareBuilder(); - result.hasField1 = true; - result.field1_ = value; - return this; - } - public Builder ClearField1() { - PrepareBuilder(); - result.hasField1 = false; - result.field1_ = 0; - return this; - } - - public bool HasField2 { - get { return result.hasField2; } - } - public int Field2 { - get { return result.Field2; } - set { SetField2(value); } - } - public Builder SetField2(int value) { - PrepareBuilder(); - result.hasField2 = true; - result.field2_ = value; - return this; - } - public Builder ClearField2() { - PrepareBuilder(); - result.hasField2 = false; - result.field2_ = 0; - return this; - } - - public bool HasField3 { - get { return result.hasField3; } - } - public int Field3 { - get { return result.Field3; } - set { SetField3(value); } - } - public Builder SetField3(int value) { - PrepareBuilder(); - result.hasField3 = true; - result.field3_ = value; - return this; - } - public Builder ClearField3() { - PrepareBuilder(); - result.hasField3 = false; - result.field3_ = 0; - return this; - } - - public bool HasField15 { - get { return result.hasField15; } - } - public string Field15 { - get { return result.Field15; } - set { SetField15(value); } - } - public Builder SetField15(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField15 = true; - result.field15_ = value; - return this; - } - public Builder ClearField15() { - PrepareBuilder(); - result.hasField15 = false; - result.field15_ = ""; - return this; - } - - public bool HasField12 { - get { return result.hasField12; } - } - public bool Field12 { - get { return result.Field12; } - set { SetField12(value); } - } - public Builder SetField12(bool value) { - PrepareBuilder(); - result.hasField12 = true; - result.field12_ = value; - return this; - } - public Builder ClearField12() { - PrepareBuilder(); - result.hasField12 = false; - result.field12_ = true; - return this; - } - - public bool HasField13 { - get { return result.hasField13; } - } - public long Field13 { - get { return result.Field13; } - set { SetField13(value); } - } - public Builder SetField13(long value) { - PrepareBuilder(); - result.hasField13 = true; - result.field13_ = value; - return this; - } - public Builder ClearField13() { - PrepareBuilder(); - result.hasField13 = false; - result.field13_ = 0L; - return this; - } - - public bool HasField14 { - get { return result.hasField14; } - } - public long Field14 { - get { return result.Field14; } - set { SetField14(value); } - } - public Builder SetField14(long value) { - PrepareBuilder(); - result.hasField14 = true; - result.field14_ = value; - return this; - } - public Builder ClearField14() { - PrepareBuilder(); - result.hasField14 = false; - result.field14_ = 0L; - return this; - } - - public bool HasField16 { - get { return result.hasField16; } - } - public int Field16 { - get { return result.Field16; } - set { SetField16(value); } - } - public Builder SetField16(int value) { - PrepareBuilder(); - result.hasField16 = true; - result.field16_ = value; - return this; - } - public Builder ClearField16() { - PrepareBuilder(); - result.hasField16 = false; - result.field16_ = 0; - return this; - } - - public bool HasField19 { - get { return result.hasField19; } - } - public int Field19 { - get { return result.Field19; } - set { SetField19(value); } - } - public Builder SetField19(int value) { - PrepareBuilder(); - result.hasField19 = true; - result.field19_ = value; - return this; - } - public Builder ClearField19() { - PrepareBuilder(); - result.hasField19 = false; - result.field19_ = 2; - return this; - } - - public bool HasField20 { - get { return result.hasField20; } - } - public bool Field20 { - get { return result.Field20; } - set { SetField20(value); } - } - public Builder SetField20(bool value) { - PrepareBuilder(); - result.hasField20 = true; - result.field20_ = value; - return this; - } - public Builder ClearField20() { - PrepareBuilder(); - result.hasField20 = false; - result.field20_ = true; - return this; - } - - public bool HasField28 { - get { return result.hasField28; } - } - public bool Field28 { - get { return result.Field28; } - set { SetField28(value); } - } - public Builder SetField28(bool value) { - PrepareBuilder(); - result.hasField28 = true; - result.field28_ = value; - return this; - } - public Builder ClearField28() { - PrepareBuilder(); - result.hasField28 = false; - result.field28_ = true; - return this; - } - - public bool HasField21 { - get { return result.hasField21; } - } - [global::System.CLSCompliant(false)] - public ulong Field21 { - get { return result.Field21; } - set { SetField21(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetField21(ulong value) { - PrepareBuilder(); - result.hasField21 = true; - result.field21_ = value; - return this; - } - public Builder ClearField21() { - PrepareBuilder(); - result.hasField21 = false; - result.field21_ = 0; - return this; - } - - public bool HasField22 { - get { return result.hasField22; } - } - public int Field22 { - get { return result.Field22; } - set { SetField22(value); } - } - public Builder SetField22(int value) { - PrepareBuilder(); - result.hasField22 = true; - result.field22_ = value; - return this; - } - public Builder ClearField22() { - PrepareBuilder(); - result.hasField22 = false; - result.field22_ = 0; - return this; - } - - public bool HasField23 { - get { return result.hasField23; } - } - public bool Field23 { - get { return result.Field23; } - set { SetField23(value); } - } - public Builder SetField23(bool value) { - PrepareBuilder(); - result.hasField23 = true; - result.field23_ = value; - return this; - } - public Builder ClearField23() { - PrepareBuilder(); - result.hasField23 = false; - result.field23_ = false; - return this; - } - - public bool HasField206 { - get { return result.hasField206; } - } - public bool Field206 { - get { return result.Field206; } - set { SetField206(value); } - } - public Builder SetField206(bool value) { - PrepareBuilder(); - result.hasField206 = true; - result.field206_ = value; - return this; - } - public Builder ClearField206() { - PrepareBuilder(); - result.hasField206 = false; - result.field206_ = false; - return this; - } - - public bool HasField203 { - get { return result.hasField203; } - } - [global::System.CLSCompliant(false)] - public uint Field203 { - get { return result.Field203; } - set { SetField203(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetField203(uint value) { - PrepareBuilder(); - result.hasField203 = true; - result.field203_ = value; - return this; - } - public Builder ClearField203() { - PrepareBuilder(); - result.hasField203 = false; - result.field203_ = 0; - return this; - } - - public bool HasField204 { - get { return result.hasField204; } - } - public int Field204 { - get { return result.Field204; } - set { SetField204(value); } - } - public Builder SetField204(int value) { - PrepareBuilder(); - result.hasField204 = true; - result.field204_ = value; - return this; - } - public Builder ClearField204() { - PrepareBuilder(); - result.hasField204 = false; - result.field204_ = 0; - return this; - } - - public bool HasField205 { - get { return result.hasField205; } - } - public string Field205 { - get { return result.Field205; } - set { SetField205(value); } - } - public Builder SetField205(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField205 = true; - result.field205_ = value; - return this; - } - public Builder ClearField205() { - PrepareBuilder(); - result.hasField205 = false; - result.field205_ = ""; - return this; - } - - public bool HasField207 { - get { return result.hasField207; } - } - [global::System.CLSCompliant(false)] - public ulong Field207 { - get { return result.Field207; } - set { SetField207(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetField207(ulong value) { - PrepareBuilder(); - result.hasField207 = true; - result.field207_ = value; - return this; - } - public Builder ClearField207() { - PrepareBuilder(); - result.hasField207 = false; - result.field207_ = 0UL; - return this; - } - - public bool HasField300 { - get { return result.hasField300; } - } - [global::System.CLSCompliant(false)] - public ulong Field300 { - get { return result.Field300; } - set { SetField300(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetField300(ulong value) { - PrepareBuilder(); - result.hasField300 = true; - result.field300_ = value; - return this; - } - public Builder ClearField300() { - PrepareBuilder(); - result.hasField300 = false; - result.field300_ = 0UL; - return this; - } - } - static SpeedMessage1SubMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.ProtoBench.GoogleSpeedProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class SpeedMessage2 : pb::GeneratedMessage { - private SpeedMessage2() { } - private static readonly SpeedMessage2 defaultInstance = new SpeedMessage2().MakeReadOnly(); - private static readonly string[] _speedMessage2FieldNames = new string[] { "field1", "field109", "field127", "field128", "field129", "field130", "field131", "field2", "field205", "field206", "field21", "field210", "field211", "field212", "field213", "field216", "field217", "field218", "field220", "field221", "field222", "field25", "field3", "field30", "field4", "field6", "field63", "field71", "field75", "group1" }; - private static readonly uint[] _speedMessage2FieldTags = new uint[] { 10, 872, 1018, 1026, 1032, 1040, 1048, 18, 1640, 1648, 168, 1680, 1688, 1696, 1704, 1728, 1736, 1744, 1760, 1768, 1781, 205, 24, 240, 32, 50, 504, 568, 600, 83 }; - public static SpeedMessage2 DefaultInstance { - get { return defaultInstance; } - } - - public override SpeedMessage2 DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override SpeedMessage2 ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.ProtoBench.GoogleSpeedProtoFile.internal__static_benchmarks_SpeedMessage2__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.ProtoBench.GoogleSpeedProtoFile.internal__static_benchmarks_SpeedMessage2__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Group1 : pb::GeneratedMessage { - private Group1() { } - private static readonly Group1 defaultInstance = new Group1().MakeReadOnly(); - private static readonly string[] _group1FieldNames = new string[] { "field11", "field12", "field13", "field14", "field15", "field16", "field20", "field22", "field24", "field26", "field27", "field28", "field29", "field31", "field5", "field73" }; - private static readonly uint[] _group1FieldTags = new uint[] { 93, 98, 106, 114, 120, 130, 160, 178, 194, 213, 218, 224, 234, 250, 40, 584 }; - public static Group1 DefaultInstance { - get { return defaultInstance; } - } - - public override Group1 DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override Group1 ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.ProtoBench.GoogleSpeedProtoFile.internal__static_benchmarks_SpeedMessage2_Group1__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.ProtoBench.GoogleSpeedProtoFile.internal__static_benchmarks_SpeedMessage2_Group1__FieldAccessorTable; } - } - - public const int Field11FieldNumber = 11; - private bool hasField11; - private float field11_; - public bool HasField11 { - get { return hasField11; } - } - public float Field11 { - get { return field11_; } - } - - public const int Field26FieldNumber = 26; - private bool hasField26; - private float field26_; - public bool HasField26 { - get { return hasField26; } - } - public float Field26 { - get { return field26_; } - } - - public const int Field12FieldNumber = 12; - private bool hasField12; - private string field12_ = ""; - public bool HasField12 { - get { return hasField12; } - } - public string Field12 { - get { return field12_; } - } - - public const int Field13FieldNumber = 13; - private bool hasField13; - private string field13_ = ""; - public bool HasField13 { - get { return hasField13; } - } - public string Field13 { - get { return field13_; } - } - - public const int Field14FieldNumber = 14; - private pbc::PopsicleList field14_ = new pbc::PopsicleList(); - public scg::IList Field14List { - get { return pbc::Lists.AsReadOnly(field14_); } - } - public int Field14Count { - get { return field14_.Count; } - } - public string GetField14(int index) { - return field14_[index]; - } - - public const int Field15FieldNumber = 15; - private bool hasField15; - private ulong field15_; - public bool HasField15 { - get { return hasField15; } - } - [global::System.CLSCompliant(false)] - public ulong Field15 { - get { return field15_; } - } - - public const int Field5FieldNumber = 5; - private bool hasField5; - private int field5_; - public bool HasField5 { - get { return hasField5; } - } - public int Field5 { - get { return field5_; } - } - - public const int Field27FieldNumber = 27; - private bool hasField27; - private string field27_ = ""; - public bool HasField27 { - get { return hasField27; } - } - public string Field27 { - get { return field27_; } - } - - public const int Field28FieldNumber = 28; - private bool hasField28; - private int field28_; - public bool HasField28 { - get { return hasField28; } - } - public int Field28 { - get { return field28_; } - } - - public const int Field29FieldNumber = 29; - private bool hasField29; - private string field29_ = ""; - public bool HasField29 { - get { return hasField29; } - } - public string Field29 { - get { return field29_; } - } - - public const int Field16FieldNumber = 16; - private bool hasField16; - private string field16_ = ""; - public bool HasField16 { - get { return hasField16; } - } - public string Field16 { - get { return field16_; } - } - - public const int Field22FieldNumber = 22; - private pbc::PopsicleList field22_ = new pbc::PopsicleList(); - public scg::IList Field22List { - get { return pbc::Lists.AsReadOnly(field22_); } - } - public int Field22Count { - get { return field22_.Count; } - } - public string GetField22(int index) { - return field22_[index]; - } - - public const int Field73FieldNumber = 73; - private pbc::PopsicleList field73_ = new pbc::PopsicleList(); - public scg::IList Field73List { - get { return pbc::Lists.AsReadOnly(field73_); } - } - public int Field73Count { - get { return field73_.Count; } - } - public int GetField73(int index) { - return field73_[index]; - } - - public const int Field20FieldNumber = 20; - private bool hasField20; - private int field20_; - public bool HasField20 { - get { return hasField20; } - } - public int Field20 { - get { return field20_; } - } - - public const int Field24FieldNumber = 24; - private bool hasField24; - private string field24_ = ""; - public bool HasField24 { - get { return hasField24; } - } - public string Field24 { - get { return field24_; } - } - - public const int Field31FieldNumber = 31; - private bool hasField31; - private global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2GroupedMessage field31_; - public bool HasField31 { - get { return hasField31; } - } - public global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2GroupedMessage Field31 { - get { return field31_ ?? global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2GroupedMessage.DefaultInstance; } - } - - public override bool IsInitialized { - get { - if (!hasField11) return false; - if (!hasField15) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _group1FieldNames; - if (hasField5) { - output.WriteInt32(5, field_names[14], Field5); - } - if (hasField11) { - output.WriteFloat(11, field_names[0], Field11); - } - if (hasField12) { - output.WriteString(12, field_names[1], Field12); - } - if (hasField13) { - output.WriteString(13, field_names[2], Field13); - } - if (field14_.Count > 0) { - output.WriteStringArray(14, field_names[3], field14_); - } - if (hasField15) { - output.WriteUInt64(15, field_names[4], Field15); - } - if (hasField16) { - output.WriteString(16, field_names[5], Field16); - } - if (hasField20) { - output.WriteInt32(20, field_names[6], Field20); - } - if (field22_.Count > 0) { - output.WriteStringArray(22, field_names[7], field22_); - } - if (hasField24) { - output.WriteString(24, field_names[8], Field24); - } - if (hasField26) { - output.WriteFloat(26, field_names[9], Field26); - } - if (hasField27) { - output.WriteString(27, field_names[10], Field27); - } - if (hasField28) { - output.WriteInt32(28, field_names[11], Field28); - } - if (hasField29) { - output.WriteString(29, field_names[12], Field29); - } - if (hasField31) { - output.WriteMessage(31, field_names[13], Field31); - } - if (field73_.Count > 0) { - output.WriteInt32Array(73, field_names[15], field73_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasField11) { - size += pb::CodedOutputStream.ComputeFloatSize(11, Field11); - } - if (hasField26) { - size += pb::CodedOutputStream.ComputeFloatSize(26, Field26); - } - if (hasField12) { - size += pb::CodedOutputStream.ComputeStringSize(12, Field12); - } - if (hasField13) { - size += pb::CodedOutputStream.ComputeStringSize(13, Field13); - } - { - int dataSize = 0; - foreach (string element in Field14List) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 1 * field14_.Count; - } - if (hasField15) { - size += pb::CodedOutputStream.ComputeUInt64Size(15, Field15); - } - if (hasField5) { - size += pb::CodedOutputStream.ComputeInt32Size(5, Field5); - } - if (hasField27) { - size += pb::CodedOutputStream.ComputeStringSize(27, Field27); - } - if (hasField28) { - size += pb::CodedOutputStream.ComputeInt32Size(28, Field28); - } - if (hasField29) { - size += pb::CodedOutputStream.ComputeStringSize(29, Field29); - } - if (hasField16) { - size += pb::CodedOutputStream.ComputeStringSize(16, Field16); - } - { - int dataSize = 0; - foreach (string element in Field22List) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 2 * field22_.Count; - } - { - int dataSize = 0; - foreach (int element in Field73List) { - dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); - } - size += dataSize; - size += 2 * field73_.Count; - } - if (hasField20) { - size += pb::CodedOutputStream.ComputeInt32Size(20, Field20); - } - if (hasField24) { - size += pb::CodedOutputStream.ComputeStringSize(24, Field24); - } - if (hasField31) { - size += pb::CodedOutputStream.ComputeMessageSize(31, Field31); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static Group1 ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Group1 ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Group1 ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Group1 ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Group1 ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Group1 ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Group1 ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Group1 ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Group1 ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Group1 ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private Group1 MakeReadOnly() { - field14_.MakeReadOnly(); - field22_.MakeReadOnly(); - field73_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Group1 prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(Group1 cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private Group1 result; - - private Group1 PrepareBuilder() { - if (resultIsReadOnly) { - Group1 original = result; - result = new Group1(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override Group1 MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2.Types.Group1.Descriptor; } - } - - public override Group1 DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2.Types.Group1.DefaultInstance; } - } - - public override Group1 BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Group1) { - return MergeFrom((Group1) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Group1 other) { - if (other == global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2.Types.Group1.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasField11) { - Field11 = other.Field11; - } - if (other.HasField26) { - Field26 = other.Field26; - } - if (other.HasField12) { - Field12 = other.Field12; - } - if (other.HasField13) { - Field13 = other.Field13; - } - if (other.field14_.Count != 0) { - result.field14_.Add(other.field14_); - } - if (other.HasField15) { - Field15 = other.Field15; - } - if (other.HasField5) { - Field5 = other.Field5; - } - if (other.HasField27) { - Field27 = other.Field27; - } - if (other.HasField28) { - Field28 = other.Field28; - } - if (other.HasField29) { - Field29 = other.Field29; - } - if (other.HasField16) { - Field16 = other.Field16; - } - if (other.field22_.Count != 0) { - result.field22_.Add(other.field22_); - } - if (other.field73_.Count != 0) { - result.field73_.Add(other.field73_); - } - if (other.HasField20) { - Field20 = other.Field20; - } - if (other.HasField24) { - Field24 = other.Field24; - } - if (other.HasField31) { - MergeField31(other.Field31); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_group1FieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _group1FieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 40: { - result.hasField5 = input.ReadInt32(ref result.field5_); - break; - } - case 93: { - result.hasField11 = input.ReadFloat(ref result.field11_); - break; - } - case 98: { - result.hasField12 = input.ReadString(ref result.field12_); - break; - } - case 106: { - result.hasField13 = input.ReadString(ref result.field13_); - break; - } - case 114: { - input.ReadStringArray(tag, field_name, result.field14_); - break; - } - case 120: { - result.hasField15 = input.ReadUInt64(ref result.field15_); - break; - } - case 130: { - result.hasField16 = input.ReadString(ref result.field16_); - break; - } - case 160: { - result.hasField20 = input.ReadInt32(ref result.field20_); - break; - } - case 178: { - input.ReadStringArray(tag, field_name, result.field22_); - break; - } - case 194: { - result.hasField24 = input.ReadString(ref result.field24_); - break; - } - case 213: { - result.hasField26 = input.ReadFloat(ref result.field26_); - break; - } - case 218: { - result.hasField27 = input.ReadString(ref result.field27_); - break; - } - case 224: { - result.hasField28 = input.ReadInt32(ref result.field28_); - break; - } - case 234: { - result.hasField29 = input.ReadString(ref result.field29_); - break; - } - case 250: { - global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2GroupedMessage.Builder subBuilder = global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2GroupedMessage.CreateBuilder(); - if (result.hasField31) { - subBuilder.MergeFrom(Field31); - } - input.ReadMessage(subBuilder, extensionRegistry); - Field31 = subBuilder.BuildPartial(); - break; - } - case 586: - case 584: { - input.ReadInt32Array(tag, field_name, result.field73_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasField11 { - get { return result.hasField11; } - } - public float Field11 { - get { return result.Field11; } - set { SetField11(value); } - } - public Builder SetField11(float value) { - PrepareBuilder(); - result.hasField11 = true; - result.field11_ = value; - return this; - } - public Builder ClearField11() { - PrepareBuilder(); - result.hasField11 = false; - result.field11_ = 0F; - return this; - } - - public bool HasField26 { - get { return result.hasField26; } - } - public float Field26 { - get { return result.Field26; } - set { SetField26(value); } - } - public Builder SetField26(float value) { - PrepareBuilder(); - result.hasField26 = true; - result.field26_ = value; - return this; - } - public Builder ClearField26() { - PrepareBuilder(); - result.hasField26 = false; - result.field26_ = 0F; - return this; - } - - public bool HasField12 { - get { return result.hasField12; } - } - public string Field12 { - get { return result.Field12; } - set { SetField12(value); } - } - public Builder SetField12(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField12 = true; - result.field12_ = value; - return this; - } - public Builder ClearField12() { - PrepareBuilder(); - result.hasField12 = false; - result.field12_ = ""; - return this; - } - - public bool HasField13 { - get { return result.hasField13; } - } - public string Field13 { - get { return result.Field13; } - set { SetField13(value); } - } - public Builder SetField13(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField13 = true; - result.field13_ = value; - return this; - } - public Builder ClearField13() { - PrepareBuilder(); - result.hasField13 = false; - result.field13_ = ""; - return this; - } - - public pbc::IPopsicleList Field14List { - get { return PrepareBuilder().field14_; } - } - public int Field14Count { - get { return result.Field14Count; } - } - public string GetField14(int index) { - return result.GetField14(index); - } - public Builder SetField14(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.field14_[index] = value; - return this; - } - public Builder AddField14(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.field14_.Add(value); - return this; - } - public Builder AddRangeField14(scg::IEnumerable values) { - PrepareBuilder(); - result.field14_.Add(values); - return this; - } - public Builder ClearField14() { - PrepareBuilder(); - result.field14_.Clear(); - return this; - } - - public bool HasField15 { - get { return result.hasField15; } - } - [global::System.CLSCompliant(false)] - public ulong Field15 { - get { return result.Field15; } - set { SetField15(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetField15(ulong value) { - PrepareBuilder(); - result.hasField15 = true; - result.field15_ = value; - return this; - } - public Builder ClearField15() { - PrepareBuilder(); - result.hasField15 = false; - result.field15_ = 0UL; - return this; - } - - public bool HasField5 { - get { return result.hasField5; } - } - public int Field5 { - get { return result.Field5; } - set { SetField5(value); } - } - public Builder SetField5(int value) { - PrepareBuilder(); - result.hasField5 = true; - result.field5_ = value; - return this; - } - public Builder ClearField5() { - PrepareBuilder(); - result.hasField5 = false; - result.field5_ = 0; - return this; - } - - public bool HasField27 { - get { return result.hasField27; } - } - public string Field27 { - get { return result.Field27; } - set { SetField27(value); } - } - public Builder SetField27(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField27 = true; - result.field27_ = value; - return this; - } - public Builder ClearField27() { - PrepareBuilder(); - result.hasField27 = false; - result.field27_ = ""; - return this; - } - - public bool HasField28 { - get { return result.hasField28; } - } - public int Field28 { - get { return result.Field28; } - set { SetField28(value); } - } - public Builder SetField28(int value) { - PrepareBuilder(); - result.hasField28 = true; - result.field28_ = value; - return this; - } - public Builder ClearField28() { - PrepareBuilder(); - result.hasField28 = false; - result.field28_ = 0; - return this; - } - - public bool HasField29 { - get { return result.hasField29; } - } - public string Field29 { - get { return result.Field29; } - set { SetField29(value); } - } - public Builder SetField29(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField29 = true; - result.field29_ = value; - return this; - } - public Builder ClearField29() { - PrepareBuilder(); - result.hasField29 = false; - result.field29_ = ""; - return this; - } - - public bool HasField16 { - get { return result.hasField16; } - } - public string Field16 { - get { return result.Field16; } - set { SetField16(value); } - } - public Builder SetField16(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField16 = true; - result.field16_ = value; - return this; - } - public Builder ClearField16() { - PrepareBuilder(); - result.hasField16 = false; - result.field16_ = ""; - return this; - } - - public pbc::IPopsicleList Field22List { - get { return PrepareBuilder().field22_; } - } - public int Field22Count { - get { return result.Field22Count; } - } - public string GetField22(int index) { - return result.GetField22(index); - } - public Builder SetField22(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.field22_[index] = value; - return this; - } - public Builder AddField22(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.field22_.Add(value); - return this; - } - public Builder AddRangeField22(scg::IEnumerable values) { - PrepareBuilder(); - result.field22_.Add(values); - return this; - } - public Builder ClearField22() { - PrepareBuilder(); - result.field22_.Clear(); - return this; - } - - public pbc::IPopsicleList Field73List { - get { return PrepareBuilder().field73_; } - } - public int Field73Count { - get { return result.Field73Count; } - } - public int GetField73(int index) { - return result.GetField73(index); - } - public Builder SetField73(int index, int value) { - PrepareBuilder(); - result.field73_[index] = value; - return this; - } - public Builder AddField73(int value) { - PrepareBuilder(); - result.field73_.Add(value); - return this; - } - public Builder AddRangeField73(scg::IEnumerable values) { - PrepareBuilder(); - result.field73_.Add(values); - return this; - } - public Builder ClearField73() { - PrepareBuilder(); - result.field73_.Clear(); - return this; - } - - public bool HasField20 { - get { return result.hasField20; } - } - public int Field20 { - get { return result.Field20; } - set { SetField20(value); } - } - public Builder SetField20(int value) { - PrepareBuilder(); - result.hasField20 = true; - result.field20_ = value; - return this; - } - public Builder ClearField20() { - PrepareBuilder(); - result.hasField20 = false; - result.field20_ = 0; - return this; - } - - public bool HasField24 { - get { return result.hasField24; } - } - public string Field24 { - get { return result.Field24; } - set { SetField24(value); } - } - public Builder SetField24(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField24 = true; - result.field24_ = value; - return this; - } - public Builder ClearField24() { - PrepareBuilder(); - result.hasField24 = false; - result.field24_ = ""; - return this; - } - - public bool HasField31 { - get { return result.hasField31; } - } - public global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2GroupedMessage Field31 { - get { return result.Field31; } - set { SetField31(value); } - } - public Builder SetField31(global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2GroupedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField31 = true; - result.field31_ = value; - return this; - } - public Builder SetField31(global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2GroupedMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasField31 = true; - result.field31_ = builderForValue.Build(); - return this; - } - public Builder MergeField31(global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2GroupedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasField31 && - result.field31_ != global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2GroupedMessage.DefaultInstance) { - result.field31_ = global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2GroupedMessage.CreateBuilder(result.field31_).MergeFrom(value).BuildPartial(); - } else { - result.field31_ = value; - } - result.hasField31 = true; - return this; - } - public Builder ClearField31() { - PrepareBuilder(); - result.hasField31 = false; - result.field31_ = null; - return this; - } - } - static Group1() { - object.ReferenceEquals(global::Google.ProtocolBuffers.ProtoBench.GoogleSpeedProtoFile.Descriptor, null); - } - } - - } - #endregion - - public const int Field1FieldNumber = 1; - private bool hasField1; - private string field1_ = ""; - public bool HasField1 { - get { return hasField1; } - } - public string Field1 { - get { return field1_; } - } - - public const int Field3FieldNumber = 3; - private bool hasField3; - private long field3_; - public bool HasField3 { - get { return hasField3; } - } - public long Field3 { - get { return field3_; } - } - - public const int Field4FieldNumber = 4; - private bool hasField4; - private long field4_; - public bool HasField4 { - get { return hasField4; } - } - public long Field4 { - get { return field4_; } - } - - public const int Field30FieldNumber = 30; - private bool hasField30; - private long field30_; - public bool HasField30 { - get { return hasField30; } - } - public long Field30 { - get { return field30_; } - } - - public const int Field75FieldNumber = 75; - private bool hasField75; - private bool field75_; - public bool HasField75 { - get { return hasField75; } - } - public bool Field75 { - get { return field75_; } - } - - public const int Field6FieldNumber = 6; - private bool hasField6; - private string field6_ = ""; - public bool HasField6 { - get { return hasField6; } - } - public string Field6 { - get { return field6_; } - } - - public const int Field2FieldNumber = 2; - private bool hasField2; - private pb::ByteString field2_ = pb::ByteString.Empty; - public bool HasField2 { - get { return hasField2; } - } - public pb::ByteString Field2 { - get { return field2_; } - } - - public const int Field21FieldNumber = 21; - private bool hasField21; - private int field21_; - public bool HasField21 { - get { return hasField21; } - } - public int Field21 { - get { return field21_; } - } - - public const int Field71FieldNumber = 71; - private bool hasField71; - private int field71_; - public bool HasField71 { - get { return hasField71; } - } - public int Field71 { - get { return field71_; } - } - - public const int Field25FieldNumber = 25; - private bool hasField25; - private float field25_; - public bool HasField25 { - get { return hasField25; } - } - public float Field25 { - get { return field25_; } - } - - public const int Field109FieldNumber = 109; - private bool hasField109; - private int field109_; - public bool HasField109 { - get { return hasField109; } - } - public int Field109 { - get { return field109_; } - } - - public const int Field210FieldNumber = 210; - private bool hasField210; - private int field210_; - public bool HasField210 { - get { return hasField210; } - } - public int Field210 { - get { return field210_; } - } - - public const int Field211FieldNumber = 211; - private bool hasField211; - private int field211_; - public bool HasField211 { - get { return hasField211; } - } - public int Field211 { - get { return field211_; } - } - - public const int Field212FieldNumber = 212; - private bool hasField212; - private int field212_; - public bool HasField212 { - get { return hasField212; } - } - public int Field212 { - get { return field212_; } - } - - public const int Field213FieldNumber = 213; - private bool hasField213; - private int field213_; - public bool HasField213 { - get { return hasField213; } - } - public int Field213 { - get { return field213_; } - } - - public const int Field216FieldNumber = 216; - private bool hasField216; - private int field216_; - public bool HasField216 { - get { return hasField216; } - } - public int Field216 { - get { return field216_; } - } - - public const int Field217FieldNumber = 217; - private bool hasField217; - private int field217_; - public bool HasField217 { - get { return hasField217; } - } - public int Field217 { - get { return field217_; } - } - - public const int Field218FieldNumber = 218; - private bool hasField218; - private int field218_; - public bool HasField218 { - get { return hasField218; } - } - public int Field218 { - get { return field218_; } - } - - public const int Field220FieldNumber = 220; - private bool hasField220; - private int field220_; - public bool HasField220 { - get { return hasField220; } - } - public int Field220 { - get { return field220_; } - } - - public const int Field221FieldNumber = 221; - private bool hasField221; - private int field221_; - public bool HasField221 { - get { return hasField221; } - } - public int Field221 { - get { return field221_; } - } - - public const int Field222FieldNumber = 222; - private bool hasField222; - private float field222_; - public bool HasField222 { - get { return hasField222; } - } - public float Field222 { - get { return field222_; } - } - - public const int Field63FieldNumber = 63; - private bool hasField63; - private int field63_; - public bool HasField63 { - get { return hasField63; } - } - public int Field63 { - get { return field63_; } - } - - public const int Group1FieldNumber = 10; - private pbc::PopsicleList group1_ = new pbc::PopsicleList(); - public scg::IList Group1List { - get { return group1_; } - } - public int Group1Count { - get { return group1_.Count; } - } - public global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2.Types.Group1 GetGroup1(int index) { - return group1_[index]; - } - - public const int Field128FieldNumber = 128; - private pbc::PopsicleList field128_ = new pbc::PopsicleList(); - public scg::IList Field128List { - get { return pbc::Lists.AsReadOnly(field128_); } - } - public int Field128Count { - get { return field128_.Count; } - } - public string GetField128(int index) { - return field128_[index]; - } - - public const int Field131FieldNumber = 131; - private bool hasField131; - private long field131_; - public bool HasField131 { - get { return hasField131; } - } - public long Field131 { - get { return field131_; } - } - - public const int Field127FieldNumber = 127; - private pbc::PopsicleList field127_ = new pbc::PopsicleList(); - public scg::IList Field127List { - get { return pbc::Lists.AsReadOnly(field127_); } - } - public int Field127Count { - get { return field127_.Count; } - } - public string GetField127(int index) { - return field127_[index]; - } - - public const int Field129FieldNumber = 129; - private bool hasField129; - private int field129_; - public bool HasField129 { - get { return hasField129; } - } - public int Field129 { - get { return field129_; } - } - - public const int Field130FieldNumber = 130; - private pbc::PopsicleList field130_ = new pbc::PopsicleList(); - public scg::IList Field130List { - get { return pbc::Lists.AsReadOnly(field130_); } - } - public int Field130Count { - get { return field130_.Count; } - } - public long GetField130(int index) { - return field130_[index]; - } - - public const int Field205FieldNumber = 205; - private bool hasField205; - private bool field205_; - public bool HasField205 { - get { return hasField205; } - } - public bool Field205 { - get { return field205_; } - } - - public const int Field206FieldNumber = 206; - private bool hasField206; - private bool field206_; - public bool HasField206 { - get { return hasField206; } - } - public bool Field206 { - get { return field206_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _speedMessage2FieldNames; - if (hasField1) { - output.WriteString(1, field_names[0], Field1); - } - if (hasField2) { - output.WriteBytes(2, field_names[7], Field2); - } - if (hasField3) { - output.WriteInt64(3, field_names[22], Field3); - } - if (hasField4) { - output.WriteInt64(4, field_names[24], Field4); - } - if (hasField6) { - output.WriteString(6, field_names[25], Field6); - } - if (group1_.Count > 0) { - output.WriteGroupArray(10, field_names[29], group1_); - } - if (hasField21) { - output.WriteInt32(21, field_names[10], Field21); - } - if (hasField25) { - output.WriteFloat(25, field_names[21], Field25); - } - if (hasField30) { - output.WriteInt64(30, field_names[23], Field30); - } - if (hasField63) { - output.WriteInt32(63, field_names[26], Field63); - } - if (hasField71) { - output.WriteInt32(71, field_names[27], Field71); - } - if (hasField75) { - output.WriteBool(75, field_names[28], Field75); - } - if (hasField109) { - output.WriteInt32(109, field_names[1], Field109); - } - if (field127_.Count > 0) { - output.WriteStringArray(127, field_names[2], field127_); - } - if (field128_.Count > 0) { - output.WriteStringArray(128, field_names[3], field128_); - } - if (hasField129) { - output.WriteInt32(129, field_names[4], Field129); - } - if (field130_.Count > 0) { - output.WriteInt64Array(130, field_names[5], field130_); - } - if (hasField131) { - output.WriteInt64(131, field_names[6], Field131); - } - if (hasField205) { - output.WriteBool(205, field_names[8], Field205); - } - if (hasField206) { - output.WriteBool(206, field_names[9], Field206); - } - if (hasField210) { - output.WriteInt32(210, field_names[11], Field210); - } - if (hasField211) { - output.WriteInt32(211, field_names[12], Field211); - } - if (hasField212) { - output.WriteInt32(212, field_names[13], Field212); - } - if (hasField213) { - output.WriteInt32(213, field_names[14], Field213); - } - if (hasField216) { - output.WriteInt32(216, field_names[15], Field216); - } - if (hasField217) { - output.WriteInt32(217, field_names[16], Field217); - } - if (hasField218) { - output.WriteInt32(218, field_names[17], Field218); - } - if (hasField220) { - output.WriteInt32(220, field_names[18], Field220); - } - if (hasField221) { - output.WriteInt32(221, field_names[19], Field221); - } - if (hasField222) { - output.WriteFloat(222, field_names[20], Field222); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasField1) { - size += pb::CodedOutputStream.ComputeStringSize(1, Field1); - } - if (hasField3) { - size += pb::CodedOutputStream.ComputeInt64Size(3, Field3); - } - if (hasField4) { - size += pb::CodedOutputStream.ComputeInt64Size(4, Field4); - } - if (hasField30) { - size += pb::CodedOutputStream.ComputeInt64Size(30, Field30); - } - if (hasField75) { - size += pb::CodedOutputStream.ComputeBoolSize(75, Field75); - } - if (hasField6) { - size += pb::CodedOutputStream.ComputeStringSize(6, Field6); - } - if (hasField2) { - size += pb::CodedOutputStream.ComputeBytesSize(2, Field2); - } - if (hasField21) { - size += pb::CodedOutputStream.ComputeInt32Size(21, Field21); - } - if (hasField71) { - size += pb::CodedOutputStream.ComputeInt32Size(71, Field71); - } - if (hasField25) { - size += pb::CodedOutputStream.ComputeFloatSize(25, Field25); - } - if (hasField109) { - size += pb::CodedOutputStream.ComputeInt32Size(109, Field109); - } - if (hasField210) { - size += pb::CodedOutputStream.ComputeInt32Size(210, Field210); - } - if (hasField211) { - size += pb::CodedOutputStream.ComputeInt32Size(211, Field211); - } - if (hasField212) { - size += pb::CodedOutputStream.ComputeInt32Size(212, Field212); - } - if (hasField213) { - size += pb::CodedOutputStream.ComputeInt32Size(213, Field213); - } - if (hasField216) { - size += pb::CodedOutputStream.ComputeInt32Size(216, Field216); - } - if (hasField217) { - size += pb::CodedOutputStream.ComputeInt32Size(217, Field217); - } - if (hasField218) { - size += pb::CodedOutputStream.ComputeInt32Size(218, Field218); - } - if (hasField220) { - size += pb::CodedOutputStream.ComputeInt32Size(220, Field220); - } - if (hasField221) { - size += pb::CodedOutputStream.ComputeInt32Size(221, Field221); - } - if (hasField222) { - size += pb::CodedOutputStream.ComputeFloatSize(222, Field222); - } - if (hasField63) { - size += pb::CodedOutputStream.ComputeInt32Size(63, Field63); - } - foreach (global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2.Types.Group1 element in Group1List) { - size += pb::CodedOutputStream.ComputeGroupSize(10, element); - } - { - int dataSize = 0; - foreach (string element in Field128List) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 2 * field128_.Count; - } - if (hasField131) { - size += pb::CodedOutputStream.ComputeInt64Size(131, Field131); - } - { - int dataSize = 0; - foreach (string element in Field127List) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 2 * field127_.Count; - } - if (hasField129) { - size += pb::CodedOutputStream.ComputeInt32Size(129, Field129); - } - { - int dataSize = 0; - foreach (long element in Field130List) { - dataSize += pb::CodedOutputStream.ComputeInt64SizeNoTag(element); - } - size += dataSize; - size += 2 * field130_.Count; - } - if (hasField205) { - size += pb::CodedOutputStream.ComputeBoolSize(205, Field205); - } - if (hasField206) { - size += pb::CodedOutputStream.ComputeBoolSize(206, Field206); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static SpeedMessage2 ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SpeedMessage2 ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SpeedMessage2 ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SpeedMessage2 ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SpeedMessage2 ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SpeedMessage2 ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SpeedMessage2 ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SpeedMessage2 ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SpeedMessage2 ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SpeedMessage2 ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private SpeedMessage2 MakeReadOnly() { - group1_.MakeReadOnly(); - field128_.MakeReadOnly(); - field127_.MakeReadOnly(); - field130_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SpeedMessage2 prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(SpeedMessage2 cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private SpeedMessage2 result; - - private SpeedMessage2 PrepareBuilder() { - if (resultIsReadOnly) { - SpeedMessage2 original = result; - result = new SpeedMessage2(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override SpeedMessage2 MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2.Descriptor; } - } - - public override SpeedMessage2 DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2.DefaultInstance; } - } - - public override SpeedMessage2 BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SpeedMessage2) { - return MergeFrom((SpeedMessage2) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SpeedMessage2 other) { - if (other == global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasField1) { - Field1 = other.Field1; - } - if (other.HasField3) { - Field3 = other.Field3; - } - if (other.HasField4) { - Field4 = other.Field4; - } - if (other.HasField30) { - Field30 = other.Field30; - } - if (other.HasField75) { - Field75 = other.Field75; - } - if (other.HasField6) { - Field6 = other.Field6; - } - if (other.HasField2) { - Field2 = other.Field2; - } - if (other.HasField21) { - Field21 = other.Field21; - } - if (other.HasField71) { - Field71 = other.Field71; - } - if (other.HasField25) { - Field25 = other.Field25; - } - if (other.HasField109) { - Field109 = other.Field109; - } - if (other.HasField210) { - Field210 = other.Field210; - } - if (other.HasField211) { - Field211 = other.Field211; - } - if (other.HasField212) { - Field212 = other.Field212; - } - if (other.HasField213) { - Field213 = other.Field213; - } - if (other.HasField216) { - Field216 = other.Field216; - } - if (other.HasField217) { - Field217 = other.Field217; - } - if (other.HasField218) { - Field218 = other.Field218; - } - if (other.HasField220) { - Field220 = other.Field220; - } - if (other.HasField221) { - Field221 = other.Field221; - } - if (other.HasField222) { - Field222 = other.Field222; - } - if (other.HasField63) { - Field63 = other.Field63; - } - if (other.group1_.Count != 0) { - result.group1_.Add(other.group1_); - } - if (other.field128_.Count != 0) { - result.field128_.Add(other.field128_); - } - if (other.HasField131) { - Field131 = other.Field131; - } - if (other.field127_.Count != 0) { - result.field127_.Add(other.field127_); - } - if (other.HasField129) { - Field129 = other.Field129; - } - if (other.field130_.Count != 0) { - result.field130_.Add(other.field130_); - } - if (other.HasField205) { - Field205 = other.Field205; - } - if (other.HasField206) { - Field206 = other.Field206; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_speedMessage2FieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _speedMessage2FieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasField1 = input.ReadString(ref result.field1_); - break; - } - case 18: { - result.hasField2 = input.ReadBytes(ref result.field2_); - break; - } - case 24: { - result.hasField3 = input.ReadInt64(ref result.field3_); - break; - } - case 32: { - result.hasField4 = input.ReadInt64(ref result.field4_); - break; - } - case 50: { - result.hasField6 = input.ReadString(ref result.field6_); - break; - } - case 83: { - input.ReadGroupArray(tag, field_name, result.group1_, global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2.Types.Group1.DefaultInstance, extensionRegistry); - break; - } - case 168: { - result.hasField21 = input.ReadInt32(ref result.field21_); - break; - } - case 205: { - result.hasField25 = input.ReadFloat(ref result.field25_); - break; - } - case 240: { - result.hasField30 = input.ReadInt64(ref result.field30_); - break; - } - case 504: { - result.hasField63 = input.ReadInt32(ref result.field63_); - break; - } - case 568: { - result.hasField71 = input.ReadInt32(ref result.field71_); - break; - } - case 600: { - result.hasField75 = input.ReadBool(ref result.field75_); - break; - } - case 872: { - result.hasField109 = input.ReadInt32(ref result.field109_); - break; - } - case 1018: { - input.ReadStringArray(tag, field_name, result.field127_); - break; - } - case 1026: { - input.ReadStringArray(tag, field_name, result.field128_); - break; - } - case 1032: { - result.hasField129 = input.ReadInt32(ref result.field129_); - break; - } - case 1042: - case 1040: { - input.ReadInt64Array(tag, field_name, result.field130_); - break; - } - case 1048: { - result.hasField131 = input.ReadInt64(ref result.field131_); - break; - } - case 1640: { - result.hasField205 = input.ReadBool(ref result.field205_); - break; - } - case 1648: { - result.hasField206 = input.ReadBool(ref result.field206_); - break; - } - case 1680: { - result.hasField210 = input.ReadInt32(ref result.field210_); - break; - } - case 1688: { - result.hasField211 = input.ReadInt32(ref result.field211_); - break; - } - case 1696: { - result.hasField212 = input.ReadInt32(ref result.field212_); - break; - } - case 1704: { - result.hasField213 = input.ReadInt32(ref result.field213_); - break; - } - case 1728: { - result.hasField216 = input.ReadInt32(ref result.field216_); - break; - } - case 1736: { - result.hasField217 = input.ReadInt32(ref result.field217_); - break; - } - case 1744: { - result.hasField218 = input.ReadInt32(ref result.field218_); - break; - } - case 1760: { - result.hasField220 = input.ReadInt32(ref result.field220_); - break; - } - case 1768: { - result.hasField221 = input.ReadInt32(ref result.field221_); - break; - } - case 1781: { - result.hasField222 = input.ReadFloat(ref result.field222_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasField1 { - get { return result.hasField1; } - } - public string Field1 { - get { return result.Field1; } - set { SetField1(value); } - } - public Builder SetField1(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField1 = true; - result.field1_ = value; - return this; - } - public Builder ClearField1() { - PrepareBuilder(); - result.hasField1 = false; - result.field1_ = ""; - return this; - } - - public bool HasField3 { - get { return result.hasField3; } - } - public long Field3 { - get { return result.Field3; } - set { SetField3(value); } - } - public Builder SetField3(long value) { - PrepareBuilder(); - result.hasField3 = true; - result.field3_ = value; - return this; - } - public Builder ClearField3() { - PrepareBuilder(); - result.hasField3 = false; - result.field3_ = 0L; - return this; - } - - public bool HasField4 { - get { return result.hasField4; } - } - public long Field4 { - get { return result.Field4; } - set { SetField4(value); } - } - public Builder SetField4(long value) { - PrepareBuilder(); - result.hasField4 = true; - result.field4_ = value; - return this; - } - public Builder ClearField4() { - PrepareBuilder(); - result.hasField4 = false; - result.field4_ = 0L; - return this; - } - - public bool HasField30 { - get { return result.hasField30; } - } - public long Field30 { - get { return result.Field30; } - set { SetField30(value); } - } - public Builder SetField30(long value) { - PrepareBuilder(); - result.hasField30 = true; - result.field30_ = value; - return this; - } - public Builder ClearField30() { - PrepareBuilder(); - result.hasField30 = false; - result.field30_ = 0L; - return this; - } - - public bool HasField75 { - get { return result.hasField75; } - } - public bool Field75 { - get { return result.Field75; } - set { SetField75(value); } - } - public Builder SetField75(bool value) { - PrepareBuilder(); - result.hasField75 = true; - result.field75_ = value; - return this; - } - public Builder ClearField75() { - PrepareBuilder(); - result.hasField75 = false; - result.field75_ = false; - return this; - } - - public bool HasField6 { - get { return result.hasField6; } - } - public string Field6 { - get { return result.Field6; } - set { SetField6(value); } - } - public Builder SetField6(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField6 = true; - result.field6_ = value; - return this; - } - public Builder ClearField6() { - PrepareBuilder(); - result.hasField6 = false; - result.field6_ = ""; - return this; - } - - public bool HasField2 { - get { return result.hasField2; } - } - public pb::ByteString Field2 { - get { return result.Field2; } - set { SetField2(value); } - } - public Builder SetField2(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField2 = true; - result.field2_ = value; - return this; - } - public Builder ClearField2() { - PrepareBuilder(); - result.hasField2 = false; - result.field2_ = pb::ByteString.Empty; - return this; - } - - public bool HasField21 { - get { return result.hasField21; } - } - public int Field21 { - get { return result.Field21; } - set { SetField21(value); } - } - public Builder SetField21(int value) { - PrepareBuilder(); - result.hasField21 = true; - result.field21_ = value; - return this; - } - public Builder ClearField21() { - PrepareBuilder(); - result.hasField21 = false; - result.field21_ = 0; - return this; - } - - public bool HasField71 { - get { return result.hasField71; } - } - public int Field71 { - get { return result.Field71; } - set { SetField71(value); } - } - public Builder SetField71(int value) { - PrepareBuilder(); - result.hasField71 = true; - result.field71_ = value; - return this; - } - public Builder ClearField71() { - PrepareBuilder(); - result.hasField71 = false; - result.field71_ = 0; - return this; - } - - public bool HasField25 { - get { return result.hasField25; } - } - public float Field25 { - get { return result.Field25; } - set { SetField25(value); } - } - public Builder SetField25(float value) { - PrepareBuilder(); - result.hasField25 = true; - result.field25_ = value; - return this; - } - public Builder ClearField25() { - PrepareBuilder(); - result.hasField25 = false; - result.field25_ = 0F; - return this; - } - - public bool HasField109 { - get { return result.hasField109; } - } - public int Field109 { - get { return result.Field109; } - set { SetField109(value); } - } - public Builder SetField109(int value) { - PrepareBuilder(); - result.hasField109 = true; - result.field109_ = value; - return this; - } - public Builder ClearField109() { - PrepareBuilder(); - result.hasField109 = false; - result.field109_ = 0; - return this; - } - - public bool HasField210 { - get { return result.hasField210; } - } - public int Field210 { - get { return result.Field210; } - set { SetField210(value); } - } - public Builder SetField210(int value) { - PrepareBuilder(); - result.hasField210 = true; - result.field210_ = value; - return this; - } - public Builder ClearField210() { - PrepareBuilder(); - result.hasField210 = false; - result.field210_ = 0; - return this; - } - - public bool HasField211 { - get { return result.hasField211; } - } - public int Field211 { - get { return result.Field211; } - set { SetField211(value); } - } - public Builder SetField211(int value) { - PrepareBuilder(); - result.hasField211 = true; - result.field211_ = value; - return this; - } - public Builder ClearField211() { - PrepareBuilder(); - result.hasField211 = false; - result.field211_ = 0; - return this; - } - - public bool HasField212 { - get { return result.hasField212; } - } - public int Field212 { - get { return result.Field212; } - set { SetField212(value); } - } - public Builder SetField212(int value) { - PrepareBuilder(); - result.hasField212 = true; - result.field212_ = value; - return this; - } - public Builder ClearField212() { - PrepareBuilder(); - result.hasField212 = false; - result.field212_ = 0; - return this; - } - - public bool HasField213 { - get { return result.hasField213; } - } - public int Field213 { - get { return result.Field213; } - set { SetField213(value); } - } - public Builder SetField213(int value) { - PrepareBuilder(); - result.hasField213 = true; - result.field213_ = value; - return this; - } - public Builder ClearField213() { - PrepareBuilder(); - result.hasField213 = false; - result.field213_ = 0; - return this; - } - - public bool HasField216 { - get { return result.hasField216; } - } - public int Field216 { - get { return result.Field216; } - set { SetField216(value); } - } - public Builder SetField216(int value) { - PrepareBuilder(); - result.hasField216 = true; - result.field216_ = value; - return this; - } - public Builder ClearField216() { - PrepareBuilder(); - result.hasField216 = false; - result.field216_ = 0; - return this; - } - - public bool HasField217 { - get { return result.hasField217; } - } - public int Field217 { - get { return result.Field217; } - set { SetField217(value); } - } - public Builder SetField217(int value) { - PrepareBuilder(); - result.hasField217 = true; - result.field217_ = value; - return this; - } - public Builder ClearField217() { - PrepareBuilder(); - result.hasField217 = false; - result.field217_ = 0; - return this; - } - - public bool HasField218 { - get { return result.hasField218; } - } - public int Field218 { - get { return result.Field218; } - set { SetField218(value); } - } - public Builder SetField218(int value) { - PrepareBuilder(); - result.hasField218 = true; - result.field218_ = value; - return this; - } - public Builder ClearField218() { - PrepareBuilder(); - result.hasField218 = false; - result.field218_ = 0; - return this; - } - - public bool HasField220 { - get { return result.hasField220; } - } - public int Field220 { - get { return result.Field220; } - set { SetField220(value); } - } - public Builder SetField220(int value) { - PrepareBuilder(); - result.hasField220 = true; - result.field220_ = value; - return this; - } - public Builder ClearField220() { - PrepareBuilder(); - result.hasField220 = false; - result.field220_ = 0; - return this; - } - - public bool HasField221 { - get { return result.hasField221; } - } - public int Field221 { - get { return result.Field221; } - set { SetField221(value); } - } - public Builder SetField221(int value) { - PrepareBuilder(); - result.hasField221 = true; - result.field221_ = value; - return this; - } - public Builder ClearField221() { - PrepareBuilder(); - result.hasField221 = false; - result.field221_ = 0; - return this; - } - - public bool HasField222 { - get { return result.hasField222; } - } - public float Field222 { - get { return result.Field222; } - set { SetField222(value); } - } - public Builder SetField222(float value) { - PrepareBuilder(); - result.hasField222 = true; - result.field222_ = value; - return this; - } - public Builder ClearField222() { - PrepareBuilder(); - result.hasField222 = false; - result.field222_ = 0F; - return this; - } - - public bool HasField63 { - get { return result.hasField63; } - } - public int Field63 { - get { return result.Field63; } - set { SetField63(value); } - } - public Builder SetField63(int value) { - PrepareBuilder(); - result.hasField63 = true; - result.field63_ = value; - return this; - } - public Builder ClearField63() { - PrepareBuilder(); - result.hasField63 = false; - result.field63_ = 0; - return this; - } - - public pbc::IPopsicleList Group1List { - get { return PrepareBuilder().group1_; } - } - public int Group1Count { - get { return result.Group1Count; } - } - public global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2.Types.Group1 GetGroup1(int index) { - return result.GetGroup1(index); - } - public Builder SetGroup1(int index, global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2.Types.Group1 value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.group1_[index] = value; - return this; - } - public Builder SetGroup1(int index, global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2.Types.Group1.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.group1_[index] = builderForValue.Build(); - return this; - } - public Builder AddGroup1(global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2.Types.Group1 value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.group1_.Add(value); - return this; - } - public Builder AddGroup1(global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2.Types.Group1.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.group1_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeGroup1(scg::IEnumerable values) { - PrepareBuilder(); - result.group1_.Add(values); - return this; - } - public Builder ClearGroup1() { - PrepareBuilder(); - result.group1_.Clear(); - return this; - } - - public pbc::IPopsicleList Field128List { - get { return PrepareBuilder().field128_; } - } - public int Field128Count { - get { return result.Field128Count; } - } - public string GetField128(int index) { - return result.GetField128(index); - } - public Builder SetField128(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.field128_[index] = value; - return this; - } - public Builder AddField128(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.field128_.Add(value); - return this; - } - public Builder AddRangeField128(scg::IEnumerable values) { - PrepareBuilder(); - result.field128_.Add(values); - return this; - } - public Builder ClearField128() { - PrepareBuilder(); - result.field128_.Clear(); - return this; - } - - public bool HasField131 { - get { return result.hasField131; } - } - public long Field131 { - get { return result.Field131; } - set { SetField131(value); } - } - public Builder SetField131(long value) { - PrepareBuilder(); - result.hasField131 = true; - result.field131_ = value; - return this; - } - public Builder ClearField131() { - PrepareBuilder(); - result.hasField131 = false; - result.field131_ = 0L; - return this; - } - - public pbc::IPopsicleList Field127List { - get { return PrepareBuilder().field127_; } - } - public int Field127Count { - get { return result.Field127Count; } - } - public string GetField127(int index) { - return result.GetField127(index); - } - public Builder SetField127(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.field127_[index] = value; - return this; - } - public Builder AddField127(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.field127_.Add(value); - return this; - } - public Builder AddRangeField127(scg::IEnumerable values) { - PrepareBuilder(); - result.field127_.Add(values); - return this; - } - public Builder ClearField127() { - PrepareBuilder(); - result.field127_.Clear(); - return this; - } - - public bool HasField129 { - get { return result.hasField129; } - } - public int Field129 { - get { return result.Field129; } - set { SetField129(value); } - } - public Builder SetField129(int value) { - PrepareBuilder(); - result.hasField129 = true; - result.field129_ = value; - return this; - } - public Builder ClearField129() { - PrepareBuilder(); - result.hasField129 = false; - result.field129_ = 0; - return this; - } - - public pbc::IPopsicleList Field130List { - get { return PrepareBuilder().field130_; } - } - public int Field130Count { - get { return result.Field130Count; } - } - public long GetField130(int index) { - return result.GetField130(index); - } - public Builder SetField130(int index, long value) { - PrepareBuilder(); - result.field130_[index] = value; - return this; - } - public Builder AddField130(long value) { - PrepareBuilder(); - result.field130_.Add(value); - return this; - } - public Builder AddRangeField130(scg::IEnumerable values) { - PrepareBuilder(); - result.field130_.Add(values); - return this; - } - public Builder ClearField130() { - PrepareBuilder(); - result.field130_.Clear(); - return this; - } - - public bool HasField205 { - get { return result.hasField205; } - } - public bool Field205 { - get { return result.Field205; } - set { SetField205(value); } - } - public Builder SetField205(bool value) { - PrepareBuilder(); - result.hasField205 = true; - result.field205_ = value; - return this; - } - public Builder ClearField205() { - PrepareBuilder(); - result.hasField205 = false; - result.field205_ = false; - return this; - } - - public bool HasField206 { - get { return result.hasField206; } - } - public bool Field206 { - get { return result.Field206; } - set { SetField206(value); } - } - public Builder SetField206(bool value) { - PrepareBuilder(); - result.hasField206 = true; - result.field206_ = value; - return this; - } - public Builder ClearField206() { - PrepareBuilder(); - result.hasField206 = false; - result.field206_ = false; - return this; - } - } - static SpeedMessage2() { - object.ReferenceEquals(global::Google.ProtocolBuffers.ProtoBench.GoogleSpeedProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class SpeedMessage2GroupedMessage : pb::GeneratedMessage { - private SpeedMessage2GroupedMessage() { } - private static readonly SpeedMessage2GroupedMessage defaultInstance = new SpeedMessage2GroupedMessage().MakeReadOnly(); - private static readonly string[] _speedMessage2GroupedMessageFieldNames = new string[] { "field1", "field10", "field11", "field2", "field3", "field4", "field5", "field6", "field7", "field8", "field9" }; - private static readonly uint[] _speedMessage2GroupedMessageFieldTags = new uint[] { 13, 85, 88, 21, 29, 32, 40, 48, 56, 69, 72 }; - public static SpeedMessage2GroupedMessage DefaultInstance { - get { return defaultInstance; } - } - - public override SpeedMessage2GroupedMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override SpeedMessage2GroupedMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.ProtoBench.GoogleSpeedProtoFile.internal__static_benchmarks_SpeedMessage2GroupedMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.ProtoBench.GoogleSpeedProtoFile.internal__static_benchmarks_SpeedMessage2GroupedMessage__FieldAccessorTable; } - } - - public const int Field1FieldNumber = 1; - private bool hasField1; - private float field1_; - public bool HasField1 { - get { return hasField1; } - } - public float Field1 { - get { return field1_; } - } - - public const int Field2FieldNumber = 2; - private bool hasField2; - private float field2_; - public bool HasField2 { - get { return hasField2; } - } - public float Field2 { - get { return field2_; } - } - - public const int Field3FieldNumber = 3; - private bool hasField3; - private float field3_; - public bool HasField3 { - get { return hasField3; } - } - public float Field3 { - get { return field3_; } - } - - public const int Field4FieldNumber = 4; - private bool hasField4; - private bool field4_; - public bool HasField4 { - get { return hasField4; } - } - public bool Field4 { - get { return field4_; } - } - - public const int Field5FieldNumber = 5; - private bool hasField5; - private bool field5_; - public bool HasField5 { - get { return hasField5; } - } - public bool Field5 { - get { return field5_; } - } - - public const int Field6FieldNumber = 6; - private bool hasField6; - private bool field6_ = true; - public bool HasField6 { - get { return hasField6; } - } - public bool Field6 { - get { return field6_; } - } - - public const int Field7FieldNumber = 7; - private bool hasField7; - private bool field7_; - public bool HasField7 { - get { return hasField7; } - } - public bool Field7 { - get { return field7_; } - } - - public const int Field8FieldNumber = 8; - private bool hasField8; - private float field8_; - public bool HasField8 { - get { return hasField8; } - } - public float Field8 { - get { return field8_; } - } - - public const int Field9FieldNumber = 9; - private bool hasField9; - private bool field9_; - public bool HasField9 { - get { return hasField9; } - } - public bool Field9 { - get { return field9_; } - } - - public const int Field10FieldNumber = 10; - private bool hasField10; - private float field10_; - public bool HasField10 { - get { return hasField10; } - } - public float Field10 { - get { return field10_; } - } - - public const int Field11FieldNumber = 11; - private bool hasField11; - private long field11_; - public bool HasField11 { - get { return hasField11; } - } - public long Field11 { - get { return field11_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _speedMessage2GroupedMessageFieldNames; - if (hasField1) { - output.WriteFloat(1, field_names[0], Field1); - } - if (hasField2) { - output.WriteFloat(2, field_names[3], Field2); - } - if (hasField3) { - output.WriteFloat(3, field_names[4], Field3); - } - if (hasField4) { - output.WriteBool(4, field_names[5], Field4); - } - if (hasField5) { - output.WriteBool(5, field_names[6], Field5); - } - if (hasField6) { - output.WriteBool(6, field_names[7], Field6); - } - if (hasField7) { - output.WriteBool(7, field_names[8], Field7); - } - if (hasField8) { - output.WriteFloat(8, field_names[9], Field8); - } - if (hasField9) { - output.WriteBool(9, field_names[10], Field9); - } - if (hasField10) { - output.WriteFloat(10, field_names[1], Field10); - } - if (hasField11) { - output.WriteInt64(11, field_names[2], Field11); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasField1) { - size += pb::CodedOutputStream.ComputeFloatSize(1, Field1); - } - if (hasField2) { - size += pb::CodedOutputStream.ComputeFloatSize(2, Field2); - } - if (hasField3) { - size += pb::CodedOutputStream.ComputeFloatSize(3, Field3); - } - if (hasField4) { - size += pb::CodedOutputStream.ComputeBoolSize(4, Field4); - } - if (hasField5) { - size += pb::CodedOutputStream.ComputeBoolSize(5, Field5); - } - if (hasField6) { - size += pb::CodedOutputStream.ComputeBoolSize(6, Field6); - } - if (hasField7) { - size += pb::CodedOutputStream.ComputeBoolSize(7, Field7); - } - if (hasField8) { - size += pb::CodedOutputStream.ComputeFloatSize(8, Field8); - } - if (hasField9) { - size += pb::CodedOutputStream.ComputeBoolSize(9, Field9); - } - if (hasField10) { - size += pb::CodedOutputStream.ComputeFloatSize(10, Field10); - } - if (hasField11) { - size += pb::CodedOutputStream.ComputeInt64Size(11, Field11); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static SpeedMessage2GroupedMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SpeedMessage2GroupedMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SpeedMessage2GroupedMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SpeedMessage2GroupedMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SpeedMessage2GroupedMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SpeedMessage2GroupedMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SpeedMessage2GroupedMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SpeedMessage2GroupedMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SpeedMessage2GroupedMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SpeedMessage2GroupedMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private SpeedMessage2GroupedMessage MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SpeedMessage2GroupedMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(SpeedMessage2GroupedMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private SpeedMessage2GroupedMessage result; - - private SpeedMessage2GroupedMessage PrepareBuilder() { - if (resultIsReadOnly) { - SpeedMessage2GroupedMessage original = result; - result = new SpeedMessage2GroupedMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override SpeedMessage2GroupedMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2GroupedMessage.Descriptor; } - } - - public override SpeedMessage2GroupedMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2GroupedMessage.DefaultInstance; } - } - - public override SpeedMessage2GroupedMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SpeedMessage2GroupedMessage) { - return MergeFrom((SpeedMessage2GroupedMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SpeedMessage2GroupedMessage other) { - if (other == global::Google.ProtocolBuffers.ProtoBench.SpeedMessage2GroupedMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasField1) { - Field1 = other.Field1; - } - if (other.HasField2) { - Field2 = other.Field2; - } - if (other.HasField3) { - Field3 = other.Field3; - } - if (other.HasField4) { - Field4 = other.Field4; - } - if (other.HasField5) { - Field5 = other.Field5; - } - if (other.HasField6) { - Field6 = other.Field6; - } - if (other.HasField7) { - Field7 = other.Field7; - } - if (other.HasField8) { - Field8 = other.Field8; - } - if (other.HasField9) { - Field9 = other.Field9; - } - if (other.HasField10) { - Field10 = other.Field10; - } - if (other.HasField11) { - Field11 = other.Field11; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_speedMessage2GroupedMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _speedMessage2GroupedMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 13: { - result.hasField1 = input.ReadFloat(ref result.field1_); - break; - } - case 21: { - result.hasField2 = input.ReadFloat(ref result.field2_); - break; - } - case 29: { - result.hasField3 = input.ReadFloat(ref result.field3_); - break; - } - case 32: { - result.hasField4 = input.ReadBool(ref result.field4_); - break; - } - case 40: { - result.hasField5 = input.ReadBool(ref result.field5_); - break; - } - case 48: { - result.hasField6 = input.ReadBool(ref result.field6_); - break; - } - case 56: { - result.hasField7 = input.ReadBool(ref result.field7_); - break; - } - case 69: { - result.hasField8 = input.ReadFloat(ref result.field8_); - break; - } - case 72: { - result.hasField9 = input.ReadBool(ref result.field9_); - break; - } - case 85: { - result.hasField10 = input.ReadFloat(ref result.field10_); - break; - } - case 88: { - result.hasField11 = input.ReadInt64(ref result.field11_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasField1 { - get { return result.hasField1; } - } - public float Field1 { - get { return result.Field1; } - set { SetField1(value); } - } - public Builder SetField1(float value) { - PrepareBuilder(); - result.hasField1 = true; - result.field1_ = value; - return this; - } - public Builder ClearField1() { - PrepareBuilder(); - result.hasField1 = false; - result.field1_ = 0F; - return this; - } - - public bool HasField2 { - get { return result.hasField2; } - } - public float Field2 { - get { return result.Field2; } - set { SetField2(value); } - } - public Builder SetField2(float value) { - PrepareBuilder(); - result.hasField2 = true; - result.field2_ = value; - return this; - } - public Builder ClearField2() { - PrepareBuilder(); - result.hasField2 = false; - result.field2_ = 0F; - return this; - } - - public bool HasField3 { - get { return result.hasField3; } - } - public float Field3 { - get { return result.Field3; } - set { SetField3(value); } - } - public Builder SetField3(float value) { - PrepareBuilder(); - result.hasField3 = true; - result.field3_ = value; - return this; - } - public Builder ClearField3() { - PrepareBuilder(); - result.hasField3 = false; - result.field3_ = 0F; - return this; - } - - public bool HasField4 { - get { return result.hasField4; } - } - public bool Field4 { - get { return result.Field4; } - set { SetField4(value); } - } - public Builder SetField4(bool value) { - PrepareBuilder(); - result.hasField4 = true; - result.field4_ = value; - return this; - } - public Builder ClearField4() { - PrepareBuilder(); - result.hasField4 = false; - result.field4_ = false; - return this; - } - - public bool HasField5 { - get { return result.hasField5; } - } - public bool Field5 { - get { return result.Field5; } - set { SetField5(value); } - } - public Builder SetField5(bool value) { - PrepareBuilder(); - result.hasField5 = true; - result.field5_ = value; - return this; - } - public Builder ClearField5() { - PrepareBuilder(); - result.hasField5 = false; - result.field5_ = false; - return this; - } - - public bool HasField6 { - get { return result.hasField6; } - } - public bool Field6 { - get { return result.Field6; } - set { SetField6(value); } - } - public Builder SetField6(bool value) { - PrepareBuilder(); - result.hasField6 = true; - result.field6_ = value; - return this; - } - public Builder ClearField6() { - PrepareBuilder(); - result.hasField6 = false; - result.field6_ = true; - return this; - } - - public bool HasField7 { - get { return result.hasField7; } - } - public bool Field7 { - get { return result.Field7; } - set { SetField7(value); } - } - public Builder SetField7(bool value) { - PrepareBuilder(); - result.hasField7 = true; - result.field7_ = value; - return this; - } - public Builder ClearField7() { - PrepareBuilder(); - result.hasField7 = false; - result.field7_ = false; - return this; - } - - public bool HasField8 { - get { return result.hasField8; } - } - public float Field8 { - get { return result.Field8; } - set { SetField8(value); } - } - public Builder SetField8(float value) { - PrepareBuilder(); - result.hasField8 = true; - result.field8_ = value; - return this; - } - public Builder ClearField8() { - PrepareBuilder(); - result.hasField8 = false; - result.field8_ = 0F; - return this; - } - - public bool HasField9 { - get { return result.hasField9; } - } - public bool Field9 { - get { return result.Field9; } - set { SetField9(value); } - } - public Builder SetField9(bool value) { - PrepareBuilder(); - result.hasField9 = true; - result.field9_ = value; - return this; - } - public Builder ClearField9() { - PrepareBuilder(); - result.hasField9 = false; - result.field9_ = false; - return this; - } - - public bool HasField10 { - get { return result.hasField10; } - } - public float Field10 { - get { return result.Field10; } - set { SetField10(value); } - } - public Builder SetField10(float value) { - PrepareBuilder(); - result.hasField10 = true; - result.field10_ = value; - return this; - } - public Builder ClearField10() { - PrepareBuilder(); - result.hasField10 = false; - result.field10_ = 0F; - return this; - } - - public bool HasField11 { - get { return result.hasField11; } - } - public long Field11 { - get { return result.Field11; } - set { SetField11(value); } - } - public Builder SetField11(long value) { - PrepareBuilder(); - result.hasField11 = true; - result.field11_ = value; - return this; - } - public Builder ClearField11() { - PrepareBuilder(); - result.hasField11 = false; - result.field11_ = 0L; - return this; - } - } - static SpeedMessage2GroupedMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.ProtoBench.GoogleSpeedProtoFile.Descriptor, null); - } - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/ProtoBench/TestProtos/UnitTestImportProtoFile.cs b/src/ProtoBench/TestProtos/UnitTestImportProtoFile.cs deleted file mode 100644 index 4cae2b8..0000000 --- a/src/ProtoBench/TestProtos/UnitTestImportProtoFile.cs +++ /dev/null @@ -1,346 +0,0 @@ -// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.TestProtos { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class UnitTestImportProtoFile { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_import_ImportMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static UnitTestImportProtoFile() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CiVnb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfaW1wb3J0LnByb3RvEhhwcm90", - "b2J1Zl91bml0dGVzdF9pbXBvcnQaJGdvb2dsZS9wcm90b2J1Zi9jc2hhcnBf", - "b3B0aW9ucy5wcm90byIaCg1JbXBvcnRNZXNzYWdlEgkKAWQYASABKAUqPAoK", - "SW1wb3J0RW51bRIOCgpJTVBPUlRfRk9PEAcSDgoKSU1QT1JUX0JBUhAIEg4K", - "CklNUE9SVF9CQVoQCUJbChhjb20uZ29vZ2xlLnByb3RvYnVmLnRlc3RIAcI+", - "PAohR29vZ2xlLlByb3RvY29sQnVmZmVycy5UZXN0UHJvdG9zEhdVbml0VGVz", - "dEltcG9ydFByb3RvRmlsZQ==")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_protobuf_unittest_import_ImportMessage__Descriptor = Descriptor.MessageTypes[0]; - internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_import_ImportMessage__Descriptor, - new string[] { "D", }); - pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); - RegisterAllExtensions(registry); - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.RegisterAllExtensions(registry); - return registry; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, - }, assigner); - } - #endregion - - } - #region Enums - public enum ImportEnum { - IMPORT_FOO = 7, - IMPORT_BAR = 8, - IMPORT_BAZ = 9, - } - - #endregion - - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class ImportMessage : pb::GeneratedMessage { - private ImportMessage() { } - private static readonly ImportMessage defaultInstance = new ImportMessage().MakeReadOnly(); - private static readonly string[] _importMessageFieldNames = new string[] { "d" }; - private static readonly uint[] _importMessageFieldTags = new uint[] { 8 }; - public static ImportMessage DefaultInstance { - get { return defaultInstance; } - } - - public override ImportMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override ImportMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestImportProtoFile.internal__static_protobuf_unittest_import_ImportMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestImportProtoFile.internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable; } - } - - public const int DFieldNumber = 1; - private bool hasD; - private int d_; - public bool HasD { - get { return hasD; } - } - public int D { - get { return d_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _importMessageFieldNames; - if (hasD) { - output.WriteInt32(1, field_names[0], D); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasD) { - size += pb::CodedOutputStream.ComputeInt32Size(1, D); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static ImportMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ImportMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ImportMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ImportMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ImportMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ImportMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ImportMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ImportMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ImportMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ImportMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private ImportMessage MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ImportMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(ImportMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private ImportMessage result; - - private ImportMessage PrepareBuilder() { - if (resultIsReadOnly) { - ImportMessage original = result; - result = new ImportMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override ImportMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.ImportMessage.Descriptor; } - } - - public override ImportMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.ImportMessage.DefaultInstance; } - } - - public override ImportMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ImportMessage) { - return MergeFrom((ImportMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ImportMessage other) { - if (other == global::Google.ProtocolBuffers.TestProtos.ImportMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasD) { - D = other.D; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_importMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _importMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasD = input.ReadInt32(ref result.d_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasD { - get { return result.hasD; } - } - public int D { - get { return result.D; } - set { SetD(value); } - } - public Builder SetD(int value) { - PrepareBuilder(); - result.hasD = true; - result.d_ = value; - return this; - } - public Builder ClearD() { - PrepareBuilder(); - result.hasD = false; - result.d_ = 0; - return this; - } - } - static ImportMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestImportProtoFile.Descriptor, null); - } - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/ProtoBench/TestProtos/UnitTestProtoFile.cs b/src/ProtoBench/TestProtos/UnitTestProtoFile.cs deleted file mode 100644 index dd31c67..0000000 --- a/src/ProtoBench/TestProtos/UnitTestProtoFile.cs +++ /dev/null @@ -1,21602 +0,0 @@ -// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.TestProtos { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class UnitTestProtoFile { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalInt32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalInt64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalUint32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalUint64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalSint32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalSint64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalFixed32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalFixed64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalSfixed32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalSfixed64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalFloatExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalDoubleExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalBoolExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalStringExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalBytesExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalGroupExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalNestedMessageExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalForeignMessageExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalImportMessageExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalNestedEnumExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalForeignEnumExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalImportEnumExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalStringPieceExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalCordExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedInt32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedInt64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedUint32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedUint64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedSint32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedSint64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedFixed32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedFixed64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedSfixed32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedSfixed64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedFloatExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedDoubleExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedBoolExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedStringExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedBytesExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedGroupExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedNestedMessageExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedForeignMessageExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedImportMessageExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedNestedEnumExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedForeignEnumExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedImportEnumExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedStringPieceExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedCordExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultInt32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultInt64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultUint32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultUint64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultSint32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultSint64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultFixed32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultFixed64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultSfixed32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultSfixed64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultFloatExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultDoubleExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultBoolExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultStringExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultBytesExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultNestedEnumExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultForeignEnumExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultImportEnumExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultStringPieceExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultCordExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.MyExtensionString); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.MyExtensionInt); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedInt32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedInt64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedUint32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedUint64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedSint32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedSint64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedFixed32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedFixed64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedSfixed32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedSfixed64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedFloatExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedDoubleExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedBoolExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedEnumExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.TestNestedExtension.Test); - registry.Add(global::Google.ProtocolBuffers.TestProtos.TestRequired.Single); - registry.Add(global::Google.ProtocolBuffers.TestProtos.TestRequired.Multi); - } - #endregion - #region Extensions - public const int OptionalInt32ExtensionFieldNumber = 1; - public static pb::GeneratedExtensionBase OptionalInt32Extension; - public const int OptionalInt64ExtensionFieldNumber = 2; - public static pb::GeneratedExtensionBase OptionalInt64Extension; - public const int OptionalUint32ExtensionFieldNumber = 3; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase OptionalUint32Extension; - public const int OptionalUint64ExtensionFieldNumber = 4; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase OptionalUint64Extension; - public const int OptionalSint32ExtensionFieldNumber = 5; - public static pb::GeneratedExtensionBase OptionalSint32Extension; - public const int OptionalSint64ExtensionFieldNumber = 6; - public static pb::GeneratedExtensionBase OptionalSint64Extension; - public const int OptionalFixed32ExtensionFieldNumber = 7; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase OptionalFixed32Extension; - public const int OptionalFixed64ExtensionFieldNumber = 8; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase OptionalFixed64Extension; - public const int OptionalSfixed32ExtensionFieldNumber = 9; - public static pb::GeneratedExtensionBase OptionalSfixed32Extension; - public const int OptionalSfixed64ExtensionFieldNumber = 10; - public static pb::GeneratedExtensionBase OptionalSfixed64Extension; - public const int OptionalFloatExtensionFieldNumber = 11; - public static pb::GeneratedExtensionBase OptionalFloatExtension; - public const int OptionalDoubleExtensionFieldNumber = 12; - public static pb::GeneratedExtensionBase OptionalDoubleExtension; - public const int OptionalBoolExtensionFieldNumber = 13; - public static pb::GeneratedExtensionBase OptionalBoolExtension; - public const int OptionalStringExtensionFieldNumber = 14; - public static pb::GeneratedExtensionBase OptionalStringExtension; - public const int OptionalBytesExtensionFieldNumber = 15; - public static pb::GeneratedExtensionBase OptionalBytesExtension; - public const int OptionalGroupExtensionFieldNumber = 16; - public static pb::GeneratedExtensionBase OptionalGroupExtension; - public const int OptionalNestedMessageExtensionFieldNumber = 18; - public static pb::GeneratedExtensionBase OptionalNestedMessageExtension; - public const int OptionalForeignMessageExtensionFieldNumber = 19; - public static pb::GeneratedExtensionBase OptionalForeignMessageExtension; - public const int OptionalImportMessageExtensionFieldNumber = 20; - public static pb::GeneratedExtensionBase OptionalImportMessageExtension; - public const int OptionalNestedEnumExtensionFieldNumber = 21; - public static pb::GeneratedExtensionBase OptionalNestedEnumExtension; - public const int OptionalForeignEnumExtensionFieldNumber = 22; - public static pb::GeneratedExtensionBase OptionalForeignEnumExtension; - public const int OptionalImportEnumExtensionFieldNumber = 23; - public static pb::GeneratedExtensionBase OptionalImportEnumExtension; - public const int OptionalStringPieceExtensionFieldNumber = 24; - public static pb::GeneratedExtensionBase OptionalStringPieceExtension; - public const int OptionalCordExtensionFieldNumber = 25; - public static pb::GeneratedExtensionBase OptionalCordExtension; - public const int RepeatedInt32ExtensionFieldNumber = 31; - public static pb::GeneratedExtensionBase> RepeatedInt32Extension; - public const int RepeatedInt64ExtensionFieldNumber = 32; - public static pb::GeneratedExtensionBase> RepeatedInt64Extension; - public const int RepeatedUint32ExtensionFieldNumber = 33; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase> RepeatedUint32Extension; - public const int RepeatedUint64ExtensionFieldNumber = 34; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase> RepeatedUint64Extension; - public const int RepeatedSint32ExtensionFieldNumber = 35; - public static pb::GeneratedExtensionBase> RepeatedSint32Extension; - public const int RepeatedSint64ExtensionFieldNumber = 36; - public static pb::GeneratedExtensionBase> RepeatedSint64Extension; - public const int RepeatedFixed32ExtensionFieldNumber = 37; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase> RepeatedFixed32Extension; - public const int RepeatedFixed64ExtensionFieldNumber = 38; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase> RepeatedFixed64Extension; - public const int RepeatedSfixed32ExtensionFieldNumber = 39; - public static pb::GeneratedExtensionBase> RepeatedSfixed32Extension; - public const int RepeatedSfixed64ExtensionFieldNumber = 40; - public static pb::GeneratedExtensionBase> RepeatedSfixed64Extension; - public const int RepeatedFloatExtensionFieldNumber = 41; - public static pb::GeneratedExtensionBase> RepeatedFloatExtension; - public const int RepeatedDoubleExtensionFieldNumber = 42; - public static pb::GeneratedExtensionBase> RepeatedDoubleExtension; - public const int RepeatedBoolExtensionFieldNumber = 43; - public static pb::GeneratedExtensionBase> RepeatedBoolExtension; - public const int RepeatedStringExtensionFieldNumber = 44; - public static pb::GeneratedExtensionBase> RepeatedStringExtension; - public const int RepeatedBytesExtensionFieldNumber = 45; - public static pb::GeneratedExtensionBase> RepeatedBytesExtension; - public const int RepeatedGroupExtensionFieldNumber = 46; - public static pb::GeneratedExtensionBase> RepeatedGroupExtension; - public const int RepeatedNestedMessageExtensionFieldNumber = 48; - public static pb::GeneratedExtensionBase> RepeatedNestedMessageExtension; - public const int RepeatedForeignMessageExtensionFieldNumber = 49; - public static pb::GeneratedExtensionBase> RepeatedForeignMessageExtension; - public const int RepeatedImportMessageExtensionFieldNumber = 50; - public static pb::GeneratedExtensionBase> RepeatedImportMessageExtension; - public const int RepeatedNestedEnumExtensionFieldNumber = 51; - public static pb::GeneratedExtensionBase> RepeatedNestedEnumExtension; - public const int RepeatedForeignEnumExtensionFieldNumber = 52; - public static pb::GeneratedExtensionBase> RepeatedForeignEnumExtension; - public const int RepeatedImportEnumExtensionFieldNumber = 53; - public static pb::GeneratedExtensionBase> RepeatedImportEnumExtension; - public const int RepeatedStringPieceExtensionFieldNumber = 54; - public static pb::GeneratedExtensionBase> RepeatedStringPieceExtension; - public const int RepeatedCordExtensionFieldNumber = 55; - public static pb::GeneratedExtensionBase> RepeatedCordExtension; - public const int DefaultInt32ExtensionFieldNumber = 61; - public static pb::GeneratedExtensionBase DefaultInt32Extension; - public const int DefaultInt64ExtensionFieldNumber = 62; - public static pb::GeneratedExtensionBase DefaultInt64Extension; - public const int DefaultUint32ExtensionFieldNumber = 63; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase DefaultUint32Extension; - public const int DefaultUint64ExtensionFieldNumber = 64; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase DefaultUint64Extension; - public const int DefaultSint32ExtensionFieldNumber = 65; - public static pb::GeneratedExtensionBase DefaultSint32Extension; - public const int DefaultSint64ExtensionFieldNumber = 66; - public static pb::GeneratedExtensionBase DefaultSint64Extension; - public const int DefaultFixed32ExtensionFieldNumber = 67; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase DefaultFixed32Extension; - public const int DefaultFixed64ExtensionFieldNumber = 68; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase DefaultFixed64Extension; - public const int DefaultSfixed32ExtensionFieldNumber = 69; - public static pb::GeneratedExtensionBase DefaultSfixed32Extension; - public const int DefaultSfixed64ExtensionFieldNumber = 70; - public static pb::GeneratedExtensionBase DefaultSfixed64Extension; - public const int DefaultFloatExtensionFieldNumber = 71; - public static pb::GeneratedExtensionBase DefaultFloatExtension; - public const int DefaultDoubleExtensionFieldNumber = 72; - public static pb::GeneratedExtensionBase DefaultDoubleExtension; - public const int DefaultBoolExtensionFieldNumber = 73; - public static pb::GeneratedExtensionBase DefaultBoolExtension; - public const int DefaultStringExtensionFieldNumber = 74; - public static pb::GeneratedExtensionBase DefaultStringExtension; - public const int DefaultBytesExtensionFieldNumber = 75; - public static pb::GeneratedExtensionBase DefaultBytesExtension; - public const int DefaultNestedEnumExtensionFieldNumber = 81; - public static pb::GeneratedExtensionBase DefaultNestedEnumExtension; - public const int DefaultForeignEnumExtensionFieldNumber = 82; - public static pb::GeneratedExtensionBase DefaultForeignEnumExtension; - public const int DefaultImportEnumExtensionFieldNumber = 83; - public static pb::GeneratedExtensionBase DefaultImportEnumExtension; - public const int DefaultStringPieceExtensionFieldNumber = 84; - public static pb::GeneratedExtensionBase DefaultStringPieceExtension; - public const int DefaultCordExtensionFieldNumber = 85; - public static pb::GeneratedExtensionBase DefaultCordExtension; - public const int MyExtensionStringFieldNumber = 50; - public static pb::GeneratedExtensionBase MyExtensionString; - public const int MyExtensionIntFieldNumber = 5; - public static pb::GeneratedExtensionBase MyExtensionInt; - public const int PackedInt32ExtensionFieldNumber = 90; - public static pb::GeneratedExtensionBase> PackedInt32Extension; - public const int PackedInt64ExtensionFieldNumber = 91; - public static pb::GeneratedExtensionBase> PackedInt64Extension; - public const int PackedUint32ExtensionFieldNumber = 92; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase> PackedUint32Extension; - public const int PackedUint64ExtensionFieldNumber = 93; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase> PackedUint64Extension; - public const int PackedSint32ExtensionFieldNumber = 94; - public static pb::GeneratedExtensionBase> PackedSint32Extension; - public const int PackedSint64ExtensionFieldNumber = 95; - public static pb::GeneratedExtensionBase> PackedSint64Extension; - public const int PackedFixed32ExtensionFieldNumber = 96; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase> PackedFixed32Extension; - public const int PackedFixed64ExtensionFieldNumber = 97; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase> PackedFixed64Extension; - public const int PackedSfixed32ExtensionFieldNumber = 98; - public static pb::GeneratedExtensionBase> PackedSfixed32Extension; - public const int PackedSfixed64ExtensionFieldNumber = 99; - public static pb::GeneratedExtensionBase> PackedSfixed64Extension; - public const int PackedFloatExtensionFieldNumber = 100; - public static pb::GeneratedExtensionBase> PackedFloatExtension; - public const int PackedDoubleExtensionFieldNumber = 101; - public static pb::GeneratedExtensionBase> PackedDoubleExtension; - public const int PackedBoolExtensionFieldNumber = 102; - public static pb::GeneratedExtensionBase> PackedBoolExtension; - public const int PackedEnumExtensionFieldNumber = 103; - public static pb::GeneratedExtensionBase> PackedEnumExtension; - #endregion - - #region Static variables - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestAllTypes__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestAllTypes__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestAllTypes_NestedMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestAllTypes_NestedMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestAllTypes_OptionalGroup__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestAllTypes_OptionalGroup__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestAllTypes_RepeatedGroup__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestAllTypes_RepeatedGroup__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestDeprecatedFields__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestDeprecatedFields__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_ForeignMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_ForeignMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestAllExtensions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestAllExtensions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_OptionalGroup_extension__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_OptionalGroup_extension__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_RepeatedGroup_extension__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_RepeatedGroup_extension__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestNestedExtension__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestNestedExtension__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestRequired__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestRequired__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestRequiredForeign__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestRequiredForeign__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestForeignNested__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestForeignNested__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestEmptyMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestEmptyMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestEmptyMessageWithExtensions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestEmptyMessageWithExtensions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestMultipleExtensionRanges__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMultipleExtensionRanges__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestReallyLargeTagNumber__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestReallyLargeTagNumber__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestRecursiveMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestRecursiveMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestMutualRecursionA__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMutualRecursionA__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestMutualRecursionB__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMutualRecursionB__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestDupFieldNumber__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestDupFieldNumber__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestDupFieldNumber_Foo__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestDupFieldNumber_Foo__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestDupFieldNumber_Bar__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestDupFieldNumber_Bar__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestNestedMessageHasBits__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestNestedMessageHasBits__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestNestedMessageHasBits_NestedMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestNestedMessageHasBits_NestedMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestCamelCaseFieldNames__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestCamelCaseFieldNames__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestFieldOrderings__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestFieldOrderings__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestExtremeDefaultValues__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestExtremeDefaultValues__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_SparseEnumMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_SparseEnumMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_OneString__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_OneString__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_OneBytes__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_OneBytes__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestPackedTypes__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestPackedTypes__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestUnpackedTypes__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestUnpackedTypes__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestPackedExtensions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestPackedExtensions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestDynamicExtensions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestDynamicExtensions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestDynamicExtensions_DynamicMessageType__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestDynamicExtensions_DynamicMessageType__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestRepeatedScalarDifferentTagSizes__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestRepeatedScalarDifferentTagSizes__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_FooRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_FooRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_FooResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_FooResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_BarRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_BarRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_BarResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_BarResponse__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static UnitTestProtoFile() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "Ch5nb29nbGUvcHJvdG9idWYvdW5pdHRlc3QucHJvdG8SEXByb3RvYnVmX3Vu", - "aXR0ZXN0GiRnb29nbGUvcHJvdG9idWYvY3NoYXJwX29wdGlvbnMucHJvdG8a", - "JWdvb2dsZS9wcm90b2J1Zi91bml0dGVzdF9pbXBvcnQucHJvdG8iuxUKDFRl", - "c3RBbGxUeXBlcxIWCg5vcHRpb25hbF9pbnQzMhgBIAEoBRIWCg5vcHRpb25h", - "bF9pbnQ2NBgCIAEoAxIXCg9vcHRpb25hbF91aW50MzIYAyABKA0SFwoPb3B0", - "aW9uYWxfdWludDY0GAQgASgEEhcKD29wdGlvbmFsX3NpbnQzMhgFIAEoERIX", - "Cg9vcHRpb25hbF9zaW50NjQYBiABKBISGAoQb3B0aW9uYWxfZml4ZWQzMhgH", - "IAEoBxIYChBvcHRpb25hbF9maXhlZDY0GAggASgGEhkKEW9wdGlvbmFsX3Nm", - "aXhlZDMyGAkgASgPEhkKEW9wdGlvbmFsX3NmaXhlZDY0GAogASgQEhYKDm9w", - "dGlvbmFsX2Zsb2F0GAsgASgCEhcKD29wdGlvbmFsX2RvdWJsZRgMIAEoARIV", - "Cg1vcHRpb25hbF9ib29sGA0gASgIEhcKD29wdGlvbmFsX3N0cmluZxgOIAEo", - "CRIWCg5vcHRpb25hbF9ieXRlcxgPIAEoDBJECg1vcHRpb25hbGdyb3VwGBAg", - "ASgKMi0ucHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbFR5cGVzLk9wdGlvbmFs", - "R3JvdXASTgoXb3B0aW9uYWxfbmVzdGVkX21lc3NhZ2UYEiABKAsyLS5wcm90", - "b2J1Zl91bml0dGVzdC5UZXN0QWxsVHlwZXMuTmVzdGVkTWVzc2FnZRJDChhv", - "cHRpb25hbF9mb3JlaWduX21lc3NhZ2UYEyABKAsyIS5wcm90b2J1Zl91bml0", - "dGVzdC5Gb3JlaWduTWVzc2FnZRJIChdvcHRpb25hbF9pbXBvcnRfbWVzc2Fn", - "ZRgUIAEoCzInLnByb3RvYnVmX3VuaXR0ZXN0X2ltcG9ydC5JbXBvcnRNZXNz", - "YWdlEkgKFG9wdGlvbmFsX25lc3RlZF9lbnVtGBUgASgOMioucHJvdG9idWZf", - "dW5pdHRlc3QuVGVzdEFsbFR5cGVzLk5lc3RlZEVudW0SPQoVb3B0aW9uYWxf", - "Zm9yZWlnbl9lbnVtGBYgASgOMh4ucHJvdG9idWZfdW5pdHRlc3QuRm9yZWln", - "bkVudW0SQgoUb3B0aW9uYWxfaW1wb3J0X2VudW0YFyABKA4yJC5wcm90b2J1", - "Zl91bml0dGVzdF9pbXBvcnQuSW1wb3J0RW51bRIhChVvcHRpb25hbF9zdHJp", - "bmdfcGllY2UYGCABKAlCAggCEhkKDW9wdGlvbmFsX2NvcmQYGSABKAlCAggB", - "EhYKDnJlcGVhdGVkX2ludDMyGB8gAygFEhYKDnJlcGVhdGVkX2ludDY0GCAg", - "AygDEhcKD3JlcGVhdGVkX3VpbnQzMhghIAMoDRIXCg9yZXBlYXRlZF91aW50", - "NjQYIiADKAQSFwoPcmVwZWF0ZWRfc2ludDMyGCMgAygREhcKD3JlcGVhdGVk", - "X3NpbnQ2NBgkIAMoEhIYChByZXBlYXRlZF9maXhlZDMyGCUgAygHEhgKEHJl", - "cGVhdGVkX2ZpeGVkNjQYJiADKAYSGQoRcmVwZWF0ZWRfc2ZpeGVkMzIYJyAD", - "KA8SGQoRcmVwZWF0ZWRfc2ZpeGVkNjQYKCADKBASFgoOcmVwZWF0ZWRfZmxv", - "YXQYKSADKAISFwoPcmVwZWF0ZWRfZG91YmxlGCogAygBEhUKDXJlcGVhdGVk", - "X2Jvb2wYKyADKAgSFwoPcmVwZWF0ZWRfc3RyaW5nGCwgAygJEhYKDnJlcGVh", - "dGVkX2J5dGVzGC0gAygMEkQKDXJlcGVhdGVkZ3JvdXAYLiADKAoyLS5wcm90", - "b2J1Zl91bml0dGVzdC5UZXN0QWxsVHlwZXMuUmVwZWF0ZWRHcm91cBJOChdy", - "ZXBlYXRlZF9uZXN0ZWRfbWVzc2FnZRgwIAMoCzItLnByb3RvYnVmX3VuaXR0", - "ZXN0LlRlc3RBbGxUeXBlcy5OZXN0ZWRNZXNzYWdlEkMKGHJlcGVhdGVkX2Zv", - "cmVpZ25fbWVzc2FnZRgxIAMoCzIhLnByb3RvYnVmX3VuaXR0ZXN0LkZvcmVp", - "Z25NZXNzYWdlEkgKF3JlcGVhdGVkX2ltcG9ydF9tZXNzYWdlGDIgAygLMicu", - "cHJvdG9idWZfdW5pdHRlc3RfaW1wb3J0LkltcG9ydE1lc3NhZ2USSAoUcmVw", - "ZWF0ZWRfbmVzdGVkX2VudW0YMyADKA4yKi5wcm90b2J1Zl91bml0dGVzdC5U", - "ZXN0QWxsVHlwZXMuTmVzdGVkRW51bRI9ChVyZXBlYXRlZF9mb3JlaWduX2Vu", - "dW0YNCADKA4yHi5wcm90b2J1Zl91bml0dGVzdC5Gb3JlaWduRW51bRJCChRy", - "ZXBlYXRlZF9pbXBvcnRfZW51bRg1IAMoDjIkLnByb3RvYnVmX3VuaXR0ZXN0", - "X2ltcG9ydC5JbXBvcnRFbnVtEiEKFXJlcGVhdGVkX3N0cmluZ19waWVjZRg2", - "IAMoCUICCAISGQoNcmVwZWF0ZWRfY29yZBg3IAMoCUICCAESGQoNZGVmYXVs", - "dF9pbnQzMhg9IAEoBToCNDESGQoNZGVmYXVsdF9pbnQ2NBg+IAEoAzoCNDIS", - "GgoOZGVmYXVsdF91aW50MzIYPyABKA06AjQzEhoKDmRlZmF1bHRfdWludDY0", - "GEAgASgEOgI0NBIbCg5kZWZhdWx0X3NpbnQzMhhBIAEoEToDLTQ1EhoKDmRl", - "ZmF1bHRfc2ludDY0GEIgASgSOgI0NhIbCg9kZWZhdWx0X2ZpeGVkMzIYQyAB", - "KAc6AjQ3EhsKD2RlZmF1bHRfZml4ZWQ2NBhEIAEoBjoCNDgSHAoQZGVmYXVs", - "dF9zZml4ZWQzMhhFIAEoDzoCNDkSHQoQZGVmYXVsdF9zZml4ZWQ2NBhGIAEo", - "EDoDLTUwEhsKDWRlZmF1bHRfZmxvYXQYRyABKAI6BDUxLjUSHQoOZGVmYXVs", - "dF9kb3VibGUYSCABKAE6BTUyMDAwEhoKDGRlZmF1bHRfYm9vbBhJIAEoCDoE", - "dHJ1ZRIdCg5kZWZhdWx0X3N0cmluZxhKIAEoCToFaGVsbG8SHAoNZGVmYXVs", - "dF9ieXRlcxhLIAEoDDoFd29ybGQSTAoTZGVmYXVsdF9uZXN0ZWRfZW51bRhR", - "IAEoDjIqLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RBbGxUeXBlcy5OZXN0ZWRF", - "bnVtOgNCQVISSQoUZGVmYXVsdF9mb3JlaWduX2VudW0YUiABKA4yHi5wcm90", - "b2J1Zl91bml0dGVzdC5Gb3JlaWduRW51bToLRk9SRUlHTl9CQVISTQoTZGVm", - "YXVsdF9pbXBvcnRfZW51bRhTIAEoDjIkLnByb3RvYnVmX3VuaXR0ZXN0X2lt", - "cG9ydC5JbXBvcnRFbnVtOgpJTVBPUlRfQkFSEiUKFGRlZmF1bHRfc3RyaW5n", - "X3BpZWNlGFQgASgJOgNhYmNCAggCEh0KDGRlZmF1bHRfY29yZBhVIAEoCToD", - "MTIzQgIIARobCg1OZXN0ZWRNZXNzYWdlEgoKAmJiGAEgASgFGhoKDU9wdGlv", - "bmFsR3JvdXASCQoBYRgRIAEoBRoaCg1SZXBlYXRlZEdyb3VwEgkKAWEYLyAB", - "KAUiJwoKTmVzdGVkRW51bRIHCgNGT08QARIHCgNCQVIQAhIHCgNCQVoQAyI0", - "ChRUZXN0RGVwcmVjYXRlZEZpZWxkcxIcChBkZXByZWNhdGVkX2ludDMyGAEg", - "ASgFQgIYASIbCg5Gb3JlaWduTWVzc2FnZRIJCgFjGAEgASgFIh0KEVRlc3RB", - "bGxFeHRlbnNpb25zKggIARCAgICAAiIkChdPcHRpb25hbEdyb3VwX2V4dGVu", - "c2lvbhIJCgFhGBEgASgFIiQKF1JlcGVhdGVkR3JvdXBfZXh0ZW5zaW9uEgkK", - "AWEYLyABKAUiUAoTVGVzdE5lc3RlZEV4dGVuc2lvbjI5CgR0ZXN0EiQucHJv", - "dG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMY6gcgASgJOgR0ZXN0", - "ItUFCgxUZXN0UmVxdWlyZWQSCQoBYRgBIAIoBRIOCgZkdW1teTIYAiABKAUS", - "CQoBYhgDIAIoBRIOCgZkdW1teTQYBCABKAUSDgoGZHVtbXk1GAUgASgFEg4K", - "BmR1bW15NhgGIAEoBRIOCgZkdW1teTcYByABKAUSDgoGZHVtbXk4GAggASgF", - "Eg4KBmR1bW15ORgJIAEoBRIPCgdkdW1teTEwGAogASgFEg8KB2R1bW15MTEY", - "CyABKAUSDwoHZHVtbXkxMhgMIAEoBRIPCgdkdW1teTEzGA0gASgFEg8KB2R1", - "bW15MTQYDiABKAUSDwoHZHVtbXkxNRgPIAEoBRIPCgdkdW1teTE2GBAgASgF", - "Eg8KB2R1bW15MTcYESABKAUSDwoHZHVtbXkxOBgSIAEoBRIPCgdkdW1teTE5", - "GBMgASgFEg8KB2R1bW15MjAYFCABKAUSDwoHZHVtbXkyMRgVIAEoBRIPCgdk", - "dW1teTIyGBYgASgFEg8KB2R1bW15MjMYFyABKAUSDwoHZHVtbXkyNBgYIAEo", - "BRIPCgdkdW1teTI1GBkgASgFEg8KB2R1bW15MjYYGiABKAUSDwoHZHVtbXky", - "NxgbIAEoBRIPCgdkdW1teTI4GBwgASgFEg8KB2R1bW15MjkYHSABKAUSDwoH", - "ZHVtbXkzMBgeIAEoBRIPCgdkdW1teTMxGB8gASgFEg8KB2R1bW15MzIYICAB", - "KAUSCQoBYxghIAIoBTJWCgZzaW5nbGUSJC5wcm90b2J1Zl91bml0dGVzdC5U", - "ZXN0QWxsRXh0ZW5zaW9ucxjoByABKAsyHy5wcm90b2J1Zl91bml0dGVzdC5U", - "ZXN0UmVxdWlyZWQyVQoFbXVsdGkSJC5wcm90b2J1Zl91bml0dGVzdC5UZXN0", - "QWxsRXh0ZW5zaW9ucxjpByADKAsyHy5wcm90b2J1Zl91bml0dGVzdC5UZXN0", - "UmVxdWlyZWQimgEKE1Rlc3RSZXF1aXJlZEZvcmVpZ24SOQoQb3B0aW9uYWxf", - "bWVzc2FnZRgBIAEoCzIfLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RSZXF1aXJl", - "ZBI5ChByZXBlYXRlZF9tZXNzYWdlGAIgAygLMh8ucHJvdG9idWZfdW5pdHRl", - "c3QuVGVzdFJlcXVpcmVkEg0KBWR1bW15GAMgASgFIloKEVRlc3RGb3JlaWdu", - "TmVzdGVkEkUKDmZvcmVpZ25fbmVzdGVkGAEgASgLMi0ucHJvdG9idWZfdW5p", - "dHRlc3QuVGVzdEFsbFR5cGVzLk5lc3RlZE1lc3NhZ2UiEgoQVGVzdEVtcHR5", - "TWVzc2FnZSIqCh5UZXN0RW1wdHlNZXNzYWdlV2l0aEV4dGVuc2lvbnMqCAgB", - "EICAgIACIjcKG1Rlc3RNdWx0aXBsZUV4dGVuc2lvblJhbmdlcyoECCoQKyoG", - "CK8gEJQhKgoIgIAEEICAgIACIjQKGFRlc3RSZWFsbHlMYXJnZVRhZ051bWJl", - "chIJCgFhGAEgASgFEg0KAmJiGP///38gASgFIlUKFFRlc3RSZWN1cnNpdmVN", - "ZXNzYWdlEjIKAWEYASABKAsyJy5wcm90b2J1Zl91bml0dGVzdC5UZXN0UmVj", - "dXJzaXZlTWVzc2FnZRIJCgFpGAIgASgFIksKFFRlc3RNdXR1YWxSZWN1cnNp", - "b25BEjMKAmJiGAEgASgLMicucHJvdG9idWZfdW5pdHRlc3QuVGVzdE11dHVh", - "bFJlY3Vyc2lvbkIiYgoUVGVzdE11dHVhbFJlY3Vyc2lvbkISMgoBYRgBIAEo", - "CzInLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RNdXR1YWxSZWN1cnNpb25BEhYK", - "Dm9wdGlvbmFsX2ludDMyGAIgASgFIrMBChJUZXN0RHVwRmllbGROdW1iZXIS", - "CQoBYRgBIAEoBRI2CgNmb28YAiABKAoyKS5wcm90b2J1Zl91bml0dGVzdC5U", - "ZXN0RHVwRmllbGROdW1iZXIuRm9vEjYKA2JhchgDIAEoCjIpLnByb3RvYnVm", - "X3VuaXR0ZXN0LlRlc3REdXBGaWVsZE51bWJlci5CYXIaEAoDRm9vEgkKAWEY", - "ASABKAUaEAoDQmFyEgkKAWEYASABKAUigAIKGFRlc3ROZXN0ZWRNZXNzYWdl", - "SGFzQml0cxJaChdvcHRpb25hbF9uZXN0ZWRfbWVzc2FnZRgBIAEoCzI5LnBy", - "b3RvYnVmX3VuaXR0ZXN0LlRlc3ROZXN0ZWRNZXNzYWdlSGFzQml0cy5OZXN0", - "ZWRNZXNzYWdlGocBCg1OZXN0ZWRNZXNzYWdlEiQKHG5lc3RlZG1lc3NhZ2Vf", - "cmVwZWF0ZWRfaW50MzIYASADKAUSUAolbmVzdGVkbWVzc2FnZV9yZXBlYXRl", - "ZF9mb3JlaWdubWVzc2FnZRgCIAMoCzIhLnByb3RvYnVmX3VuaXR0ZXN0LkZv", - "cmVpZ25NZXNzYWdlIuUDChdUZXN0Q2FtZWxDYXNlRmllbGROYW1lcxIWCg5Q", - "cmltaXRpdmVGaWVsZBgBIAEoBRITCgtTdHJpbmdGaWVsZBgCIAEoCRIxCglF", - "bnVtRmllbGQYAyABKA4yHi5wcm90b2J1Zl91bml0dGVzdC5Gb3JlaWduRW51", - "bRI3CgxNZXNzYWdlRmllbGQYBCABKAsyIS5wcm90b2J1Zl91bml0dGVzdC5G", - "b3JlaWduTWVzc2FnZRIcChBTdHJpbmdQaWVjZUZpZWxkGAUgASgJQgIIAhIV", - "CglDb3JkRmllbGQYBiABKAlCAggBEh4KFlJlcGVhdGVkUHJpbWl0aXZlRmll", - "bGQYByADKAUSGwoTUmVwZWF0ZWRTdHJpbmdGaWVsZBgIIAMoCRI5ChFSZXBl", - "YXRlZEVudW1GaWVsZBgJIAMoDjIeLnByb3RvYnVmX3VuaXR0ZXN0LkZvcmVp", - "Z25FbnVtEj8KFFJlcGVhdGVkTWVzc2FnZUZpZWxkGAogAygLMiEucHJvdG9i", - "dWZfdW5pdHRlc3QuRm9yZWlnbk1lc3NhZ2USJAoYUmVwZWF0ZWRTdHJpbmdQ", - "aWVjZUZpZWxkGAsgAygJQgIIAhIdChFSZXBlYXRlZENvcmRGaWVsZBgMIAMo", - "CUICCAEiVQoSVGVzdEZpZWxkT3JkZXJpbmdzEhEKCW15X3N0cmluZxgLIAEo", - "CRIOCgZteV9pbnQYASABKAMSEAoIbXlfZmxvYXQYZSABKAIqBAgCEAsqBAgM", - "EGUiowUKGFRlc3RFeHRyZW1lRGVmYXVsdFZhbHVlcxI/Cg1lc2NhcGVkX2J5", - "dGVzGAEgASgMOihcMDAwXDAwMVwwMDdcMDEwXDAxNFxuXHJcdFwwMTNcXFwn", - "XCJcMzc2EiAKDGxhcmdlX3VpbnQzMhgCIAEoDToKNDI5NDk2NzI5NRIqCgxs", - "YXJnZV91aW50NjQYAyABKAQ6FDE4NDQ2NzQ0MDczNzA5NTUxNjE1EiAKC3Nt", - "YWxsX2ludDMyGAQgASgFOgstMjE0NzQ4MzY0NxIpCgtzbWFsbF9pbnQ2NBgF", - "IAEoAzoULTkyMjMzNzIwMzY4NTQ3NzU4MDcSGAoLdXRmOF9zdHJpbmcYBiAB", - "KAk6A+GItBIVCgp6ZXJvX2Zsb2F0GAcgASgCOgEwEhQKCW9uZV9mbG9hdBgI", - "IAEoAjoBMRIYCgtzbWFsbF9mbG9hdBgJIAEoAjoDMS41Eh4KEm5lZ2F0aXZl", - "X29uZV9mbG9hdBgKIAEoAjoCLTESHAoObmVnYXRpdmVfZmxvYXQYCyABKAI6", - "BC0xLjUSGwoLbGFyZ2VfZmxvYXQYDCABKAI6BjJlKzAwOBIlChRzbWFsbF9u", - "ZWdhdGl2ZV9mbG9hdBgNIAEoAjoHLThlLTAyOBIXCgppbmZfZG91YmxlGA4g", - "ASgBOgNpbmYSHAoObmVnX2luZl9kb3VibGUYDyABKAE6BC1pbmYSFwoKbmFu", - "X2RvdWJsZRgQIAEoAToDbmFuEhYKCWluZl9mbG9hdBgRIAEoAjoDaW5mEhsK", - "DW5lZ19pbmZfZmxvYXQYEiABKAI6BC1pbmYSFgoJbmFuX2Zsb2F0GBMgASgC", - "OgNuYW4SKwoMY3BwX3RyaWdyYXBoGBQgASgJOhU/ID8gPz8gPz8gPz8/ID8/", - "LyA/Py0iSwoRU3BhcnNlRW51bU1lc3NhZ2USNgoLc3BhcnNlX2VudW0YASAB", - "KA4yIS5wcm90b2J1Zl91bml0dGVzdC5UZXN0U3BhcnNlRW51bSIZCglPbmVT", - "dHJpbmcSDAoEZGF0YRgBIAEoCSIYCghPbmVCeXRlcxIMCgRkYXRhGAEgASgM", - "IqoDCg9UZXN0UGFja2VkVHlwZXMSGAoMcGFja2VkX2ludDMyGFogAygFQgIQ", - "ARIYCgxwYWNrZWRfaW50NjQYWyADKANCAhABEhkKDXBhY2tlZF91aW50MzIY", - "XCADKA1CAhABEhkKDXBhY2tlZF91aW50NjQYXSADKARCAhABEhkKDXBhY2tl", - "ZF9zaW50MzIYXiADKBFCAhABEhkKDXBhY2tlZF9zaW50NjQYXyADKBJCAhAB", - "EhoKDnBhY2tlZF9maXhlZDMyGGAgAygHQgIQARIaCg5wYWNrZWRfZml4ZWQ2", - "NBhhIAMoBkICEAESGwoPcGFja2VkX3NmaXhlZDMyGGIgAygPQgIQARIbCg9w", - "YWNrZWRfc2ZpeGVkNjQYYyADKBBCAhABEhgKDHBhY2tlZF9mbG9hdBhkIAMo", - "AkICEAESGQoNcGFja2VkX2RvdWJsZRhlIAMoAUICEAESFwoLcGFja2VkX2Jv", - "b2wYZiADKAhCAhABEjcKC3BhY2tlZF9lbnVtGGcgAygOMh4ucHJvdG9idWZf", - "dW5pdHRlc3QuRm9yZWlnbkVudW1CAhABIsgDChFUZXN0VW5wYWNrZWRUeXBl", - "cxIaCg51bnBhY2tlZF9pbnQzMhhaIAMoBUICEAASGgoOdW5wYWNrZWRfaW50", - "NjQYWyADKANCAhAAEhsKD3VucGFja2VkX3VpbnQzMhhcIAMoDUICEAASGwoP", - "dW5wYWNrZWRfdWludDY0GF0gAygEQgIQABIbCg91bnBhY2tlZF9zaW50MzIY", - "XiADKBFCAhAAEhsKD3VucGFja2VkX3NpbnQ2NBhfIAMoEkICEAASHAoQdW5w", - "YWNrZWRfZml4ZWQzMhhgIAMoB0ICEAASHAoQdW5wYWNrZWRfZml4ZWQ2NBhh", - "IAMoBkICEAASHQoRdW5wYWNrZWRfc2ZpeGVkMzIYYiADKA9CAhAAEh0KEXVu", - "cGFja2VkX3NmaXhlZDY0GGMgAygQQgIQABIaCg51bnBhY2tlZF9mbG9hdBhk", - "IAMoAkICEAASGwoPdW5wYWNrZWRfZG91YmxlGGUgAygBQgIQABIZCg11bnBh", - "Y2tlZF9ib29sGGYgAygIQgIQABI5Cg11bnBhY2tlZF9lbnVtGGcgAygOMh4u", - "cHJvdG9idWZfdW5pdHRlc3QuRm9yZWlnbkVudW1CAhAAIiAKFFRlc3RQYWNr", - "ZWRFeHRlbnNpb25zKggIARCAgICAAiKZBAoVVGVzdER5bmFtaWNFeHRlbnNp", - "b25zEhkKEHNjYWxhcl9leHRlbnNpb24Y0A8gASgHEjcKDmVudW1fZXh0ZW5z", - "aW9uGNEPIAEoDjIeLnByb3RvYnVmX3VuaXR0ZXN0LkZvcmVpZ25FbnVtElkK", - "FmR5bmFtaWNfZW51bV9leHRlbnNpb24Y0g8gASgOMjgucHJvdG9idWZfdW5p", - "dHRlc3QuVGVzdER5bmFtaWNFeHRlbnNpb25zLkR5bmFtaWNFbnVtVHlwZRI9", - "ChFtZXNzYWdlX2V4dGVuc2lvbhjTDyABKAsyIS5wcm90b2J1Zl91bml0dGVz", - "dC5Gb3JlaWduTWVzc2FnZRJfChlkeW5hbWljX21lc3NhZ2VfZXh0ZW5zaW9u", - "GNQPIAEoCzI7LnByb3RvYnVmX3VuaXR0ZXN0LlRlc3REeW5hbWljRXh0ZW5z", - "aW9ucy5EeW5hbWljTWVzc2FnZVR5cGUSGwoScmVwZWF0ZWRfZXh0ZW5zaW9u", - "GNUPIAMoCRIdChBwYWNrZWRfZXh0ZW5zaW9uGNYPIAMoEUICEAEaLAoSRHlu", - "YW1pY01lc3NhZ2VUeXBlEhYKDWR5bmFtaWNfZmllbGQYtBAgASgFIkcKD0R5", - "bmFtaWNFbnVtVHlwZRIQCgtEWU5BTUlDX0ZPTxCYERIQCgtEWU5BTUlDX0JB", - "UhCZERIQCgtEWU5BTUlDX0JBWhCaESLAAQojVGVzdFJlcGVhdGVkU2NhbGFy", - "RGlmZmVyZW50VGFnU2l6ZXMSGAoQcmVwZWF0ZWRfZml4ZWQzMhgMIAMoBxIW", - "Cg5yZXBlYXRlZF9pbnQzMhgNIAMoBRIZChByZXBlYXRlZF9maXhlZDY0GP4P", - "IAMoBhIXCg5yZXBlYXRlZF9pbnQ2NBj/DyADKAMSGAoOcmVwZWF0ZWRfZmxv", - "YXQY/v8PIAMoAhIZCg9yZXBlYXRlZF91aW50NjQY//8PIAMoBCIMCgpGb29S", - "ZXF1ZXN0Ig0KC0Zvb1Jlc3BvbnNlIgwKCkJhclJlcXVlc3QiDQoLQmFyUmVz", - "cG9uc2UqQAoLRm9yZWlnbkVudW0SDwoLRk9SRUlHTl9GT08QBBIPCgtGT1JF", - "SUdOX0JBUhAFEg8KC0ZPUkVJR05fQkFaEAYqRwoUVGVzdEVudW1XaXRoRHVw", - "VmFsdWUSCAoERk9PMRABEggKBEJBUjEQAhIHCgNCQVoQAxIICgRGT08yEAES", - "CAoEQkFSMhACKokBCg5UZXN0U3BhcnNlRW51bRIMCghTUEFSU0VfQRB7Eg4K", - "CFNQQVJTRV9CEKbnAxIPCghTUEFSU0VfQxCysYAGEhUKCFNQQVJTRV9EEPH/", - "/////////wESFQoIU1BBUlNFX0UQtN78////////ARIMCghTUEFSU0VfRhAA", - "EgwKCFNQQVJTRV9HEAIymQEKC1Rlc3RTZXJ2aWNlEkQKA0ZvbxIdLnByb3Rv", - "YnVmX3VuaXR0ZXN0LkZvb1JlcXVlc3QaHi5wcm90b2J1Zl91bml0dGVzdC5G", - "b29SZXNwb25zZRJECgNCYXISHS5wcm90b2J1Zl91bml0dGVzdC5CYXJSZXF1", - "ZXN0Gh4ucHJvdG9idWZfdW5pdHRlc3QuQmFyUmVzcG9uc2U6RgoYb3B0aW9u", - "YWxfaW50MzJfZXh0ZW5zaW9uEiQucHJvdG9idWZfdW5pdHRlc3QuVGVzdEFs", - "bEV4dGVuc2lvbnMYASABKAU6RgoYb3B0aW9uYWxfaW50NjRfZXh0ZW5zaW9u", - "EiQucHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYAiABKAM6", - "RwoZb3B0aW9uYWxfdWludDMyX2V4dGVuc2lvbhIkLnByb3RvYnVmX3VuaXR0", - "ZXN0LlRlc3RBbGxFeHRlbnNpb25zGAMgASgNOkcKGW9wdGlvbmFsX3VpbnQ2", - "NF9leHRlbnNpb24SJC5wcm90b2J1Zl91bml0dGVzdC5UZXN0QWxsRXh0ZW5z", - "aW9ucxgEIAEoBDpHChlvcHRpb25hbF9zaW50MzJfZXh0ZW5zaW9uEiQucHJv", - "dG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYBSABKBE6RwoZb3B0", - "aW9uYWxfc2ludDY0X2V4dGVuc2lvbhIkLnByb3RvYnVmX3VuaXR0ZXN0LlRl", - "c3RBbGxFeHRlbnNpb25zGAYgASgSOkgKGm9wdGlvbmFsX2ZpeGVkMzJfZXh0", - "ZW5zaW9uEiQucHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMY", - "ByABKAc6SAoab3B0aW9uYWxfZml4ZWQ2NF9leHRlbnNpb24SJC5wcm90b2J1", - "Zl91bml0dGVzdC5UZXN0QWxsRXh0ZW5zaW9ucxgIIAEoBjpJChtvcHRpb25h", - "bF9zZml4ZWQzMl9leHRlbnNpb24SJC5wcm90b2J1Zl91bml0dGVzdC5UZXN0", - "QWxsRXh0ZW5zaW9ucxgJIAEoDzpJChtvcHRpb25hbF9zZml4ZWQ2NF9leHRl", - "bnNpb24SJC5wcm90b2J1Zl91bml0dGVzdC5UZXN0QWxsRXh0ZW5zaW9ucxgK", - "IAEoEDpGChhvcHRpb25hbF9mbG9hdF9leHRlbnNpb24SJC5wcm90b2J1Zl91", - "bml0dGVzdC5UZXN0QWxsRXh0ZW5zaW9ucxgLIAEoAjpHChlvcHRpb25hbF9k", - "b3VibGVfZXh0ZW5zaW9uEiQucHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4", - "dGVuc2lvbnMYDCABKAE6RQoXb3B0aW9uYWxfYm9vbF9leHRlbnNpb24SJC5w", - "cm90b2J1Zl91bml0dGVzdC5UZXN0QWxsRXh0ZW5zaW9ucxgNIAEoCDpHChlv", - "cHRpb25hbF9zdHJpbmdfZXh0ZW5zaW9uEiQucHJvdG9idWZfdW5pdHRlc3Qu", - "VGVzdEFsbEV4dGVuc2lvbnMYDiABKAk6RgoYb3B0aW9uYWxfYnl0ZXNfZXh0", - "ZW5zaW9uEiQucHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMY", - "DyABKAw6cQoXb3B0aW9uYWxncm91cF9leHRlbnNpb24SJC5wcm90b2J1Zl91", - "bml0dGVzdC5UZXN0QWxsRXh0ZW5zaW9ucxgQIAEoCjIqLnByb3RvYnVmX3Vu", - "aXR0ZXN0Lk9wdGlvbmFsR3JvdXBfZXh0ZW5zaW9uOn4KIW9wdGlvbmFsX25l", - "c3RlZF9tZXNzYWdlX2V4dGVuc2lvbhIkLnByb3RvYnVmX3VuaXR0ZXN0LlRl", - "c3RBbGxFeHRlbnNpb25zGBIgASgLMi0ucHJvdG9idWZfdW5pdHRlc3QuVGVz", - "dEFsbFR5cGVzLk5lc3RlZE1lc3NhZ2U6cwoib3B0aW9uYWxfZm9yZWlnbl9t", - "ZXNzYWdlX2V4dGVuc2lvbhIkLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RBbGxF", - "eHRlbnNpb25zGBMgASgLMiEucHJvdG9idWZfdW5pdHRlc3QuRm9yZWlnbk1l", - "c3NhZ2U6eAohb3B0aW9uYWxfaW1wb3J0X21lc3NhZ2VfZXh0ZW5zaW9uEiQu", - "cHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYFCABKAsyJy5w", - "cm90b2J1Zl91bml0dGVzdF9pbXBvcnQuSW1wb3J0TWVzc2FnZTp4Ch5vcHRp", - "b25hbF9uZXN0ZWRfZW51bV9leHRlbnNpb24SJC5wcm90b2J1Zl91bml0dGVz", - "dC5UZXN0QWxsRXh0ZW5zaW9ucxgVIAEoDjIqLnByb3RvYnVmX3VuaXR0ZXN0", - "LlRlc3RBbGxUeXBlcy5OZXN0ZWRFbnVtOm0KH29wdGlvbmFsX2ZvcmVpZ25f", - "ZW51bV9leHRlbnNpb24SJC5wcm90b2J1Zl91bml0dGVzdC5UZXN0QWxsRXh0", - "ZW5zaW9ucxgWIAEoDjIeLnByb3RvYnVmX3VuaXR0ZXN0LkZvcmVpZ25FbnVt", - "OnIKHm9wdGlvbmFsX2ltcG9ydF9lbnVtX2V4dGVuc2lvbhIkLnByb3RvYnVm", - "X3VuaXR0ZXN0LlRlc3RBbGxFeHRlbnNpb25zGBcgASgOMiQucHJvdG9idWZf", - "dW5pdHRlc3RfaW1wb3J0LkltcG9ydEVudW06UQofb3B0aW9uYWxfc3RyaW5n", - "X3BpZWNlX2V4dGVuc2lvbhIkLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RBbGxF", - "eHRlbnNpb25zGBggASgJQgIIAjpJChdvcHRpb25hbF9jb3JkX2V4dGVuc2lv", - "bhIkLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RBbGxFeHRlbnNpb25zGBkgASgJ", - "QgIIATpGChhyZXBlYXRlZF9pbnQzMl9leHRlbnNpb24SJC5wcm90b2J1Zl91", - "bml0dGVzdC5UZXN0QWxsRXh0ZW5zaW9ucxgfIAMoBTpGChhyZXBlYXRlZF9p", - "bnQ2NF9leHRlbnNpb24SJC5wcm90b2J1Zl91bml0dGVzdC5UZXN0QWxsRXh0", - "ZW5zaW9ucxggIAMoAzpHChlyZXBlYXRlZF91aW50MzJfZXh0ZW5zaW9uEiQu", - "cHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYISADKA06RwoZ", - "cmVwZWF0ZWRfdWludDY0X2V4dGVuc2lvbhIkLnByb3RvYnVmX3VuaXR0ZXN0", - "LlRlc3RBbGxFeHRlbnNpb25zGCIgAygEOkcKGXJlcGVhdGVkX3NpbnQzMl9l", - "eHRlbnNpb24SJC5wcm90b2J1Zl91bml0dGVzdC5UZXN0QWxsRXh0ZW5zaW9u", - "cxgjIAMoETpHChlyZXBlYXRlZF9zaW50NjRfZXh0ZW5zaW9uEiQucHJvdG9i", - "dWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYJCADKBI6SAoacmVwZWF0", - "ZWRfZml4ZWQzMl9leHRlbnNpb24SJC5wcm90b2J1Zl91bml0dGVzdC5UZXN0", - "QWxsRXh0ZW5zaW9ucxglIAMoBzpIChpyZXBlYXRlZF9maXhlZDY0X2V4dGVu", - "c2lvbhIkLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RBbGxFeHRlbnNpb25zGCYg", - "AygGOkkKG3JlcGVhdGVkX3NmaXhlZDMyX2V4dGVuc2lvbhIkLnByb3RvYnVm", - "X3VuaXR0ZXN0LlRlc3RBbGxFeHRlbnNpb25zGCcgAygPOkkKG3JlcGVhdGVk", - "X3NmaXhlZDY0X2V4dGVuc2lvbhIkLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RB", - "bGxFeHRlbnNpb25zGCggAygQOkYKGHJlcGVhdGVkX2Zsb2F0X2V4dGVuc2lv", - "bhIkLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RBbGxFeHRlbnNpb25zGCkgAygC", - "OkcKGXJlcGVhdGVkX2RvdWJsZV9leHRlbnNpb24SJC5wcm90b2J1Zl91bml0", - "dGVzdC5UZXN0QWxsRXh0ZW5zaW9ucxgqIAMoATpFChdyZXBlYXRlZF9ib29s", - "X2V4dGVuc2lvbhIkLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RBbGxFeHRlbnNp", - "b25zGCsgAygIOkcKGXJlcGVhdGVkX3N0cmluZ19leHRlbnNpb24SJC5wcm90", - "b2J1Zl91bml0dGVzdC5UZXN0QWxsRXh0ZW5zaW9ucxgsIAMoCTpGChhyZXBl", - "YXRlZF9ieXRlc19leHRlbnNpb24SJC5wcm90b2J1Zl91bml0dGVzdC5UZXN0", - "QWxsRXh0ZW5zaW9ucxgtIAMoDDpxChdyZXBlYXRlZGdyb3VwX2V4dGVuc2lv", - "bhIkLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RBbGxFeHRlbnNpb25zGC4gAygK", - "MioucHJvdG9idWZfdW5pdHRlc3QuUmVwZWF0ZWRHcm91cF9leHRlbnNpb246", - "fgohcmVwZWF0ZWRfbmVzdGVkX21lc3NhZ2VfZXh0ZW5zaW9uEiQucHJvdG9i", - "dWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYMCADKAsyLS5wcm90b2J1", - "Zl91bml0dGVzdC5UZXN0QWxsVHlwZXMuTmVzdGVkTWVzc2FnZTpzCiJyZXBl", - "YXRlZF9mb3JlaWduX21lc3NhZ2VfZXh0ZW5zaW9uEiQucHJvdG9idWZfdW5p", - "dHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYMSADKAsyIS5wcm90b2J1Zl91bml0", - "dGVzdC5Gb3JlaWduTWVzc2FnZTp4CiFyZXBlYXRlZF9pbXBvcnRfbWVzc2Fn", - "ZV9leHRlbnNpb24SJC5wcm90b2J1Zl91bml0dGVzdC5UZXN0QWxsRXh0ZW5z", - "aW9ucxgyIAMoCzInLnByb3RvYnVmX3VuaXR0ZXN0X2ltcG9ydC5JbXBvcnRN", - "ZXNzYWdlOngKHnJlcGVhdGVkX25lc3RlZF9lbnVtX2V4dGVuc2lvbhIkLnBy", - "b3RvYnVmX3VuaXR0ZXN0LlRlc3RBbGxFeHRlbnNpb25zGDMgAygOMioucHJv", - "dG9idWZfdW5pdHRlc3QuVGVzdEFsbFR5cGVzLk5lc3RlZEVudW06bQofcmVw", - "ZWF0ZWRfZm9yZWlnbl9lbnVtX2V4dGVuc2lvbhIkLnByb3RvYnVmX3VuaXR0", - "ZXN0LlRlc3RBbGxFeHRlbnNpb25zGDQgAygOMh4ucHJvdG9idWZfdW5pdHRl", - "c3QuRm9yZWlnbkVudW06cgoecmVwZWF0ZWRfaW1wb3J0X2VudW1fZXh0ZW5z", - "aW9uEiQucHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYNSAD", - "KA4yJC5wcm90b2J1Zl91bml0dGVzdF9pbXBvcnQuSW1wb3J0RW51bTpRCh9y", - "ZXBlYXRlZF9zdHJpbmdfcGllY2VfZXh0ZW5zaW9uEiQucHJvdG9idWZfdW5p", - "dHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYNiADKAlCAggCOkkKF3JlcGVhdGVk", - "X2NvcmRfZXh0ZW5zaW9uEiQucHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4", - "dGVuc2lvbnMYNyADKAlCAggBOkkKF2RlZmF1bHRfaW50MzJfZXh0ZW5zaW9u", - "EiQucHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYPSABKAU6", - "AjQxOkkKF2RlZmF1bHRfaW50NjRfZXh0ZW5zaW9uEiQucHJvdG9idWZfdW5p", - "dHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYPiABKAM6AjQyOkoKGGRlZmF1bHRf", - "dWludDMyX2V4dGVuc2lvbhIkLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RBbGxF", - "eHRlbnNpb25zGD8gASgNOgI0MzpKChhkZWZhdWx0X3VpbnQ2NF9leHRlbnNp", - "b24SJC5wcm90b2J1Zl91bml0dGVzdC5UZXN0QWxsRXh0ZW5zaW9ucxhAIAEo", - "BDoCNDQ6SwoYZGVmYXVsdF9zaW50MzJfZXh0ZW5zaW9uEiQucHJvdG9idWZf", - "dW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYQSABKBE6Ay00NTpKChhkZWZh", - "dWx0X3NpbnQ2NF9leHRlbnNpb24SJC5wcm90b2J1Zl91bml0dGVzdC5UZXN0", - "QWxsRXh0ZW5zaW9ucxhCIAEoEjoCNDY6SwoZZGVmYXVsdF9maXhlZDMyX2V4", - "dGVuc2lvbhIkLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RBbGxFeHRlbnNpb25z", - "GEMgASgHOgI0NzpLChlkZWZhdWx0X2ZpeGVkNjRfZXh0ZW5zaW9uEiQucHJv", - "dG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYRCABKAY6AjQ4OkwK", - "GmRlZmF1bHRfc2ZpeGVkMzJfZXh0ZW5zaW9uEiQucHJvdG9idWZfdW5pdHRl", - "c3QuVGVzdEFsbEV4dGVuc2lvbnMYRSABKA86AjQ5Ok0KGmRlZmF1bHRfc2Zp", - "eGVkNjRfZXh0ZW5zaW9uEiQucHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4", - "dGVuc2lvbnMYRiABKBA6Ay01MDpLChdkZWZhdWx0X2Zsb2F0X2V4dGVuc2lv", - "bhIkLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RBbGxFeHRlbnNpb25zGEcgASgC", - "OgQ1MS41Ok0KGGRlZmF1bHRfZG91YmxlX2V4dGVuc2lvbhIkLnByb3RvYnVm", - "X3VuaXR0ZXN0LlRlc3RBbGxFeHRlbnNpb25zGEggASgBOgU1MjAwMDpKChZk", - "ZWZhdWx0X2Jvb2xfZXh0ZW5zaW9uEiQucHJvdG9idWZfdW5pdHRlc3QuVGVz", - "dEFsbEV4dGVuc2lvbnMYSSABKAg6BHRydWU6TQoYZGVmYXVsdF9zdHJpbmdf", - "ZXh0ZW5zaW9uEiQucHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lv", - "bnMYSiABKAk6BWhlbGxvOkwKF2RlZmF1bHRfYnl0ZXNfZXh0ZW5zaW9uEiQu", - "cHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYSyABKAw6BXdv", - "cmxkOnwKHWRlZmF1bHRfbmVzdGVkX2VudW1fZXh0ZW5zaW9uEiQucHJvdG9i", - "dWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYUSABKA4yKi5wcm90b2J1", - "Zl91bml0dGVzdC5UZXN0QWxsVHlwZXMuTmVzdGVkRW51bToDQkFSOnkKHmRl", - "ZmF1bHRfZm9yZWlnbl9lbnVtX2V4dGVuc2lvbhIkLnByb3RvYnVmX3VuaXR0", - "ZXN0LlRlc3RBbGxFeHRlbnNpb25zGFIgASgOMh4ucHJvdG9idWZfdW5pdHRl", - "c3QuRm9yZWlnbkVudW06C0ZPUkVJR05fQkFSOn0KHWRlZmF1bHRfaW1wb3J0", - "X2VudW1fZXh0ZW5zaW9uEiQucHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4", - "dGVuc2lvbnMYUyABKA4yJC5wcm90b2J1Zl91bml0dGVzdF9pbXBvcnQuSW1w", - "b3J0RW51bToKSU1QT1JUX0JBUjpVCh5kZWZhdWx0X3N0cmluZ19waWVjZV9l", - "eHRlbnNpb24SJC5wcm90b2J1Zl91bml0dGVzdC5UZXN0QWxsRXh0ZW5zaW9u", - "cxhUIAEoCToDYWJjQgIIAjpNChZkZWZhdWx0X2NvcmRfZXh0ZW5zaW9uEiQu", - "cHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYVSABKAk6AzEy", - "M0ICCAE6QgoTbXlfZXh0ZW5zaW9uX3N0cmluZxIlLnByb3RvYnVmX3VuaXR0", - "ZXN0LlRlc3RGaWVsZE9yZGVyaW5ncxgyIAEoCTo/ChBteV9leHRlbnNpb25f", - "aW50EiUucHJvdG9idWZfdW5pdHRlc3QuVGVzdEZpZWxkT3JkZXJpbmdzGAUg", - "ASgFOksKFnBhY2tlZF9pbnQzMl9leHRlbnNpb24SJy5wcm90b2J1Zl91bml0", - "dGVzdC5UZXN0UGFja2VkRXh0ZW5zaW9ucxhaIAMoBUICEAE6SwoWcGFja2Vk", - "X2ludDY0X2V4dGVuc2lvbhInLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RQYWNr", - "ZWRFeHRlbnNpb25zGFsgAygDQgIQATpMChdwYWNrZWRfdWludDMyX2V4dGVu", - "c2lvbhInLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RQYWNrZWRFeHRlbnNpb25z", - "GFwgAygNQgIQATpMChdwYWNrZWRfdWludDY0X2V4dGVuc2lvbhInLnByb3Rv", - "YnVmX3VuaXR0ZXN0LlRlc3RQYWNrZWRFeHRlbnNpb25zGF0gAygEQgIQATpM", - "ChdwYWNrZWRfc2ludDMyX2V4dGVuc2lvbhInLnByb3RvYnVmX3VuaXR0ZXN0", - "LlRlc3RQYWNrZWRFeHRlbnNpb25zGF4gAygRQgIQATpMChdwYWNrZWRfc2lu", - "dDY0X2V4dGVuc2lvbhInLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RQYWNrZWRF", - "eHRlbnNpb25zGF8gAygSQgIQATpNChhwYWNrZWRfZml4ZWQzMl9leHRlbnNp", - "b24SJy5wcm90b2J1Zl91bml0dGVzdC5UZXN0UGFja2VkRXh0ZW5zaW9ucxhg", - "IAMoB0ICEAE6TQoYcGFja2VkX2ZpeGVkNjRfZXh0ZW5zaW9uEicucHJvdG9i", - "dWZfdW5pdHRlc3QuVGVzdFBhY2tlZEV4dGVuc2lvbnMYYSADKAZCAhABOk4K", - "GXBhY2tlZF9zZml4ZWQzMl9leHRlbnNpb24SJy5wcm90b2J1Zl91bml0dGVz", - "dC5UZXN0UGFja2VkRXh0ZW5zaW9ucxhiIAMoD0ICEAE6TgoZcGFja2VkX3Nm", - "aXhlZDY0X2V4dGVuc2lvbhInLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RQYWNr", - "ZWRFeHRlbnNpb25zGGMgAygQQgIQATpLChZwYWNrZWRfZmxvYXRfZXh0ZW5z", - "aW9uEicucHJvdG9idWZfdW5pdHRlc3QuVGVzdFBhY2tlZEV4dGVuc2lvbnMY", - "ZCADKAJCAhABOkwKF3BhY2tlZF9kb3VibGVfZXh0ZW5zaW9uEicucHJvdG9i", - "dWZfdW5pdHRlc3QuVGVzdFBhY2tlZEV4dGVuc2lvbnMYZSADKAFCAhABOkoK", - "FXBhY2tlZF9ib29sX2V4dGVuc2lvbhInLnByb3RvYnVmX3VuaXR0ZXN0LlRl", - "c3RQYWNrZWRFeHRlbnNpb25zGGYgAygIQgIQATpqChVwYWNrZWRfZW51bV9l", - "eHRlbnNpb24SJy5wcm90b2J1Zl91bml0dGVzdC5UZXN0UGFja2VkRXh0ZW5z", - "aW9ucxhnIAMoDjIeLnByb3RvYnVmX3VuaXR0ZXN0LkZvcmVpZ25FbnVtQgIQ", - "AUJTQg1Vbml0dGVzdFByb3RvSAGAAQGIAQGQAQHCPjYKIUdvb2dsZS5Qcm90", - "b2NvbEJ1ZmZlcnMuVGVzdFByb3RvcxIRVW5pdFRlc3RQcm90b0ZpbGU=")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_protobuf_unittest_TestAllTypes__Descriptor = Descriptor.MessageTypes[0]; - internal__static_protobuf_unittest_TestAllTypes__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestAllTypes__Descriptor, - new string[] { "OptionalInt32", "OptionalInt64", "OptionalUint32", "OptionalUint64", "OptionalSint32", "OptionalSint64", "OptionalFixed32", "OptionalFixed64", "OptionalSfixed32", "OptionalSfixed64", "OptionalFloat", "OptionalDouble", "OptionalBool", "OptionalString", "OptionalBytes", "OptionalGroup", "OptionalNestedMessage", "OptionalForeignMessage", "OptionalImportMessage", "OptionalNestedEnum", "OptionalForeignEnum", "OptionalImportEnum", "OptionalStringPiece", "OptionalCord", "RepeatedInt32", "RepeatedInt64", "RepeatedUint32", "RepeatedUint64", "RepeatedSint32", "RepeatedSint64", "RepeatedFixed32", "RepeatedFixed64", "RepeatedSfixed32", "RepeatedSfixed64", "RepeatedFloat", "RepeatedDouble", "RepeatedBool", "RepeatedString", "RepeatedBytes", "RepeatedGroup", "RepeatedNestedMessage", "RepeatedForeignMessage", "RepeatedImportMessage", "RepeatedNestedEnum", "RepeatedForeignEnum", "RepeatedImportEnum", "RepeatedStringPiece", "RepeatedCord", "DefaultInt32", "DefaultInt64", "DefaultUint32", "DefaultUint64", "DefaultSint32", "DefaultSint64", "DefaultFixed32", "DefaultFixed64", "DefaultSfixed32", "DefaultSfixed64", "DefaultFloat", "DefaultDouble", "DefaultBool", "DefaultString", "DefaultBytes", "DefaultNestedEnum", "DefaultForeignEnum", "DefaultImportEnum", "DefaultStringPiece", "DefaultCord", }); - internal__static_protobuf_unittest_TestAllTypes_NestedMessage__Descriptor = internal__static_protobuf_unittest_TestAllTypes__Descriptor.NestedTypes[0]; - internal__static_protobuf_unittest_TestAllTypes_NestedMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestAllTypes_NestedMessage__Descriptor, - new string[] { "Bb", }); - internal__static_protobuf_unittest_TestAllTypes_OptionalGroup__Descriptor = internal__static_protobuf_unittest_TestAllTypes__Descriptor.NestedTypes[1]; - internal__static_protobuf_unittest_TestAllTypes_OptionalGroup__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestAllTypes_OptionalGroup__Descriptor, - new string[] { "A", }); - internal__static_protobuf_unittest_TestAllTypes_RepeatedGroup__Descriptor = internal__static_protobuf_unittest_TestAllTypes__Descriptor.NestedTypes[2]; - internal__static_protobuf_unittest_TestAllTypes_RepeatedGroup__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestAllTypes_RepeatedGroup__Descriptor, - new string[] { "A", }); - internal__static_protobuf_unittest_TestDeprecatedFields__Descriptor = Descriptor.MessageTypes[1]; - internal__static_protobuf_unittest_TestDeprecatedFields__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestDeprecatedFields__Descriptor, - new string[] { "DeprecatedInt32", }); - internal__static_protobuf_unittest_ForeignMessage__Descriptor = Descriptor.MessageTypes[2]; - internal__static_protobuf_unittest_ForeignMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_ForeignMessage__Descriptor, - new string[] { "C", }); - internal__static_protobuf_unittest_TestAllExtensions__Descriptor = Descriptor.MessageTypes[3]; - internal__static_protobuf_unittest_TestAllExtensions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestAllExtensions__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_OptionalGroup_extension__Descriptor = Descriptor.MessageTypes[4]; - internal__static_protobuf_unittest_OptionalGroup_extension__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_OptionalGroup_extension__Descriptor, - new string[] { "A", }); - internal__static_protobuf_unittest_RepeatedGroup_extension__Descriptor = Descriptor.MessageTypes[5]; - internal__static_protobuf_unittest_RepeatedGroup_extension__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_RepeatedGroup_extension__Descriptor, - new string[] { "A", }); - internal__static_protobuf_unittest_TestNestedExtension__Descriptor = Descriptor.MessageTypes[6]; - internal__static_protobuf_unittest_TestNestedExtension__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestNestedExtension__Descriptor, - new string[] { }); - global::Google.ProtocolBuffers.TestProtos.TestNestedExtension.Test = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.TestNestedExtension.Descriptor.Extensions[0]); - internal__static_protobuf_unittest_TestRequired__Descriptor = Descriptor.MessageTypes[7]; - internal__static_protobuf_unittest_TestRequired__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestRequired__Descriptor, - new string[] { "A", "Dummy2", "B", "Dummy4", "Dummy5", "Dummy6", "Dummy7", "Dummy8", "Dummy9", "Dummy10", "Dummy11", "Dummy12", "Dummy13", "Dummy14", "Dummy15", "Dummy16", "Dummy17", "Dummy18", "Dummy19", "Dummy20", "Dummy21", "Dummy22", "Dummy23", "Dummy24", "Dummy25", "Dummy26", "Dummy27", "Dummy28", "Dummy29", "Dummy30", "Dummy31", "Dummy32", "C", }); - global::Google.ProtocolBuffers.TestProtos.TestRequired.Single = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.TestRequired.Descriptor.Extensions[0]); - global::Google.ProtocolBuffers.TestProtos.TestRequired.Multi = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.TestRequired.Descriptor.Extensions[1]); - internal__static_protobuf_unittest_TestRequiredForeign__Descriptor = Descriptor.MessageTypes[8]; - internal__static_protobuf_unittest_TestRequiredForeign__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestRequiredForeign__Descriptor, - new string[] { "OptionalMessage", "RepeatedMessage", "Dummy", }); - internal__static_protobuf_unittest_TestForeignNested__Descriptor = Descriptor.MessageTypes[9]; - internal__static_protobuf_unittest_TestForeignNested__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestForeignNested__Descriptor, - new string[] { "ForeignNested", }); - internal__static_protobuf_unittest_TestEmptyMessage__Descriptor = Descriptor.MessageTypes[10]; - internal__static_protobuf_unittest_TestEmptyMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestEmptyMessage__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_TestEmptyMessageWithExtensions__Descriptor = Descriptor.MessageTypes[11]; - internal__static_protobuf_unittest_TestEmptyMessageWithExtensions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestEmptyMessageWithExtensions__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_TestMultipleExtensionRanges__Descriptor = Descriptor.MessageTypes[12]; - internal__static_protobuf_unittest_TestMultipleExtensionRanges__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestMultipleExtensionRanges__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_TestReallyLargeTagNumber__Descriptor = Descriptor.MessageTypes[13]; - internal__static_protobuf_unittest_TestReallyLargeTagNumber__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestReallyLargeTagNumber__Descriptor, - new string[] { "A", "Bb", }); - internal__static_protobuf_unittest_TestRecursiveMessage__Descriptor = Descriptor.MessageTypes[14]; - internal__static_protobuf_unittest_TestRecursiveMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestRecursiveMessage__Descriptor, - new string[] { "A", "I", }); - internal__static_protobuf_unittest_TestMutualRecursionA__Descriptor = Descriptor.MessageTypes[15]; - internal__static_protobuf_unittest_TestMutualRecursionA__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestMutualRecursionA__Descriptor, - new string[] { "Bb", }); - internal__static_protobuf_unittest_TestMutualRecursionB__Descriptor = Descriptor.MessageTypes[16]; - internal__static_protobuf_unittest_TestMutualRecursionB__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestMutualRecursionB__Descriptor, - new string[] { "A", "OptionalInt32", }); - internal__static_protobuf_unittest_TestDupFieldNumber__Descriptor = Descriptor.MessageTypes[17]; - internal__static_protobuf_unittest_TestDupFieldNumber__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestDupFieldNumber__Descriptor, - new string[] { "A", "Foo", "Bar", }); - internal__static_protobuf_unittest_TestDupFieldNumber_Foo__Descriptor = internal__static_protobuf_unittest_TestDupFieldNumber__Descriptor.NestedTypes[0]; - internal__static_protobuf_unittest_TestDupFieldNumber_Foo__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestDupFieldNumber_Foo__Descriptor, - new string[] { "A", }); - internal__static_protobuf_unittest_TestDupFieldNumber_Bar__Descriptor = internal__static_protobuf_unittest_TestDupFieldNumber__Descriptor.NestedTypes[1]; - internal__static_protobuf_unittest_TestDupFieldNumber_Bar__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestDupFieldNumber_Bar__Descriptor, - new string[] { "A", }); - internal__static_protobuf_unittest_TestNestedMessageHasBits__Descriptor = Descriptor.MessageTypes[18]; - internal__static_protobuf_unittest_TestNestedMessageHasBits__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestNestedMessageHasBits__Descriptor, - new string[] { "OptionalNestedMessage", }); - internal__static_protobuf_unittest_TestNestedMessageHasBits_NestedMessage__Descriptor = internal__static_protobuf_unittest_TestNestedMessageHasBits__Descriptor.NestedTypes[0]; - internal__static_protobuf_unittest_TestNestedMessageHasBits_NestedMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestNestedMessageHasBits_NestedMessage__Descriptor, - new string[] { "NestedmessageRepeatedInt32", "NestedmessageRepeatedForeignmessage", }); - internal__static_protobuf_unittest_TestCamelCaseFieldNames__Descriptor = Descriptor.MessageTypes[19]; - internal__static_protobuf_unittest_TestCamelCaseFieldNames__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestCamelCaseFieldNames__Descriptor, - new string[] { "PrimitiveField", "StringField", "EnumField", "MessageField", "StringPieceField", "CordField", "RepeatedPrimitiveField", "RepeatedStringField", "RepeatedEnumField", "RepeatedMessageField", "RepeatedStringPieceField", "RepeatedCordField", }); - internal__static_protobuf_unittest_TestFieldOrderings__Descriptor = Descriptor.MessageTypes[20]; - internal__static_protobuf_unittest_TestFieldOrderings__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestFieldOrderings__Descriptor, - new string[] { "MyString", "MyInt", "MyFloat", }); - internal__static_protobuf_unittest_TestExtremeDefaultValues__Descriptor = Descriptor.MessageTypes[21]; - internal__static_protobuf_unittest_TestExtremeDefaultValues__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestExtremeDefaultValues__Descriptor, - new string[] { "EscapedBytes", "LargeUint32", "LargeUint64", "SmallInt32", "SmallInt64", "Utf8String", "ZeroFloat", "OneFloat", "SmallFloat", "NegativeOneFloat", "NegativeFloat", "LargeFloat", "SmallNegativeFloat", "InfDouble", "NegInfDouble", "NanDouble", "InfFloat", "NegInfFloat", "NanFloat", "CppTrigraph", }); - internal__static_protobuf_unittest_SparseEnumMessage__Descriptor = Descriptor.MessageTypes[22]; - internal__static_protobuf_unittest_SparseEnumMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_SparseEnumMessage__Descriptor, - new string[] { "SparseEnum", }); - internal__static_protobuf_unittest_OneString__Descriptor = Descriptor.MessageTypes[23]; - internal__static_protobuf_unittest_OneString__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_OneString__Descriptor, - new string[] { "Data", }); - internal__static_protobuf_unittest_OneBytes__Descriptor = Descriptor.MessageTypes[24]; - internal__static_protobuf_unittest_OneBytes__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_OneBytes__Descriptor, - new string[] { "Data", }); - internal__static_protobuf_unittest_TestPackedTypes__Descriptor = Descriptor.MessageTypes[25]; - internal__static_protobuf_unittest_TestPackedTypes__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestPackedTypes__Descriptor, - new string[] { "PackedInt32", "PackedInt64", "PackedUint32", "PackedUint64", "PackedSint32", "PackedSint64", "PackedFixed32", "PackedFixed64", "PackedSfixed32", "PackedSfixed64", "PackedFloat", "PackedDouble", "PackedBool", "PackedEnum", }); - internal__static_protobuf_unittest_TestUnpackedTypes__Descriptor = Descriptor.MessageTypes[26]; - internal__static_protobuf_unittest_TestUnpackedTypes__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestUnpackedTypes__Descriptor, - new string[] { "UnpackedInt32", "UnpackedInt64", "UnpackedUint32", "UnpackedUint64", "UnpackedSint32", "UnpackedSint64", "UnpackedFixed32", "UnpackedFixed64", "UnpackedSfixed32", "UnpackedSfixed64", "UnpackedFloat", "UnpackedDouble", "UnpackedBool", "UnpackedEnum", }); - internal__static_protobuf_unittest_TestPackedExtensions__Descriptor = Descriptor.MessageTypes[27]; - internal__static_protobuf_unittest_TestPackedExtensions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestPackedExtensions__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_TestDynamicExtensions__Descriptor = Descriptor.MessageTypes[28]; - internal__static_protobuf_unittest_TestDynamicExtensions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestDynamicExtensions__Descriptor, - new string[] { "ScalarExtension", "EnumExtension", "DynamicEnumExtension", "MessageExtension", "DynamicMessageExtension", "RepeatedExtension", "PackedExtension", }); - internal__static_protobuf_unittest_TestDynamicExtensions_DynamicMessageType__Descriptor = internal__static_protobuf_unittest_TestDynamicExtensions__Descriptor.NestedTypes[0]; - internal__static_protobuf_unittest_TestDynamicExtensions_DynamicMessageType__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestDynamicExtensions_DynamicMessageType__Descriptor, - new string[] { "DynamicField", }); - internal__static_protobuf_unittest_TestRepeatedScalarDifferentTagSizes__Descriptor = Descriptor.MessageTypes[29]; - internal__static_protobuf_unittest_TestRepeatedScalarDifferentTagSizes__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestRepeatedScalarDifferentTagSizes__Descriptor, - new string[] { "RepeatedFixed32", "RepeatedInt32", "RepeatedFixed64", "RepeatedInt64", "RepeatedFloat", "RepeatedUint64", }); - internal__static_protobuf_unittest_FooRequest__Descriptor = Descriptor.MessageTypes[30]; - internal__static_protobuf_unittest_FooRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_FooRequest__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_FooResponse__Descriptor = Descriptor.MessageTypes[31]; - internal__static_protobuf_unittest_FooResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_FooResponse__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_BarRequest__Descriptor = Descriptor.MessageTypes[32]; - internal__static_protobuf_unittest_BarRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_BarRequest__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_BarResponse__Descriptor = Descriptor.MessageTypes[33]; - internal__static_protobuf_unittest_BarResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_BarResponse__Descriptor, - new string[] { }); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalInt32Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[0]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalInt64Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[1]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalUint32Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[2]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalUint64Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[3]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalSint32Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[4]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalSint64Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[5]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalFixed32Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[6]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalFixed64Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[7]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalSfixed32Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[8]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalSfixed64Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[9]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalFloatExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[10]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalDoubleExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[11]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalBoolExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[12]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalStringExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[13]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalBytesExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[14]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalGroupExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[15]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalNestedMessageExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[16]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalForeignMessageExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[17]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalImportMessageExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[18]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalNestedEnumExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[19]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalForeignEnumExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[20]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalImportEnumExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[21]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalStringPieceExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[22]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalCordExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[23]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedInt32Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[24]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedInt64Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[25]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedUint32Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[26]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedUint64Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[27]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedSint32Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[28]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedSint64Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[29]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedFixed32Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[30]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedFixed64Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[31]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedSfixed32Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[32]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedSfixed64Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[33]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedFloatExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[34]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedDoubleExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[35]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedBoolExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[36]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedStringExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[37]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedBytesExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[38]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedGroupExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[39]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedNestedMessageExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[40]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedForeignMessageExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[41]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedImportMessageExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[42]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedNestedEnumExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[43]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedForeignEnumExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[44]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedImportEnumExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[45]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedStringPieceExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[46]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedCordExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[47]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultInt32Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[48]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultInt64Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[49]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultUint32Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[50]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultUint64Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[51]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultSint32Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[52]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultSint64Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[53]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultFixed32Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[54]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultFixed64Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[55]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultSfixed32Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[56]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultSfixed64Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[57]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultFloatExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[58]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultDoubleExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[59]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultBoolExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[60]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultStringExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[61]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultBytesExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[62]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultNestedEnumExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[63]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultForeignEnumExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[64]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultImportEnumExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[65]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultStringPieceExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[66]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultCordExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[67]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.MyExtensionString = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[68]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.MyExtensionInt = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[69]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedInt32Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[70]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedInt64Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[71]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedUint32Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[72]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedUint64Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[73]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedSint32Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[74]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedSint64Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[75]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedFixed32Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[76]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedFixed64Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[77]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedSfixed32Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[78]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedSfixed64Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[79]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedFloatExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[80]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedDoubleExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[81]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedBoolExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[82]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedEnumExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[83]); - pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); - RegisterAllExtensions(registry); - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.RegisterAllExtensions(registry); - global::Google.ProtocolBuffers.TestProtos.UnitTestImportProtoFile.RegisterAllExtensions(registry); - return registry; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, - global::Google.ProtocolBuffers.TestProtos.UnitTestImportProtoFile.Descriptor, - }, assigner); - } - #endregion - - } - #region Enums - public enum ForeignEnum { - FOREIGN_FOO = 4, - FOREIGN_BAR = 5, - FOREIGN_BAZ = 6, - } - - public enum TestEnumWithDupValue { - FOO1 = 1, - BAR1 = 2, - BAZ = 3, - FOO2 = 1, - BAR2 = 2, - } - - public enum TestSparseEnum { - SPARSE_A = 123, - SPARSE_B = 62374, - SPARSE_C = 12589234, - SPARSE_D = -15, - SPARSE_E = -53452, - SPARSE_F = 0, - SPARSE_G = 2, - } - - #endregion - - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestAllTypes : pb::GeneratedMessage { - private TestAllTypes() { } - private static readonly TestAllTypes defaultInstance = new TestAllTypes().MakeReadOnly(); - private static readonly string[] _testAllTypesFieldNames = new string[] { "default_bool", "default_bytes", "default_cord", "default_double", "default_fixed32", "default_fixed64", "default_float", "default_foreign_enum", "default_import_enum", "default_int32", "default_int64", "default_nested_enum", "default_sfixed32", "default_sfixed64", "default_sint32", "default_sint64", "default_string", "default_string_piece", "default_uint32", "default_uint64", "optional_bool", "optional_bytes", "optional_cord", "optional_double", "optional_fixed32", "optional_fixed64", "optional_float", "optional_foreign_enum", "optional_foreign_message", "optional_import_enum", "optional_import_message", "optional_int32", "optional_int64", "optional_nested_enum", "optional_nested_message", "optional_sfixed32", "optional_sfixed64", "optional_sint32", "optional_sint64", "optional_string", "optional_string_piece", "optional_uint32", "optional_uint64", "optionalgroup", "repeated_bool", "repeated_bytes", "repeated_cord", "repeated_double", "repeated_fixed32", "repeated_fixed64", "repeated_float", "repeated_foreign_enum", "repeated_foreign_message", "repeated_import_enum", "repeated_import_message", "repeated_int32", "repeated_int64", "repeated_nested_enum", "repeated_nested_message", "repeated_sfixed32", "repeated_sfixed64", "repeated_sint32", "repeated_sint64", "repeated_string", "repeated_string_piece", "repeated_uint32", "repeated_uint64", "repeatedgroup" }; - private static readonly uint[] _testAllTypesFieldTags = new uint[] { 584, 602, 682, 577, 541, 545, 573, 656, 664, 488, 496, 648, 557, 561, 520, 528, 594, 674, 504, 512, 104, 122, 202, 97, 61, 65, 93, 176, 154, 184, 162, 8, 16, 168, 146, 77, 81, 40, 48, 114, 194, 24, 32, 131, 344, 362, 442, 337, 301, 305, 333, 416, 394, 424, 402, 248, 256, 408, 386, 317, 321, 280, 288, 354, 434, 264, 272, 371 }; - public static TestAllTypes DefaultInstance { - get { return defaultInstance; } - } - - public override TestAllTypes DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestAllTypes ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllTypes__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllTypes__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - public enum NestedEnum { - FOO = 1, - BAR = 2, - BAZ = 3, - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class NestedMessage : pb::GeneratedMessage { - private NestedMessage() { } - private static readonly NestedMessage defaultInstance = new NestedMessage().MakeReadOnly(); - private static readonly string[] _nestedMessageFieldNames = new string[] { "bb" }; - private static readonly uint[] _nestedMessageFieldTags = new uint[] { 8 }; - public static NestedMessage DefaultInstance { - get { return defaultInstance; } - } - - public override NestedMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override NestedMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllTypes_NestedMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllTypes_NestedMessage__FieldAccessorTable; } - } - - public const int BbFieldNumber = 1; - private bool hasBb; - private int bb_; - public bool HasBb { - get { return hasBb; } - } - public int Bb { - get { return bb_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _nestedMessageFieldNames; - if (hasBb) { - output.WriteInt32(1, field_names[0], Bb); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasBb) { - size += pb::CodedOutputStream.ComputeInt32Size(1, Bb); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static NestedMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NestedMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NestedMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NestedMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NestedMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NestedMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static NestedMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NestedMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private NestedMessage MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(NestedMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(NestedMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private NestedMessage result; - - private NestedMessage PrepareBuilder() { - if (resultIsReadOnly) { - NestedMessage original = result; - result = new NestedMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override NestedMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Descriptor; } - } - - public override NestedMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.DefaultInstance; } - } - - public override NestedMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is NestedMessage) { - return MergeFrom((NestedMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(NestedMessage other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasBb) { - Bb = other.Bb; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_nestedMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _nestedMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasBb = input.ReadInt32(ref result.bb_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasBb { - get { return result.hasBb; } - } - public int Bb { - get { return result.Bb; } - set { SetBb(value); } - } - public Builder SetBb(int value) { - PrepareBuilder(); - result.hasBb = true; - result.bb_ = value; - return this; - } - public Builder ClearBb() { - PrepareBuilder(); - result.hasBb = false; - result.bb_ = 0; - return this; - } - } - static NestedMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class OptionalGroup : pb::GeneratedMessage { - private OptionalGroup() { } - private static readonly OptionalGroup defaultInstance = new OptionalGroup().MakeReadOnly(); - private static readonly string[] _optionalGroupFieldNames = new string[] { "a" }; - private static readonly uint[] _optionalGroupFieldTags = new uint[] { 136 }; - public static OptionalGroup DefaultInstance { - get { return defaultInstance; } - } - - public override OptionalGroup DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override OptionalGroup ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllTypes_OptionalGroup__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllTypes_OptionalGroup__FieldAccessorTable; } - } - - public const int AFieldNumber = 17; - private bool hasA; - private int a_; - public bool HasA { - get { return hasA; } - } - public int A { - get { return a_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _optionalGroupFieldNames; - if (hasA) { - output.WriteInt32(17, field_names[0], A); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA) { - size += pb::CodedOutputStream.ComputeInt32Size(17, A); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static OptionalGroup ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OptionalGroup ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OptionalGroup ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OptionalGroup ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OptionalGroup ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OptionalGroup ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static OptionalGroup ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static OptionalGroup ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static OptionalGroup ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OptionalGroup ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private OptionalGroup MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(OptionalGroup prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(OptionalGroup cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private OptionalGroup result; - - private OptionalGroup PrepareBuilder() { - if (resultIsReadOnly) { - OptionalGroup original = result; - result = new OptionalGroup(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override OptionalGroup MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.Descriptor; } - } - - public override OptionalGroup DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.DefaultInstance; } - } - - public override OptionalGroup BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is OptionalGroup) { - return MergeFrom((OptionalGroup) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(OptionalGroup other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA) { - A = other.A; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_optionalGroupFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _optionalGroupFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 136: { - result.hasA = input.ReadInt32(ref result.a_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasA { - get { return result.hasA; } - } - public int A { - get { return result.A; } - set { SetA(value); } - } - public Builder SetA(int value) { - PrepareBuilder(); - result.hasA = true; - result.a_ = value; - return this; - } - public Builder ClearA() { - PrepareBuilder(); - result.hasA = false; - result.a_ = 0; - return this; - } - } - static OptionalGroup() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class RepeatedGroup : pb::GeneratedMessage { - private RepeatedGroup() { } - private static readonly RepeatedGroup defaultInstance = new RepeatedGroup().MakeReadOnly(); - private static readonly string[] _repeatedGroupFieldNames = new string[] { "a" }; - private static readonly uint[] _repeatedGroupFieldTags = new uint[] { 376 }; - public static RepeatedGroup DefaultInstance { - get { return defaultInstance; } - } - - public override RepeatedGroup DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override RepeatedGroup ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllTypes_RepeatedGroup__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllTypes_RepeatedGroup__FieldAccessorTable; } - } - - public const int AFieldNumber = 47; - private bool hasA; - private int a_; - public bool HasA { - get { return hasA; } - } - public int A { - get { return a_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _repeatedGroupFieldNames; - if (hasA) { - output.WriteInt32(47, field_names[0], A); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA) { - size += pb::CodedOutputStream.ComputeInt32Size(47, A); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static RepeatedGroup ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RepeatedGroup ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RepeatedGroup ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RepeatedGroup ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RepeatedGroup ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RepeatedGroup ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static RepeatedGroup ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static RepeatedGroup ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static RepeatedGroup ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RepeatedGroup ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private RepeatedGroup MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(RepeatedGroup prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(RepeatedGroup cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private RepeatedGroup result; - - private RepeatedGroup PrepareBuilder() { - if (resultIsReadOnly) { - RepeatedGroup original = result; - result = new RepeatedGroup(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override RepeatedGroup MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup.Descriptor; } - } - - public override RepeatedGroup DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup.DefaultInstance; } - } - - public override RepeatedGroup BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is RepeatedGroup) { - return MergeFrom((RepeatedGroup) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(RepeatedGroup other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA) { - A = other.A; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_repeatedGroupFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _repeatedGroupFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 376: { - result.hasA = input.ReadInt32(ref result.a_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasA { - get { return result.hasA; } - } - public int A { - get { return result.A; } - set { SetA(value); } - } - public Builder SetA(int value) { - PrepareBuilder(); - result.hasA = true; - result.a_ = value; - return this; - } - public Builder ClearA() { - PrepareBuilder(); - result.hasA = false; - result.a_ = 0; - return this; - } - } - static RepeatedGroup() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - } - #endregion - - public const int OptionalInt32FieldNumber = 1; - private bool hasOptionalInt32; - private int optionalInt32_; - public bool HasOptionalInt32 { - get { return hasOptionalInt32; } - } - public int OptionalInt32 { - get { return optionalInt32_; } - } - - public const int OptionalInt64FieldNumber = 2; - private bool hasOptionalInt64; - private long optionalInt64_; - public bool HasOptionalInt64 { - get { return hasOptionalInt64; } - } - public long OptionalInt64 { - get { return optionalInt64_; } - } - - public const int OptionalUint32FieldNumber = 3; - private bool hasOptionalUint32; - private uint optionalUint32_; - public bool HasOptionalUint32 { - get { return hasOptionalUint32; } - } - [global::System.CLSCompliant(false)] - public uint OptionalUint32 { - get { return optionalUint32_; } - } - - public const int OptionalUint64FieldNumber = 4; - private bool hasOptionalUint64; - private ulong optionalUint64_; - public bool HasOptionalUint64 { - get { return hasOptionalUint64; } - } - [global::System.CLSCompliant(false)] - public ulong OptionalUint64 { - get { return optionalUint64_; } - } - - public const int OptionalSint32FieldNumber = 5; - private bool hasOptionalSint32; - private int optionalSint32_; - public bool HasOptionalSint32 { - get { return hasOptionalSint32; } - } - public int OptionalSint32 { - get { return optionalSint32_; } - } - - public const int OptionalSint64FieldNumber = 6; - private bool hasOptionalSint64; - private long optionalSint64_; - public bool HasOptionalSint64 { - get { return hasOptionalSint64; } - } - public long OptionalSint64 { - get { return optionalSint64_; } - } - - public const int OptionalFixed32FieldNumber = 7; - private bool hasOptionalFixed32; - private uint optionalFixed32_; - public bool HasOptionalFixed32 { - get { return hasOptionalFixed32; } - } - [global::System.CLSCompliant(false)] - public uint OptionalFixed32 { - get { return optionalFixed32_; } - } - - public const int OptionalFixed64FieldNumber = 8; - private bool hasOptionalFixed64; - private ulong optionalFixed64_; - public bool HasOptionalFixed64 { - get { return hasOptionalFixed64; } - } - [global::System.CLSCompliant(false)] - public ulong OptionalFixed64 { - get { return optionalFixed64_; } - } - - public const int OptionalSfixed32FieldNumber = 9; - private bool hasOptionalSfixed32; - private int optionalSfixed32_; - public bool HasOptionalSfixed32 { - get { return hasOptionalSfixed32; } - } - public int OptionalSfixed32 { - get { return optionalSfixed32_; } - } - - public const int OptionalSfixed64FieldNumber = 10; - private bool hasOptionalSfixed64; - private long optionalSfixed64_; - public bool HasOptionalSfixed64 { - get { return hasOptionalSfixed64; } - } - public long OptionalSfixed64 { - get { return optionalSfixed64_; } - } - - public const int OptionalFloatFieldNumber = 11; - private bool hasOptionalFloat; - private float optionalFloat_; - public bool HasOptionalFloat { - get { return hasOptionalFloat; } - } - public float OptionalFloat { - get { return optionalFloat_; } - } - - public const int OptionalDoubleFieldNumber = 12; - private bool hasOptionalDouble; - private double optionalDouble_; - public bool HasOptionalDouble { - get { return hasOptionalDouble; } - } - public double OptionalDouble { - get { return optionalDouble_; } - } - - public const int OptionalBoolFieldNumber = 13; - private bool hasOptionalBool; - private bool optionalBool_; - public bool HasOptionalBool { - get { return hasOptionalBool; } - } - public bool OptionalBool { - get { return optionalBool_; } - } - - public const int OptionalStringFieldNumber = 14; - private bool hasOptionalString; - private string optionalString_ = ""; - public bool HasOptionalString { - get { return hasOptionalString; } - } - public string OptionalString { - get { return optionalString_; } - } - - public const int OptionalBytesFieldNumber = 15; - private bool hasOptionalBytes; - private pb::ByteString optionalBytes_ = pb::ByteString.Empty; - public bool HasOptionalBytes { - get { return hasOptionalBytes; } - } - public pb::ByteString OptionalBytes { - get { return optionalBytes_; } - } - - public const int OptionalGroupFieldNumber = 16; - private bool hasOptionalGroup; - private global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup optionalGroup_; - public bool HasOptionalGroup { - get { return hasOptionalGroup; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup OptionalGroup { - get { return optionalGroup_ ?? global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.DefaultInstance; } - } - - public const int OptionalNestedMessageFieldNumber = 18; - private bool hasOptionalNestedMessage; - private global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage optionalNestedMessage_; - public bool HasOptionalNestedMessage { - get { return hasOptionalNestedMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage OptionalNestedMessage { - get { return optionalNestedMessage_ ?? global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.DefaultInstance; } - } - - public const int OptionalForeignMessageFieldNumber = 19; - private bool hasOptionalForeignMessage; - private global::Google.ProtocolBuffers.TestProtos.ForeignMessage optionalForeignMessage_; - public bool HasOptionalForeignMessage { - get { return hasOptionalForeignMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage OptionalForeignMessage { - get { return optionalForeignMessage_ ?? global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance; } - } - - public const int OptionalImportMessageFieldNumber = 20; - private bool hasOptionalImportMessage; - private global::Google.ProtocolBuffers.TestProtos.ImportMessage optionalImportMessage_; - public bool HasOptionalImportMessage { - get { return hasOptionalImportMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportMessage OptionalImportMessage { - get { return optionalImportMessage_ ?? global::Google.ProtocolBuffers.TestProtos.ImportMessage.DefaultInstance; } - } - - public const int OptionalNestedEnumFieldNumber = 21; - private bool hasOptionalNestedEnum; - private global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum optionalNestedEnum_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum.FOO; - public bool HasOptionalNestedEnum { - get { return hasOptionalNestedEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum OptionalNestedEnum { - get { return optionalNestedEnum_; } - } - - public const int OptionalForeignEnumFieldNumber = 22; - private bool hasOptionalForeignEnum; - private global::Google.ProtocolBuffers.TestProtos.ForeignEnum optionalForeignEnum_ = global::Google.ProtocolBuffers.TestProtos.ForeignEnum.FOREIGN_FOO; - public bool HasOptionalForeignEnum { - get { return hasOptionalForeignEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum OptionalForeignEnum { - get { return optionalForeignEnum_; } - } - - public const int OptionalImportEnumFieldNumber = 23; - private bool hasOptionalImportEnum; - private global::Google.ProtocolBuffers.TestProtos.ImportEnum optionalImportEnum_ = global::Google.ProtocolBuffers.TestProtos.ImportEnum.IMPORT_FOO; - public bool HasOptionalImportEnum { - get { return hasOptionalImportEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportEnum OptionalImportEnum { - get { return optionalImportEnum_; } - } - - public const int OptionalStringPieceFieldNumber = 24; - private bool hasOptionalStringPiece; - private string optionalStringPiece_ = ""; - public bool HasOptionalStringPiece { - get { return hasOptionalStringPiece; } - } - public string OptionalStringPiece { - get { return optionalStringPiece_; } - } - - public const int OptionalCordFieldNumber = 25; - private bool hasOptionalCord; - private string optionalCord_ = ""; - public bool HasOptionalCord { - get { return hasOptionalCord; } - } - public string OptionalCord { - get { return optionalCord_; } - } - - public const int RepeatedInt32FieldNumber = 31; - private pbc::PopsicleList repeatedInt32_ = new pbc::PopsicleList(); - public scg::IList RepeatedInt32List { - get { return pbc::Lists.AsReadOnly(repeatedInt32_); } - } - public int RepeatedInt32Count { - get { return repeatedInt32_.Count; } - } - public int GetRepeatedInt32(int index) { - return repeatedInt32_[index]; - } - - public const int RepeatedInt64FieldNumber = 32; - private pbc::PopsicleList repeatedInt64_ = new pbc::PopsicleList(); - public scg::IList RepeatedInt64List { - get { return pbc::Lists.AsReadOnly(repeatedInt64_); } - } - public int RepeatedInt64Count { - get { return repeatedInt64_.Count; } - } - public long GetRepeatedInt64(int index) { - return repeatedInt64_[index]; - } - - public const int RepeatedUint32FieldNumber = 33; - private pbc::PopsicleList repeatedUint32_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList RepeatedUint32List { - get { return pbc::Lists.AsReadOnly(repeatedUint32_); } - } - public int RepeatedUint32Count { - get { return repeatedUint32_.Count; } - } - [global::System.CLSCompliant(false)] - public uint GetRepeatedUint32(int index) { - return repeatedUint32_[index]; - } - - public const int RepeatedUint64FieldNumber = 34; - private pbc::PopsicleList repeatedUint64_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList RepeatedUint64List { - get { return pbc::Lists.AsReadOnly(repeatedUint64_); } - } - public int RepeatedUint64Count { - get { return repeatedUint64_.Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetRepeatedUint64(int index) { - return repeatedUint64_[index]; - } - - public const int RepeatedSint32FieldNumber = 35; - private pbc::PopsicleList repeatedSint32_ = new pbc::PopsicleList(); - public scg::IList RepeatedSint32List { - get { return pbc::Lists.AsReadOnly(repeatedSint32_); } - } - public int RepeatedSint32Count { - get { return repeatedSint32_.Count; } - } - public int GetRepeatedSint32(int index) { - return repeatedSint32_[index]; - } - - public const int RepeatedSint64FieldNumber = 36; - private pbc::PopsicleList repeatedSint64_ = new pbc::PopsicleList(); - public scg::IList RepeatedSint64List { - get { return pbc::Lists.AsReadOnly(repeatedSint64_); } - } - public int RepeatedSint64Count { - get { return repeatedSint64_.Count; } - } - public long GetRepeatedSint64(int index) { - return repeatedSint64_[index]; - } - - public const int RepeatedFixed32FieldNumber = 37; - private pbc::PopsicleList repeatedFixed32_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList RepeatedFixed32List { - get { return pbc::Lists.AsReadOnly(repeatedFixed32_); } - } - public int RepeatedFixed32Count { - get { return repeatedFixed32_.Count; } - } - [global::System.CLSCompliant(false)] - public uint GetRepeatedFixed32(int index) { - return repeatedFixed32_[index]; - } - - public const int RepeatedFixed64FieldNumber = 38; - private pbc::PopsicleList repeatedFixed64_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList RepeatedFixed64List { - get { return pbc::Lists.AsReadOnly(repeatedFixed64_); } - } - public int RepeatedFixed64Count { - get { return repeatedFixed64_.Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetRepeatedFixed64(int index) { - return repeatedFixed64_[index]; - } - - public const int RepeatedSfixed32FieldNumber = 39; - private pbc::PopsicleList repeatedSfixed32_ = new pbc::PopsicleList(); - public scg::IList RepeatedSfixed32List { - get { return pbc::Lists.AsReadOnly(repeatedSfixed32_); } - } - public int RepeatedSfixed32Count { - get { return repeatedSfixed32_.Count; } - } - public int GetRepeatedSfixed32(int index) { - return repeatedSfixed32_[index]; - } - - public const int RepeatedSfixed64FieldNumber = 40; - private pbc::PopsicleList repeatedSfixed64_ = new pbc::PopsicleList(); - public scg::IList RepeatedSfixed64List { - get { return pbc::Lists.AsReadOnly(repeatedSfixed64_); } - } - public int RepeatedSfixed64Count { - get { return repeatedSfixed64_.Count; } - } - public long GetRepeatedSfixed64(int index) { - return repeatedSfixed64_[index]; - } - - public const int RepeatedFloatFieldNumber = 41; - private pbc::PopsicleList repeatedFloat_ = new pbc::PopsicleList(); - public scg::IList RepeatedFloatList { - get { return pbc::Lists.AsReadOnly(repeatedFloat_); } - } - public int RepeatedFloatCount { - get { return repeatedFloat_.Count; } - } - public float GetRepeatedFloat(int index) { - return repeatedFloat_[index]; - } - - public const int RepeatedDoubleFieldNumber = 42; - private pbc::PopsicleList repeatedDouble_ = new pbc::PopsicleList(); - public scg::IList RepeatedDoubleList { - get { return pbc::Lists.AsReadOnly(repeatedDouble_); } - } - public int RepeatedDoubleCount { - get { return repeatedDouble_.Count; } - } - public double GetRepeatedDouble(int index) { - return repeatedDouble_[index]; - } - - public const int RepeatedBoolFieldNumber = 43; - private pbc::PopsicleList repeatedBool_ = new pbc::PopsicleList(); - public scg::IList RepeatedBoolList { - get { return pbc::Lists.AsReadOnly(repeatedBool_); } - } - public int RepeatedBoolCount { - get { return repeatedBool_.Count; } - } - public bool GetRepeatedBool(int index) { - return repeatedBool_[index]; - } - - public const int RepeatedStringFieldNumber = 44; - private pbc::PopsicleList repeatedString_ = new pbc::PopsicleList(); - public scg::IList RepeatedStringList { - get { return pbc::Lists.AsReadOnly(repeatedString_); } - } - public int RepeatedStringCount { - get { return repeatedString_.Count; } - } - public string GetRepeatedString(int index) { - return repeatedString_[index]; - } - - public const int RepeatedBytesFieldNumber = 45; - private pbc::PopsicleList repeatedBytes_ = new pbc::PopsicleList(); - public scg::IList RepeatedBytesList { - get { return pbc::Lists.AsReadOnly(repeatedBytes_); } - } - public int RepeatedBytesCount { - get { return repeatedBytes_.Count; } - } - public pb::ByteString GetRepeatedBytes(int index) { - return repeatedBytes_[index]; - } - - public const int RepeatedGroupFieldNumber = 46; - private pbc::PopsicleList repeatedGroup_ = new pbc::PopsicleList(); - public scg::IList RepeatedGroupList { - get { return repeatedGroup_; } - } - public int RepeatedGroupCount { - get { return repeatedGroup_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup GetRepeatedGroup(int index) { - return repeatedGroup_[index]; - } - - public const int RepeatedNestedMessageFieldNumber = 48; - private pbc::PopsicleList repeatedNestedMessage_ = new pbc::PopsicleList(); - public scg::IList RepeatedNestedMessageList { - get { return repeatedNestedMessage_; } - } - public int RepeatedNestedMessageCount { - get { return repeatedNestedMessage_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage GetRepeatedNestedMessage(int index) { - return repeatedNestedMessage_[index]; - } - - public const int RepeatedForeignMessageFieldNumber = 49; - private pbc::PopsicleList repeatedForeignMessage_ = new pbc::PopsicleList(); - public scg::IList RepeatedForeignMessageList { - get { return repeatedForeignMessage_; } - } - public int RepeatedForeignMessageCount { - get { return repeatedForeignMessage_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage GetRepeatedForeignMessage(int index) { - return repeatedForeignMessage_[index]; - } - - public const int RepeatedImportMessageFieldNumber = 50; - private pbc::PopsicleList repeatedImportMessage_ = new pbc::PopsicleList(); - public scg::IList RepeatedImportMessageList { - get { return repeatedImportMessage_; } - } - public int RepeatedImportMessageCount { - get { return repeatedImportMessage_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportMessage GetRepeatedImportMessage(int index) { - return repeatedImportMessage_[index]; - } - - public const int RepeatedNestedEnumFieldNumber = 51; - private pbc::PopsicleList repeatedNestedEnum_ = new pbc::PopsicleList(); - public scg::IList RepeatedNestedEnumList { - get { return pbc::Lists.AsReadOnly(repeatedNestedEnum_); } - } - public int RepeatedNestedEnumCount { - get { return repeatedNestedEnum_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum GetRepeatedNestedEnum(int index) { - return repeatedNestedEnum_[index]; - } - - public const int RepeatedForeignEnumFieldNumber = 52; - private pbc::PopsicleList repeatedForeignEnum_ = new pbc::PopsicleList(); - public scg::IList RepeatedForeignEnumList { - get { return pbc::Lists.AsReadOnly(repeatedForeignEnum_); } - } - public int RepeatedForeignEnumCount { - get { return repeatedForeignEnum_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum GetRepeatedForeignEnum(int index) { - return repeatedForeignEnum_[index]; - } - - public const int RepeatedImportEnumFieldNumber = 53; - private pbc::PopsicleList repeatedImportEnum_ = new pbc::PopsicleList(); - public scg::IList RepeatedImportEnumList { - get { return pbc::Lists.AsReadOnly(repeatedImportEnum_); } - } - public int RepeatedImportEnumCount { - get { return repeatedImportEnum_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportEnum GetRepeatedImportEnum(int index) { - return repeatedImportEnum_[index]; - } - - public const int RepeatedStringPieceFieldNumber = 54; - private pbc::PopsicleList repeatedStringPiece_ = new pbc::PopsicleList(); - public scg::IList RepeatedStringPieceList { - get { return pbc::Lists.AsReadOnly(repeatedStringPiece_); } - } - public int RepeatedStringPieceCount { - get { return repeatedStringPiece_.Count; } - } - public string GetRepeatedStringPiece(int index) { - return repeatedStringPiece_[index]; - } - - public const int RepeatedCordFieldNumber = 55; - private pbc::PopsicleList repeatedCord_ = new pbc::PopsicleList(); - public scg::IList RepeatedCordList { - get { return pbc::Lists.AsReadOnly(repeatedCord_); } - } - public int RepeatedCordCount { - get { return repeatedCord_.Count; } - } - public string GetRepeatedCord(int index) { - return repeatedCord_[index]; - } - - public const int DefaultInt32FieldNumber = 61; - private bool hasDefaultInt32; - private int defaultInt32_ = 41; - public bool HasDefaultInt32 { - get { return hasDefaultInt32; } - } - public int DefaultInt32 { - get { return defaultInt32_; } - } - - public const int DefaultInt64FieldNumber = 62; - private bool hasDefaultInt64; - private long defaultInt64_ = 42L; - public bool HasDefaultInt64 { - get { return hasDefaultInt64; } - } - public long DefaultInt64 { - get { return defaultInt64_; } - } - - public const int DefaultUint32FieldNumber = 63; - private bool hasDefaultUint32; - private uint defaultUint32_ = 43; - public bool HasDefaultUint32 { - get { return hasDefaultUint32; } - } - [global::System.CLSCompliant(false)] - public uint DefaultUint32 { - get { return defaultUint32_; } - } - - public const int DefaultUint64FieldNumber = 64; - private bool hasDefaultUint64; - private ulong defaultUint64_ = 44UL; - public bool HasDefaultUint64 { - get { return hasDefaultUint64; } - } - [global::System.CLSCompliant(false)] - public ulong DefaultUint64 { - get { return defaultUint64_; } - } - - public const int DefaultSint32FieldNumber = 65; - private bool hasDefaultSint32; - private int defaultSint32_ = -45; - public bool HasDefaultSint32 { - get { return hasDefaultSint32; } - } - public int DefaultSint32 { - get { return defaultSint32_; } - } - - public const int DefaultSint64FieldNumber = 66; - private bool hasDefaultSint64; - private long defaultSint64_ = 46; - public bool HasDefaultSint64 { - get { return hasDefaultSint64; } - } - public long DefaultSint64 { - get { return defaultSint64_; } - } - - public const int DefaultFixed32FieldNumber = 67; - private bool hasDefaultFixed32; - private uint defaultFixed32_ = 47; - public bool HasDefaultFixed32 { - get { return hasDefaultFixed32; } - } - [global::System.CLSCompliant(false)] - public uint DefaultFixed32 { - get { return defaultFixed32_; } - } - - public const int DefaultFixed64FieldNumber = 68; - private bool hasDefaultFixed64; - private ulong defaultFixed64_ = 48; - public bool HasDefaultFixed64 { - get { return hasDefaultFixed64; } - } - [global::System.CLSCompliant(false)] - public ulong DefaultFixed64 { - get { return defaultFixed64_; } - } - - public const int DefaultSfixed32FieldNumber = 69; - private bool hasDefaultSfixed32; - private int defaultSfixed32_ = 49; - public bool HasDefaultSfixed32 { - get { return hasDefaultSfixed32; } - } - public int DefaultSfixed32 { - get { return defaultSfixed32_; } - } - - public const int DefaultSfixed64FieldNumber = 70; - private bool hasDefaultSfixed64; - private long defaultSfixed64_ = -50; - public bool HasDefaultSfixed64 { - get { return hasDefaultSfixed64; } - } - public long DefaultSfixed64 { - get { return defaultSfixed64_; } - } - - public const int DefaultFloatFieldNumber = 71; - private bool hasDefaultFloat; - private float defaultFloat_ = 51.5F; - public bool HasDefaultFloat { - get { return hasDefaultFloat; } - } - public float DefaultFloat { - get { return defaultFloat_; } - } - - public const int DefaultDoubleFieldNumber = 72; - private bool hasDefaultDouble; - private double defaultDouble_ = 52000D; - public bool HasDefaultDouble { - get { return hasDefaultDouble; } - } - public double DefaultDouble { - get { return defaultDouble_; } - } - - public const int DefaultBoolFieldNumber = 73; - private bool hasDefaultBool; - private bool defaultBool_ = true; - public bool HasDefaultBool { - get { return hasDefaultBool; } - } - public bool DefaultBool { - get { return defaultBool_; } - } - - public const int DefaultStringFieldNumber = 74; - private bool hasDefaultString; - private string defaultString_ = "hello"; - public bool HasDefaultString { - get { return hasDefaultString; } - } - public string DefaultString { - get { return defaultString_; } - } - - public const int DefaultBytesFieldNumber = 75; - private bool hasDefaultBytes; - private pb::ByteString defaultBytes_ = (pb::ByteString) global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Descriptor.Fields[62].DefaultValue; - public bool HasDefaultBytes { - get { return hasDefaultBytes; } - } - public pb::ByteString DefaultBytes { - get { return defaultBytes_; } - } - - public const int DefaultNestedEnumFieldNumber = 81; - private bool hasDefaultNestedEnum; - private global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum defaultNestedEnum_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum.BAR; - public bool HasDefaultNestedEnum { - get { return hasDefaultNestedEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum DefaultNestedEnum { - get { return defaultNestedEnum_; } - } - - public const int DefaultForeignEnumFieldNumber = 82; - private bool hasDefaultForeignEnum; - private global::Google.ProtocolBuffers.TestProtos.ForeignEnum defaultForeignEnum_ = global::Google.ProtocolBuffers.TestProtos.ForeignEnum.FOREIGN_BAR; - public bool HasDefaultForeignEnum { - get { return hasDefaultForeignEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum DefaultForeignEnum { - get { return defaultForeignEnum_; } - } - - public const int DefaultImportEnumFieldNumber = 83; - private bool hasDefaultImportEnum; - private global::Google.ProtocolBuffers.TestProtos.ImportEnum defaultImportEnum_ = global::Google.ProtocolBuffers.TestProtos.ImportEnum.IMPORT_BAR; - public bool HasDefaultImportEnum { - get { return hasDefaultImportEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportEnum DefaultImportEnum { - get { return defaultImportEnum_; } - } - - public const int DefaultStringPieceFieldNumber = 84; - private bool hasDefaultStringPiece; - private string defaultStringPiece_ = "abc"; - public bool HasDefaultStringPiece { - get { return hasDefaultStringPiece; } - } - public string DefaultStringPiece { - get { return defaultStringPiece_; } - } - - public const int DefaultCordFieldNumber = 85; - private bool hasDefaultCord; - private string defaultCord_ = "123"; - public bool HasDefaultCord { - get { return hasDefaultCord; } - } - public string DefaultCord { - get { return defaultCord_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testAllTypesFieldNames; - if (hasOptionalInt32) { - output.WriteInt32(1, field_names[31], OptionalInt32); - } - if (hasOptionalInt64) { - output.WriteInt64(2, field_names[32], OptionalInt64); - } - if (hasOptionalUint32) { - output.WriteUInt32(3, field_names[41], OptionalUint32); - } - if (hasOptionalUint64) { - output.WriteUInt64(4, field_names[42], OptionalUint64); - } - if (hasOptionalSint32) { - output.WriteSInt32(5, field_names[37], OptionalSint32); - } - if (hasOptionalSint64) { - output.WriteSInt64(6, field_names[38], OptionalSint64); - } - if (hasOptionalFixed32) { - output.WriteFixed32(7, field_names[24], OptionalFixed32); - } - if (hasOptionalFixed64) { - output.WriteFixed64(8, field_names[25], OptionalFixed64); - } - if (hasOptionalSfixed32) { - output.WriteSFixed32(9, field_names[35], OptionalSfixed32); - } - if (hasOptionalSfixed64) { - output.WriteSFixed64(10, field_names[36], OptionalSfixed64); - } - if (hasOptionalFloat) { - output.WriteFloat(11, field_names[26], OptionalFloat); - } - if (hasOptionalDouble) { - output.WriteDouble(12, field_names[23], OptionalDouble); - } - if (hasOptionalBool) { - output.WriteBool(13, field_names[20], OptionalBool); - } - if (hasOptionalString) { - output.WriteString(14, field_names[39], OptionalString); - } - if (hasOptionalBytes) { - output.WriteBytes(15, field_names[21], OptionalBytes); - } - if (hasOptionalGroup) { - output.WriteGroup(16, field_names[43], OptionalGroup); - } - if (hasOptionalNestedMessage) { - output.WriteMessage(18, field_names[34], OptionalNestedMessage); - } - if (hasOptionalForeignMessage) { - output.WriteMessage(19, field_names[28], OptionalForeignMessage); - } - if (hasOptionalImportMessage) { - output.WriteMessage(20, field_names[30], OptionalImportMessage); - } - if (hasOptionalNestedEnum) { - output.WriteEnum(21, field_names[33], (int) OptionalNestedEnum, OptionalNestedEnum); - } - if (hasOptionalForeignEnum) { - output.WriteEnum(22, field_names[27], (int) OptionalForeignEnum, OptionalForeignEnum); - } - if (hasOptionalImportEnum) { - output.WriteEnum(23, field_names[29], (int) OptionalImportEnum, OptionalImportEnum); - } - if (hasOptionalStringPiece) { - output.WriteString(24, field_names[40], OptionalStringPiece); - } - if (hasOptionalCord) { - output.WriteString(25, field_names[22], OptionalCord); - } - if (repeatedInt32_.Count > 0) { - output.WriteInt32Array(31, field_names[55], repeatedInt32_); - } - if (repeatedInt64_.Count > 0) { - output.WriteInt64Array(32, field_names[56], repeatedInt64_); - } - if (repeatedUint32_.Count > 0) { - output.WriteUInt32Array(33, field_names[65], repeatedUint32_); - } - if (repeatedUint64_.Count > 0) { - output.WriteUInt64Array(34, field_names[66], repeatedUint64_); - } - if (repeatedSint32_.Count > 0) { - output.WriteSInt32Array(35, field_names[61], repeatedSint32_); - } - if (repeatedSint64_.Count > 0) { - output.WriteSInt64Array(36, field_names[62], repeatedSint64_); - } - if (repeatedFixed32_.Count > 0) { - output.WriteFixed32Array(37, field_names[48], repeatedFixed32_); - } - if (repeatedFixed64_.Count > 0) { - output.WriteFixed64Array(38, field_names[49], repeatedFixed64_); - } - if (repeatedSfixed32_.Count > 0) { - output.WriteSFixed32Array(39, field_names[59], repeatedSfixed32_); - } - if (repeatedSfixed64_.Count > 0) { - output.WriteSFixed64Array(40, field_names[60], repeatedSfixed64_); - } - if (repeatedFloat_.Count > 0) { - output.WriteFloatArray(41, field_names[50], repeatedFloat_); - } - if (repeatedDouble_.Count > 0) { - output.WriteDoubleArray(42, field_names[47], repeatedDouble_); - } - if (repeatedBool_.Count > 0) { - output.WriteBoolArray(43, field_names[44], repeatedBool_); - } - if (repeatedString_.Count > 0) { - output.WriteStringArray(44, field_names[63], repeatedString_); - } - if (repeatedBytes_.Count > 0) { - output.WriteBytesArray(45, field_names[45], repeatedBytes_); - } - if (repeatedGroup_.Count > 0) { - output.WriteGroupArray(46, field_names[67], repeatedGroup_); - } - if (repeatedNestedMessage_.Count > 0) { - output.WriteMessageArray(48, field_names[58], repeatedNestedMessage_); - } - if (repeatedForeignMessage_.Count > 0) { - output.WriteMessageArray(49, field_names[52], repeatedForeignMessage_); - } - if (repeatedImportMessage_.Count > 0) { - output.WriteMessageArray(50, field_names[54], repeatedImportMessage_); - } - if (repeatedNestedEnum_.Count > 0) { - output.WriteEnumArray(51, field_names[57], repeatedNestedEnum_); - } - if (repeatedForeignEnum_.Count > 0) { - output.WriteEnumArray(52, field_names[51], repeatedForeignEnum_); - } - if (repeatedImportEnum_.Count > 0) { - output.WriteEnumArray(53, field_names[53], repeatedImportEnum_); - } - if (repeatedStringPiece_.Count > 0) { - output.WriteStringArray(54, field_names[64], repeatedStringPiece_); - } - if (repeatedCord_.Count > 0) { - output.WriteStringArray(55, field_names[46], repeatedCord_); - } - if (hasDefaultInt32) { - output.WriteInt32(61, field_names[9], DefaultInt32); - } - if (hasDefaultInt64) { - output.WriteInt64(62, field_names[10], DefaultInt64); - } - if (hasDefaultUint32) { - output.WriteUInt32(63, field_names[18], DefaultUint32); - } - if (hasDefaultUint64) { - output.WriteUInt64(64, field_names[19], DefaultUint64); - } - if (hasDefaultSint32) { - output.WriteSInt32(65, field_names[14], DefaultSint32); - } - if (hasDefaultSint64) { - output.WriteSInt64(66, field_names[15], DefaultSint64); - } - if (hasDefaultFixed32) { - output.WriteFixed32(67, field_names[4], DefaultFixed32); - } - if (hasDefaultFixed64) { - output.WriteFixed64(68, field_names[5], DefaultFixed64); - } - if (hasDefaultSfixed32) { - output.WriteSFixed32(69, field_names[12], DefaultSfixed32); - } - if (hasDefaultSfixed64) { - output.WriteSFixed64(70, field_names[13], DefaultSfixed64); - } - if (hasDefaultFloat) { - output.WriteFloat(71, field_names[6], DefaultFloat); - } - if (hasDefaultDouble) { - output.WriteDouble(72, field_names[3], DefaultDouble); - } - if (hasDefaultBool) { - output.WriteBool(73, field_names[0], DefaultBool); - } - if (hasDefaultString) { - output.WriteString(74, field_names[16], DefaultString); - } - if (hasDefaultBytes) { - output.WriteBytes(75, field_names[1], DefaultBytes); - } - if (hasDefaultNestedEnum) { - output.WriteEnum(81, field_names[11], (int) DefaultNestedEnum, DefaultNestedEnum); - } - if (hasDefaultForeignEnum) { - output.WriteEnum(82, field_names[7], (int) DefaultForeignEnum, DefaultForeignEnum); - } - if (hasDefaultImportEnum) { - output.WriteEnum(83, field_names[8], (int) DefaultImportEnum, DefaultImportEnum); - } - if (hasDefaultStringPiece) { - output.WriteString(84, field_names[17], DefaultStringPiece); - } - if (hasDefaultCord) { - output.WriteString(85, field_names[2], DefaultCord); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasOptionalInt32) { - size += pb::CodedOutputStream.ComputeInt32Size(1, OptionalInt32); - } - if (hasOptionalInt64) { - size += pb::CodedOutputStream.ComputeInt64Size(2, OptionalInt64); - } - if (hasOptionalUint32) { - size += pb::CodedOutputStream.ComputeUInt32Size(3, OptionalUint32); - } - if (hasOptionalUint64) { - size += pb::CodedOutputStream.ComputeUInt64Size(4, OptionalUint64); - } - if (hasOptionalSint32) { - size += pb::CodedOutputStream.ComputeSInt32Size(5, OptionalSint32); - } - if (hasOptionalSint64) { - size += pb::CodedOutputStream.ComputeSInt64Size(6, OptionalSint64); - } - if (hasOptionalFixed32) { - size += pb::CodedOutputStream.ComputeFixed32Size(7, OptionalFixed32); - } - if (hasOptionalFixed64) { - size += pb::CodedOutputStream.ComputeFixed64Size(8, OptionalFixed64); - } - if (hasOptionalSfixed32) { - size += pb::CodedOutputStream.ComputeSFixed32Size(9, OptionalSfixed32); - } - if (hasOptionalSfixed64) { - size += pb::CodedOutputStream.ComputeSFixed64Size(10, OptionalSfixed64); - } - if (hasOptionalFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(11, OptionalFloat); - } - if (hasOptionalDouble) { - size += pb::CodedOutputStream.ComputeDoubleSize(12, OptionalDouble); - } - if (hasOptionalBool) { - size += pb::CodedOutputStream.ComputeBoolSize(13, OptionalBool); - } - if (hasOptionalString) { - size += pb::CodedOutputStream.ComputeStringSize(14, OptionalString); - } - if (hasOptionalBytes) { - size += pb::CodedOutputStream.ComputeBytesSize(15, OptionalBytes); - } - if (hasOptionalGroup) { - size += pb::CodedOutputStream.ComputeGroupSize(16, OptionalGroup); - } - if (hasOptionalNestedMessage) { - size += pb::CodedOutputStream.ComputeMessageSize(18, OptionalNestedMessage); - } - if (hasOptionalForeignMessage) { - size += pb::CodedOutputStream.ComputeMessageSize(19, OptionalForeignMessage); - } - if (hasOptionalImportMessage) { - size += pb::CodedOutputStream.ComputeMessageSize(20, OptionalImportMessage); - } - if (hasOptionalNestedEnum) { - size += pb::CodedOutputStream.ComputeEnumSize(21, (int) OptionalNestedEnum); - } - if (hasOptionalForeignEnum) { - size += pb::CodedOutputStream.ComputeEnumSize(22, (int) OptionalForeignEnum); - } - if (hasOptionalImportEnum) { - size += pb::CodedOutputStream.ComputeEnumSize(23, (int) OptionalImportEnum); - } - if (hasOptionalStringPiece) { - size += pb::CodedOutputStream.ComputeStringSize(24, OptionalStringPiece); - } - if (hasOptionalCord) { - size += pb::CodedOutputStream.ComputeStringSize(25, OptionalCord); - } - { - int dataSize = 0; - foreach (int element in RepeatedInt32List) { - dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedInt32_.Count; - } - { - int dataSize = 0; - foreach (long element in RepeatedInt64List) { - dataSize += pb::CodedOutputStream.ComputeInt64SizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedInt64_.Count; - } - { - int dataSize = 0; - foreach (uint element in RepeatedUint32List) { - dataSize += pb::CodedOutputStream.ComputeUInt32SizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedUint32_.Count; - } - { - int dataSize = 0; - foreach (ulong element in RepeatedUint64List) { - dataSize += pb::CodedOutputStream.ComputeUInt64SizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedUint64_.Count; - } - { - int dataSize = 0; - foreach (int element in RepeatedSint32List) { - dataSize += pb::CodedOutputStream.ComputeSInt32SizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedSint32_.Count; - } - { - int dataSize = 0; - foreach (long element in RepeatedSint64List) { - dataSize += pb::CodedOutputStream.ComputeSInt64SizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedSint64_.Count; - } - { - int dataSize = 0; - dataSize = 4 * repeatedFixed32_.Count; - size += dataSize; - size += 2 * repeatedFixed32_.Count; - } - { - int dataSize = 0; - dataSize = 8 * repeatedFixed64_.Count; - size += dataSize; - size += 2 * repeatedFixed64_.Count; - } - { - int dataSize = 0; - dataSize = 4 * repeatedSfixed32_.Count; - size += dataSize; - size += 2 * repeatedSfixed32_.Count; - } - { - int dataSize = 0; - dataSize = 8 * repeatedSfixed64_.Count; - size += dataSize; - size += 2 * repeatedSfixed64_.Count; - } - { - int dataSize = 0; - dataSize = 4 * repeatedFloat_.Count; - size += dataSize; - size += 2 * repeatedFloat_.Count; - } - { - int dataSize = 0; - dataSize = 8 * repeatedDouble_.Count; - size += dataSize; - size += 2 * repeatedDouble_.Count; - } - { - int dataSize = 0; - dataSize = 1 * repeatedBool_.Count; - size += dataSize; - size += 2 * repeatedBool_.Count; - } - { - int dataSize = 0; - foreach (string element in RepeatedStringList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedString_.Count; - } - { - int dataSize = 0; - foreach (pb::ByteString element in RepeatedBytesList) { - dataSize += pb::CodedOutputStream.ComputeBytesSizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedBytes_.Count; - } - foreach (global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup element in RepeatedGroupList) { - size += pb::CodedOutputStream.ComputeGroupSize(46, element); - } - foreach (global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage element in RepeatedNestedMessageList) { - size += pb::CodedOutputStream.ComputeMessageSize(48, element); - } - foreach (global::Google.ProtocolBuffers.TestProtos.ForeignMessage element in RepeatedForeignMessageList) { - size += pb::CodedOutputStream.ComputeMessageSize(49, element); - } - foreach (global::Google.ProtocolBuffers.TestProtos.ImportMessage element in RepeatedImportMessageList) { - size += pb::CodedOutputStream.ComputeMessageSize(50, element); - } - { - int dataSize = 0; - if (repeatedNestedEnum_.Count > 0) { - foreach (global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum element in repeatedNestedEnum_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 2 * repeatedNestedEnum_.Count; - } - } - { - int dataSize = 0; - if (repeatedForeignEnum_.Count > 0) { - foreach (global::Google.ProtocolBuffers.TestProtos.ForeignEnum element in repeatedForeignEnum_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 2 * repeatedForeignEnum_.Count; - } - } - { - int dataSize = 0; - if (repeatedImportEnum_.Count > 0) { - foreach (global::Google.ProtocolBuffers.TestProtos.ImportEnum element in repeatedImportEnum_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 2 * repeatedImportEnum_.Count; - } - } - { - int dataSize = 0; - foreach (string element in RepeatedStringPieceList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedStringPiece_.Count; - } - { - int dataSize = 0; - foreach (string element in RepeatedCordList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedCord_.Count; - } - if (hasDefaultInt32) { - size += pb::CodedOutputStream.ComputeInt32Size(61, DefaultInt32); - } - if (hasDefaultInt64) { - size += pb::CodedOutputStream.ComputeInt64Size(62, DefaultInt64); - } - if (hasDefaultUint32) { - size += pb::CodedOutputStream.ComputeUInt32Size(63, DefaultUint32); - } - if (hasDefaultUint64) { - size += pb::CodedOutputStream.ComputeUInt64Size(64, DefaultUint64); - } - if (hasDefaultSint32) { - size += pb::CodedOutputStream.ComputeSInt32Size(65, DefaultSint32); - } - if (hasDefaultSint64) { - size += pb::CodedOutputStream.ComputeSInt64Size(66, DefaultSint64); - } - if (hasDefaultFixed32) { - size += pb::CodedOutputStream.ComputeFixed32Size(67, DefaultFixed32); - } - if (hasDefaultFixed64) { - size += pb::CodedOutputStream.ComputeFixed64Size(68, DefaultFixed64); - } - if (hasDefaultSfixed32) { - size += pb::CodedOutputStream.ComputeSFixed32Size(69, DefaultSfixed32); - } - if (hasDefaultSfixed64) { - size += pb::CodedOutputStream.ComputeSFixed64Size(70, DefaultSfixed64); - } - if (hasDefaultFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(71, DefaultFloat); - } - if (hasDefaultDouble) { - size += pb::CodedOutputStream.ComputeDoubleSize(72, DefaultDouble); - } - if (hasDefaultBool) { - size += pb::CodedOutputStream.ComputeBoolSize(73, DefaultBool); - } - if (hasDefaultString) { - size += pb::CodedOutputStream.ComputeStringSize(74, DefaultString); - } - if (hasDefaultBytes) { - size += pb::CodedOutputStream.ComputeBytesSize(75, DefaultBytes); - } - if (hasDefaultNestedEnum) { - size += pb::CodedOutputStream.ComputeEnumSize(81, (int) DefaultNestedEnum); - } - if (hasDefaultForeignEnum) { - size += pb::CodedOutputStream.ComputeEnumSize(82, (int) DefaultForeignEnum); - } - if (hasDefaultImportEnum) { - size += pb::CodedOutputStream.ComputeEnumSize(83, (int) DefaultImportEnum); - } - if (hasDefaultStringPiece) { - size += pb::CodedOutputStream.ComputeStringSize(84, DefaultStringPiece); - } - if (hasDefaultCord) { - size += pb::CodedOutputStream.ComputeStringSize(85, DefaultCord); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestAllTypes ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestAllTypes ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestAllTypes ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestAllTypes ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestAllTypes ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestAllTypes ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestAllTypes ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestAllTypes ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestAllTypes ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestAllTypes ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestAllTypes MakeReadOnly() { - repeatedInt32_.MakeReadOnly(); - repeatedInt64_.MakeReadOnly(); - repeatedUint32_.MakeReadOnly(); - repeatedUint64_.MakeReadOnly(); - repeatedSint32_.MakeReadOnly(); - repeatedSint64_.MakeReadOnly(); - repeatedFixed32_.MakeReadOnly(); - repeatedFixed64_.MakeReadOnly(); - repeatedSfixed32_.MakeReadOnly(); - repeatedSfixed64_.MakeReadOnly(); - repeatedFloat_.MakeReadOnly(); - repeatedDouble_.MakeReadOnly(); - repeatedBool_.MakeReadOnly(); - repeatedString_.MakeReadOnly(); - repeatedBytes_.MakeReadOnly(); - repeatedGroup_.MakeReadOnly(); - repeatedNestedMessage_.MakeReadOnly(); - repeatedForeignMessage_.MakeReadOnly(); - repeatedImportMessage_.MakeReadOnly(); - repeatedNestedEnum_.MakeReadOnly(); - repeatedForeignEnum_.MakeReadOnly(); - repeatedImportEnum_.MakeReadOnly(); - repeatedStringPiece_.MakeReadOnly(); - repeatedCord_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestAllTypes prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestAllTypes cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestAllTypes result; - - private TestAllTypes PrepareBuilder() { - if (resultIsReadOnly) { - TestAllTypes original = result; - result = new TestAllTypes(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestAllTypes MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Descriptor; } - } - - public override TestAllTypes DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypes.DefaultInstance; } - } - - public override TestAllTypes BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestAllTypes) { - return MergeFrom((TestAllTypes) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestAllTypes other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestAllTypes.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasOptionalInt32) { - OptionalInt32 = other.OptionalInt32; - } - if (other.HasOptionalInt64) { - OptionalInt64 = other.OptionalInt64; - } - if (other.HasOptionalUint32) { - OptionalUint32 = other.OptionalUint32; - } - if (other.HasOptionalUint64) { - OptionalUint64 = other.OptionalUint64; - } - if (other.HasOptionalSint32) { - OptionalSint32 = other.OptionalSint32; - } - if (other.HasOptionalSint64) { - OptionalSint64 = other.OptionalSint64; - } - if (other.HasOptionalFixed32) { - OptionalFixed32 = other.OptionalFixed32; - } - if (other.HasOptionalFixed64) { - OptionalFixed64 = other.OptionalFixed64; - } - if (other.HasOptionalSfixed32) { - OptionalSfixed32 = other.OptionalSfixed32; - } - if (other.HasOptionalSfixed64) { - OptionalSfixed64 = other.OptionalSfixed64; - } - if (other.HasOptionalFloat) { - OptionalFloat = other.OptionalFloat; - } - if (other.HasOptionalDouble) { - OptionalDouble = other.OptionalDouble; - } - if (other.HasOptionalBool) { - OptionalBool = other.OptionalBool; - } - if (other.HasOptionalString) { - OptionalString = other.OptionalString; - } - if (other.HasOptionalBytes) { - OptionalBytes = other.OptionalBytes; - } - if (other.HasOptionalGroup) { - MergeOptionalGroup(other.OptionalGroup); - } - if (other.HasOptionalNestedMessage) { - MergeOptionalNestedMessage(other.OptionalNestedMessage); - } - if (other.HasOptionalForeignMessage) { - MergeOptionalForeignMessage(other.OptionalForeignMessage); - } - if (other.HasOptionalImportMessage) { - MergeOptionalImportMessage(other.OptionalImportMessage); - } - if (other.HasOptionalNestedEnum) { - OptionalNestedEnum = other.OptionalNestedEnum; - } - if (other.HasOptionalForeignEnum) { - OptionalForeignEnum = other.OptionalForeignEnum; - } - if (other.HasOptionalImportEnum) { - OptionalImportEnum = other.OptionalImportEnum; - } - if (other.HasOptionalStringPiece) { - OptionalStringPiece = other.OptionalStringPiece; - } - if (other.HasOptionalCord) { - OptionalCord = other.OptionalCord; - } - if (other.repeatedInt32_.Count != 0) { - result.repeatedInt32_.Add(other.repeatedInt32_); - } - if (other.repeatedInt64_.Count != 0) { - result.repeatedInt64_.Add(other.repeatedInt64_); - } - if (other.repeatedUint32_.Count != 0) { - result.repeatedUint32_.Add(other.repeatedUint32_); - } - if (other.repeatedUint64_.Count != 0) { - result.repeatedUint64_.Add(other.repeatedUint64_); - } - if (other.repeatedSint32_.Count != 0) { - result.repeatedSint32_.Add(other.repeatedSint32_); - } - if (other.repeatedSint64_.Count != 0) { - result.repeatedSint64_.Add(other.repeatedSint64_); - } - if (other.repeatedFixed32_.Count != 0) { - result.repeatedFixed32_.Add(other.repeatedFixed32_); - } - if (other.repeatedFixed64_.Count != 0) { - result.repeatedFixed64_.Add(other.repeatedFixed64_); - } - if (other.repeatedSfixed32_.Count != 0) { - result.repeatedSfixed32_.Add(other.repeatedSfixed32_); - } - if (other.repeatedSfixed64_.Count != 0) { - result.repeatedSfixed64_.Add(other.repeatedSfixed64_); - } - if (other.repeatedFloat_.Count != 0) { - result.repeatedFloat_.Add(other.repeatedFloat_); - } - if (other.repeatedDouble_.Count != 0) { - result.repeatedDouble_.Add(other.repeatedDouble_); - } - if (other.repeatedBool_.Count != 0) { - result.repeatedBool_.Add(other.repeatedBool_); - } - if (other.repeatedString_.Count != 0) { - result.repeatedString_.Add(other.repeatedString_); - } - if (other.repeatedBytes_.Count != 0) { - result.repeatedBytes_.Add(other.repeatedBytes_); - } - if (other.repeatedGroup_.Count != 0) { - result.repeatedGroup_.Add(other.repeatedGroup_); - } - if (other.repeatedNestedMessage_.Count != 0) { - result.repeatedNestedMessage_.Add(other.repeatedNestedMessage_); - } - if (other.repeatedForeignMessage_.Count != 0) { - result.repeatedForeignMessage_.Add(other.repeatedForeignMessage_); - } - if (other.repeatedImportMessage_.Count != 0) { - result.repeatedImportMessage_.Add(other.repeatedImportMessage_); - } - if (other.repeatedNestedEnum_.Count != 0) { - result.repeatedNestedEnum_.Add(other.repeatedNestedEnum_); - } - if (other.repeatedForeignEnum_.Count != 0) { - result.repeatedForeignEnum_.Add(other.repeatedForeignEnum_); - } - if (other.repeatedImportEnum_.Count != 0) { - result.repeatedImportEnum_.Add(other.repeatedImportEnum_); - } - if (other.repeatedStringPiece_.Count != 0) { - result.repeatedStringPiece_.Add(other.repeatedStringPiece_); - } - if (other.repeatedCord_.Count != 0) { - result.repeatedCord_.Add(other.repeatedCord_); - } - if (other.HasDefaultInt32) { - DefaultInt32 = other.DefaultInt32; - } - if (other.HasDefaultInt64) { - DefaultInt64 = other.DefaultInt64; - } - if (other.HasDefaultUint32) { - DefaultUint32 = other.DefaultUint32; - } - if (other.HasDefaultUint64) { - DefaultUint64 = other.DefaultUint64; - } - if (other.HasDefaultSint32) { - DefaultSint32 = other.DefaultSint32; - } - if (other.HasDefaultSint64) { - DefaultSint64 = other.DefaultSint64; - } - if (other.HasDefaultFixed32) { - DefaultFixed32 = other.DefaultFixed32; - } - if (other.HasDefaultFixed64) { - DefaultFixed64 = other.DefaultFixed64; - } - if (other.HasDefaultSfixed32) { - DefaultSfixed32 = other.DefaultSfixed32; - } - if (other.HasDefaultSfixed64) { - DefaultSfixed64 = other.DefaultSfixed64; - } - if (other.HasDefaultFloat) { - DefaultFloat = other.DefaultFloat; - } - if (other.HasDefaultDouble) { - DefaultDouble = other.DefaultDouble; - } - if (other.HasDefaultBool) { - DefaultBool = other.DefaultBool; - } - if (other.HasDefaultString) { - DefaultString = other.DefaultString; - } - if (other.HasDefaultBytes) { - DefaultBytes = other.DefaultBytes; - } - if (other.HasDefaultNestedEnum) { - DefaultNestedEnum = other.DefaultNestedEnum; - } - if (other.HasDefaultForeignEnum) { - DefaultForeignEnum = other.DefaultForeignEnum; - } - if (other.HasDefaultImportEnum) { - DefaultImportEnum = other.DefaultImportEnum; - } - if (other.HasDefaultStringPiece) { - DefaultStringPiece = other.DefaultStringPiece; - } - if (other.HasDefaultCord) { - DefaultCord = other.DefaultCord; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testAllTypesFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testAllTypesFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasOptionalInt32 = input.ReadInt32(ref result.optionalInt32_); - break; - } - case 16: { - result.hasOptionalInt64 = input.ReadInt64(ref result.optionalInt64_); - break; - } - case 24: { - result.hasOptionalUint32 = input.ReadUInt32(ref result.optionalUint32_); - break; - } - case 32: { - result.hasOptionalUint64 = input.ReadUInt64(ref result.optionalUint64_); - break; - } - case 40: { - result.hasOptionalSint32 = input.ReadSInt32(ref result.optionalSint32_); - break; - } - case 48: { - result.hasOptionalSint64 = input.ReadSInt64(ref result.optionalSint64_); - break; - } - case 61: { - result.hasOptionalFixed32 = input.ReadFixed32(ref result.optionalFixed32_); - break; - } - case 65: { - result.hasOptionalFixed64 = input.ReadFixed64(ref result.optionalFixed64_); - break; - } - case 77: { - result.hasOptionalSfixed32 = input.ReadSFixed32(ref result.optionalSfixed32_); - break; - } - case 81: { - result.hasOptionalSfixed64 = input.ReadSFixed64(ref result.optionalSfixed64_); - break; - } - case 93: { - result.hasOptionalFloat = input.ReadFloat(ref result.optionalFloat_); - break; - } - case 97: { - result.hasOptionalDouble = input.ReadDouble(ref result.optionalDouble_); - break; - } - case 104: { - result.hasOptionalBool = input.ReadBool(ref result.optionalBool_); - break; - } - case 114: { - result.hasOptionalString = input.ReadString(ref result.optionalString_); - break; - } - case 122: { - result.hasOptionalBytes = input.ReadBytes(ref result.optionalBytes_); - break; - } - case 131: { - global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.CreateBuilder(); - if (result.hasOptionalGroup) { - subBuilder.MergeFrom(OptionalGroup); - } - input.ReadGroup(16, subBuilder, extensionRegistry); - OptionalGroup = subBuilder.BuildPartial(); - break; - } - case 146: { - global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.CreateBuilder(); - if (result.hasOptionalNestedMessage) { - subBuilder.MergeFrom(OptionalNestedMessage); - } - input.ReadMessage(subBuilder, extensionRegistry); - OptionalNestedMessage = subBuilder.BuildPartial(); - break; - } - case 154: { - global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.ForeignMessage.CreateBuilder(); - if (result.hasOptionalForeignMessage) { - subBuilder.MergeFrom(OptionalForeignMessage); - } - input.ReadMessage(subBuilder, extensionRegistry); - OptionalForeignMessage = subBuilder.BuildPartial(); - break; - } - case 162: { - global::Google.ProtocolBuffers.TestProtos.ImportMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.ImportMessage.CreateBuilder(); - if (result.hasOptionalImportMessage) { - subBuilder.MergeFrom(OptionalImportMessage); - } - input.ReadMessage(subBuilder, extensionRegistry); - OptionalImportMessage = subBuilder.BuildPartial(); - break; - } - case 168: { - object unknown; - if(input.ReadEnum(ref result.optionalNestedEnum_, out unknown)) { - result.hasOptionalNestedEnum = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(21, (ulong)(int)unknown); - } - break; - } - case 176: { - object unknown; - if(input.ReadEnum(ref result.optionalForeignEnum_, out unknown)) { - result.hasOptionalForeignEnum = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(22, (ulong)(int)unknown); - } - break; - } - case 184: { - object unknown; - if(input.ReadEnum(ref result.optionalImportEnum_, out unknown)) { - result.hasOptionalImportEnum = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(23, (ulong)(int)unknown); - } - break; - } - case 194: { - result.hasOptionalStringPiece = input.ReadString(ref result.optionalStringPiece_); - break; - } - case 202: { - result.hasOptionalCord = input.ReadString(ref result.optionalCord_); - break; - } - case 250: - case 248: { - input.ReadInt32Array(tag, field_name, result.repeatedInt32_); - break; - } - case 258: - case 256: { - input.ReadInt64Array(tag, field_name, result.repeatedInt64_); - break; - } - case 266: - case 264: { - input.ReadUInt32Array(tag, field_name, result.repeatedUint32_); - break; - } - case 274: - case 272: { - input.ReadUInt64Array(tag, field_name, result.repeatedUint64_); - break; - } - case 282: - case 280: { - input.ReadSInt32Array(tag, field_name, result.repeatedSint32_); - break; - } - case 290: - case 288: { - input.ReadSInt64Array(tag, field_name, result.repeatedSint64_); - break; - } - case 298: - case 301: { - input.ReadFixed32Array(tag, field_name, result.repeatedFixed32_); - break; - } - case 306: - case 305: { - input.ReadFixed64Array(tag, field_name, result.repeatedFixed64_); - break; - } - case 314: - case 317: { - input.ReadSFixed32Array(tag, field_name, result.repeatedSfixed32_); - break; - } - case 322: - case 321: { - input.ReadSFixed64Array(tag, field_name, result.repeatedSfixed64_); - break; - } - case 330: - case 333: { - input.ReadFloatArray(tag, field_name, result.repeatedFloat_); - break; - } - case 338: - case 337: { - input.ReadDoubleArray(tag, field_name, result.repeatedDouble_); - break; - } - case 346: - case 344: { - input.ReadBoolArray(tag, field_name, result.repeatedBool_); - break; - } - case 354: { - input.ReadStringArray(tag, field_name, result.repeatedString_); - break; - } - case 362: { - input.ReadBytesArray(tag, field_name, result.repeatedBytes_); - break; - } - case 371: { - input.ReadGroupArray(tag, field_name, result.repeatedGroup_, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup.DefaultInstance, extensionRegistry); - break; - } - case 386: { - input.ReadMessageArray(tag, field_name, result.repeatedNestedMessage_, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.DefaultInstance, extensionRegistry); - break; - } - case 394: { - input.ReadMessageArray(tag, field_name, result.repeatedForeignMessage_, global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance, extensionRegistry); - break; - } - case 402: { - input.ReadMessageArray(tag, field_name, result.repeatedImportMessage_, global::Google.ProtocolBuffers.TestProtos.ImportMessage.DefaultInstance, extensionRegistry); - break; - } - case 410: - case 408: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.repeatedNestedEnum_, out unknownItems); - if (unknownItems != null) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - foreach (object rawValue in unknownItems) - if (rawValue is int) - unknownFields.MergeVarintField(51, (ulong)(int)rawValue); - } - break; - } - case 418: - case 416: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.repeatedForeignEnum_, out unknownItems); - if (unknownItems != null) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - foreach (object rawValue in unknownItems) - if (rawValue is int) - unknownFields.MergeVarintField(52, (ulong)(int)rawValue); - } - break; - } - case 426: - case 424: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.repeatedImportEnum_, out unknownItems); - if (unknownItems != null) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - foreach (object rawValue in unknownItems) - if (rawValue is int) - unknownFields.MergeVarintField(53, (ulong)(int)rawValue); - } - break; - } - case 434: { - input.ReadStringArray(tag, field_name, result.repeatedStringPiece_); - break; - } - case 442: { - input.ReadStringArray(tag, field_name, result.repeatedCord_); - break; - } - case 488: { - result.hasDefaultInt32 = input.ReadInt32(ref result.defaultInt32_); - break; - } - case 496: { - result.hasDefaultInt64 = input.ReadInt64(ref result.defaultInt64_); - break; - } - case 504: { - result.hasDefaultUint32 = input.ReadUInt32(ref result.defaultUint32_); - break; - } - case 512: { - result.hasDefaultUint64 = input.ReadUInt64(ref result.defaultUint64_); - break; - } - case 520: { - result.hasDefaultSint32 = input.ReadSInt32(ref result.defaultSint32_); - break; - } - case 528: { - result.hasDefaultSint64 = input.ReadSInt64(ref result.defaultSint64_); - break; - } - case 541: { - result.hasDefaultFixed32 = input.ReadFixed32(ref result.defaultFixed32_); - break; - } - case 545: { - result.hasDefaultFixed64 = input.ReadFixed64(ref result.defaultFixed64_); - break; - } - case 557: { - result.hasDefaultSfixed32 = input.ReadSFixed32(ref result.defaultSfixed32_); - break; - } - case 561: { - result.hasDefaultSfixed64 = input.ReadSFixed64(ref result.defaultSfixed64_); - break; - } - case 573: { - result.hasDefaultFloat = input.ReadFloat(ref result.defaultFloat_); - break; - } - case 577: { - result.hasDefaultDouble = input.ReadDouble(ref result.defaultDouble_); - break; - } - case 584: { - result.hasDefaultBool = input.ReadBool(ref result.defaultBool_); - break; - } - case 594: { - result.hasDefaultString = input.ReadString(ref result.defaultString_); - break; - } - case 602: { - result.hasDefaultBytes = input.ReadBytes(ref result.defaultBytes_); - break; - } - case 648: { - object unknown; - if(input.ReadEnum(ref result.defaultNestedEnum_, out unknown)) { - result.hasDefaultNestedEnum = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(81, (ulong)(int)unknown); - } - break; - } - case 656: { - object unknown; - if(input.ReadEnum(ref result.defaultForeignEnum_, out unknown)) { - result.hasDefaultForeignEnum = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(82, (ulong)(int)unknown); - } - break; - } - case 664: { - object unknown; - if(input.ReadEnum(ref result.defaultImportEnum_, out unknown)) { - result.hasDefaultImportEnum = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(83, (ulong)(int)unknown); - } - break; - } - case 674: { - result.hasDefaultStringPiece = input.ReadString(ref result.defaultStringPiece_); - break; - } - case 682: { - result.hasDefaultCord = input.ReadString(ref result.defaultCord_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasOptionalInt32 { - get { return result.hasOptionalInt32; } - } - public int OptionalInt32 { - get { return result.OptionalInt32; } - set { SetOptionalInt32(value); } - } - public Builder SetOptionalInt32(int value) { - PrepareBuilder(); - result.hasOptionalInt32 = true; - result.optionalInt32_ = value; - return this; - } - public Builder ClearOptionalInt32() { - PrepareBuilder(); - result.hasOptionalInt32 = false; - result.optionalInt32_ = 0; - return this; - } - - public bool HasOptionalInt64 { - get { return result.hasOptionalInt64; } - } - public long OptionalInt64 { - get { return result.OptionalInt64; } - set { SetOptionalInt64(value); } - } - public Builder SetOptionalInt64(long value) { - PrepareBuilder(); - result.hasOptionalInt64 = true; - result.optionalInt64_ = value; - return this; - } - public Builder ClearOptionalInt64() { - PrepareBuilder(); - result.hasOptionalInt64 = false; - result.optionalInt64_ = 0L; - return this; - } - - public bool HasOptionalUint32 { - get { return result.hasOptionalUint32; } - } - [global::System.CLSCompliant(false)] - public uint OptionalUint32 { - get { return result.OptionalUint32; } - set { SetOptionalUint32(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetOptionalUint32(uint value) { - PrepareBuilder(); - result.hasOptionalUint32 = true; - result.optionalUint32_ = value; - return this; - } - public Builder ClearOptionalUint32() { - PrepareBuilder(); - result.hasOptionalUint32 = false; - result.optionalUint32_ = 0; - return this; - } - - public bool HasOptionalUint64 { - get { return result.hasOptionalUint64; } - } - [global::System.CLSCompliant(false)] - public ulong OptionalUint64 { - get { return result.OptionalUint64; } - set { SetOptionalUint64(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetOptionalUint64(ulong value) { - PrepareBuilder(); - result.hasOptionalUint64 = true; - result.optionalUint64_ = value; - return this; - } - public Builder ClearOptionalUint64() { - PrepareBuilder(); - result.hasOptionalUint64 = false; - result.optionalUint64_ = 0UL; - return this; - } - - public bool HasOptionalSint32 { - get { return result.hasOptionalSint32; } - } - public int OptionalSint32 { - get { return result.OptionalSint32; } - set { SetOptionalSint32(value); } - } - public Builder SetOptionalSint32(int value) { - PrepareBuilder(); - result.hasOptionalSint32 = true; - result.optionalSint32_ = value; - return this; - } - public Builder ClearOptionalSint32() { - PrepareBuilder(); - result.hasOptionalSint32 = false; - result.optionalSint32_ = 0; - return this; - } - - public bool HasOptionalSint64 { - get { return result.hasOptionalSint64; } - } - public long OptionalSint64 { - get { return result.OptionalSint64; } - set { SetOptionalSint64(value); } - } - public Builder SetOptionalSint64(long value) { - PrepareBuilder(); - result.hasOptionalSint64 = true; - result.optionalSint64_ = value; - return this; - } - public Builder ClearOptionalSint64() { - PrepareBuilder(); - result.hasOptionalSint64 = false; - result.optionalSint64_ = 0; - return this; - } - - public bool HasOptionalFixed32 { - get { return result.hasOptionalFixed32; } - } - [global::System.CLSCompliant(false)] - public uint OptionalFixed32 { - get { return result.OptionalFixed32; } - set { SetOptionalFixed32(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetOptionalFixed32(uint value) { - PrepareBuilder(); - result.hasOptionalFixed32 = true; - result.optionalFixed32_ = value; - return this; - } - public Builder ClearOptionalFixed32() { - PrepareBuilder(); - result.hasOptionalFixed32 = false; - result.optionalFixed32_ = 0; - return this; - } - - public bool HasOptionalFixed64 { - get { return result.hasOptionalFixed64; } - } - [global::System.CLSCompliant(false)] - public ulong OptionalFixed64 { - get { return result.OptionalFixed64; } - set { SetOptionalFixed64(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetOptionalFixed64(ulong value) { - PrepareBuilder(); - result.hasOptionalFixed64 = true; - result.optionalFixed64_ = value; - return this; - } - public Builder ClearOptionalFixed64() { - PrepareBuilder(); - result.hasOptionalFixed64 = false; - result.optionalFixed64_ = 0; - return this; - } - - public bool HasOptionalSfixed32 { - get { return result.hasOptionalSfixed32; } - } - public int OptionalSfixed32 { - get { return result.OptionalSfixed32; } - set { SetOptionalSfixed32(value); } - } - public Builder SetOptionalSfixed32(int value) { - PrepareBuilder(); - result.hasOptionalSfixed32 = true; - result.optionalSfixed32_ = value; - return this; - } - public Builder ClearOptionalSfixed32() { - PrepareBuilder(); - result.hasOptionalSfixed32 = false; - result.optionalSfixed32_ = 0; - return this; - } - - public bool HasOptionalSfixed64 { - get { return result.hasOptionalSfixed64; } - } - public long OptionalSfixed64 { - get { return result.OptionalSfixed64; } - set { SetOptionalSfixed64(value); } - } - public Builder SetOptionalSfixed64(long value) { - PrepareBuilder(); - result.hasOptionalSfixed64 = true; - result.optionalSfixed64_ = value; - return this; - } - public Builder ClearOptionalSfixed64() { - PrepareBuilder(); - result.hasOptionalSfixed64 = false; - result.optionalSfixed64_ = 0; - return this; - } - - public bool HasOptionalFloat { - get { return result.hasOptionalFloat; } - } - public float OptionalFloat { - get { return result.OptionalFloat; } - set { SetOptionalFloat(value); } - } - public Builder SetOptionalFloat(float value) { - PrepareBuilder(); - result.hasOptionalFloat = true; - result.optionalFloat_ = value; - return this; - } - public Builder ClearOptionalFloat() { - PrepareBuilder(); - result.hasOptionalFloat = false; - result.optionalFloat_ = 0F; - return this; - } - - public bool HasOptionalDouble { - get { return result.hasOptionalDouble; } - } - public double OptionalDouble { - get { return result.OptionalDouble; } - set { SetOptionalDouble(value); } - } - public Builder SetOptionalDouble(double value) { - PrepareBuilder(); - result.hasOptionalDouble = true; - result.optionalDouble_ = value; - return this; - } - public Builder ClearOptionalDouble() { - PrepareBuilder(); - result.hasOptionalDouble = false; - result.optionalDouble_ = 0D; - return this; - } - - public bool HasOptionalBool { - get { return result.hasOptionalBool; } - } - public bool OptionalBool { - get { return result.OptionalBool; } - set { SetOptionalBool(value); } - } - public Builder SetOptionalBool(bool value) { - PrepareBuilder(); - result.hasOptionalBool = true; - result.optionalBool_ = value; - return this; - } - public Builder ClearOptionalBool() { - PrepareBuilder(); - result.hasOptionalBool = false; - result.optionalBool_ = false; - return this; - } - - public bool HasOptionalString { - get { return result.hasOptionalString; } - } - public string OptionalString { - get { return result.OptionalString; } - set { SetOptionalString(value); } - } - public Builder SetOptionalString(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalString = true; - result.optionalString_ = value; - return this; - } - public Builder ClearOptionalString() { - PrepareBuilder(); - result.hasOptionalString = false; - result.optionalString_ = ""; - return this; - } - - public bool HasOptionalBytes { - get { return result.hasOptionalBytes; } - } - public pb::ByteString OptionalBytes { - get { return result.OptionalBytes; } - set { SetOptionalBytes(value); } - } - public Builder SetOptionalBytes(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalBytes = true; - result.optionalBytes_ = value; - return this; - } - public Builder ClearOptionalBytes() { - PrepareBuilder(); - result.hasOptionalBytes = false; - result.optionalBytes_ = pb::ByteString.Empty; - return this; - } - - public bool HasOptionalGroup { - get { return result.hasOptionalGroup; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup OptionalGroup { - get { return result.OptionalGroup; } - set { SetOptionalGroup(value); } - } - public Builder SetOptionalGroup(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalGroup = true; - result.optionalGroup_ = value; - return this; - } - public Builder SetOptionalGroup(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptionalGroup = true; - result.optionalGroup_ = builderForValue.Build(); - return this; - } - public Builder MergeOptionalGroup(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptionalGroup && - result.optionalGroup_ != global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.DefaultInstance) { - result.optionalGroup_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.CreateBuilder(result.optionalGroup_).MergeFrom(value).BuildPartial(); - } else { - result.optionalGroup_ = value; - } - result.hasOptionalGroup = true; - return this; - } - public Builder ClearOptionalGroup() { - PrepareBuilder(); - result.hasOptionalGroup = false; - result.optionalGroup_ = null; - return this; - } - - public bool HasOptionalNestedMessage { - get { return result.hasOptionalNestedMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage OptionalNestedMessage { - get { return result.OptionalNestedMessage; } - set { SetOptionalNestedMessage(value); } - } - public Builder SetOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalNestedMessage = true; - result.optionalNestedMessage_ = value; - return this; - } - public Builder SetOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptionalNestedMessage = true; - result.optionalNestedMessage_ = builderForValue.Build(); - return this; - } - public Builder MergeOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptionalNestedMessage && - result.optionalNestedMessage_ != global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.DefaultInstance) { - result.optionalNestedMessage_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.CreateBuilder(result.optionalNestedMessage_).MergeFrom(value).BuildPartial(); - } else { - result.optionalNestedMessage_ = value; - } - result.hasOptionalNestedMessage = true; - return this; - } - public Builder ClearOptionalNestedMessage() { - PrepareBuilder(); - result.hasOptionalNestedMessage = false; - result.optionalNestedMessage_ = null; - return this; - } - - public bool HasOptionalForeignMessage { - get { return result.hasOptionalForeignMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage OptionalForeignMessage { - get { return result.OptionalForeignMessage; } - set { SetOptionalForeignMessage(value); } - } - public Builder SetOptionalForeignMessage(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalForeignMessage = true; - result.optionalForeignMessage_ = value; - return this; - } - public Builder SetOptionalForeignMessage(global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptionalForeignMessage = true; - result.optionalForeignMessage_ = builderForValue.Build(); - return this; - } - public Builder MergeOptionalForeignMessage(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptionalForeignMessage && - result.optionalForeignMessage_ != global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance) { - result.optionalForeignMessage_ = global::Google.ProtocolBuffers.TestProtos.ForeignMessage.CreateBuilder(result.optionalForeignMessage_).MergeFrom(value).BuildPartial(); - } else { - result.optionalForeignMessage_ = value; - } - result.hasOptionalForeignMessage = true; - return this; - } - public Builder ClearOptionalForeignMessage() { - PrepareBuilder(); - result.hasOptionalForeignMessage = false; - result.optionalForeignMessage_ = null; - return this; - } - - public bool HasOptionalImportMessage { - get { return result.hasOptionalImportMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportMessage OptionalImportMessage { - get { return result.OptionalImportMessage; } - set { SetOptionalImportMessage(value); } - } - public Builder SetOptionalImportMessage(global::Google.ProtocolBuffers.TestProtos.ImportMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalImportMessage = true; - result.optionalImportMessage_ = value; - return this; - } - public Builder SetOptionalImportMessage(global::Google.ProtocolBuffers.TestProtos.ImportMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptionalImportMessage = true; - result.optionalImportMessage_ = builderForValue.Build(); - return this; - } - public Builder MergeOptionalImportMessage(global::Google.ProtocolBuffers.TestProtos.ImportMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptionalImportMessage && - result.optionalImportMessage_ != global::Google.ProtocolBuffers.TestProtos.ImportMessage.DefaultInstance) { - result.optionalImportMessage_ = global::Google.ProtocolBuffers.TestProtos.ImportMessage.CreateBuilder(result.optionalImportMessage_).MergeFrom(value).BuildPartial(); - } else { - result.optionalImportMessage_ = value; - } - result.hasOptionalImportMessage = true; - return this; - } - public Builder ClearOptionalImportMessage() { - PrepareBuilder(); - result.hasOptionalImportMessage = false; - result.optionalImportMessage_ = null; - return this; - } - - public bool HasOptionalNestedEnum { - get { return result.hasOptionalNestedEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum OptionalNestedEnum { - get { return result.OptionalNestedEnum; } - set { SetOptionalNestedEnum(value); } - } - public Builder SetOptionalNestedEnum(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum value) { - PrepareBuilder(); - result.hasOptionalNestedEnum = true; - result.optionalNestedEnum_ = value; - return this; - } - public Builder ClearOptionalNestedEnum() { - PrepareBuilder(); - result.hasOptionalNestedEnum = false; - result.optionalNestedEnum_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum.FOO; - return this; - } - - public bool HasOptionalForeignEnum { - get { return result.hasOptionalForeignEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum OptionalForeignEnum { - get { return result.OptionalForeignEnum; } - set { SetOptionalForeignEnum(value); } - } - public Builder SetOptionalForeignEnum(global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) { - PrepareBuilder(); - result.hasOptionalForeignEnum = true; - result.optionalForeignEnum_ = value; - return this; - } - public Builder ClearOptionalForeignEnum() { - PrepareBuilder(); - result.hasOptionalForeignEnum = false; - result.optionalForeignEnum_ = global::Google.ProtocolBuffers.TestProtos.ForeignEnum.FOREIGN_FOO; - return this; - } - - public bool HasOptionalImportEnum { - get { return result.hasOptionalImportEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportEnum OptionalImportEnum { - get { return result.OptionalImportEnum; } - set { SetOptionalImportEnum(value); } - } - public Builder SetOptionalImportEnum(global::Google.ProtocolBuffers.TestProtos.ImportEnum value) { - PrepareBuilder(); - result.hasOptionalImportEnum = true; - result.optionalImportEnum_ = value; - return this; - } - public Builder ClearOptionalImportEnum() { - PrepareBuilder(); - result.hasOptionalImportEnum = false; - result.optionalImportEnum_ = global::Google.ProtocolBuffers.TestProtos.ImportEnum.IMPORT_FOO; - return this; - } - - public bool HasOptionalStringPiece { - get { return result.hasOptionalStringPiece; } - } - public string OptionalStringPiece { - get { return result.OptionalStringPiece; } - set { SetOptionalStringPiece(value); } - } - public Builder SetOptionalStringPiece(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalStringPiece = true; - result.optionalStringPiece_ = value; - return this; - } - public Builder ClearOptionalStringPiece() { - PrepareBuilder(); - result.hasOptionalStringPiece = false; - result.optionalStringPiece_ = ""; - return this; - } - - public bool HasOptionalCord { - get { return result.hasOptionalCord; } - } - public string OptionalCord { - get { return result.OptionalCord; } - set { SetOptionalCord(value); } - } - public Builder SetOptionalCord(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalCord = true; - result.optionalCord_ = value; - return this; - } - public Builder ClearOptionalCord() { - PrepareBuilder(); - result.hasOptionalCord = false; - result.optionalCord_ = ""; - return this; - } - - public pbc::IPopsicleList RepeatedInt32List { - get { return PrepareBuilder().repeatedInt32_; } - } - public int RepeatedInt32Count { - get { return result.RepeatedInt32Count; } - } - public int GetRepeatedInt32(int index) { - return result.GetRepeatedInt32(index); - } - public Builder SetRepeatedInt32(int index, int value) { - PrepareBuilder(); - result.repeatedInt32_[index] = value; - return this; - } - public Builder AddRepeatedInt32(int value) { - PrepareBuilder(); - result.repeatedInt32_.Add(value); - return this; - } - public Builder AddRangeRepeatedInt32(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedInt32_.Add(values); - return this; - } - public Builder ClearRepeatedInt32() { - PrepareBuilder(); - result.repeatedInt32_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedInt64List { - get { return PrepareBuilder().repeatedInt64_; } - } - public int RepeatedInt64Count { - get { return result.RepeatedInt64Count; } - } - public long GetRepeatedInt64(int index) { - return result.GetRepeatedInt64(index); - } - public Builder SetRepeatedInt64(int index, long value) { - PrepareBuilder(); - result.repeatedInt64_[index] = value; - return this; - } - public Builder AddRepeatedInt64(long value) { - PrepareBuilder(); - result.repeatedInt64_.Add(value); - return this; - } - public Builder AddRangeRepeatedInt64(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedInt64_.Add(values); - return this; - } - public Builder ClearRepeatedInt64() { - PrepareBuilder(); - result.repeatedInt64_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList RepeatedUint32List { - get { return PrepareBuilder().repeatedUint32_; } - } - public int RepeatedUint32Count { - get { return result.RepeatedUint32Count; } - } - [global::System.CLSCompliant(false)] - public uint GetRepeatedUint32(int index) { - return result.GetRepeatedUint32(index); - } - [global::System.CLSCompliant(false)] - public Builder SetRepeatedUint32(int index, uint value) { - PrepareBuilder(); - result.repeatedUint32_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRepeatedUint32(uint value) { - PrepareBuilder(); - result.repeatedUint32_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeRepeatedUint32(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedUint32_.Add(values); - return this; - } - public Builder ClearRepeatedUint32() { - PrepareBuilder(); - result.repeatedUint32_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList RepeatedUint64List { - get { return PrepareBuilder().repeatedUint64_; } - } - public int RepeatedUint64Count { - get { return result.RepeatedUint64Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetRepeatedUint64(int index) { - return result.GetRepeatedUint64(index); - } - [global::System.CLSCompliant(false)] - public Builder SetRepeatedUint64(int index, ulong value) { - PrepareBuilder(); - result.repeatedUint64_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRepeatedUint64(ulong value) { - PrepareBuilder(); - result.repeatedUint64_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeRepeatedUint64(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedUint64_.Add(values); - return this; - } - public Builder ClearRepeatedUint64() { - PrepareBuilder(); - result.repeatedUint64_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedSint32List { - get { return PrepareBuilder().repeatedSint32_; } - } - public int RepeatedSint32Count { - get { return result.RepeatedSint32Count; } - } - public int GetRepeatedSint32(int index) { - return result.GetRepeatedSint32(index); - } - public Builder SetRepeatedSint32(int index, int value) { - PrepareBuilder(); - result.repeatedSint32_[index] = value; - return this; - } - public Builder AddRepeatedSint32(int value) { - PrepareBuilder(); - result.repeatedSint32_.Add(value); - return this; - } - public Builder AddRangeRepeatedSint32(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedSint32_.Add(values); - return this; - } - public Builder ClearRepeatedSint32() { - PrepareBuilder(); - result.repeatedSint32_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedSint64List { - get { return PrepareBuilder().repeatedSint64_; } - } - public int RepeatedSint64Count { - get { return result.RepeatedSint64Count; } - } - public long GetRepeatedSint64(int index) { - return result.GetRepeatedSint64(index); - } - public Builder SetRepeatedSint64(int index, long value) { - PrepareBuilder(); - result.repeatedSint64_[index] = value; - return this; - } - public Builder AddRepeatedSint64(long value) { - PrepareBuilder(); - result.repeatedSint64_.Add(value); - return this; - } - public Builder AddRangeRepeatedSint64(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedSint64_.Add(values); - return this; - } - public Builder ClearRepeatedSint64() { - PrepareBuilder(); - result.repeatedSint64_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList RepeatedFixed32List { - get { return PrepareBuilder().repeatedFixed32_; } - } - public int RepeatedFixed32Count { - get { return result.RepeatedFixed32Count; } - } - [global::System.CLSCompliant(false)] - public uint GetRepeatedFixed32(int index) { - return result.GetRepeatedFixed32(index); - } - [global::System.CLSCompliant(false)] - public Builder SetRepeatedFixed32(int index, uint value) { - PrepareBuilder(); - result.repeatedFixed32_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRepeatedFixed32(uint value) { - PrepareBuilder(); - result.repeatedFixed32_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeRepeatedFixed32(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedFixed32_.Add(values); - return this; - } - public Builder ClearRepeatedFixed32() { - PrepareBuilder(); - result.repeatedFixed32_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList RepeatedFixed64List { - get { return PrepareBuilder().repeatedFixed64_; } - } - public int RepeatedFixed64Count { - get { return result.RepeatedFixed64Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetRepeatedFixed64(int index) { - return result.GetRepeatedFixed64(index); - } - [global::System.CLSCompliant(false)] - public Builder SetRepeatedFixed64(int index, ulong value) { - PrepareBuilder(); - result.repeatedFixed64_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRepeatedFixed64(ulong value) { - PrepareBuilder(); - result.repeatedFixed64_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeRepeatedFixed64(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedFixed64_.Add(values); - return this; - } - public Builder ClearRepeatedFixed64() { - PrepareBuilder(); - result.repeatedFixed64_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedSfixed32List { - get { return PrepareBuilder().repeatedSfixed32_; } - } - public int RepeatedSfixed32Count { - get { return result.RepeatedSfixed32Count; } - } - public int GetRepeatedSfixed32(int index) { - return result.GetRepeatedSfixed32(index); - } - public Builder SetRepeatedSfixed32(int index, int value) { - PrepareBuilder(); - result.repeatedSfixed32_[index] = value; - return this; - } - public Builder AddRepeatedSfixed32(int value) { - PrepareBuilder(); - result.repeatedSfixed32_.Add(value); - return this; - } - public Builder AddRangeRepeatedSfixed32(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedSfixed32_.Add(values); - return this; - } - public Builder ClearRepeatedSfixed32() { - PrepareBuilder(); - result.repeatedSfixed32_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedSfixed64List { - get { return PrepareBuilder().repeatedSfixed64_; } - } - public int RepeatedSfixed64Count { - get { return result.RepeatedSfixed64Count; } - } - public long GetRepeatedSfixed64(int index) { - return result.GetRepeatedSfixed64(index); - } - public Builder SetRepeatedSfixed64(int index, long value) { - PrepareBuilder(); - result.repeatedSfixed64_[index] = value; - return this; - } - public Builder AddRepeatedSfixed64(long value) { - PrepareBuilder(); - result.repeatedSfixed64_.Add(value); - return this; - } - public Builder AddRangeRepeatedSfixed64(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedSfixed64_.Add(values); - return this; - } - public Builder ClearRepeatedSfixed64() { - PrepareBuilder(); - result.repeatedSfixed64_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedFloatList { - get { return PrepareBuilder().repeatedFloat_; } - } - public int RepeatedFloatCount { - get { return result.RepeatedFloatCount; } - } - public float GetRepeatedFloat(int index) { - return result.GetRepeatedFloat(index); - } - public Builder SetRepeatedFloat(int index, float value) { - PrepareBuilder(); - result.repeatedFloat_[index] = value; - return this; - } - public Builder AddRepeatedFloat(float value) { - PrepareBuilder(); - result.repeatedFloat_.Add(value); - return this; - } - public Builder AddRangeRepeatedFloat(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedFloat_.Add(values); - return this; - } - public Builder ClearRepeatedFloat() { - PrepareBuilder(); - result.repeatedFloat_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedDoubleList { - get { return PrepareBuilder().repeatedDouble_; } - } - public int RepeatedDoubleCount { - get { return result.RepeatedDoubleCount; } - } - public double GetRepeatedDouble(int index) { - return result.GetRepeatedDouble(index); - } - public Builder SetRepeatedDouble(int index, double value) { - PrepareBuilder(); - result.repeatedDouble_[index] = value; - return this; - } - public Builder AddRepeatedDouble(double value) { - PrepareBuilder(); - result.repeatedDouble_.Add(value); - return this; - } - public Builder AddRangeRepeatedDouble(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedDouble_.Add(values); - return this; - } - public Builder ClearRepeatedDouble() { - PrepareBuilder(); - result.repeatedDouble_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedBoolList { - get { return PrepareBuilder().repeatedBool_; } - } - public int RepeatedBoolCount { - get { return result.RepeatedBoolCount; } - } - public bool GetRepeatedBool(int index) { - return result.GetRepeatedBool(index); - } - public Builder SetRepeatedBool(int index, bool value) { - PrepareBuilder(); - result.repeatedBool_[index] = value; - return this; - } - public Builder AddRepeatedBool(bool value) { - PrepareBuilder(); - result.repeatedBool_.Add(value); - return this; - } - public Builder AddRangeRepeatedBool(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedBool_.Add(values); - return this; - } - public Builder ClearRepeatedBool() { - PrepareBuilder(); - result.repeatedBool_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedStringList { - get { return PrepareBuilder().repeatedString_; } - } - public int RepeatedStringCount { - get { return result.RepeatedStringCount; } - } - public string GetRepeatedString(int index) { - return result.GetRepeatedString(index); - } - public Builder SetRepeatedString(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedString_[index] = value; - return this; - } - public Builder AddRepeatedString(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedString_.Add(value); - return this; - } - public Builder AddRangeRepeatedString(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedString_.Add(values); - return this; - } - public Builder ClearRepeatedString() { - PrepareBuilder(); - result.repeatedString_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedBytesList { - get { return PrepareBuilder().repeatedBytes_; } - } - public int RepeatedBytesCount { - get { return result.RepeatedBytesCount; } - } - public pb::ByteString GetRepeatedBytes(int index) { - return result.GetRepeatedBytes(index); - } - public Builder SetRepeatedBytes(int index, pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedBytes_[index] = value; - return this; - } - public Builder AddRepeatedBytes(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedBytes_.Add(value); - return this; - } - public Builder AddRangeRepeatedBytes(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedBytes_.Add(values); - return this; - } - public Builder ClearRepeatedBytes() { - PrepareBuilder(); - result.repeatedBytes_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedGroupList { - get { return PrepareBuilder().repeatedGroup_; } - } - public int RepeatedGroupCount { - get { return result.RepeatedGroupCount; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup GetRepeatedGroup(int index) { - return result.GetRepeatedGroup(index); - } - public Builder SetRepeatedGroup(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedGroup_[index] = value; - return this; - } - public Builder SetRepeatedGroup(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedGroup_[index] = builderForValue.Build(); - return this; - } - public Builder AddRepeatedGroup(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedGroup_.Add(value); - return this; - } - public Builder AddRepeatedGroup(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedGroup_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeRepeatedGroup(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedGroup_.Add(values); - return this; - } - public Builder ClearRepeatedGroup() { - PrepareBuilder(); - result.repeatedGroup_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedNestedMessageList { - get { return PrepareBuilder().repeatedNestedMessage_; } - } - public int RepeatedNestedMessageCount { - get { return result.RepeatedNestedMessageCount; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage GetRepeatedNestedMessage(int index) { - return result.GetRepeatedNestedMessage(index); - } - public Builder SetRepeatedNestedMessage(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedNestedMessage_[index] = value; - return this; - } - public Builder SetRepeatedNestedMessage(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedNestedMessage_[index] = builderForValue.Build(); - return this; - } - public Builder AddRepeatedNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedNestedMessage_.Add(value); - return this; - } - public Builder AddRepeatedNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedNestedMessage_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeRepeatedNestedMessage(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedNestedMessage_.Add(values); - return this; - } - public Builder ClearRepeatedNestedMessage() { - PrepareBuilder(); - result.repeatedNestedMessage_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedForeignMessageList { - get { return PrepareBuilder().repeatedForeignMessage_; } - } - public int RepeatedForeignMessageCount { - get { return result.RepeatedForeignMessageCount; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage GetRepeatedForeignMessage(int index) { - return result.GetRepeatedForeignMessage(index); - } - public Builder SetRepeatedForeignMessage(int index, global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedForeignMessage_[index] = value; - return this; - } - public Builder SetRepeatedForeignMessage(int index, global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedForeignMessage_[index] = builderForValue.Build(); - return this; - } - public Builder AddRepeatedForeignMessage(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedForeignMessage_.Add(value); - return this; - } - public Builder AddRepeatedForeignMessage(global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedForeignMessage_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeRepeatedForeignMessage(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedForeignMessage_.Add(values); - return this; - } - public Builder ClearRepeatedForeignMessage() { - PrepareBuilder(); - result.repeatedForeignMessage_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedImportMessageList { - get { return PrepareBuilder().repeatedImportMessage_; } - } - public int RepeatedImportMessageCount { - get { return result.RepeatedImportMessageCount; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportMessage GetRepeatedImportMessage(int index) { - return result.GetRepeatedImportMessage(index); - } - public Builder SetRepeatedImportMessage(int index, global::Google.ProtocolBuffers.TestProtos.ImportMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedImportMessage_[index] = value; - return this; - } - public Builder SetRepeatedImportMessage(int index, global::Google.ProtocolBuffers.TestProtos.ImportMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedImportMessage_[index] = builderForValue.Build(); - return this; - } - public Builder AddRepeatedImportMessage(global::Google.ProtocolBuffers.TestProtos.ImportMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedImportMessage_.Add(value); - return this; - } - public Builder AddRepeatedImportMessage(global::Google.ProtocolBuffers.TestProtos.ImportMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedImportMessage_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeRepeatedImportMessage(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedImportMessage_.Add(values); - return this; - } - public Builder ClearRepeatedImportMessage() { - PrepareBuilder(); - result.repeatedImportMessage_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedNestedEnumList { - get { return PrepareBuilder().repeatedNestedEnum_; } - } - public int RepeatedNestedEnumCount { - get { return result.RepeatedNestedEnumCount; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum GetRepeatedNestedEnum(int index) { - return result.GetRepeatedNestedEnum(index); - } - public Builder SetRepeatedNestedEnum(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum value) { - PrepareBuilder(); - result.repeatedNestedEnum_[index] = value; - return this; - } - public Builder AddRepeatedNestedEnum(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum value) { - PrepareBuilder(); - result.repeatedNestedEnum_.Add(value); - return this; - } - public Builder AddRangeRepeatedNestedEnum(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedNestedEnum_.Add(values); - return this; - } - public Builder ClearRepeatedNestedEnum() { - PrepareBuilder(); - result.repeatedNestedEnum_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedForeignEnumList { - get { return PrepareBuilder().repeatedForeignEnum_; } - } - public int RepeatedForeignEnumCount { - get { return result.RepeatedForeignEnumCount; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum GetRepeatedForeignEnum(int index) { - return result.GetRepeatedForeignEnum(index); - } - public Builder SetRepeatedForeignEnum(int index, global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) { - PrepareBuilder(); - result.repeatedForeignEnum_[index] = value; - return this; - } - public Builder AddRepeatedForeignEnum(global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) { - PrepareBuilder(); - result.repeatedForeignEnum_.Add(value); - return this; - } - public Builder AddRangeRepeatedForeignEnum(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedForeignEnum_.Add(values); - return this; - } - public Builder ClearRepeatedForeignEnum() { - PrepareBuilder(); - result.repeatedForeignEnum_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedImportEnumList { - get { return PrepareBuilder().repeatedImportEnum_; } - } - public int RepeatedImportEnumCount { - get { return result.RepeatedImportEnumCount; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportEnum GetRepeatedImportEnum(int index) { - return result.GetRepeatedImportEnum(index); - } - public Builder SetRepeatedImportEnum(int index, global::Google.ProtocolBuffers.TestProtos.ImportEnum value) { - PrepareBuilder(); - result.repeatedImportEnum_[index] = value; - return this; - } - public Builder AddRepeatedImportEnum(global::Google.ProtocolBuffers.TestProtos.ImportEnum value) { - PrepareBuilder(); - result.repeatedImportEnum_.Add(value); - return this; - } - public Builder AddRangeRepeatedImportEnum(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedImportEnum_.Add(values); - return this; - } - public Builder ClearRepeatedImportEnum() { - PrepareBuilder(); - result.repeatedImportEnum_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedStringPieceList { - get { return PrepareBuilder().repeatedStringPiece_; } - } - public int RepeatedStringPieceCount { - get { return result.RepeatedStringPieceCount; } - } - public string GetRepeatedStringPiece(int index) { - return result.GetRepeatedStringPiece(index); - } - public Builder SetRepeatedStringPiece(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedStringPiece_[index] = value; - return this; - } - public Builder AddRepeatedStringPiece(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedStringPiece_.Add(value); - return this; - } - public Builder AddRangeRepeatedStringPiece(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedStringPiece_.Add(values); - return this; - } - public Builder ClearRepeatedStringPiece() { - PrepareBuilder(); - result.repeatedStringPiece_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedCordList { - get { return PrepareBuilder().repeatedCord_; } - } - public int RepeatedCordCount { - get { return result.RepeatedCordCount; } - } - public string GetRepeatedCord(int index) { - return result.GetRepeatedCord(index); - } - public Builder SetRepeatedCord(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedCord_[index] = value; - return this; - } - public Builder AddRepeatedCord(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedCord_.Add(value); - return this; - } - public Builder AddRangeRepeatedCord(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedCord_.Add(values); - return this; - } - public Builder ClearRepeatedCord() { - PrepareBuilder(); - result.repeatedCord_.Clear(); - return this; - } - - public bool HasDefaultInt32 { - get { return result.hasDefaultInt32; } - } - public int DefaultInt32 { - get { return result.DefaultInt32; } - set { SetDefaultInt32(value); } - } - public Builder SetDefaultInt32(int value) { - PrepareBuilder(); - result.hasDefaultInt32 = true; - result.defaultInt32_ = value; - return this; - } - public Builder ClearDefaultInt32() { - PrepareBuilder(); - result.hasDefaultInt32 = false; - result.defaultInt32_ = 41; - return this; - } - - public bool HasDefaultInt64 { - get { return result.hasDefaultInt64; } - } - public long DefaultInt64 { - get { return result.DefaultInt64; } - set { SetDefaultInt64(value); } - } - public Builder SetDefaultInt64(long value) { - PrepareBuilder(); - result.hasDefaultInt64 = true; - result.defaultInt64_ = value; - return this; - } - public Builder ClearDefaultInt64() { - PrepareBuilder(); - result.hasDefaultInt64 = false; - result.defaultInt64_ = 42L; - return this; - } - - public bool HasDefaultUint32 { - get { return result.hasDefaultUint32; } - } - [global::System.CLSCompliant(false)] - public uint DefaultUint32 { - get { return result.DefaultUint32; } - set { SetDefaultUint32(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetDefaultUint32(uint value) { - PrepareBuilder(); - result.hasDefaultUint32 = true; - result.defaultUint32_ = value; - return this; - } - public Builder ClearDefaultUint32() { - PrepareBuilder(); - result.hasDefaultUint32 = false; - result.defaultUint32_ = 43; - return this; - } - - public bool HasDefaultUint64 { - get { return result.hasDefaultUint64; } - } - [global::System.CLSCompliant(false)] - public ulong DefaultUint64 { - get { return result.DefaultUint64; } - set { SetDefaultUint64(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetDefaultUint64(ulong value) { - PrepareBuilder(); - result.hasDefaultUint64 = true; - result.defaultUint64_ = value; - return this; - } - public Builder ClearDefaultUint64() { - PrepareBuilder(); - result.hasDefaultUint64 = false; - result.defaultUint64_ = 44UL; - return this; - } - - public bool HasDefaultSint32 { - get { return result.hasDefaultSint32; } - } - public int DefaultSint32 { - get { return result.DefaultSint32; } - set { SetDefaultSint32(value); } - } - public Builder SetDefaultSint32(int value) { - PrepareBuilder(); - result.hasDefaultSint32 = true; - result.defaultSint32_ = value; - return this; - } - public Builder ClearDefaultSint32() { - PrepareBuilder(); - result.hasDefaultSint32 = false; - result.defaultSint32_ = -45; - return this; - } - - public bool HasDefaultSint64 { - get { return result.hasDefaultSint64; } - } - public long DefaultSint64 { - get { return result.DefaultSint64; } - set { SetDefaultSint64(value); } - } - public Builder SetDefaultSint64(long value) { - PrepareBuilder(); - result.hasDefaultSint64 = true; - result.defaultSint64_ = value; - return this; - } - public Builder ClearDefaultSint64() { - PrepareBuilder(); - result.hasDefaultSint64 = false; - result.defaultSint64_ = 46; - return this; - } - - public bool HasDefaultFixed32 { - get { return result.hasDefaultFixed32; } - } - [global::System.CLSCompliant(false)] - public uint DefaultFixed32 { - get { return result.DefaultFixed32; } - set { SetDefaultFixed32(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetDefaultFixed32(uint value) { - PrepareBuilder(); - result.hasDefaultFixed32 = true; - result.defaultFixed32_ = value; - return this; - } - public Builder ClearDefaultFixed32() { - PrepareBuilder(); - result.hasDefaultFixed32 = false; - result.defaultFixed32_ = 47; - return this; - } - - public bool HasDefaultFixed64 { - get { return result.hasDefaultFixed64; } - } - [global::System.CLSCompliant(false)] - public ulong DefaultFixed64 { - get { return result.DefaultFixed64; } - set { SetDefaultFixed64(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetDefaultFixed64(ulong value) { - PrepareBuilder(); - result.hasDefaultFixed64 = true; - result.defaultFixed64_ = value; - return this; - } - public Builder ClearDefaultFixed64() { - PrepareBuilder(); - result.hasDefaultFixed64 = false; - result.defaultFixed64_ = 48; - return this; - } - - public bool HasDefaultSfixed32 { - get { return result.hasDefaultSfixed32; } - } - public int DefaultSfixed32 { - get { return result.DefaultSfixed32; } - set { SetDefaultSfixed32(value); } - } - public Builder SetDefaultSfixed32(int value) { - PrepareBuilder(); - result.hasDefaultSfixed32 = true; - result.defaultSfixed32_ = value; - return this; - } - public Builder ClearDefaultSfixed32() { - PrepareBuilder(); - result.hasDefaultSfixed32 = false; - result.defaultSfixed32_ = 49; - return this; - } - - public bool HasDefaultSfixed64 { - get { return result.hasDefaultSfixed64; } - } - public long DefaultSfixed64 { - get { return result.DefaultSfixed64; } - set { SetDefaultSfixed64(value); } - } - public Builder SetDefaultSfixed64(long value) { - PrepareBuilder(); - result.hasDefaultSfixed64 = true; - result.defaultSfixed64_ = value; - return this; - } - public Builder ClearDefaultSfixed64() { - PrepareBuilder(); - result.hasDefaultSfixed64 = false; - result.defaultSfixed64_ = -50; - return this; - } - - public bool HasDefaultFloat { - get { return result.hasDefaultFloat; } - } - public float DefaultFloat { - get { return result.DefaultFloat; } - set { SetDefaultFloat(value); } - } - public Builder SetDefaultFloat(float value) { - PrepareBuilder(); - result.hasDefaultFloat = true; - result.defaultFloat_ = value; - return this; - } - public Builder ClearDefaultFloat() { - PrepareBuilder(); - result.hasDefaultFloat = false; - result.defaultFloat_ = 51.5F; - return this; - } - - public bool HasDefaultDouble { - get { return result.hasDefaultDouble; } - } - public double DefaultDouble { - get { return result.DefaultDouble; } - set { SetDefaultDouble(value); } - } - public Builder SetDefaultDouble(double value) { - PrepareBuilder(); - result.hasDefaultDouble = true; - result.defaultDouble_ = value; - return this; - } - public Builder ClearDefaultDouble() { - PrepareBuilder(); - result.hasDefaultDouble = false; - result.defaultDouble_ = 52000D; - return this; - } - - public bool HasDefaultBool { - get { return result.hasDefaultBool; } - } - public bool DefaultBool { - get { return result.DefaultBool; } - set { SetDefaultBool(value); } - } - public Builder SetDefaultBool(bool value) { - PrepareBuilder(); - result.hasDefaultBool = true; - result.defaultBool_ = value; - return this; - } - public Builder ClearDefaultBool() { - PrepareBuilder(); - result.hasDefaultBool = false; - result.defaultBool_ = true; - return this; - } - - public bool HasDefaultString { - get { return result.hasDefaultString; } - } - public string DefaultString { - get { return result.DefaultString; } - set { SetDefaultString(value); } - } - public Builder SetDefaultString(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasDefaultString = true; - result.defaultString_ = value; - return this; - } - public Builder ClearDefaultString() { - PrepareBuilder(); - result.hasDefaultString = false; - result.defaultString_ = "hello"; - return this; - } - - public bool HasDefaultBytes { - get { return result.hasDefaultBytes; } - } - public pb::ByteString DefaultBytes { - get { return result.DefaultBytes; } - set { SetDefaultBytes(value); } - } - public Builder SetDefaultBytes(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasDefaultBytes = true; - result.defaultBytes_ = value; - return this; - } - public Builder ClearDefaultBytes() { - PrepareBuilder(); - result.hasDefaultBytes = false; - result.defaultBytes_ = (pb::ByteString) global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Descriptor.Fields[62].DefaultValue; - return this; - } - - public bool HasDefaultNestedEnum { - get { return result.hasDefaultNestedEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum DefaultNestedEnum { - get { return result.DefaultNestedEnum; } - set { SetDefaultNestedEnum(value); } - } - public Builder SetDefaultNestedEnum(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum value) { - PrepareBuilder(); - result.hasDefaultNestedEnum = true; - result.defaultNestedEnum_ = value; - return this; - } - public Builder ClearDefaultNestedEnum() { - PrepareBuilder(); - result.hasDefaultNestedEnum = false; - result.defaultNestedEnum_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum.BAR; - return this; - } - - public bool HasDefaultForeignEnum { - get { return result.hasDefaultForeignEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum DefaultForeignEnum { - get { return result.DefaultForeignEnum; } - set { SetDefaultForeignEnum(value); } - } - public Builder SetDefaultForeignEnum(global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) { - PrepareBuilder(); - result.hasDefaultForeignEnum = true; - result.defaultForeignEnum_ = value; - return this; - } - public Builder ClearDefaultForeignEnum() { - PrepareBuilder(); - result.hasDefaultForeignEnum = false; - result.defaultForeignEnum_ = global::Google.ProtocolBuffers.TestProtos.ForeignEnum.FOREIGN_BAR; - return this; - } - - public bool HasDefaultImportEnum { - get { return result.hasDefaultImportEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportEnum DefaultImportEnum { - get { return result.DefaultImportEnum; } - set { SetDefaultImportEnum(value); } - } - public Builder SetDefaultImportEnum(global::Google.ProtocolBuffers.TestProtos.ImportEnum value) { - PrepareBuilder(); - result.hasDefaultImportEnum = true; - result.defaultImportEnum_ = value; - return this; - } - public Builder ClearDefaultImportEnum() { - PrepareBuilder(); - result.hasDefaultImportEnum = false; - result.defaultImportEnum_ = global::Google.ProtocolBuffers.TestProtos.ImportEnum.IMPORT_BAR; - return this; - } - - public bool HasDefaultStringPiece { - get { return result.hasDefaultStringPiece; } - } - public string DefaultStringPiece { - get { return result.DefaultStringPiece; } - set { SetDefaultStringPiece(value); } - } - public Builder SetDefaultStringPiece(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasDefaultStringPiece = true; - result.defaultStringPiece_ = value; - return this; - } - public Builder ClearDefaultStringPiece() { - PrepareBuilder(); - result.hasDefaultStringPiece = false; - result.defaultStringPiece_ = "abc"; - return this; - } - - public bool HasDefaultCord { - get { return result.hasDefaultCord; } - } - public string DefaultCord { - get { return result.DefaultCord; } - set { SetDefaultCord(value); } - } - public Builder SetDefaultCord(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasDefaultCord = true; - result.defaultCord_ = value; - return this; - } - public Builder ClearDefaultCord() { - PrepareBuilder(); - result.hasDefaultCord = false; - result.defaultCord_ = "123"; - return this; - } - } - static TestAllTypes() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestDeprecatedFields : pb::GeneratedMessage { - private TestDeprecatedFields() { } - private static readonly TestDeprecatedFields defaultInstance = new TestDeprecatedFields().MakeReadOnly(); - private static readonly string[] _testDeprecatedFieldsFieldNames = new string[] { "deprecated_int32" }; - private static readonly uint[] _testDeprecatedFieldsFieldTags = new uint[] { 8 }; - public static TestDeprecatedFields DefaultInstance { - get { return defaultInstance; } - } - - public override TestDeprecatedFields DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestDeprecatedFields ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDeprecatedFields__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDeprecatedFields__FieldAccessorTable; } - } - - public const int DeprecatedInt32FieldNumber = 1; - private bool hasDeprecatedInt32; - private int deprecatedInt32_; - [global::System.ObsoleteAttribute()] - public bool HasDeprecatedInt32 { - get { return hasDeprecatedInt32; } - } - [global::System.ObsoleteAttribute()] - public int DeprecatedInt32 { - get { return deprecatedInt32_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testDeprecatedFieldsFieldNames; - if (hasDeprecatedInt32) { - output.WriteInt32(1, field_names[0], DeprecatedInt32); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasDeprecatedInt32) { - size += pb::CodedOutputStream.ComputeInt32Size(1, DeprecatedInt32); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestDeprecatedFields ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestDeprecatedFields ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestDeprecatedFields ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestDeprecatedFields ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestDeprecatedFields ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestDeprecatedFields ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestDeprecatedFields ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestDeprecatedFields ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestDeprecatedFields ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestDeprecatedFields ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestDeprecatedFields MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestDeprecatedFields prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestDeprecatedFields cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestDeprecatedFields result; - - private TestDeprecatedFields PrepareBuilder() { - if (resultIsReadOnly) { - TestDeprecatedFields original = result; - result = new TestDeprecatedFields(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestDeprecatedFields MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestDeprecatedFields.Descriptor; } - } - - public override TestDeprecatedFields DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestDeprecatedFields.DefaultInstance; } - } - - public override TestDeprecatedFields BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestDeprecatedFields) { - return MergeFrom((TestDeprecatedFields) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestDeprecatedFields other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestDeprecatedFields.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasDeprecatedInt32) { - DeprecatedInt32 = other.DeprecatedInt32; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testDeprecatedFieldsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testDeprecatedFieldsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasDeprecatedInt32 = input.ReadInt32(ref result.deprecatedInt32_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - [global::System.ObsoleteAttribute()] - public bool HasDeprecatedInt32 { - get { return result.hasDeprecatedInt32; } - } - [global::System.ObsoleteAttribute()] - public int DeprecatedInt32 { - get { return result.DeprecatedInt32; } - set { SetDeprecatedInt32(value); } - } - [global::System.ObsoleteAttribute()] - public Builder SetDeprecatedInt32(int value) { - PrepareBuilder(); - result.hasDeprecatedInt32 = true; - result.deprecatedInt32_ = value; - return this; - } - [global::System.ObsoleteAttribute()] - public Builder ClearDeprecatedInt32() { - PrepareBuilder(); - result.hasDeprecatedInt32 = false; - result.deprecatedInt32_ = 0; - return this; - } - } - static TestDeprecatedFields() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class ForeignMessage : pb::GeneratedMessage { - private ForeignMessage() { } - private static readonly ForeignMessage defaultInstance = new ForeignMessage().MakeReadOnly(); - private static readonly string[] _foreignMessageFieldNames = new string[] { "c" }; - private static readonly uint[] _foreignMessageFieldTags = new uint[] { 8 }; - public static ForeignMessage DefaultInstance { - get { return defaultInstance; } - } - - public override ForeignMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override ForeignMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_ForeignMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_ForeignMessage__FieldAccessorTable; } - } - - public const int CFieldNumber = 1; - private bool hasC; - private int c_; - public bool HasC { - get { return hasC; } - } - public int C { - get { return c_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _foreignMessageFieldNames; - if (hasC) { - output.WriteInt32(1, field_names[0], C); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasC) { - size += pb::CodedOutputStream.ComputeInt32Size(1, C); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static ForeignMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ForeignMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ForeignMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ForeignMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ForeignMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ForeignMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ForeignMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ForeignMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ForeignMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ForeignMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private ForeignMessage MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ForeignMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(ForeignMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private ForeignMessage result; - - private ForeignMessage PrepareBuilder() { - if (resultIsReadOnly) { - ForeignMessage original = result; - result = new ForeignMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override ForeignMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Descriptor; } - } - - public override ForeignMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance; } - } - - public override ForeignMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ForeignMessage) { - return MergeFrom((ForeignMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ForeignMessage other) { - if (other == global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasC) { - C = other.C; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_foreignMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _foreignMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasC = input.ReadInt32(ref result.c_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasC { - get { return result.hasC; } - } - public int C { - get { return result.C; } - set { SetC(value); } - } - public Builder SetC(int value) { - PrepareBuilder(); - result.hasC = true; - result.c_ = value; - return this; - } - public Builder ClearC() { - PrepareBuilder(); - result.hasC = false; - result.c_ = 0; - return this; - } - } - static ForeignMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestAllExtensions : pb::ExtendableMessage { - private TestAllExtensions() { } - private static readonly TestAllExtensions defaultInstance = new TestAllExtensions().MakeReadOnly(); - private static readonly string[] _testAllExtensionsFieldNames = new string[] { }; - private static readonly uint[] _testAllExtensionsFieldTags = new uint[] { }; - public static TestAllExtensions DefaultInstance { - get { return defaultInstance; } - } - - public override TestAllExtensions DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestAllExtensions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllExtensions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllExtensions__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testAllExtensionsFieldNames; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - extensionWriter.WriteUntil(536870912, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestAllExtensions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestAllExtensions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestAllExtensions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestAllExtensions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestAllExtensions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestAllExtensions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestAllExtensions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestAllExtensions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestAllExtensions ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestAllExtensions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestAllExtensions MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestAllExtensions prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestAllExtensions cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestAllExtensions result; - - private TestAllExtensions PrepareBuilder() { - if (resultIsReadOnly) { - TestAllExtensions original = result; - result = new TestAllExtensions(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestAllExtensions MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestAllExtensions.Descriptor; } - } - - public override TestAllExtensions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestAllExtensions.DefaultInstance; } - } - - public override TestAllExtensions BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestAllExtensions) { - return MergeFrom((TestAllExtensions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestAllExtensions other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestAllExtensions.DefaultInstance) return this; - PrepareBuilder(); - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testAllExtensionsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testAllExtensionsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static TestAllExtensions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class OptionalGroup_extension : pb::GeneratedMessage { - private OptionalGroup_extension() { } - private static readonly OptionalGroup_extension defaultInstance = new OptionalGroup_extension().MakeReadOnly(); - private static readonly string[] _optionalGroupExtensionFieldNames = new string[] { "a" }; - private static readonly uint[] _optionalGroupExtensionFieldTags = new uint[] { 136 }; - public static OptionalGroup_extension DefaultInstance { - get { return defaultInstance; } - } - - public override OptionalGroup_extension DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override OptionalGroup_extension ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_OptionalGroup_extension__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_OptionalGroup_extension__FieldAccessorTable; } - } - - public const int AFieldNumber = 17; - private bool hasA; - private int a_; - public bool HasA { - get { return hasA; } - } - public int A { - get { return a_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _optionalGroupExtensionFieldNames; - if (hasA) { - output.WriteInt32(17, field_names[0], A); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA) { - size += pb::CodedOutputStream.ComputeInt32Size(17, A); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static OptionalGroup_extension ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OptionalGroup_extension ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OptionalGroup_extension ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OptionalGroup_extension ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OptionalGroup_extension ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OptionalGroup_extension ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static OptionalGroup_extension ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static OptionalGroup_extension ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static OptionalGroup_extension ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OptionalGroup_extension ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private OptionalGroup_extension MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(OptionalGroup_extension prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(OptionalGroup_extension cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private OptionalGroup_extension result; - - private OptionalGroup_extension PrepareBuilder() { - if (resultIsReadOnly) { - OptionalGroup_extension original = result; - result = new OptionalGroup_extension(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override OptionalGroup_extension MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension.Descriptor; } - } - - public override OptionalGroup_extension DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension.DefaultInstance; } - } - - public override OptionalGroup_extension BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is OptionalGroup_extension) { - return MergeFrom((OptionalGroup_extension) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(OptionalGroup_extension other) { - if (other == global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA) { - A = other.A; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_optionalGroupExtensionFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _optionalGroupExtensionFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 136: { - result.hasA = input.ReadInt32(ref result.a_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasA { - get { return result.hasA; } - } - public int A { - get { return result.A; } - set { SetA(value); } - } - public Builder SetA(int value) { - PrepareBuilder(); - result.hasA = true; - result.a_ = value; - return this; - } - public Builder ClearA() { - PrepareBuilder(); - result.hasA = false; - result.a_ = 0; - return this; - } - } - static OptionalGroup_extension() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class RepeatedGroup_extension : pb::GeneratedMessage { - private RepeatedGroup_extension() { } - private static readonly RepeatedGroup_extension defaultInstance = new RepeatedGroup_extension().MakeReadOnly(); - private static readonly string[] _repeatedGroupExtensionFieldNames = new string[] { "a" }; - private static readonly uint[] _repeatedGroupExtensionFieldTags = new uint[] { 376 }; - public static RepeatedGroup_extension DefaultInstance { - get { return defaultInstance; } - } - - public override RepeatedGroup_extension DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override RepeatedGroup_extension ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_RepeatedGroup_extension__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_RepeatedGroup_extension__FieldAccessorTable; } - } - - public const int AFieldNumber = 47; - private bool hasA; - private int a_; - public bool HasA { - get { return hasA; } - } - public int A { - get { return a_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _repeatedGroupExtensionFieldNames; - if (hasA) { - output.WriteInt32(47, field_names[0], A); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA) { - size += pb::CodedOutputStream.ComputeInt32Size(47, A); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static RepeatedGroup_extension ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RepeatedGroup_extension ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RepeatedGroup_extension ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RepeatedGroup_extension ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RepeatedGroup_extension ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RepeatedGroup_extension ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static RepeatedGroup_extension ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static RepeatedGroup_extension ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static RepeatedGroup_extension ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RepeatedGroup_extension ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private RepeatedGroup_extension MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(RepeatedGroup_extension prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(RepeatedGroup_extension cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private RepeatedGroup_extension result; - - private RepeatedGroup_extension PrepareBuilder() { - if (resultIsReadOnly) { - RepeatedGroup_extension original = result; - result = new RepeatedGroup_extension(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override RepeatedGroup_extension MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension.Descriptor; } - } - - public override RepeatedGroup_extension DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension.DefaultInstance; } - } - - public override RepeatedGroup_extension BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is RepeatedGroup_extension) { - return MergeFrom((RepeatedGroup_extension) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(RepeatedGroup_extension other) { - if (other == global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA) { - A = other.A; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_repeatedGroupExtensionFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _repeatedGroupExtensionFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 376: { - result.hasA = input.ReadInt32(ref result.a_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasA { - get { return result.hasA; } - } - public int A { - get { return result.A; } - set { SetA(value); } - } - public Builder SetA(int value) { - PrepareBuilder(); - result.hasA = true; - result.a_ = value; - return this; - } - public Builder ClearA() { - PrepareBuilder(); - result.hasA = false; - result.a_ = 0; - return this; - } - } - static RepeatedGroup_extension() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestNestedExtension : pb::GeneratedMessage { - private TestNestedExtension() { } - private static readonly TestNestedExtension defaultInstance = new TestNestedExtension().MakeReadOnly(); - private static readonly string[] _testNestedExtensionFieldNames = new string[] { }; - private static readonly uint[] _testNestedExtensionFieldTags = new uint[] { }; - public static TestNestedExtension DefaultInstance { - get { return defaultInstance; } - } - - public override TestNestedExtension DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestNestedExtension ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestNestedExtension__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestNestedExtension__FieldAccessorTable; } - } - - public const int TestFieldNumber = 1002; - public static pb::GeneratedExtensionBase Test; - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testNestedExtensionFieldNames; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestNestedExtension ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestNestedExtension ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestNestedExtension ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestNestedExtension ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestNestedExtension ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestNestedExtension ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestNestedExtension ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestNestedExtension ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestNestedExtension ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestNestedExtension ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestNestedExtension MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestNestedExtension prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestNestedExtension cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestNestedExtension result; - - private TestNestedExtension PrepareBuilder() { - if (resultIsReadOnly) { - TestNestedExtension original = result; - result = new TestNestedExtension(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestNestedExtension MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestNestedExtension.Descriptor; } - } - - public override TestNestedExtension DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestNestedExtension.DefaultInstance; } - } - - public override TestNestedExtension BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestNestedExtension) { - return MergeFrom((TestNestedExtension) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestNestedExtension other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestNestedExtension.DefaultInstance) return this; - PrepareBuilder(); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testNestedExtensionFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testNestedExtensionFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static TestNestedExtension() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestRequired : pb::GeneratedMessage { - private TestRequired() { } - private static readonly TestRequired defaultInstance = new TestRequired().MakeReadOnly(); - private static readonly string[] _testRequiredFieldNames = new string[] { "a", "b", "c", "dummy10", "dummy11", "dummy12", "dummy13", "dummy14", "dummy15", "dummy16", "dummy17", "dummy18", "dummy19", "dummy2", "dummy20", "dummy21", "dummy22", "dummy23", "dummy24", "dummy25", "dummy26", "dummy27", "dummy28", "dummy29", "dummy30", "dummy31", "dummy32", "dummy4", "dummy5", "dummy6", "dummy7", "dummy8", "dummy9" }; - private static readonly uint[] _testRequiredFieldTags = new uint[] { 8, 24, 264, 80, 88, 96, 104, 112, 120, 128, 136, 144, 152, 16, 160, 168, 176, 184, 192, 200, 208, 216, 224, 232, 240, 248, 256, 32, 40, 48, 56, 64, 72 }; - public static TestRequired DefaultInstance { - get { return defaultInstance; } - } - - public override TestRequired DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestRequired ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestRequired__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestRequired__FieldAccessorTable; } - } - - public const int SingleFieldNumber = 1000; - public static pb::GeneratedExtensionBase Single; - public const int MultiFieldNumber = 1001; - public static pb::GeneratedExtensionBase> Multi; - public const int AFieldNumber = 1; - private bool hasA; - private int a_; - public bool HasA { - get { return hasA; } - } - public int A { - get { return a_; } - } - - public const int Dummy2FieldNumber = 2; - private bool hasDummy2; - private int dummy2_; - public bool HasDummy2 { - get { return hasDummy2; } - } - public int Dummy2 { - get { return dummy2_; } - } - - public const int BFieldNumber = 3; - private bool hasB; - private int b_; - public bool HasB { - get { return hasB; } - } - public int B { - get { return b_; } - } - - public const int Dummy4FieldNumber = 4; - private bool hasDummy4; - private int dummy4_; - public bool HasDummy4 { - get { return hasDummy4; } - } - public int Dummy4 { - get { return dummy4_; } - } - - public const int Dummy5FieldNumber = 5; - private bool hasDummy5; - private int dummy5_; - public bool HasDummy5 { - get { return hasDummy5; } - } - public int Dummy5 { - get { return dummy5_; } - } - - public const int Dummy6FieldNumber = 6; - private bool hasDummy6; - private int dummy6_; - public bool HasDummy6 { - get { return hasDummy6; } - } - public int Dummy6 { - get { return dummy6_; } - } - - public const int Dummy7FieldNumber = 7; - private bool hasDummy7; - private int dummy7_; - public bool HasDummy7 { - get { return hasDummy7; } - } - public int Dummy7 { - get { return dummy7_; } - } - - public const int Dummy8FieldNumber = 8; - private bool hasDummy8; - private int dummy8_; - public bool HasDummy8 { - get { return hasDummy8; } - } - public int Dummy8 { - get { return dummy8_; } - } - - public const int Dummy9FieldNumber = 9; - private bool hasDummy9; - private int dummy9_; - public bool HasDummy9 { - get { return hasDummy9; } - } - public int Dummy9 { - get { return dummy9_; } - } - - public const int Dummy10FieldNumber = 10; - private bool hasDummy10; - private int dummy10_; - public bool HasDummy10 { - get { return hasDummy10; } - } - public int Dummy10 { - get { return dummy10_; } - } - - public const int Dummy11FieldNumber = 11; - private bool hasDummy11; - private int dummy11_; - public bool HasDummy11 { - get { return hasDummy11; } - } - public int Dummy11 { - get { return dummy11_; } - } - - public const int Dummy12FieldNumber = 12; - private bool hasDummy12; - private int dummy12_; - public bool HasDummy12 { - get { return hasDummy12; } - } - public int Dummy12 { - get { return dummy12_; } - } - - public const int Dummy13FieldNumber = 13; - private bool hasDummy13; - private int dummy13_; - public bool HasDummy13 { - get { return hasDummy13; } - } - public int Dummy13 { - get { return dummy13_; } - } - - public const int Dummy14FieldNumber = 14; - private bool hasDummy14; - private int dummy14_; - public bool HasDummy14 { - get { return hasDummy14; } - } - public int Dummy14 { - get { return dummy14_; } - } - - public const int Dummy15FieldNumber = 15; - private bool hasDummy15; - private int dummy15_; - public bool HasDummy15 { - get { return hasDummy15; } - } - public int Dummy15 { - get { return dummy15_; } - } - - public const int Dummy16FieldNumber = 16; - private bool hasDummy16; - private int dummy16_; - public bool HasDummy16 { - get { return hasDummy16; } - } - public int Dummy16 { - get { return dummy16_; } - } - - public const int Dummy17FieldNumber = 17; - private bool hasDummy17; - private int dummy17_; - public bool HasDummy17 { - get { return hasDummy17; } - } - public int Dummy17 { - get { return dummy17_; } - } - - public const int Dummy18FieldNumber = 18; - private bool hasDummy18; - private int dummy18_; - public bool HasDummy18 { - get { return hasDummy18; } - } - public int Dummy18 { - get { return dummy18_; } - } - - public const int Dummy19FieldNumber = 19; - private bool hasDummy19; - private int dummy19_; - public bool HasDummy19 { - get { return hasDummy19; } - } - public int Dummy19 { - get { return dummy19_; } - } - - public const int Dummy20FieldNumber = 20; - private bool hasDummy20; - private int dummy20_; - public bool HasDummy20 { - get { return hasDummy20; } - } - public int Dummy20 { - get { return dummy20_; } - } - - public const int Dummy21FieldNumber = 21; - private bool hasDummy21; - private int dummy21_; - public bool HasDummy21 { - get { return hasDummy21; } - } - public int Dummy21 { - get { return dummy21_; } - } - - public const int Dummy22FieldNumber = 22; - private bool hasDummy22; - private int dummy22_; - public bool HasDummy22 { - get { return hasDummy22; } - } - public int Dummy22 { - get { return dummy22_; } - } - - public const int Dummy23FieldNumber = 23; - private bool hasDummy23; - private int dummy23_; - public bool HasDummy23 { - get { return hasDummy23; } - } - public int Dummy23 { - get { return dummy23_; } - } - - public const int Dummy24FieldNumber = 24; - private bool hasDummy24; - private int dummy24_; - public bool HasDummy24 { - get { return hasDummy24; } - } - public int Dummy24 { - get { return dummy24_; } - } - - public const int Dummy25FieldNumber = 25; - private bool hasDummy25; - private int dummy25_; - public bool HasDummy25 { - get { return hasDummy25; } - } - public int Dummy25 { - get { return dummy25_; } - } - - public const int Dummy26FieldNumber = 26; - private bool hasDummy26; - private int dummy26_; - public bool HasDummy26 { - get { return hasDummy26; } - } - public int Dummy26 { - get { return dummy26_; } - } - - public const int Dummy27FieldNumber = 27; - private bool hasDummy27; - private int dummy27_; - public bool HasDummy27 { - get { return hasDummy27; } - } - public int Dummy27 { - get { return dummy27_; } - } - - public const int Dummy28FieldNumber = 28; - private bool hasDummy28; - private int dummy28_; - public bool HasDummy28 { - get { return hasDummy28; } - } - public int Dummy28 { - get { return dummy28_; } - } - - public const int Dummy29FieldNumber = 29; - private bool hasDummy29; - private int dummy29_; - public bool HasDummy29 { - get { return hasDummy29; } - } - public int Dummy29 { - get { return dummy29_; } - } - - public const int Dummy30FieldNumber = 30; - private bool hasDummy30; - private int dummy30_; - public bool HasDummy30 { - get { return hasDummy30; } - } - public int Dummy30 { - get { return dummy30_; } - } - - public const int Dummy31FieldNumber = 31; - private bool hasDummy31; - private int dummy31_; - public bool HasDummy31 { - get { return hasDummy31; } - } - public int Dummy31 { - get { return dummy31_; } - } - - public const int Dummy32FieldNumber = 32; - private bool hasDummy32; - private int dummy32_; - public bool HasDummy32 { - get { return hasDummy32; } - } - public int Dummy32 { - get { return dummy32_; } - } - - public const int CFieldNumber = 33; - private bool hasC; - private int c_; - public bool HasC { - get { return hasC; } - } - public int C { - get { return c_; } - } - - public override bool IsInitialized { - get { - if (!hasA) return false; - if (!hasB) return false; - if (!hasC) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testRequiredFieldNames; - if (hasA) { - output.WriteInt32(1, field_names[0], A); - } - if (hasDummy2) { - output.WriteInt32(2, field_names[13], Dummy2); - } - if (hasB) { - output.WriteInt32(3, field_names[1], B); - } - if (hasDummy4) { - output.WriteInt32(4, field_names[27], Dummy4); - } - if (hasDummy5) { - output.WriteInt32(5, field_names[28], Dummy5); - } - if (hasDummy6) { - output.WriteInt32(6, field_names[29], Dummy6); - } - if (hasDummy7) { - output.WriteInt32(7, field_names[30], Dummy7); - } - if (hasDummy8) { - output.WriteInt32(8, field_names[31], Dummy8); - } - if (hasDummy9) { - output.WriteInt32(9, field_names[32], Dummy9); - } - if (hasDummy10) { - output.WriteInt32(10, field_names[3], Dummy10); - } - if (hasDummy11) { - output.WriteInt32(11, field_names[4], Dummy11); - } - if (hasDummy12) { - output.WriteInt32(12, field_names[5], Dummy12); - } - if (hasDummy13) { - output.WriteInt32(13, field_names[6], Dummy13); - } - if (hasDummy14) { - output.WriteInt32(14, field_names[7], Dummy14); - } - if (hasDummy15) { - output.WriteInt32(15, field_names[8], Dummy15); - } - if (hasDummy16) { - output.WriteInt32(16, field_names[9], Dummy16); - } - if (hasDummy17) { - output.WriteInt32(17, field_names[10], Dummy17); - } - if (hasDummy18) { - output.WriteInt32(18, field_names[11], Dummy18); - } - if (hasDummy19) { - output.WriteInt32(19, field_names[12], Dummy19); - } - if (hasDummy20) { - output.WriteInt32(20, field_names[14], Dummy20); - } - if (hasDummy21) { - output.WriteInt32(21, field_names[15], Dummy21); - } - if (hasDummy22) { - output.WriteInt32(22, field_names[16], Dummy22); - } - if (hasDummy23) { - output.WriteInt32(23, field_names[17], Dummy23); - } - if (hasDummy24) { - output.WriteInt32(24, field_names[18], Dummy24); - } - if (hasDummy25) { - output.WriteInt32(25, field_names[19], Dummy25); - } - if (hasDummy26) { - output.WriteInt32(26, field_names[20], Dummy26); - } - if (hasDummy27) { - output.WriteInt32(27, field_names[21], Dummy27); - } - if (hasDummy28) { - output.WriteInt32(28, field_names[22], Dummy28); - } - if (hasDummy29) { - output.WriteInt32(29, field_names[23], Dummy29); - } - if (hasDummy30) { - output.WriteInt32(30, field_names[24], Dummy30); - } - if (hasDummy31) { - output.WriteInt32(31, field_names[25], Dummy31); - } - if (hasDummy32) { - output.WriteInt32(32, field_names[26], Dummy32); - } - if (hasC) { - output.WriteInt32(33, field_names[2], C); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA) { - size += pb::CodedOutputStream.ComputeInt32Size(1, A); - } - if (hasDummy2) { - size += pb::CodedOutputStream.ComputeInt32Size(2, Dummy2); - } - if (hasB) { - size += pb::CodedOutputStream.ComputeInt32Size(3, B); - } - if (hasDummy4) { - size += pb::CodedOutputStream.ComputeInt32Size(4, Dummy4); - } - if (hasDummy5) { - size += pb::CodedOutputStream.ComputeInt32Size(5, Dummy5); - } - if (hasDummy6) { - size += pb::CodedOutputStream.ComputeInt32Size(6, Dummy6); - } - if (hasDummy7) { - size += pb::CodedOutputStream.ComputeInt32Size(7, Dummy7); - } - if (hasDummy8) { - size += pb::CodedOutputStream.ComputeInt32Size(8, Dummy8); - } - if (hasDummy9) { - size += pb::CodedOutputStream.ComputeInt32Size(9, Dummy9); - } - if (hasDummy10) { - size += pb::CodedOutputStream.ComputeInt32Size(10, Dummy10); - } - if (hasDummy11) { - size += pb::CodedOutputStream.ComputeInt32Size(11, Dummy11); - } - if (hasDummy12) { - size += pb::CodedOutputStream.ComputeInt32Size(12, Dummy12); - } - if (hasDummy13) { - size += pb::CodedOutputStream.ComputeInt32Size(13, Dummy13); - } - if (hasDummy14) { - size += pb::CodedOutputStream.ComputeInt32Size(14, Dummy14); - } - if (hasDummy15) { - size += pb::CodedOutputStream.ComputeInt32Size(15, Dummy15); - } - if (hasDummy16) { - size += pb::CodedOutputStream.ComputeInt32Size(16, Dummy16); - } - if (hasDummy17) { - size += pb::CodedOutputStream.ComputeInt32Size(17, Dummy17); - } - if (hasDummy18) { - size += pb::CodedOutputStream.ComputeInt32Size(18, Dummy18); - } - if (hasDummy19) { - size += pb::CodedOutputStream.ComputeInt32Size(19, Dummy19); - } - if (hasDummy20) { - size += pb::CodedOutputStream.ComputeInt32Size(20, Dummy20); - } - if (hasDummy21) { - size += pb::CodedOutputStream.ComputeInt32Size(21, Dummy21); - } - if (hasDummy22) { - size += pb::CodedOutputStream.ComputeInt32Size(22, Dummy22); - } - if (hasDummy23) { - size += pb::CodedOutputStream.ComputeInt32Size(23, Dummy23); - } - if (hasDummy24) { - size += pb::CodedOutputStream.ComputeInt32Size(24, Dummy24); - } - if (hasDummy25) { - size += pb::CodedOutputStream.ComputeInt32Size(25, Dummy25); - } - if (hasDummy26) { - size += pb::CodedOutputStream.ComputeInt32Size(26, Dummy26); - } - if (hasDummy27) { - size += pb::CodedOutputStream.ComputeInt32Size(27, Dummy27); - } - if (hasDummy28) { - size += pb::CodedOutputStream.ComputeInt32Size(28, Dummy28); - } - if (hasDummy29) { - size += pb::CodedOutputStream.ComputeInt32Size(29, Dummy29); - } - if (hasDummy30) { - size += pb::CodedOutputStream.ComputeInt32Size(30, Dummy30); - } - if (hasDummy31) { - size += pb::CodedOutputStream.ComputeInt32Size(31, Dummy31); - } - if (hasDummy32) { - size += pb::CodedOutputStream.ComputeInt32Size(32, Dummy32); - } - if (hasC) { - size += pb::CodedOutputStream.ComputeInt32Size(33, C); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestRequired ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestRequired ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestRequired ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestRequired ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestRequired ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestRequired ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestRequired ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestRequired ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestRequired ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestRequired ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestRequired MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestRequired prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestRequired cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestRequired result; - - private TestRequired PrepareBuilder() { - if (resultIsReadOnly) { - TestRequired original = result; - result = new TestRequired(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestRequired MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestRequired.Descriptor; } - } - - public override TestRequired DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestRequired.DefaultInstance; } - } - - public override TestRequired BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestRequired) { - return MergeFrom((TestRequired) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestRequired other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestRequired.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA) { - A = other.A; - } - if (other.HasDummy2) { - Dummy2 = other.Dummy2; - } - if (other.HasB) { - B = other.B; - } - if (other.HasDummy4) { - Dummy4 = other.Dummy4; - } - if (other.HasDummy5) { - Dummy5 = other.Dummy5; - } - if (other.HasDummy6) { - Dummy6 = other.Dummy6; - } - if (other.HasDummy7) { - Dummy7 = other.Dummy7; - } - if (other.HasDummy8) { - Dummy8 = other.Dummy8; - } - if (other.HasDummy9) { - Dummy9 = other.Dummy9; - } - if (other.HasDummy10) { - Dummy10 = other.Dummy10; - } - if (other.HasDummy11) { - Dummy11 = other.Dummy11; - } - if (other.HasDummy12) { - Dummy12 = other.Dummy12; - } - if (other.HasDummy13) { - Dummy13 = other.Dummy13; - } - if (other.HasDummy14) { - Dummy14 = other.Dummy14; - } - if (other.HasDummy15) { - Dummy15 = other.Dummy15; - } - if (other.HasDummy16) { - Dummy16 = other.Dummy16; - } - if (other.HasDummy17) { - Dummy17 = other.Dummy17; - } - if (other.HasDummy18) { - Dummy18 = other.Dummy18; - } - if (other.HasDummy19) { - Dummy19 = other.Dummy19; - } - if (other.HasDummy20) { - Dummy20 = other.Dummy20; - } - if (other.HasDummy21) { - Dummy21 = other.Dummy21; - } - if (other.HasDummy22) { - Dummy22 = other.Dummy22; - } - if (other.HasDummy23) { - Dummy23 = other.Dummy23; - } - if (other.HasDummy24) { - Dummy24 = other.Dummy24; - } - if (other.HasDummy25) { - Dummy25 = other.Dummy25; - } - if (other.HasDummy26) { - Dummy26 = other.Dummy26; - } - if (other.HasDummy27) { - Dummy27 = other.Dummy27; - } - if (other.HasDummy28) { - Dummy28 = other.Dummy28; - } - if (other.HasDummy29) { - Dummy29 = other.Dummy29; - } - if (other.HasDummy30) { - Dummy30 = other.Dummy30; - } - if (other.HasDummy31) { - Dummy31 = other.Dummy31; - } - if (other.HasDummy32) { - Dummy32 = other.Dummy32; - } - if (other.HasC) { - C = other.C; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testRequiredFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testRequiredFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasA = input.ReadInt32(ref result.a_); - break; - } - case 16: { - result.hasDummy2 = input.ReadInt32(ref result.dummy2_); - break; - } - case 24: { - result.hasB = input.ReadInt32(ref result.b_); - break; - } - case 32: { - result.hasDummy4 = input.ReadInt32(ref result.dummy4_); - break; - } - case 40: { - result.hasDummy5 = input.ReadInt32(ref result.dummy5_); - break; - } - case 48: { - result.hasDummy6 = input.ReadInt32(ref result.dummy6_); - break; - } - case 56: { - result.hasDummy7 = input.ReadInt32(ref result.dummy7_); - break; - } - case 64: { - result.hasDummy8 = input.ReadInt32(ref result.dummy8_); - break; - } - case 72: { - result.hasDummy9 = input.ReadInt32(ref result.dummy9_); - break; - } - case 80: { - result.hasDummy10 = input.ReadInt32(ref result.dummy10_); - break; - } - case 88: { - result.hasDummy11 = input.ReadInt32(ref result.dummy11_); - break; - } - case 96: { - result.hasDummy12 = input.ReadInt32(ref result.dummy12_); - break; - } - case 104: { - result.hasDummy13 = input.ReadInt32(ref result.dummy13_); - break; - } - case 112: { - result.hasDummy14 = input.ReadInt32(ref result.dummy14_); - break; - } - case 120: { - result.hasDummy15 = input.ReadInt32(ref result.dummy15_); - break; - } - case 128: { - result.hasDummy16 = input.ReadInt32(ref result.dummy16_); - break; - } - case 136: { - result.hasDummy17 = input.ReadInt32(ref result.dummy17_); - break; - } - case 144: { - result.hasDummy18 = input.ReadInt32(ref result.dummy18_); - break; - } - case 152: { - result.hasDummy19 = input.ReadInt32(ref result.dummy19_); - break; - } - case 160: { - result.hasDummy20 = input.ReadInt32(ref result.dummy20_); - break; - } - case 168: { - result.hasDummy21 = input.ReadInt32(ref result.dummy21_); - break; - } - case 176: { - result.hasDummy22 = input.ReadInt32(ref result.dummy22_); - break; - } - case 184: { - result.hasDummy23 = input.ReadInt32(ref result.dummy23_); - break; - } - case 192: { - result.hasDummy24 = input.ReadInt32(ref result.dummy24_); - break; - } - case 200: { - result.hasDummy25 = input.ReadInt32(ref result.dummy25_); - break; - } - case 208: { - result.hasDummy26 = input.ReadInt32(ref result.dummy26_); - break; - } - case 216: { - result.hasDummy27 = input.ReadInt32(ref result.dummy27_); - break; - } - case 224: { - result.hasDummy28 = input.ReadInt32(ref result.dummy28_); - break; - } - case 232: { - result.hasDummy29 = input.ReadInt32(ref result.dummy29_); - break; - } - case 240: { - result.hasDummy30 = input.ReadInt32(ref result.dummy30_); - break; - } - case 248: { - result.hasDummy31 = input.ReadInt32(ref result.dummy31_); - break; - } - case 256: { - result.hasDummy32 = input.ReadInt32(ref result.dummy32_); - break; - } - case 264: { - result.hasC = input.ReadInt32(ref result.c_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasA { - get { return result.hasA; } - } - public int A { - get { return result.A; } - set { SetA(value); } - } - public Builder SetA(int value) { - PrepareBuilder(); - result.hasA = true; - result.a_ = value; - return this; - } - public Builder ClearA() { - PrepareBuilder(); - result.hasA = false; - result.a_ = 0; - return this; - } - - public bool HasDummy2 { - get { return result.hasDummy2; } - } - public int Dummy2 { - get { return result.Dummy2; } - set { SetDummy2(value); } - } - public Builder SetDummy2(int value) { - PrepareBuilder(); - result.hasDummy2 = true; - result.dummy2_ = value; - return this; - } - public Builder ClearDummy2() { - PrepareBuilder(); - result.hasDummy2 = false; - result.dummy2_ = 0; - return this; - } - - public bool HasB { - get { return result.hasB; } - } - public int B { - get { return result.B; } - set { SetB(value); } - } - public Builder SetB(int value) { - PrepareBuilder(); - result.hasB = true; - result.b_ = value; - return this; - } - public Builder ClearB() { - PrepareBuilder(); - result.hasB = false; - result.b_ = 0; - return this; - } - - public bool HasDummy4 { - get { return result.hasDummy4; } - } - public int Dummy4 { - get { return result.Dummy4; } - set { SetDummy4(value); } - } - public Builder SetDummy4(int value) { - PrepareBuilder(); - result.hasDummy4 = true; - result.dummy4_ = value; - return this; - } - public Builder ClearDummy4() { - PrepareBuilder(); - result.hasDummy4 = false; - result.dummy4_ = 0; - return this; - } - - public bool HasDummy5 { - get { return result.hasDummy5; } - } - public int Dummy5 { - get { return result.Dummy5; } - set { SetDummy5(value); } - } - public Builder SetDummy5(int value) { - PrepareBuilder(); - result.hasDummy5 = true; - result.dummy5_ = value; - return this; - } - public Builder ClearDummy5() { - PrepareBuilder(); - result.hasDummy5 = false; - result.dummy5_ = 0; - return this; - } - - public bool HasDummy6 { - get { return result.hasDummy6; } - } - public int Dummy6 { - get { return result.Dummy6; } - set { SetDummy6(value); } - } - public Builder SetDummy6(int value) { - PrepareBuilder(); - result.hasDummy6 = true; - result.dummy6_ = value; - return this; - } - public Builder ClearDummy6() { - PrepareBuilder(); - result.hasDummy6 = false; - result.dummy6_ = 0; - return this; - } - - public bool HasDummy7 { - get { return result.hasDummy7; } - } - public int Dummy7 { - get { return result.Dummy7; } - set { SetDummy7(value); } - } - public Builder SetDummy7(int value) { - PrepareBuilder(); - result.hasDummy7 = true; - result.dummy7_ = value; - return this; - } - public Builder ClearDummy7() { - PrepareBuilder(); - result.hasDummy7 = false; - result.dummy7_ = 0; - return this; - } - - public bool HasDummy8 { - get { return result.hasDummy8; } - } - public int Dummy8 { - get { return result.Dummy8; } - set { SetDummy8(value); } - } - public Builder SetDummy8(int value) { - PrepareBuilder(); - result.hasDummy8 = true; - result.dummy8_ = value; - return this; - } - public Builder ClearDummy8() { - PrepareBuilder(); - result.hasDummy8 = false; - result.dummy8_ = 0; - return this; - } - - public bool HasDummy9 { - get { return result.hasDummy9; } - } - public int Dummy9 { - get { return result.Dummy9; } - set { SetDummy9(value); } - } - public Builder SetDummy9(int value) { - PrepareBuilder(); - result.hasDummy9 = true; - result.dummy9_ = value; - return this; - } - public Builder ClearDummy9() { - PrepareBuilder(); - result.hasDummy9 = false; - result.dummy9_ = 0; - return this; - } - - public bool HasDummy10 { - get { return result.hasDummy10; } - } - public int Dummy10 { - get { return result.Dummy10; } - set { SetDummy10(value); } - } - public Builder SetDummy10(int value) { - PrepareBuilder(); - result.hasDummy10 = true; - result.dummy10_ = value; - return this; - } - public Builder ClearDummy10() { - PrepareBuilder(); - result.hasDummy10 = false; - result.dummy10_ = 0; - return this; - } - - public bool HasDummy11 { - get { return result.hasDummy11; } - } - public int Dummy11 { - get { return result.Dummy11; } - set { SetDummy11(value); } - } - public Builder SetDummy11(int value) { - PrepareBuilder(); - result.hasDummy11 = true; - result.dummy11_ = value; - return this; - } - public Builder ClearDummy11() { - PrepareBuilder(); - result.hasDummy11 = false; - result.dummy11_ = 0; - return this; - } - - public bool HasDummy12 { - get { return result.hasDummy12; } - } - public int Dummy12 { - get { return result.Dummy12; } - set { SetDummy12(value); } - } - public Builder SetDummy12(int value) { - PrepareBuilder(); - result.hasDummy12 = true; - result.dummy12_ = value; - return this; - } - public Builder ClearDummy12() { - PrepareBuilder(); - result.hasDummy12 = false; - result.dummy12_ = 0; - return this; - } - - public bool HasDummy13 { - get { return result.hasDummy13; } - } - public int Dummy13 { - get { return result.Dummy13; } - set { SetDummy13(value); } - } - public Builder SetDummy13(int value) { - PrepareBuilder(); - result.hasDummy13 = true; - result.dummy13_ = value; - return this; - } - public Builder ClearDummy13() { - PrepareBuilder(); - result.hasDummy13 = false; - result.dummy13_ = 0; - return this; - } - - public bool HasDummy14 { - get { return result.hasDummy14; } - } - public int Dummy14 { - get { return result.Dummy14; } - set { SetDummy14(value); } - } - public Builder SetDummy14(int value) { - PrepareBuilder(); - result.hasDummy14 = true; - result.dummy14_ = value; - return this; - } - public Builder ClearDummy14() { - PrepareBuilder(); - result.hasDummy14 = false; - result.dummy14_ = 0; - return this; - } - - public bool HasDummy15 { - get { return result.hasDummy15; } - } - public int Dummy15 { - get { return result.Dummy15; } - set { SetDummy15(value); } - } - public Builder SetDummy15(int value) { - PrepareBuilder(); - result.hasDummy15 = true; - result.dummy15_ = value; - return this; - } - public Builder ClearDummy15() { - PrepareBuilder(); - result.hasDummy15 = false; - result.dummy15_ = 0; - return this; - } - - public bool HasDummy16 { - get { return result.hasDummy16; } - } - public int Dummy16 { - get { return result.Dummy16; } - set { SetDummy16(value); } - } - public Builder SetDummy16(int value) { - PrepareBuilder(); - result.hasDummy16 = true; - result.dummy16_ = value; - return this; - } - public Builder ClearDummy16() { - PrepareBuilder(); - result.hasDummy16 = false; - result.dummy16_ = 0; - return this; - } - - public bool HasDummy17 { - get { return result.hasDummy17; } - } - public int Dummy17 { - get { return result.Dummy17; } - set { SetDummy17(value); } - } - public Builder SetDummy17(int value) { - PrepareBuilder(); - result.hasDummy17 = true; - result.dummy17_ = value; - return this; - } - public Builder ClearDummy17() { - PrepareBuilder(); - result.hasDummy17 = false; - result.dummy17_ = 0; - return this; - } - - public bool HasDummy18 { - get { return result.hasDummy18; } - } - public int Dummy18 { - get { return result.Dummy18; } - set { SetDummy18(value); } - } - public Builder SetDummy18(int value) { - PrepareBuilder(); - result.hasDummy18 = true; - result.dummy18_ = value; - return this; - } - public Builder ClearDummy18() { - PrepareBuilder(); - result.hasDummy18 = false; - result.dummy18_ = 0; - return this; - } - - public bool HasDummy19 { - get { return result.hasDummy19; } - } - public int Dummy19 { - get { return result.Dummy19; } - set { SetDummy19(value); } - } - public Builder SetDummy19(int value) { - PrepareBuilder(); - result.hasDummy19 = true; - result.dummy19_ = value; - return this; - } - public Builder ClearDummy19() { - PrepareBuilder(); - result.hasDummy19 = false; - result.dummy19_ = 0; - return this; - } - - public bool HasDummy20 { - get { return result.hasDummy20; } - } - public int Dummy20 { - get { return result.Dummy20; } - set { SetDummy20(value); } - } - public Builder SetDummy20(int value) { - PrepareBuilder(); - result.hasDummy20 = true; - result.dummy20_ = value; - return this; - } - public Builder ClearDummy20() { - PrepareBuilder(); - result.hasDummy20 = false; - result.dummy20_ = 0; - return this; - } - - public bool HasDummy21 { - get { return result.hasDummy21; } - } - public int Dummy21 { - get { return result.Dummy21; } - set { SetDummy21(value); } - } - public Builder SetDummy21(int value) { - PrepareBuilder(); - result.hasDummy21 = true; - result.dummy21_ = value; - return this; - } - public Builder ClearDummy21() { - PrepareBuilder(); - result.hasDummy21 = false; - result.dummy21_ = 0; - return this; - } - - public bool HasDummy22 { - get { return result.hasDummy22; } - } - public int Dummy22 { - get { return result.Dummy22; } - set { SetDummy22(value); } - } - public Builder SetDummy22(int value) { - PrepareBuilder(); - result.hasDummy22 = true; - result.dummy22_ = value; - return this; - } - public Builder ClearDummy22() { - PrepareBuilder(); - result.hasDummy22 = false; - result.dummy22_ = 0; - return this; - } - - public bool HasDummy23 { - get { return result.hasDummy23; } - } - public int Dummy23 { - get { return result.Dummy23; } - set { SetDummy23(value); } - } - public Builder SetDummy23(int value) { - PrepareBuilder(); - result.hasDummy23 = true; - result.dummy23_ = value; - return this; - } - public Builder ClearDummy23() { - PrepareBuilder(); - result.hasDummy23 = false; - result.dummy23_ = 0; - return this; - } - - public bool HasDummy24 { - get { return result.hasDummy24; } - } - public int Dummy24 { - get { return result.Dummy24; } - set { SetDummy24(value); } - } - public Builder SetDummy24(int value) { - PrepareBuilder(); - result.hasDummy24 = true; - result.dummy24_ = value; - return this; - } - public Builder ClearDummy24() { - PrepareBuilder(); - result.hasDummy24 = false; - result.dummy24_ = 0; - return this; - } - - public bool HasDummy25 { - get { return result.hasDummy25; } - } - public int Dummy25 { - get { return result.Dummy25; } - set { SetDummy25(value); } - } - public Builder SetDummy25(int value) { - PrepareBuilder(); - result.hasDummy25 = true; - result.dummy25_ = value; - return this; - } - public Builder ClearDummy25() { - PrepareBuilder(); - result.hasDummy25 = false; - result.dummy25_ = 0; - return this; - } - - public bool HasDummy26 { - get { return result.hasDummy26; } - } - public int Dummy26 { - get { return result.Dummy26; } - set { SetDummy26(value); } - } - public Builder SetDummy26(int value) { - PrepareBuilder(); - result.hasDummy26 = true; - result.dummy26_ = value; - return this; - } - public Builder ClearDummy26() { - PrepareBuilder(); - result.hasDummy26 = false; - result.dummy26_ = 0; - return this; - } - - public bool HasDummy27 { - get { return result.hasDummy27; } - } - public int Dummy27 { - get { return result.Dummy27; } - set { SetDummy27(value); } - } - public Builder SetDummy27(int value) { - PrepareBuilder(); - result.hasDummy27 = true; - result.dummy27_ = value; - return this; - } - public Builder ClearDummy27() { - PrepareBuilder(); - result.hasDummy27 = false; - result.dummy27_ = 0; - return this; - } - - public bool HasDummy28 { - get { return result.hasDummy28; } - } - public int Dummy28 { - get { return result.Dummy28; } - set { SetDummy28(value); } - } - public Builder SetDummy28(int value) { - PrepareBuilder(); - result.hasDummy28 = true; - result.dummy28_ = value; - return this; - } - public Builder ClearDummy28() { - PrepareBuilder(); - result.hasDummy28 = false; - result.dummy28_ = 0; - return this; - } - - public bool HasDummy29 { - get { return result.hasDummy29; } - } - public int Dummy29 { - get { return result.Dummy29; } - set { SetDummy29(value); } - } - public Builder SetDummy29(int value) { - PrepareBuilder(); - result.hasDummy29 = true; - result.dummy29_ = value; - return this; - } - public Builder ClearDummy29() { - PrepareBuilder(); - result.hasDummy29 = false; - result.dummy29_ = 0; - return this; - } - - public bool HasDummy30 { - get { return result.hasDummy30; } - } - public int Dummy30 { - get { return result.Dummy30; } - set { SetDummy30(value); } - } - public Builder SetDummy30(int value) { - PrepareBuilder(); - result.hasDummy30 = true; - result.dummy30_ = value; - return this; - } - public Builder ClearDummy30() { - PrepareBuilder(); - result.hasDummy30 = false; - result.dummy30_ = 0; - return this; - } - - public bool HasDummy31 { - get { return result.hasDummy31; } - } - public int Dummy31 { - get { return result.Dummy31; } - set { SetDummy31(value); } - } - public Builder SetDummy31(int value) { - PrepareBuilder(); - result.hasDummy31 = true; - result.dummy31_ = value; - return this; - } - public Builder ClearDummy31() { - PrepareBuilder(); - result.hasDummy31 = false; - result.dummy31_ = 0; - return this; - } - - public bool HasDummy32 { - get { return result.hasDummy32; } - } - public int Dummy32 { - get { return result.Dummy32; } - set { SetDummy32(value); } - } - public Builder SetDummy32(int value) { - PrepareBuilder(); - result.hasDummy32 = true; - result.dummy32_ = value; - return this; - } - public Builder ClearDummy32() { - PrepareBuilder(); - result.hasDummy32 = false; - result.dummy32_ = 0; - return this; - } - - public bool HasC { - get { return result.hasC; } - } - public int C { - get { return result.C; } - set { SetC(value); } - } - public Builder SetC(int value) { - PrepareBuilder(); - result.hasC = true; - result.c_ = value; - return this; - } - public Builder ClearC() { - PrepareBuilder(); - result.hasC = false; - result.c_ = 0; - return this; - } - } - static TestRequired() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestRequiredForeign : pb::GeneratedMessage { - private TestRequiredForeign() { } - private static readonly TestRequiredForeign defaultInstance = new TestRequiredForeign().MakeReadOnly(); - private static readonly string[] _testRequiredForeignFieldNames = new string[] { "dummy", "optional_message", "repeated_message" }; - private static readonly uint[] _testRequiredForeignFieldTags = new uint[] { 24, 10, 18 }; - public static TestRequiredForeign DefaultInstance { - get { return defaultInstance; } - } - - public override TestRequiredForeign DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestRequiredForeign ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestRequiredForeign__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestRequiredForeign__FieldAccessorTable; } - } - - public const int OptionalMessageFieldNumber = 1; - private bool hasOptionalMessage; - private global::Google.ProtocolBuffers.TestProtos.TestRequired optionalMessage_; - public bool HasOptionalMessage { - get { return hasOptionalMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.TestRequired OptionalMessage { - get { return optionalMessage_ ?? global::Google.ProtocolBuffers.TestProtos.TestRequired.DefaultInstance; } - } - - public const int RepeatedMessageFieldNumber = 2; - private pbc::PopsicleList repeatedMessage_ = new pbc::PopsicleList(); - public scg::IList RepeatedMessageList { - get { return repeatedMessage_; } - } - public int RepeatedMessageCount { - get { return repeatedMessage_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.TestRequired GetRepeatedMessage(int index) { - return repeatedMessage_[index]; - } - - public const int DummyFieldNumber = 3; - private bool hasDummy; - private int dummy_; - public bool HasDummy { - get { return hasDummy; } - } - public int Dummy { - get { return dummy_; } - } - - public override bool IsInitialized { - get { - if (HasOptionalMessage) { - if (!OptionalMessage.IsInitialized) return false; - } - foreach (global::Google.ProtocolBuffers.TestProtos.TestRequired element in RepeatedMessageList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testRequiredForeignFieldNames; - if (hasOptionalMessage) { - output.WriteMessage(1, field_names[1], OptionalMessage); - } - if (repeatedMessage_.Count > 0) { - output.WriteMessageArray(2, field_names[2], repeatedMessage_); - } - if (hasDummy) { - output.WriteInt32(3, field_names[0], Dummy); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasOptionalMessage) { - size += pb::CodedOutputStream.ComputeMessageSize(1, OptionalMessage); - } - foreach (global::Google.ProtocolBuffers.TestProtos.TestRequired element in RepeatedMessageList) { - size += pb::CodedOutputStream.ComputeMessageSize(2, element); - } - if (hasDummy) { - size += pb::CodedOutputStream.ComputeInt32Size(3, Dummy); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestRequiredForeign ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestRequiredForeign ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestRequiredForeign ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestRequiredForeign ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestRequiredForeign ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestRequiredForeign ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestRequiredForeign ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestRequiredForeign ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestRequiredForeign ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestRequiredForeign ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestRequiredForeign MakeReadOnly() { - repeatedMessage_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestRequiredForeign prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestRequiredForeign cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestRequiredForeign result; - - private TestRequiredForeign PrepareBuilder() { - if (resultIsReadOnly) { - TestRequiredForeign original = result; - result = new TestRequiredForeign(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestRequiredForeign MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestRequiredForeign.Descriptor; } - } - - public override TestRequiredForeign DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestRequiredForeign.DefaultInstance; } - } - - public override TestRequiredForeign BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestRequiredForeign) { - return MergeFrom((TestRequiredForeign) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestRequiredForeign other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestRequiredForeign.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasOptionalMessage) { - MergeOptionalMessage(other.OptionalMessage); - } - if (other.repeatedMessage_.Count != 0) { - result.repeatedMessage_.Add(other.repeatedMessage_); - } - if (other.HasDummy) { - Dummy = other.Dummy; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testRequiredForeignFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testRequiredForeignFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - global::Google.ProtocolBuffers.TestProtos.TestRequired.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestRequired.CreateBuilder(); - if (result.hasOptionalMessage) { - subBuilder.MergeFrom(OptionalMessage); - } - input.ReadMessage(subBuilder, extensionRegistry); - OptionalMessage = subBuilder.BuildPartial(); - break; - } - case 18: { - input.ReadMessageArray(tag, field_name, result.repeatedMessage_, global::Google.ProtocolBuffers.TestProtos.TestRequired.DefaultInstance, extensionRegistry); - break; - } - case 24: { - result.hasDummy = input.ReadInt32(ref result.dummy_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasOptionalMessage { - get { return result.hasOptionalMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.TestRequired OptionalMessage { - get { return result.OptionalMessage; } - set { SetOptionalMessage(value); } - } - public Builder SetOptionalMessage(global::Google.ProtocolBuffers.TestProtos.TestRequired value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalMessage = true; - result.optionalMessage_ = value; - return this; - } - public Builder SetOptionalMessage(global::Google.ProtocolBuffers.TestProtos.TestRequired.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptionalMessage = true; - result.optionalMessage_ = builderForValue.Build(); - return this; - } - public Builder MergeOptionalMessage(global::Google.ProtocolBuffers.TestProtos.TestRequired value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptionalMessage && - result.optionalMessage_ != global::Google.ProtocolBuffers.TestProtos.TestRequired.DefaultInstance) { - result.optionalMessage_ = global::Google.ProtocolBuffers.TestProtos.TestRequired.CreateBuilder(result.optionalMessage_).MergeFrom(value).BuildPartial(); - } else { - result.optionalMessage_ = value; - } - result.hasOptionalMessage = true; - return this; - } - public Builder ClearOptionalMessage() { - PrepareBuilder(); - result.hasOptionalMessage = false; - result.optionalMessage_ = null; - return this; - } - - public pbc::IPopsicleList RepeatedMessageList { - get { return PrepareBuilder().repeatedMessage_; } - } - public int RepeatedMessageCount { - get { return result.RepeatedMessageCount; } - } - public global::Google.ProtocolBuffers.TestProtos.TestRequired GetRepeatedMessage(int index) { - return result.GetRepeatedMessage(index); - } - public Builder SetRepeatedMessage(int index, global::Google.ProtocolBuffers.TestProtos.TestRequired value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedMessage_[index] = value; - return this; - } - public Builder SetRepeatedMessage(int index, global::Google.ProtocolBuffers.TestProtos.TestRequired.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedMessage_[index] = builderForValue.Build(); - return this; - } - public Builder AddRepeatedMessage(global::Google.ProtocolBuffers.TestProtos.TestRequired value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedMessage_.Add(value); - return this; - } - public Builder AddRepeatedMessage(global::Google.ProtocolBuffers.TestProtos.TestRequired.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedMessage_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeRepeatedMessage(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedMessage_.Add(values); - return this; - } - public Builder ClearRepeatedMessage() { - PrepareBuilder(); - result.repeatedMessage_.Clear(); - return this; - } - - public bool HasDummy { - get { return result.hasDummy; } - } - public int Dummy { - get { return result.Dummy; } - set { SetDummy(value); } - } - public Builder SetDummy(int value) { - PrepareBuilder(); - result.hasDummy = true; - result.dummy_ = value; - return this; - } - public Builder ClearDummy() { - PrepareBuilder(); - result.hasDummy = false; - result.dummy_ = 0; - return this; - } - } - static TestRequiredForeign() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestForeignNested : pb::GeneratedMessage { - private TestForeignNested() { } - private static readonly TestForeignNested defaultInstance = new TestForeignNested().MakeReadOnly(); - private static readonly string[] _testForeignNestedFieldNames = new string[] { "foreign_nested" }; - private static readonly uint[] _testForeignNestedFieldTags = new uint[] { 10 }; - public static TestForeignNested DefaultInstance { - get { return defaultInstance; } - } - - public override TestForeignNested DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestForeignNested ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestForeignNested__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestForeignNested__FieldAccessorTable; } - } - - public const int ForeignNestedFieldNumber = 1; - private bool hasForeignNested; - private global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage foreignNested_; - public bool HasForeignNested { - get { return hasForeignNested; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage ForeignNested { - get { return foreignNested_ ?? global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.DefaultInstance; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testForeignNestedFieldNames; - if (hasForeignNested) { - output.WriteMessage(1, field_names[0], ForeignNested); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasForeignNested) { - size += pb::CodedOutputStream.ComputeMessageSize(1, ForeignNested); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestForeignNested ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestForeignNested ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestForeignNested ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestForeignNested ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestForeignNested ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestForeignNested ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestForeignNested ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestForeignNested ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestForeignNested ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestForeignNested ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestForeignNested MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestForeignNested prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestForeignNested cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestForeignNested result; - - private TestForeignNested PrepareBuilder() { - if (resultIsReadOnly) { - TestForeignNested original = result; - result = new TestForeignNested(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestForeignNested MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestForeignNested.Descriptor; } - } - - public override TestForeignNested DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestForeignNested.DefaultInstance; } - } - - public override TestForeignNested BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestForeignNested) { - return MergeFrom((TestForeignNested) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestForeignNested other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestForeignNested.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasForeignNested) { - MergeForeignNested(other.ForeignNested); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testForeignNestedFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testForeignNestedFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.CreateBuilder(); - if (result.hasForeignNested) { - subBuilder.MergeFrom(ForeignNested); - } - input.ReadMessage(subBuilder, extensionRegistry); - ForeignNested = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasForeignNested { - get { return result.hasForeignNested; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage ForeignNested { - get { return result.ForeignNested; } - set { SetForeignNested(value); } - } - public Builder SetForeignNested(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasForeignNested = true; - result.foreignNested_ = value; - return this; - } - public Builder SetForeignNested(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasForeignNested = true; - result.foreignNested_ = builderForValue.Build(); - return this; - } - public Builder MergeForeignNested(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasForeignNested && - result.foreignNested_ != global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.DefaultInstance) { - result.foreignNested_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.CreateBuilder(result.foreignNested_).MergeFrom(value).BuildPartial(); - } else { - result.foreignNested_ = value; - } - result.hasForeignNested = true; - return this; - } - public Builder ClearForeignNested() { - PrepareBuilder(); - result.hasForeignNested = false; - result.foreignNested_ = null; - return this; - } - } - static TestForeignNested() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestEmptyMessage : pb::GeneratedMessage { - private TestEmptyMessage() { } - private static readonly TestEmptyMessage defaultInstance = new TestEmptyMessage().MakeReadOnly(); - private static readonly string[] _testEmptyMessageFieldNames = new string[] { }; - private static readonly uint[] _testEmptyMessageFieldTags = new uint[] { }; - public static TestEmptyMessage DefaultInstance { - get { return defaultInstance; } - } - - public override TestEmptyMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestEmptyMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestEmptyMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestEmptyMessage__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testEmptyMessageFieldNames; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestEmptyMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestEmptyMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestEmptyMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestEmptyMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestEmptyMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestEmptyMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestEmptyMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestEmptyMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestEmptyMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestEmptyMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestEmptyMessage MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestEmptyMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestEmptyMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestEmptyMessage result; - - private TestEmptyMessage PrepareBuilder() { - if (resultIsReadOnly) { - TestEmptyMessage original = result; - result = new TestEmptyMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestEmptyMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestEmptyMessage.Descriptor; } - } - - public override TestEmptyMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestEmptyMessage.DefaultInstance; } - } - - public override TestEmptyMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestEmptyMessage) { - return MergeFrom((TestEmptyMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestEmptyMessage other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestEmptyMessage.DefaultInstance) return this; - PrepareBuilder(); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testEmptyMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testEmptyMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static TestEmptyMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestEmptyMessageWithExtensions : pb::ExtendableMessage { - private TestEmptyMessageWithExtensions() { } - private static readonly TestEmptyMessageWithExtensions defaultInstance = new TestEmptyMessageWithExtensions().MakeReadOnly(); - private static readonly string[] _testEmptyMessageWithExtensionsFieldNames = new string[] { }; - private static readonly uint[] _testEmptyMessageWithExtensionsFieldTags = new uint[] { }; - public static TestEmptyMessageWithExtensions DefaultInstance { - get { return defaultInstance; } - } - - public override TestEmptyMessageWithExtensions DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestEmptyMessageWithExtensions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestEmptyMessageWithExtensions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestEmptyMessageWithExtensions__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testEmptyMessageWithExtensionsFieldNames; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - extensionWriter.WriteUntil(536870912, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestEmptyMessageWithExtensions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestEmptyMessageWithExtensions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestEmptyMessageWithExtensions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestEmptyMessageWithExtensions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestEmptyMessageWithExtensions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestEmptyMessageWithExtensions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestEmptyMessageWithExtensions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestEmptyMessageWithExtensions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestEmptyMessageWithExtensions ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestEmptyMessageWithExtensions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestEmptyMessageWithExtensions MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestEmptyMessageWithExtensions prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestEmptyMessageWithExtensions cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestEmptyMessageWithExtensions result; - - private TestEmptyMessageWithExtensions PrepareBuilder() { - if (resultIsReadOnly) { - TestEmptyMessageWithExtensions original = result; - result = new TestEmptyMessageWithExtensions(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestEmptyMessageWithExtensions MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestEmptyMessageWithExtensions.Descriptor; } - } - - public override TestEmptyMessageWithExtensions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestEmptyMessageWithExtensions.DefaultInstance; } - } - - public override TestEmptyMessageWithExtensions BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestEmptyMessageWithExtensions) { - return MergeFrom((TestEmptyMessageWithExtensions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestEmptyMessageWithExtensions other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestEmptyMessageWithExtensions.DefaultInstance) return this; - PrepareBuilder(); - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testEmptyMessageWithExtensionsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testEmptyMessageWithExtensionsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static TestEmptyMessageWithExtensions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestMultipleExtensionRanges : pb::ExtendableMessage { - private TestMultipleExtensionRanges() { } - private static readonly TestMultipleExtensionRanges defaultInstance = new TestMultipleExtensionRanges().MakeReadOnly(); - private static readonly string[] _testMultipleExtensionRangesFieldNames = new string[] { }; - private static readonly uint[] _testMultipleExtensionRangesFieldTags = new uint[] { }; - public static TestMultipleExtensionRanges DefaultInstance { - get { return defaultInstance; } - } - - public override TestMultipleExtensionRanges DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestMultipleExtensionRanges ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestMultipleExtensionRanges__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestMultipleExtensionRanges__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testMultipleExtensionRangesFieldNames; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - extensionWriter.WriteUntil(43, output); - extensionWriter.WriteUntil(4244, output); - extensionWriter.WriteUntil(536870912, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestMultipleExtensionRanges ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestMultipleExtensionRanges ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestMultipleExtensionRanges ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestMultipleExtensionRanges ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestMultipleExtensionRanges ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestMultipleExtensionRanges ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestMultipleExtensionRanges ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestMultipleExtensionRanges ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestMultipleExtensionRanges ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestMultipleExtensionRanges ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestMultipleExtensionRanges MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestMultipleExtensionRanges prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestMultipleExtensionRanges cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestMultipleExtensionRanges result; - - private TestMultipleExtensionRanges PrepareBuilder() { - if (resultIsReadOnly) { - TestMultipleExtensionRanges original = result; - result = new TestMultipleExtensionRanges(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestMultipleExtensionRanges MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestMultipleExtensionRanges.Descriptor; } - } - - public override TestMultipleExtensionRanges DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestMultipleExtensionRanges.DefaultInstance; } - } - - public override TestMultipleExtensionRanges BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestMultipleExtensionRanges) { - return MergeFrom((TestMultipleExtensionRanges) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestMultipleExtensionRanges other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestMultipleExtensionRanges.DefaultInstance) return this; - PrepareBuilder(); - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testMultipleExtensionRangesFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testMultipleExtensionRangesFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static TestMultipleExtensionRanges() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestReallyLargeTagNumber : pb::GeneratedMessage { - private TestReallyLargeTagNumber() { } - private static readonly TestReallyLargeTagNumber defaultInstance = new TestReallyLargeTagNumber().MakeReadOnly(); - private static readonly string[] _testReallyLargeTagNumberFieldNames = new string[] { "a", "bb" }; - private static readonly uint[] _testReallyLargeTagNumberFieldTags = new uint[] { 8, 2147483640 }; - public static TestReallyLargeTagNumber DefaultInstance { - get { return defaultInstance; } - } - - public override TestReallyLargeTagNumber DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestReallyLargeTagNumber ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestReallyLargeTagNumber__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestReallyLargeTagNumber__FieldAccessorTable; } - } - - public const int AFieldNumber = 1; - private bool hasA; - private int a_; - public bool HasA { - get { return hasA; } - } - public int A { - get { return a_; } - } - - public const int BbFieldNumber = 268435455; - private bool hasBb; - private int bb_; - public bool HasBb { - get { return hasBb; } - } - public int Bb { - get { return bb_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testReallyLargeTagNumberFieldNames; - if (hasA) { - output.WriteInt32(1, field_names[0], A); - } - if (hasBb) { - output.WriteInt32(268435455, field_names[1], Bb); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA) { - size += pb::CodedOutputStream.ComputeInt32Size(1, A); - } - if (hasBb) { - size += pb::CodedOutputStream.ComputeInt32Size(268435455, Bb); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestReallyLargeTagNumber ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestReallyLargeTagNumber ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestReallyLargeTagNumber ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestReallyLargeTagNumber ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestReallyLargeTagNumber ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestReallyLargeTagNumber ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestReallyLargeTagNumber ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestReallyLargeTagNumber ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestReallyLargeTagNumber ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestReallyLargeTagNumber ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestReallyLargeTagNumber MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestReallyLargeTagNumber prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestReallyLargeTagNumber cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestReallyLargeTagNumber result; - - private TestReallyLargeTagNumber PrepareBuilder() { - if (resultIsReadOnly) { - TestReallyLargeTagNumber original = result; - result = new TestReallyLargeTagNumber(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestReallyLargeTagNumber MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestReallyLargeTagNumber.Descriptor; } - } - - public override TestReallyLargeTagNumber DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestReallyLargeTagNumber.DefaultInstance; } - } - - public override TestReallyLargeTagNumber BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestReallyLargeTagNumber) { - return MergeFrom((TestReallyLargeTagNumber) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestReallyLargeTagNumber other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestReallyLargeTagNumber.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA) { - A = other.A; - } - if (other.HasBb) { - Bb = other.Bb; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testReallyLargeTagNumberFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testReallyLargeTagNumberFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasA = input.ReadInt32(ref result.a_); - break; - } - case 2147483640: { - result.hasBb = input.ReadInt32(ref result.bb_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasA { - get { return result.hasA; } - } - public int A { - get { return result.A; } - set { SetA(value); } - } - public Builder SetA(int value) { - PrepareBuilder(); - result.hasA = true; - result.a_ = value; - return this; - } - public Builder ClearA() { - PrepareBuilder(); - result.hasA = false; - result.a_ = 0; - return this; - } - - public bool HasBb { - get { return result.hasBb; } - } - public int Bb { - get { return result.Bb; } - set { SetBb(value); } - } - public Builder SetBb(int value) { - PrepareBuilder(); - result.hasBb = true; - result.bb_ = value; - return this; - } - public Builder ClearBb() { - PrepareBuilder(); - result.hasBb = false; - result.bb_ = 0; - return this; - } - } - static TestReallyLargeTagNumber() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestRecursiveMessage : pb::GeneratedMessage { - private TestRecursiveMessage() { } - private static readonly TestRecursiveMessage defaultInstance = new TestRecursiveMessage().MakeReadOnly(); - private static readonly string[] _testRecursiveMessageFieldNames = new string[] { "a", "i" }; - private static readonly uint[] _testRecursiveMessageFieldTags = new uint[] { 10, 16 }; - public static TestRecursiveMessage DefaultInstance { - get { return defaultInstance; } - } - - public override TestRecursiveMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestRecursiveMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestRecursiveMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestRecursiveMessage__FieldAccessorTable; } - } - - public const int AFieldNumber = 1; - private bool hasA; - private global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage a_; - public bool HasA { - get { return hasA; } - } - public global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage A { - get { return a_ ?? global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.DefaultInstance; } - } - - public const int IFieldNumber = 2; - private bool hasI; - private int i_; - public bool HasI { - get { return hasI; } - } - public int I { - get { return i_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testRecursiveMessageFieldNames; - if (hasA) { - output.WriteMessage(1, field_names[0], A); - } - if (hasI) { - output.WriteInt32(2, field_names[1], I); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA) { - size += pb::CodedOutputStream.ComputeMessageSize(1, A); - } - if (hasI) { - size += pb::CodedOutputStream.ComputeInt32Size(2, I); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestRecursiveMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestRecursiveMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestRecursiveMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestRecursiveMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestRecursiveMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestRecursiveMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestRecursiveMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestRecursiveMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestRecursiveMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestRecursiveMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestRecursiveMessage MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestRecursiveMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestRecursiveMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestRecursiveMessage result; - - private TestRecursiveMessage PrepareBuilder() { - if (resultIsReadOnly) { - TestRecursiveMessage original = result; - result = new TestRecursiveMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestRecursiveMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.Descriptor; } - } - - public override TestRecursiveMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.DefaultInstance; } - } - - public override TestRecursiveMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestRecursiveMessage) { - return MergeFrom((TestRecursiveMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestRecursiveMessage other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA) { - MergeA(other.A); - } - if (other.HasI) { - I = other.I; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testRecursiveMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testRecursiveMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.CreateBuilder(); - if (result.hasA) { - subBuilder.MergeFrom(A); - } - input.ReadMessage(subBuilder, extensionRegistry); - A = subBuilder.BuildPartial(); - break; - } - case 16: { - result.hasI = input.ReadInt32(ref result.i_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasA { - get { return result.hasA; } - } - public global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage A { - get { return result.A; } - set { SetA(value); } - } - public Builder SetA(global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasA = true; - result.a_ = value; - return this; - } - public Builder SetA(global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasA = true; - result.a_ = builderForValue.Build(); - return this; - } - public Builder MergeA(global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasA && - result.a_ != global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.DefaultInstance) { - result.a_ = global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.CreateBuilder(result.a_).MergeFrom(value).BuildPartial(); - } else { - result.a_ = value; - } - result.hasA = true; - return this; - } - public Builder ClearA() { - PrepareBuilder(); - result.hasA = false; - result.a_ = null; - return this; - } - - public bool HasI { - get { return result.hasI; } - } - public int I { - get { return result.I; } - set { SetI(value); } - } - public Builder SetI(int value) { - PrepareBuilder(); - result.hasI = true; - result.i_ = value; - return this; - } - public Builder ClearI() { - PrepareBuilder(); - result.hasI = false; - result.i_ = 0; - return this; - } - } - static TestRecursiveMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestMutualRecursionA : pb::GeneratedMessage { - private TestMutualRecursionA() { } - private static readonly TestMutualRecursionA defaultInstance = new TestMutualRecursionA().MakeReadOnly(); - private static readonly string[] _testMutualRecursionAFieldNames = new string[] { "bb" }; - private static readonly uint[] _testMutualRecursionAFieldTags = new uint[] { 10 }; - public static TestMutualRecursionA DefaultInstance { - get { return defaultInstance; } - } - - public override TestMutualRecursionA DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestMutualRecursionA ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestMutualRecursionA__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestMutualRecursionA__FieldAccessorTable; } - } - - public const int BbFieldNumber = 1; - private bool hasBb; - private global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB bb_; - public bool HasBb { - get { return hasBb; } - } - public global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB Bb { - get { return bb_ ?? global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.DefaultInstance; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testMutualRecursionAFieldNames; - if (hasBb) { - output.WriteMessage(1, field_names[0], Bb); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasBb) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Bb); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestMutualRecursionA ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestMutualRecursionA ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestMutualRecursionA ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestMutualRecursionA ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestMutualRecursionA ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestMutualRecursionA ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestMutualRecursionA ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestMutualRecursionA ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestMutualRecursionA ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestMutualRecursionA ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestMutualRecursionA MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestMutualRecursionA prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestMutualRecursionA cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestMutualRecursionA result; - - private TestMutualRecursionA PrepareBuilder() { - if (resultIsReadOnly) { - TestMutualRecursionA original = result; - result = new TestMutualRecursionA(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestMutualRecursionA MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.Descriptor; } - } - - public override TestMutualRecursionA DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.DefaultInstance; } - } - - public override TestMutualRecursionA BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestMutualRecursionA) { - return MergeFrom((TestMutualRecursionA) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestMutualRecursionA other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasBb) { - MergeBb(other.Bb); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testMutualRecursionAFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testMutualRecursionAFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.CreateBuilder(); - if (result.hasBb) { - subBuilder.MergeFrom(Bb); - } - input.ReadMessage(subBuilder, extensionRegistry); - Bb = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasBb { - get { return result.hasBb; } - } - public global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB Bb { - get { return result.Bb; } - set { SetBb(value); } - } - public Builder SetBb(global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasBb = true; - result.bb_ = value; - return this; - } - public Builder SetBb(global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasBb = true; - result.bb_ = builderForValue.Build(); - return this; - } - public Builder MergeBb(global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasBb && - result.bb_ != global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.DefaultInstance) { - result.bb_ = global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.CreateBuilder(result.bb_).MergeFrom(value).BuildPartial(); - } else { - result.bb_ = value; - } - result.hasBb = true; - return this; - } - public Builder ClearBb() { - PrepareBuilder(); - result.hasBb = false; - result.bb_ = null; - return this; - } - } - static TestMutualRecursionA() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestMutualRecursionB : pb::GeneratedMessage { - private TestMutualRecursionB() { } - private static readonly TestMutualRecursionB defaultInstance = new TestMutualRecursionB().MakeReadOnly(); - private static readonly string[] _testMutualRecursionBFieldNames = new string[] { "a", "optional_int32" }; - private static readonly uint[] _testMutualRecursionBFieldTags = new uint[] { 10, 16 }; - public static TestMutualRecursionB DefaultInstance { - get { return defaultInstance; } - } - - public override TestMutualRecursionB DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestMutualRecursionB ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestMutualRecursionB__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestMutualRecursionB__FieldAccessorTable; } - } - - public const int AFieldNumber = 1; - private bool hasA; - private global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA a_; - public bool HasA { - get { return hasA; } - } - public global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA A { - get { return a_ ?? global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.DefaultInstance; } - } - - public const int OptionalInt32FieldNumber = 2; - private bool hasOptionalInt32; - private int optionalInt32_; - public bool HasOptionalInt32 { - get { return hasOptionalInt32; } - } - public int OptionalInt32 { - get { return optionalInt32_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testMutualRecursionBFieldNames; - if (hasA) { - output.WriteMessage(1, field_names[0], A); - } - if (hasOptionalInt32) { - output.WriteInt32(2, field_names[1], OptionalInt32); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA) { - size += pb::CodedOutputStream.ComputeMessageSize(1, A); - } - if (hasOptionalInt32) { - size += pb::CodedOutputStream.ComputeInt32Size(2, OptionalInt32); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestMutualRecursionB ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestMutualRecursionB ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestMutualRecursionB ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestMutualRecursionB ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestMutualRecursionB ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestMutualRecursionB ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestMutualRecursionB ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestMutualRecursionB ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestMutualRecursionB ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestMutualRecursionB ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestMutualRecursionB MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestMutualRecursionB prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestMutualRecursionB cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestMutualRecursionB result; - - private TestMutualRecursionB PrepareBuilder() { - if (resultIsReadOnly) { - TestMutualRecursionB original = result; - result = new TestMutualRecursionB(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestMutualRecursionB MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.Descriptor; } - } - - public override TestMutualRecursionB DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.DefaultInstance; } - } - - public override TestMutualRecursionB BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestMutualRecursionB) { - return MergeFrom((TestMutualRecursionB) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestMutualRecursionB other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA) { - MergeA(other.A); - } - if (other.HasOptionalInt32) { - OptionalInt32 = other.OptionalInt32; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testMutualRecursionBFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testMutualRecursionBFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.CreateBuilder(); - if (result.hasA) { - subBuilder.MergeFrom(A); - } - input.ReadMessage(subBuilder, extensionRegistry); - A = subBuilder.BuildPartial(); - break; - } - case 16: { - result.hasOptionalInt32 = input.ReadInt32(ref result.optionalInt32_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasA { - get { return result.hasA; } - } - public global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA A { - get { return result.A; } - set { SetA(value); } - } - public Builder SetA(global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasA = true; - result.a_ = value; - return this; - } - public Builder SetA(global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasA = true; - result.a_ = builderForValue.Build(); - return this; - } - public Builder MergeA(global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasA && - result.a_ != global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.DefaultInstance) { - result.a_ = global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.CreateBuilder(result.a_).MergeFrom(value).BuildPartial(); - } else { - result.a_ = value; - } - result.hasA = true; - return this; - } - public Builder ClearA() { - PrepareBuilder(); - result.hasA = false; - result.a_ = null; - return this; - } - - public bool HasOptionalInt32 { - get { return result.hasOptionalInt32; } - } - public int OptionalInt32 { - get { return result.OptionalInt32; } - set { SetOptionalInt32(value); } - } - public Builder SetOptionalInt32(int value) { - PrepareBuilder(); - result.hasOptionalInt32 = true; - result.optionalInt32_ = value; - return this; - } - public Builder ClearOptionalInt32() { - PrepareBuilder(); - result.hasOptionalInt32 = false; - result.optionalInt32_ = 0; - return this; - } - } - static TestMutualRecursionB() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestDupFieldNumber : pb::GeneratedMessage { - private TestDupFieldNumber() { } - private static readonly TestDupFieldNumber defaultInstance = new TestDupFieldNumber().MakeReadOnly(); - private static readonly string[] _testDupFieldNumberFieldNames = new string[] { "a", "bar", "foo" }; - private static readonly uint[] _testDupFieldNumberFieldTags = new uint[] { 8, 27, 19 }; - public static TestDupFieldNumber DefaultInstance { - get { return defaultInstance; } - } - - public override TestDupFieldNumber DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestDupFieldNumber ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDupFieldNumber__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDupFieldNumber__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Foo : pb::GeneratedMessage { - private Foo() { } - private static readonly Foo defaultInstance = new Foo().MakeReadOnly(); - private static readonly string[] _fooFieldNames = new string[] { "a" }; - private static readonly uint[] _fooFieldTags = new uint[] { 8 }; - public static Foo DefaultInstance { - get { return defaultInstance; } - } - - public override Foo DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override Foo ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDupFieldNumber_Foo__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDupFieldNumber_Foo__FieldAccessorTable; } - } - - public const int AFieldNumber = 1; - private bool hasA; - private int a_; - public bool HasA { - get { return hasA; } - } - public int A { - get { return a_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _fooFieldNames; - if (hasA) { - output.WriteInt32(1, field_names[0], A); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA) { - size += pb::CodedOutputStream.ComputeInt32Size(1, A); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static Foo ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Foo ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Foo ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Foo ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Foo ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Foo ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Foo ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Foo ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Foo ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Foo ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private Foo MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Foo prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(Foo cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private Foo result; - - private Foo PrepareBuilder() { - if (resultIsReadOnly) { - Foo original = result; - result = new Foo(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override Foo MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.Descriptor; } - } - - public override Foo DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.DefaultInstance; } - } - - public override Foo BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Foo) { - return MergeFrom((Foo) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Foo other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA) { - A = other.A; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_fooFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _fooFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasA = input.ReadInt32(ref result.a_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasA { - get { return result.hasA; } - } - public int A { - get { return result.A; } - set { SetA(value); } - } - public Builder SetA(int value) { - PrepareBuilder(); - result.hasA = true; - result.a_ = value; - return this; - } - public Builder ClearA() { - PrepareBuilder(); - result.hasA = false; - result.a_ = 0; - return this; - } - } - static Foo() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Bar : pb::GeneratedMessage { - private Bar() { } - private static readonly Bar defaultInstance = new Bar().MakeReadOnly(); - private static readonly string[] _barFieldNames = new string[] { "a" }; - private static readonly uint[] _barFieldTags = new uint[] { 8 }; - public static Bar DefaultInstance { - get { return defaultInstance; } - } - - public override Bar DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override Bar ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDupFieldNumber_Bar__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDupFieldNumber_Bar__FieldAccessorTable; } - } - - public const int AFieldNumber = 1; - private bool hasA; - private int a_; - public bool HasA { - get { return hasA; } - } - public int A { - get { return a_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _barFieldNames; - if (hasA) { - output.WriteInt32(1, field_names[0], A); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA) { - size += pb::CodedOutputStream.ComputeInt32Size(1, A); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static Bar ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Bar ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Bar ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Bar ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Bar ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Bar ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Bar ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Bar ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Bar ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Bar ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private Bar MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Bar prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(Bar cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private Bar result; - - private Bar PrepareBuilder() { - if (resultIsReadOnly) { - Bar original = result; - result = new Bar(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override Bar MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.Descriptor; } - } - - public override Bar DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.DefaultInstance; } - } - - public override Bar BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Bar) { - return MergeFrom((Bar) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Bar other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA) { - A = other.A; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_barFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _barFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasA = input.ReadInt32(ref result.a_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasA { - get { return result.hasA; } - } - public int A { - get { return result.A; } - set { SetA(value); } - } - public Builder SetA(int value) { - PrepareBuilder(); - result.hasA = true; - result.a_ = value; - return this; - } - public Builder ClearA() { - PrepareBuilder(); - result.hasA = false; - result.a_ = 0; - return this; - } - } - static Bar() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - } - #endregion - - public const int AFieldNumber = 1; - private bool hasA; - private int a_; - public bool HasA { - get { return hasA; } - } - public int A { - get { return a_; } - } - - public const int FooFieldNumber = 2; - private bool hasFoo; - private global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo foo_; - public bool HasFoo { - get { return hasFoo; } - } - public global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo Foo { - get { return foo_ ?? global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.DefaultInstance; } - } - - public const int BarFieldNumber = 3; - private bool hasBar; - private global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar bar_; - public bool HasBar { - get { return hasBar; } - } - public global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar Bar { - get { return bar_ ?? global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.DefaultInstance; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testDupFieldNumberFieldNames; - if (hasA) { - output.WriteInt32(1, field_names[0], A); - } - if (hasFoo) { - output.WriteGroup(2, field_names[2], Foo); - } - if (hasBar) { - output.WriteGroup(3, field_names[1], Bar); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA) { - size += pb::CodedOutputStream.ComputeInt32Size(1, A); - } - if (hasFoo) { - size += pb::CodedOutputStream.ComputeGroupSize(2, Foo); - } - if (hasBar) { - size += pb::CodedOutputStream.ComputeGroupSize(3, Bar); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestDupFieldNumber ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestDupFieldNumber ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestDupFieldNumber ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestDupFieldNumber ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestDupFieldNumber ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestDupFieldNumber ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestDupFieldNumber ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestDupFieldNumber ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestDupFieldNumber ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestDupFieldNumber ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestDupFieldNumber MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestDupFieldNumber prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestDupFieldNumber cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestDupFieldNumber result; - - private TestDupFieldNumber PrepareBuilder() { - if (resultIsReadOnly) { - TestDupFieldNumber original = result; - result = new TestDupFieldNumber(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestDupFieldNumber MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Descriptor; } - } - - public override TestDupFieldNumber DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.DefaultInstance; } - } - - public override TestDupFieldNumber BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestDupFieldNumber) { - return MergeFrom((TestDupFieldNumber) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestDupFieldNumber other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA) { - A = other.A; - } - if (other.HasFoo) { - MergeFoo(other.Foo); - } - if (other.HasBar) { - MergeBar(other.Bar); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testDupFieldNumberFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testDupFieldNumberFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasA = input.ReadInt32(ref result.a_); - break; - } - case 19: { - global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.CreateBuilder(); - if (result.hasFoo) { - subBuilder.MergeFrom(Foo); - } - input.ReadGroup(2, subBuilder, extensionRegistry); - Foo = subBuilder.BuildPartial(); - break; - } - case 27: { - global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.CreateBuilder(); - if (result.hasBar) { - subBuilder.MergeFrom(Bar); - } - input.ReadGroup(3, subBuilder, extensionRegistry); - Bar = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasA { - get { return result.hasA; } - } - public int A { - get { return result.A; } - set { SetA(value); } - } - public Builder SetA(int value) { - PrepareBuilder(); - result.hasA = true; - result.a_ = value; - return this; - } - public Builder ClearA() { - PrepareBuilder(); - result.hasA = false; - result.a_ = 0; - return this; - } - - public bool HasFoo { - get { return result.hasFoo; } - } - public global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo Foo { - get { return result.Foo; } - set { SetFoo(value); } - } - public Builder SetFoo(global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasFoo = true; - result.foo_ = value; - return this; - } - public Builder SetFoo(global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasFoo = true; - result.foo_ = builderForValue.Build(); - return this; - } - public Builder MergeFoo(global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasFoo && - result.foo_ != global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.DefaultInstance) { - result.foo_ = global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.CreateBuilder(result.foo_).MergeFrom(value).BuildPartial(); - } else { - result.foo_ = value; - } - result.hasFoo = true; - return this; - } - public Builder ClearFoo() { - PrepareBuilder(); - result.hasFoo = false; - result.foo_ = null; - return this; - } - - public bool HasBar { - get { return result.hasBar; } - } - public global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar Bar { - get { return result.Bar; } - set { SetBar(value); } - } - public Builder SetBar(global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasBar = true; - result.bar_ = value; - return this; - } - public Builder SetBar(global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasBar = true; - result.bar_ = builderForValue.Build(); - return this; - } - public Builder MergeBar(global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasBar && - result.bar_ != global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.DefaultInstance) { - result.bar_ = global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.CreateBuilder(result.bar_).MergeFrom(value).BuildPartial(); - } else { - result.bar_ = value; - } - result.hasBar = true; - return this; - } - public Builder ClearBar() { - PrepareBuilder(); - result.hasBar = false; - result.bar_ = null; - return this; - } - } - static TestDupFieldNumber() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestNestedMessageHasBits : pb::GeneratedMessage { - private TestNestedMessageHasBits() { } - private static readonly TestNestedMessageHasBits defaultInstance = new TestNestedMessageHasBits().MakeReadOnly(); - private static readonly string[] _testNestedMessageHasBitsFieldNames = new string[] { "optional_nested_message" }; - private static readonly uint[] _testNestedMessageHasBitsFieldTags = new uint[] { 10 }; - public static TestNestedMessageHasBits DefaultInstance { - get { return defaultInstance; } - } - - public override TestNestedMessageHasBits DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestNestedMessageHasBits ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestNestedMessageHasBits__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestNestedMessageHasBits__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class NestedMessage : pb::GeneratedMessage { - private NestedMessage() { } - private static readonly NestedMessage defaultInstance = new NestedMessage().MakeReadOnly(); - private static readonly string[] _nestedMessageFieldNames = new string[] { "nestedmessage_repeated_foreignmessage", "nestedmessage_repeated_int32" }; - private static readonly uint[] _nestedMessageFieldTags = new uint[] { 18, 8 }; - public static NestedMessage DefaultInstance { - get { return defaultInstance; } - } - - public override NestedMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override NestedMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestNestedMessageHasBits_NestedMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestNestedMessageHasBits_NestedMessage__FieldAccessorTable; } - } - - public const int NestedmessageRepeatedInt32FieldNumber = 1; - private pbc::PopsicleList nestedmessageRepeatedInt32_ = new pbc::PopsicleList(); - public scg::IList NestedmessageRepeatedInt32List { - get { return pbc::Lists.AsReadOnly(nestedmessageRepeatedInt32_); } - } - public int NestedmessageRepeatedInt32Count { - get { return nestedmessageRepeatedInt32_.Count; } - } - public int GetNestedmessageRepeatedInt32(int index) { - return nestedmessageRepeatedInt32_[index]; - } - - public const int NestedmessageRepeatedForeignmessageFieldNumber = 2; - private pbc::PopsicleList nestedmessageRepeatedForeignmessage_ = new pbc::PopsicleList(); - public scg::IList NestedmessageRepeatedForeignmessageList { - get { return nestedmessageRepeatedForeignmessage_; } - } - public int NestedmessageRepeatedForeignmessageCount { - get { return nestedmessageRepeatedForeignmessage_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage GetNestedmessageRepeatedForeignmessage(int index) { - return nestedmessageRepeatedForeignmessage_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _nestedMessageFieldNames; - if (nestedmessageRepeatedInt32_.Count > 0) { - output.WriteInt32Array(1, field_names[1], nestedmessageRepeatedInt32_); - } - if (nestedmessageRepeatedForeignmessage_.Count > 0) { - output.WriteMessageArray(2, field_names[0], nestedmessageRepeatedForeignmessage_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - foreach (int element in NestedmessageRepeatedInt32List) { - dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); - } - size += dataSize; - size += 1 * nestedmessageRepeatedInt32_.Count; - } - foreach (global::Google.ProtocolBuffers.TestProtos.ForeignMessage element in NestedmessageRepeatedForeignmessageList) { - size += pb::CodedOutputStream.ComputeMessageSize(2, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static NestedMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NestedMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NestedMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NestedMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NestedMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NestedMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static NestedMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NestedMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private NestedMessage MakeReadOnly() { - nestedmessageRepeatedInt32_.MakeReadOnly(); - nestedmessageRepeatedForeignmessage_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(NestedMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(NestedMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private NestedMessage result; - - private NestedMessage PrepareBuilder() { - if (resultIsReadOnly) { - NestedMessage original = result; - result = new NestedMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override NestedMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.Descriptor; } - } - - public override NestedMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.DefaultInstance; } - } - - public override NestedMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is NestedMessage) { - return MergeFrom((NestedMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(NestedMessage other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.nestedmessageRepeatedInt32_.Count != 0) { - result.nestedmessageRepeatedInt32_.Add(other.nestedmessageRepeatedInt32_); - } - if (other.nestedmessageRepeatedForeignmessage_.Count != 0) { - result.nestedmessageRepeatedForeignmessage_.Add(other.nestedmessageRepeatedForeignmessage_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_nestedMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _nestedMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: - case 8: { - input.ReadInt32Array(tag, field_name, result.nestedmessageRepeatedInt32_); - break; - } - case 18: { - input.ReadMessageArray(tag, field_name, result.nestedmessageRepeatedForeignmessage_, global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance, extensionRegistry); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public pbc::IPopsicleList NestedmessageRepeatedInt32List { - get { return PrepareBuilder().nestedmessageRepeatedInt32_; } - } - public int NestedmessageRepeatedInt32Count { - get { return result.NestedmessageRepeatedInt32Count; } - } - public int GetNestedmessageRepeatedInt32(int index) { - return result.GetNestedmessageRepeatedInt32(index); - } - public Builder SetNestedmessageRepeatedInt32(int index, int value) { - PrepareBuilder(); - result.nestedmessageRepeatedInt32_[index] = value; - return this; - } - public Builder AddNestedmessageRepeatedInt32(int value) { - PrepareBuilder(); - result.nestedmessageRepeatedInt32_.Add(value); - return this; - } - public Builder AddRangeNestedmessageRepeatedInt32(scg::IEnumerable values) { - PrepareBuilder(); - result.nestedmessageRepeatedInt32_.Add(values); - return this; - } - public Builder ClearNestedmessageRepeatedInt32() { - PrepareBuilder(); - result.nestedmessageRepeatedInt32_.Clear(); - return this; - } - - public pbc::IPopsicleList NestedmessageRepeatedForeignmessageList { - get { return PrepareBuilder().nestedmessageRepeatedForeignmessage_; } - } - public int NestedmessageRepeatedForeignmessageCount { - get { return result.NestedmessageRepeatedForeignmessageCount; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage GetNestedmessageRepeatedForeignmessage(int index) { - return result.GetNestedmessageRepeatedForeignmessage(index); - } - public Builder SetNestedmessageRepeatedForeignmessage(int index, global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.nestedmessageRepeatedForeignmessage_[index] = value; - return this; - } - public Builder SetNestedmessageRepeatedForeignmessage(int index, global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.nestedmessageRepeatedForeignmessage_[index] = builderForValue.Build(); - return this; - } - public Builder AddNestedmessageRepeatedForeignmessage(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.nestedmessageRepeatedForeignmessage_.Add(value); - return this; - } - public Builder AddNestedmessageRepeatedForeignmessage(global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.nestedmessageRepeatedForeignmessage_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeNestedmessageRepeatedForeignmessage(scg::IEnumerable values) { - PrepareBuilder(); - result.nestedmessageRepeatedForeignmessage_.Add(values); - return this; - } - public Builder ClearNestedmessageRepeatedForeignmessage() { - PrepareBuilder(); - result.nestedmessageRepeatedForeignmessage_.Clear(); - return this; - } - } - static NestedMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - } - #endregion - - public const int OptionalNestedMessageFieldNumber = 1; - private bool hasOptionalNestedMessage; - private global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage optionalNestedMessage_; - public bool HasOptionalNestedMessage { - get { return hasOptionalNestedMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage OptionalNestedMessage { - get { return optionalNestedMessage_ ?? global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.DefaultInstance; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testNestedMessageHasBitsFieldNames; - if (hasOptionalNestedMessage) { - output.WriteMessage(1, field_names[0], OptionalNestedMessage); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasOptionalNestedMessage) { - size += pb::CodedOutputStream.ComputeMessageSize(1, OptionalNestedMessage); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestNestedMessageHasBits ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestNestedMessageHasBits ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestNestedMessageHasBits ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestNestedMessageHasBits ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestNestedMessageHasBits ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestNestedMessageHasBits ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestNestedMessageHasBits ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestNestedMessageHasBits ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestNestedMessageHasBits ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestNestedMessageHasBits ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestNestedMessageHasBits MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestNestedMessageHasBits prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestNestedMessageHasBits cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestNestedMessageHasBits result; - - private TestNestedMessageHasBits PrepareBuilder() { - if (resultIsReadOnly) { - TestNestedMessageHasBits original = result; - result = new TestNestedMessageHasBits(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestNestedMessageHasBits MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Descriptor; } - } - - public override TestNestedMessageHasBits DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.DefaultInstance; } - } - - public override TestNestedMessageHasBits BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestNestedMessageHasBits) { - return MergeFrom((TestNestedMessageHasBits) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestNestedMessageHasBits other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasOptionalNestedMessage) { - MergeOptionalNestedMessage(other.OptionalNestedMessage); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testNestedMessageHasBitsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testNestedMessageHasBitsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.CreateBuilder(); - if (result.hasOptionalNestedMessage) { - subBuilder.MergeFrom(OptionalNestedMessage); - } - input.ReadMessage(subBuilder, extensionRegistry); - OptionalNestedMessage = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasOptionalNestedMessage { - get { return result.hasOptionalNestedMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage OptionalNestedMessage { - get { return result.OptionalNestedMessage; } - set { SetOptionalNestedMessage(value); } - } - public Builder SetOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalNestedMessage = true; - result.optionalNestedMessage_ = value; - return this; - } - public Builder SetOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptionalNestedMessage = true; - result.optionalNestedMessage_ = builderForValue.Build(); - return this; - } - public Builder MergeOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptionalNestedMessage && - result.optionalNestedMessage_ != global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.DefaultInstance) { - result.optionalNestedMessage_ = global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.CreateBuilder(result.optionalNestedMessage_).MergeFrom(value).BuildPartial(); - } else { - result.optionalNestedMessage_ = value; - } - result.hasOptionalNestedMessage = true; - return this; - } - public Builder ClearOptionalNestedMessage() { - PrepareBuilder(); - result.hasOptionalNestedMessage = false; - result.optionalNestedMessage_ = null; - return this; - } - } - static TestNestedMessageHasBits() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestCamelCaseFieldNames : pb::GeneratedMessage { - private TestCamelCaseFieldNames() { } - private static readonly TestCamelCaseFieldNames defaultInstance = new TestCamelCaseFieldNames().MakeReadOnly(); - private static readonly string[] _testCamelCaseFieldNamesFieldNames = new string[] { "CordField", "EnumField", "MessageField", "PrimitiveField", "RepeatedCordField", "RepeatedEnumField", "RepeatedMessageField", "RepeatedPrimitiveField", "RepeatedStringField", "RepeatedStringPieceField", "StringField", "StringPieceField" }; - private static readonly uint[] _testCamelCaseFieldNamesFieldTags = new uint[] { 50, 24, 34, 8, 98, 72, 82, 56, 66, 90, 18, 42 }; - public static TestCamelCaseFieldNames DefaultInstance { - get { return defaultInstance; } - } - - public override TestCamelCaseFieldNames DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestCamelCaseFieldNames ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestCamelCaseFieldNames__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestCamelCaseFieldNames__FieldAccessorTable; } - } - - public const int PrimitiveFieldFieldNumber = 1; - private bool hasPrimitiveField; - private int primitiveField_; - public bool HasPrimitiveField { - get { return hasPrimitiveField; } - } - public int PrimitiveField { - get { return primitiveField_; } - } - - public const int StringFieldFieldNumber = 2; - private bool hasStringField; - private string stringField_ = ""; - public bool HasStringField { - get { return hasStringField; } - } - public string StringField { - get { return stringField_; } - } - - public const int EnumFieldFieldNumber = 3; - private bool hasEnumField; - private global::Google.ProtocolBuffers.TestProtos.ForeignEnum enumField_ = global::Google.ProtocolBuffers.TestProtos.ForeignEnum.FOREIGN_FOO; - public bool HasEnumField { - get { return hasEnumField; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum EnumField { - get { return enumField_; } - } - - public const int MessageFieldFieldNumber = 4; - private bool hasMessageField; - private global::Google.ProtocolBuffers.TestProtos.ForeignMessage messageField_; - public bool HasMessageField { - get { return hasMessageField; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage MessageField { - get { return messageField_ ?? global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance; } - } - - public const int StringPieceFieldFieldNumber = 5; - private bool hasStringPieceField; - private string stringPieceField_ = ""; - public bool HasStringPieceField { - get { return hasStringPieceField; } - } - public string StringPieceField { - get { return stringPieceField_; } - } - - public const int CordFieldFieldNumber = 6; - private bool hasCordField; - private string cordField_ = ""; - public bool HasCordField { - get { return hasCordField; } - } - public string CordField { - get { return cordField_; } - } - - public const int RepeatedPrimitiveFieldFieldNumber = 7; - private pbc::PopsicleList repeatedPrimitiveField_ = new pbc::PopsicleList(); - public scg::IList RepeatedPrimitiveFieldList { - get { return pbc::Lists.AsReadOnly(repeatedPrimitiveField_); } - } - public int RepeatedPrimitiveFieldCount { - get { return repeatedPrimitiveField_.Count; } - } - public int GetRepeatedPrimitiveField(int index) { - return repeatedPrimitiveField_[index]; - } - - public const int RepeatedStringFieldFieldNumber = 8; - private pbc::PopsicleList repeatedStringField_ = new pbc::PopsicleList(); - public scg::IList RepeatedStringFieldList { - get { return pbc::Lists.AsReadOnly(repeatedStringField_); } - } - public int RepeatedStringFieldCount { - get { return repeatedStringField_.Count; } - } - public string GetRepeatedStringField(int index) { - return repeatedStringField_[index]; - } - - public const int RepeatedEnumFieldFieldNumber = 9; - private pbc::PopsicleList repeatedEnumField_ = new pbc::PopsicleList(); - public scg::IList RepeatedEnumFieldList { - get { return pbc::Lists.AsReadOnly(repeatedEnumField_); } - } - public int RepeatedEnumFieldCount { - get { return repeatedEnumField_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum GetRepeatedEnumField(int index) { - return repeatedEnumField_[index]; - } - - public const int RepeatedMessageFieldFieldNumber = 10; - private pbc::PopsicleList repeatedMessageField_ = new pbc::PopsicleList(); - public scg::IList RepeatedMessageFieldList { - get { return repeatedMessageField_; } - } - public int RepeatedMessageFieldCount { - get { return repeatedMessageField_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage GetRepeatedMessageField(int index) { - return repeatedMessageField_[index]; - } - - public const int RepeatedStringPieceFieldFieldNumber = 11; - private pbc::PopsicleList repeatedStringPieceField_ = new pbc::PopsicleList(); - public scg::IList RepeatedStringPieceFieldList { - get { return pbc::Lists.AsReadOnly(repeatedStringPieceField_); } - } - public int RepeatedStringPieceFieldCount { - get { return repeatedStringPieceField_.Count; } - } - public string GetRepeatedStringPieceField(int index) { - return repeatedStringPieceField_[index]; - } - - public const int RepeatedCordFieldFieldNumber = 12; - private pbc::PopsicleList repeatedCordField_ = new pbc::PopsicleList(); - public scg::IList RepeatedCordFieldList { - get { return pbc::Lists.AsReadOnly(repeatedCordField_); } - } - public int RepeatedCordFieldCount { - get { return repeatedCordField_.Count; } - } - public string GetRepeatedCordField(int index) { - return repeatedCordField_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testCamelCaseFieldNamesFieldNames; - if (hasPrimitiveField) { - output.WriteInt32(1, field_names[3], PrimitiveField); - } - if (hasStringField) { - output.WriteString(2, field_names[10], StringField); - } - if (hasEnumField) { - output.WriteEnum(3, field_names[1], (int) EnumField, EnumField); - } - if (hasMessageField) { - output.WriteMessage(4, field_names[2], MessageField); - } - if (hasStringPieceField) { - output.WriteString(5, field_names[11], StringPieceField); - } - if (hasCordField) { - output.WriteString(6, field_names[0], CordField); - } - if (repeatedPrimitiveField_.Count > 0) { - output.WriteInt32Array(7, field_names[7], repeatedPrimitiveField_); - } - if (repeatedStringField_.Count > 0) { - output.WriteStringArray(8, field_names[8], repeatedStringField_); - } - if (repeatedEnumField_.Count > 0) { - output.WriteEnumArray(9, field_names[5], repeatedEnumField_); - } - if (repeatedMessageField_.Count > 0) { - output.WriteMessageArray(10, field_names[6], repeatedMessageField_); - } - if (repeatedStringPieceField_.Count > 0) { - output.WriteStringArray(11, field_names[9], repeatedStringPieceField_); - } - if (repeatedCordField_.Count > 0) { - output.WriteStringArray(12, field_names[4], repeatedCordField_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasPrimitiveField) { - size += pb::CodedOutputStream.ComputeInt32Size(1, PrimitiveField); - } - if (hasStringField) { - size += pb::CodedOutputStream.ComputeStringSize(2, StringField); - } - if (hasEnumField) { - size += pb::CodedOutputStream.ComputeEnumSize(3, (int) EnumField); - } - if (hasMessageField) { - size += pb::CodedOutputStream.ComputeMessageSize(4, MessageField); - } - if (hasStringPieceField) { - size += pb::CodedOutputStream.ComputeStringSize(5, StringPieceField); - } - if (hasCordField) { - size += pb::CodedOutputStream.ComputeStringSize(6, CordField); - } - { - int dataSize = 0; - foreach (int element in RepeatedPrimitiveFieldList) { - dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); - } - size += dataSize; - size += 1 * repeatedPrimitiveField_.Count; - } - { - int dataSize = 0; - foreach (string element in RepeatedStringFieldList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 1 * repeatedStringField_.Count; - } - { - int dataSize = 0; - if (repeatedEnumField_.Count > 0) { - foreach (global::Google.ProtocolBuffers.TestProtos.ForeignEnum element in repeatedEnumField_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 1 * repeatedEnumField_.Count; - } - } - foreach (global::Google.ProtocolBuffers.TestProtos.ForeignMessage element in RepeatedMessageFieldList) { - size += pb::CodedOutputStream.ComputeMessageSize(10, element); - } - { - int dataSize = 0; - foreach (string element in RepeatedStringPieceFieldList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 1 * repeatedStringPieceField_.Count; - } - { - int dataSize = 0; - foreach (string element in RepeatedCordFieldList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 1 * repeatedCordField_.Count; - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestCamelCaseFieldNames ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestCamelCaseFieldNames ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestCamelCaseFieldNames ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestCamelCaseFieldNames ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestCamelCaseFieldNames ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestCamelCaseFieldNames ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestCamelCaseFieldNames ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestCamelCaseFieldNames ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestCamelCaseFieldNames ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestCamelCaseFieldNames ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestCamelCaseFieldNames MakeReadOnly() { - repeatedPrimitiveField_.MakeReadOnly(); - repeatedStringField_.MakeReadOnly(); - repeatedEnumField_.MakeReadOnly(); - repeatedMessageField_.MakeReadOnly(); - repeatedStringPieceField_.MakeReadOnly(); - repeatedCordField_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestCamelCaseFieldNames prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestCamelCaseFieldNames cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestCamelCaseFieldNames result; - - private TestCamelCaseFieldNames PrepareBuilder() { - if (resultIsReadOnly) { - TestCamelCaseFieldNames original = result; - result = new TestCamelCaseFieldNames(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestCamelCaseFieldNames MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestCamelCaseFieldNames.Descriptor; } - } - - public override TestCamelCaseFieldNames DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestCamelCaseFieldNames.DefaultInstance; } - } - - public override TestCamelCaseFieldNames BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestCamelCaseFieldNames) { - return MergeFrom((TestCamelCaseFieldNames) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestCamelCaseFieldNames other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestCamelCaseFieldNames.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasPrimitiveField) { - PrimitiveField = other.PrimitiveField; - } - if (other.HasStringField) { - StringField = other.StringField; - } - if (other.HasEnumField) { - EnumField = other.EnumField; - } - if (other.HasMessageField) { - MergeMessageField(other.MessageField); - } - if (other.HasStringPieceField) { - StringPieceField = other.StringPieceField; - } - if (other.HasCordField) { - CordField = other.CordField; - } - if (other.repeatedPrimitiveField_.Count != 0) { - result.repeatedPrimitiveField_.Add(other.repeatedPrimitiveField_); - } - if (other.repeatedStringField_.Count != 0) { - result.repeatedStringField_.Add(other.repeatedStringField_); - } - if (other.repeatedEnumField_.Count != 0) { - result.repeatedEnumField_.Add(other.repeatedEnumField_); - } - if (other.repeatedMessageField_.Count != 0) { - result.repeatedMessageField_.Add(other.repeatedMessageField_); - } - if (other.repeatedStringPieceField_.Count != 0) { - result.repeatedStringPieceField_.Add(other.repeatedStringPieceField_); - } - if (other.repeatedCordField_.Count != 0) { - result.repeatedCordField_.Add(other.repeatedCordField_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testCamelCaseFieldNamesFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testCamelCaseFieldNamesFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasPrimitiveField = input.ReadInt32(ref result.primitiveField_); - break; - } - case 18: { - result.hasStringField = input.ReadString(ref result.stringField_); - break; - } - case 24: { - object unknown; - if(input.ReadEnum(ref result.enumField_, out unknown)) { - result.hasEnumField = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(3, (ulong)(int)unknown); - } - break; - } - case 34: { - global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.ForeignMessage.CreateBuilder(); - if (result.hasMessageField) { - subBuilder.MergeFrom(MessageField); - } - input.ReadMessage(subBuilder, extensionRegistry); - MessageField = subBuilder.BuildPartial(); - break; - } - case 42: { - result.hasStringPieceField = input.ReadString(ref result.stringPieceField_); - break; - } - case 50: { - result.hasCordField = input.ReadString(ref result.cordField_); - break; - } - case 58: - case 56: { - input.ReadInt32Array(tag, field_name, result.repeatedPrimitiveField_); - break; - } - case 66: { - input.ReadStringArray(tag, field_name, result.repeatedStringField_); - break; - } - case 74: - case 72: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.repeatedEnumField_, out unknownItems); - if (unknownItems != null) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - foreach (object rawValue in unknownItems) - if (rawValue is int) - unknownFields.MergeVarintField(9, (ulong)(int)rawValue); - } - break; - } - case 82: { - input.ReadMessageArray(tag, field_name, result.repeatedMessageField_, global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance, extensionRegistry); - break; - } - case 90: { - input.ReadStringArray(tag, field_name, result.repeatedStringPieceField_); - break; - } - case 98: { - input.ReadStringArray(tag, field_name, result.repeatedCordField_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasPrimitiveField { - get { return result.hasPrimitiveField; } - } - public int PrimitiveField { - get { return result.PrimitiveField; } - set { SetPrimitiveField(value); } - } - public Builder SetPrimitiveField(int value) { - PrepareBuilder(); - result.hasPrimitiveField = true; - result.primitiveField_ = value; - return this; - } - public Builder ClearPrimitiveField() { - PrepareBuilder(); - result.hasPrimitiveField = false; - result.primitiveField_ = 0; - return this; - } - - public bool HasStringField { - get { return result.hasStringField; } - } - public string StringField { - get { return result.StringField; } - set { SetStringField(value); } - } - public Builder SetStringField(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasStringField = true; - result.stringField_ = value; - return this; - } - public Builder ClearStringField() { - PrepareBuilder(); - result.hasStringField = false; - result.stringField_ = ""; - return this; - } - - public bool HasEnumField { - get { return result.hasEnumField; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum EnumField { - get { return result.EnumField; } - set { SetEnumField(value); } - } - public Builder SetEnumField(global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) { - PrepareBuilder(); - result.hasEnumField = true; - result.enumField_ = value; - return this; - } - public Builder ClearEnumField() { - PrepareBuilder(); - result.hasEnumField = false; - result.enumField_ = global::Google.ProtocolBuffers.TestProtos.ForeignEnum.FOREIGN_FOO; - return this; - } - - public bool HasMessageField { - get { return result.hasMessageField; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage MessageField { - get { return result.MessageField; } - set { SetMessageField(value); } - } - public Builder SetMessageField(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasMessageField = true; - result.messageField_ = value; - return this; - } - public Builder SetMessageField(global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasMessageField = true; - result.messageField_ = builderForValue.Build(); - return this; - } - public Builder MergeMessageField(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasMessageField && - result.messageField_ != global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance) { - result.messageField_ = global::Google.ProtocolBuffers.TestProtos.ForeignMessage.CreateBuilder(result.messageField_).MergeFrom(value).BuildPartial(); - } else { - result.messageField_ = value; - } - result.hasMessageField = true; - return this; - } - public Builder ClearMessageField() { - PrepareBuilder(); - result.hasMessageField = false; - result.messageField_ = null; - return this; - } - - public bool HasStringPieceField { - get { return result.hasStringPieceField; } - } - public string StringPieceField { - get { return result.StringPieceField; } - set { SetStringPieceField(value); } - } - public Builder SetStringPieceField(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasStringPieceField = true; - result.stringPieceField_ = value; - return this; - } - public Builder ClearStringPieceField() { - PrepareBuilder(); - result.hasStringPieceField = false; - result.stringPieceField_ = ""; - return this; - } - - public bool HasCordField { - get { return result.hasCordField; } - } - public string CordField { - get { return result.CordField; } - set { SetCordField(value); } - } - public Builder SetCordField(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasCordField = true; - result.cordField_ = value; - return this; - } - public Builder ClearCordField() { - PrepareBuilder(); - result.hasCordField = false; - result.cordField_ = ""; - return this; - } - - public pbc::IPopsicleList RepeatedPrimitiveFieldList { - get { return PrepareBuilder().repeatedPrimitiveField_; } - } - public int RepeatedPrimitiveFieldCount { - get { return result.RepeatedPrimitiveFieldCount; } - } - public int GetRepeatedPrimitiveField(int index) { - return result.GetRepeatedPrimitiveField(index); - } - public Builder SetRepeatedPrimitiveField(int index, int value) { - PrepareBuilder(); - result.repeatedPrimitiveField_[index] = value; - return this; - } - public Builder AddRepeatedPrimitiveField(int value) { - PrepareBuilder(); - result.repeatedPrimitiveField_.Add(value); - return this; - } - public Builder AddRangeRepeatedPrimitiveField(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedPrimitiveField_.Add(values); - return this; - } - public Builder ClearRepeatedPrimitiveField() { - PrepareBuilder(); - result.repeatedPrimitiveField_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedStringFieldList { - get { return PrepareBuilder().repeatedStringField_; } - } - public int RepeatedStringFieldCount { - get { return result.RepeatedStringFieldCount; } - } - public string GetRepeatedStringField(int index) { - return result.GetRepeatedStringField(index); - } - public Builder SetRepeatedStringField(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedStringField_[index] = value; - return this; - } - public Builder AddRepeatedStringField(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedStringField_.Add(value); - return this; - } - public Builder AddRangeRepeatedStringField(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedStringField_.Add(values); - return this; - } - public Builder ClearRepeatedStringField() { - PrepareBuilder(); - result.repeatedStringField_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedEnumFieldList { - get { return PrepareBuilder().repeatedEnumField_; } - } - public int RepeatedEnumFieldCount { - get { return result.RepeatedEnumFieldCount; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum GetRepeatedEnumField(int index) { - return result.GetRepeatedEnumField(index); - } - public Builder SetRepeatedEnumField(int index, global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) { - PrepareBuilder(); - result.repeatedEnumField_[index] = value; - return this; - } - public Builder AddRepeatedEnumField(global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) { - PrepareBuilder(); - result.repeatedEnumField_.Add(value); - return this; - } - public Builder AddRangeRepeatedEnumField(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedEnumField_.Add(values); - return this; - } - public Builder ClearRepeatedEnumField() { - PrepareBuilder(); - result.repeatedEnumField_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedMessageFieldList { - get { return PrepareBuilder().repeatedMessageField_; } - } - public int RepeatedMessageFieldCount { - get { return result.RepeatedMessageFieldCount; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage GetRepeatedMessageField(int index) { - return result.GetRepeatedMessageField(index); - } - public Builder SetRepeatedMessageField(int index, global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedMessageField_[index] = value; - return this; - } - public Builder SetRepeatedMessageField(int index, global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedMessageField_[index] = builderForValue.Build(); - return this; - } - public Builder AddRepeatedMessageField(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedMessageField_.Add(value); - return this; - } - public Builder AddRepeatedMessageField(global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedMessageField_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeRepeatedMessageField(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedMessageField_.Add(values); - return this; - } - public Builder ClearRepeatedMessageField() { - PrepareBuilder(); - result.repeatedMessageField_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedStringPieceFieldList { - get { return PrepareBuilder().repeatedStringPieceField_; } - } - public int RepeatedStringPieceFieldCount { - get { return result.RepeatedStringPieceFieldCount; } - } - public string GetRepeatedStringPieceField(int index) { - return result.GetRepeatedStringPieceField(index); - } - public Builder SetRepeatedStringPieceField(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedStringPieceField_[index] = value; - return this; - } - public Builder AddRepeatedStringPieceField(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedStringPieceField_.Add(value); - return this; - } - public Builder AddRangeRepeatedStringPieceField(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedStringPieceField_.Add(values); - return this; - } - public Builder ClearRepeatedStringPieceField() { - PrepareBuilder(); - result.repeatedStringPieceField_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedCordFieldList { - get { return PrepareBuilder().repeatedCordField_; } - } - public int RepeatedCordFieldCount { - get { return result.RepeatedCordFieldCount; } - } - public string GetRepeatedCordField(int index) { - return result.GetRepeatedCordField(index); - } - public Builder SetRepeatedCordField(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedCordField_[index] = value; - return this; - } - public Builder AddRepeatedCordField(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedCordField_.Add(value); - return this; - } - public Builder AddRangeRepeatedCordField(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedCordField_.Add(values); - return this; - } - public Builder ClearRepeatedCordField() { - PrepareBuilder(); - result.repeatedCordField_.Clear(); - return this; - } - } - static TestCamelCaseFieldNames() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestFieldOrderings : pb::ExtendableMessage { - private TestFieldOrderings() { } - private static readonly TestFieldOrderings defaultInstance = new TestFieldOrderings().MakeReadOnly(); - private static readonly string[] _testFieldOrderingsFieldNames = new string[] { "my_float", "my_int", "my_string" }; - private static readonly uint[] _testFieldOrderingsFieldTags = new uint[] { 813, 8, 90 }; - public static TestFieldOrderings DefaultInstance { - get { return defaultInstance; } - } - - public override TestFieldOrderings DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestFieldOrderings ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestFieldOrderings__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestFieldOrderings__FieldAccessorTable; } - } - - public const int MyStringFieldNumber = 11; - private bool hasMyString; - private string myString_ = ""; - public bool HasMyString { - get { return hasMyString; } - } - public string MyString { - get { return myString_; } - } - - public const int MyIntFieldNumber = 1; - private bool hasMyInt; - private long myInt_; - public bool HasMyInt { - get { return hasMyInt; } - } - public long MyInt { - get { return myInt_; } - } - - public const int MyFloatFieldNumber = 101; - private bool hasMyFloat; - private float myFloat_; - public bool HasMyFloat { - get { return hasMyFloat; } - } - public float MyFloat { - get { return myFloat_; } - } - - public override bool IsInitialized { - get { - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testFieldOrderingsFieldNames; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - if (hasMyInt) { - output.WriteInt64(1, field_names[1], MyInt); - } - extensionWriter.WriteUntil(11, output); - if (hasMyString) { - output.WriteString(11, field_names[2], MyString); - } - extensionWriter.WriteUntil(101, output); - if (hasMyFloat) { - output.WriteFloat(101, field_names[0], MyFloat); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasMyString) { - size += pb::CodedOutputStream.ComputeStringSize(11, MyString); - } - if (hasMyInt) { - size += pb::CodedOutputStream.ComputeInt64Size(1, MyInt); - } - if (hasMyFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(101, MyFloat); - } - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestFieldOrderings ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestFieldOrderings ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestFieldOrderings ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestFieldOrderings ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestFieldOrderings ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestFieldOrderings ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestFieldOrderings ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestFieldOrderings ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestFieldOrderings ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestFieldOrderings ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestFieldOrderings MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestFieldOrderings prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestFieldOrderings cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestFieldOrderings result; - - private TestFieldOrderings PrepareBuilder() { - if (resultIsReadOnly) { - TestFieldOrderings original = result; - result = new TestFieldOrderings(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestFieldOrderings MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestFieldOrderings.Descriptor; } - } - - public override TestFieldOrderings DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestFieldOrderings.DefaultInstance; } - } - - public override TestFieldOrderings BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestFieldOrderings) { - return MergeFrom((TestFieldOrderings) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestFieldOrderings other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestFieldOrderings.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasMyString) { - MyString = other.MyString; - } - if (other.HasMyInt) { - MyInt = other.MyInt; - } - if (other.HasMyFloat) { - MyFloat = other.MyFloat; - } - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testFieldOrderingsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testFieldOrderingsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasMyInt = input.ReadInt64(ref result.myInt_); - break; - } - case 90: { - result.hasMyString = input.ReadString(ref result.myString_); - break; - } - case 813: { - result.hasMyFloat = input.ReadFloat(ref result.myFloat_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasMyString { - get { return result.hasMyString; } - } - public string MyString { - get { return result.MyString; } - set { SetMyString(value); } - } - public Builder SetMyString(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasMyString = true; - result.myString_ = value; - return this; - } - public Builder ClearMyString() { - PrepareBuilder(); - result.hasMyString = false; - result.myString_ = ""; - return this; - } - - public bool HasMyInt { - get { return result.hasMyInt; } - } - public long MyInt { - get { return result.MyInt; } - set { SetMyInt(value); } - } - public Builder SetMyInt(long value) { - PrepareBuilder(); - result.hasMyInt = true; - result.myInt_ = value; - return this; - } - public Builder ClearMyInt() { - PrepareBuilder(); - result.hasMyInt = false; - result.myInt_ = 0L; - return this; - } - - public bool HasMyFloat { - get { return result.hasMyFloat; } - } - public float MyFloat { - get { return result.MyFloat; } - set { SetMyFloat(value); } - } - public Builder SetMyFloat(float value) { - PrepareBuilder(); - result.hasMyFloat = true; - result.myFloat_ = value; - return this; - } - public Builder ClearMyFloat() { - PrepareBuilder(); - result.hasMyFloat = false; - result.myFloat_ = 0F; - return this; - } - } - static TestFieldOrderings() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestExtremeDefaultValues : pb::GeneratedMessage { - private TestExtremeDefaultValues() { } - private static readonly TestExtremeDefaultValues defaultInstance = new TestExtremeDefaultValues().MakeReadOnly(); - private static readonly string[] _testExtremeDefaultValuesFieldNames = new string[] { "cpp_trigraph", "escaped_bytes", "inf_double", "inf_float", "large_float", "large_uint32", "large_uint64", "nan_double", "nan_float", "neg_inf_double", "neg_inf_float", "negative_float", "negative_one_float", "one_float", "small_float", "small_int32", "small_int64", "small_negative_float", "utf8_string", "zero_float" }; - private static readonly uint[] _testExtremeDefaultValuesFieldTags = new uint[] { 162, 10, 113, 141, 101, 16, 24, 129, 157, 121, 149, 93, 85, 69, 77, 32, 40, 109, 50, 61 }; - public static TestExtremeDefaultValues DefaultInstance { - get { return defaultInstance; } - } - - public override TestExtremeDefaultValues DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestExtremeDefaultValues ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestExtremeDefaultValues__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestExtremeDefaultValues__FieldAccessorTable; } - } - - public const int EscapedBytesFieldNumber = 1; - private bool hasEscapedBytes; - private pb::ByteString escapedBytes_ = (pb::ByteString) global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues.Descriptor.Fields[0].DefaultValue; - public bool HasEscapedBytes { - get { return hasEscapedBytes; } - } - public pb::ByteString EscapedBytes { - get { return escapedBytes_; } - } - - public const int LargeUint32FieldNumber = 2; - private bool hasLargeUint32; - private uint largeUint32_ = 4294967295; - public bool HasLargeUint32 { - get { return hasLargeUint32; } - } - [global::System.CLSCompliant(false)] - public uint LargeUint32 { - get { return largeUint32_; } - } - - public const int LargeUint64FieldNumber = 3; - private bool hasLargeUint64; - private ulong largeUint64_ = 18446744073709551615UL; - public bool HasLargeUint64 { - get { return hasLargeUint64; } - } - [global::System.CLSCompliant(false)] - public ulong LargeUint64 { - get { return largeUint64_; } - } - - public const int SmallInt32FieldNumber = 4; - private bool hasSmallInt32; - private int smallInt32_ = -2147483647; - public bool HasSmallInt32 { - get { return hasSmallInt32; } - } - public int SmallInt32 { - get { return smallInt32_; } - } - - public const int SmallInt64FieldNumber = 5; - private bool hasSmallInt64; - private long smallInt64_ = -9223372036854775807L; - public bool HasSmallInt64 { - get { return hasSmallInt64; } - } - public long SmallInt64 { - get { return smallInt64_; } - } - - public const int Utf8StringFieldNumber = 6; - private bool hasUtf8String; - private string utf8String_ = (string) global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues.Descriptor.Fields[5].DefaultValue; - public bool HasUtf8String { - get { return hasUtf8String; } - } - public string Utf8String { - get { return utf8String_; } - } - - public const int ZeroFloatFieldNumber = 7; - private bool hasZeroFloat; - private float zeroFloat_; - public bool HasZeroFloat { - get { return hasZeroFloat; } - } - public float ZeroFloat { - get { return zeroFloat_; } - } - - public const int OneFloatFieldNumber = 8; - private bool hasOneFloat; - private float oneFloat_ = 1F; - public bool HasOneFloat { - get { return hasOneFloat; } - } - public float OneFloat { - get { return oneFloat_; } - } - - public const int SmallFloatFieldNumber = 9; - private bool hasSmallFloat; - private float smallFloat_ = 1.5F; - public bool HasSmallFloat { - get { return hasSmallFloat; } - } - public float SmallFloat { - get { return smallFloat_; } - } - - public const int NegativeOneFloatFieldNumber = 10; - private bool hasNegativeOneFloat; - private float negativeOneFloat_ = -1F; - public bool HasNegativeOneFloat { - get { return hasNegativeOneFloat; } - } - public float NegativeOneFloat { - get { return negativeOneFloat_; } - } - - public const int NegativeFloatFieldNumber = 11; - private bool hasNegativeFloat; - private float negativeFloat_ = -1.5F; - public bool HasNegativeFloat { - get { return hasNegativeFloat; } - } - public float NegativeFloat { - get { return negativeFloat_; } - } - - public const int LargeFloatFieldNumber = 12; - private bool hasLargeFloat; - private float largeFloat_ = 2E+08F; - public bool HasLargeFloat { - get { return hasLargeFloat; } - } - public float LargeFloat { - get { return largeFloat_; } - } - - public const int SmallNegativeFloatFieldNumber = 13; - private bool hasSmallNegativeFloat; - private float smallNegativeFloat_ = -8E-28F; - public bool HasSmallNegativeFloat { - get { return hasSmallNegativeFloat; } - } - public float SmallNegativeFloat { - get { return smallNegativeFloat_; } - } - - public const int InfDoubleFieldNumber = 14; - private bool hasInfDouble; - private double infDouble_ = double.PositiveInfinity; - public bool HasInfDouble { - get { return hasInfDouble; } - } - public double InfDouble { - get { return infDouble_; } - } - - public const int NegInfDoubleFieldNumber = 15; - private bool hasNegInfDouble; - private double negInfDouble_ = double.NegativeInfinity; - public bool HasNegInfDouble { - get { return hasNegInfDouble; } - } - public double NegInfDouble { - get { return negInfDouble_; } - } - - public const int NanDoubleFieldNumber = 16; - private bool hasNanDouble; - private double nanDouble_ = double.NaN; - public bool HasNanDouble { - get { return hasNanDouble; } - } - public double NanDouble { - get { return nanDouble_; } - } - - public const int InfFloatFieldNumber = 17; - private bool hasInfFloat; - private float infFloat_ = float.PositiveInfinity; - public bool HasInfFloat { - get { return hasInfFloat; } - } - public float InfFloat { - get { return infFloat_; } - } - - public const int NegInfFloatFieldNumber = 18; - private bool hasNegInfFloat; - private float negInfFloat_ = float.NegativeInfinity; - public bool HasNegInfFloat { - get { return hasNegInfFloat; } - } - public float NegInfFloat { - get { return negInfFloat_; } - } - - public const int NanFloatFieldNumber = 19; - private bool hasNanFloat; - private float nanFloat_ = float.NaN; - public bool HasNanFloat { - get { return hasNanFloat; } - } - public float NanFloat { - get { return nanFloat_; } - } - - public const int CppTrigraphFieldNumber = 20; - private bool hasCppTrigraph; - private string cppTrigraph_ = "? ? ?? ?? ??? ??/ ??-"; - public bool HasCppTrigraph { - get { return hasCppTrigraph; } - } - public string CppTrigraph { - get { return cppTrigraph_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testExtremeDefaultValuesFieldNames; - if (hasEscapedBytes) { - output.WriteBytes(1, field_names[1], EscapedBytes); - } - if (hasLargeUint32) { - output.WriteUInt32(2, field_names[5], LargeUint32); - } - if (hasLargeUint64) { - output.WriteUInt64(3, field_names[6], LargeUint64); - } - if (hasSmallInt32) { - output.WriteInt32(4, field_names[15], SmallInt32); - } - if (hasSmallInt64) { - output.WriteInt64(5, field_names[16], SmallInt64); - } - if (hasUtf8String) { - output.WriteString(6, field_names[18], Utf8String); - } - if (hasZeroFloat) { - output.WriteFloat(7, field_names[19], ZeroFloat); - } - if (hasOneFloat) { - output.WriteFloat(8, field_names[13], OneFloat); - } - if (hasSmallFloat) { - output.WriteFloat(9, field_names[14], SmallFloat); - } - if (hasNegativeOneFloat) { - output.WriteFloat(10, field_names[12], NegativeOneFloat); - } - if (hasNegativeFloat) { - output.WriteFloat(11, field_names[11], NegativeFloat); - } - if (hasLargeFloat) { - output.WriteFloat(12, field_names[4], LargeFloat); - } - if (hasSmallNegativeFloat) { - output.WriteFloat(13, field_names[17], SmallNegativeFloat); - } - if (hasInfDouble) { - output.WriteDouble(14, field_names[2], InfDouble); - } - if (hasNegInfDouble) { - output.WriteDouble(15, field_names[9], NegInfDouble); - } - if (hasNanDouble) { - output.WriteDouble(16, field_names[7], NanDouble); - } - if (hasInfFloat) { - output.WriteFloat(17, field_names[3], InfFloat); - } - if (hasNegInfFloat) { - output.WriteFloat(18, field_names[10], NegInfFloat); - } - if (hasNanFloat) { - output.WriteFloat(19, field_names[8], NanFloat); - } - if (hasCppTrigraph) { - output.WriteString(20, field_names[0], CppTrigraph); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasEscapedBytes) { - size += pb::CodedOutputStream.ComputeBytesSize(1, EscapedBytes); - } - if (hasLargeUint32) { - size += pb::CodedOutputStream.ComputeUInt32Size(2, LargeUint32); - } - if (hasLargeUint64) { - size += pb::CodedOutputStream.ComputeUInt64Size(3, LargeUint64); - } - if (hasSmallInt32) { - size += pb::CodedOutputStream.ComputeInt32Size(4, SmallInt32); - } - if (hasSmallInt64) { - size += pb::CodedOutputStream.ComputeInt64Size(5, SmallInt64); - } - if (hasUtf8String) { - size += pb::CodedOutputStream.ComputeStringSize(6, Utf8String); - } - if (hasZeroFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(7, ZeroFloat); - } - if (hasOneFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(8, OneFloat); - } - if (hasSmallFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(9, SmallFloat); - } - if (hasNegativeOneFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(10, NegativeOneFloat); - } - if (hasNegativeFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(11, NegativeFloat); - } - if (hasLargeFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(12, LargeFloat); - } - if (hasSmallNegativeFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(13, SmallNegativeFloat); - } - if (hasInfDouble) { - size += pb::CodedOutputStream.ComputeDoubleSize(14, InfDouble); - } - if (hasNegInfDouble) { - size += pb::CodedOutputStream.ComputeDoubleSize(15, NegInfDouble); - } - if (hasNanDouble) { - size += pb::CodedOutputStream.ComputeDoubleSize(16, NanDouble); - } - if (hasInfFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(17, InfFloat); - } - if (hasNegInfFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(18, NegInfFloat); - } - if (hasNanFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(19, NanFloat); - } - if (hasCppTrigraph) { - size += pb::CodedOutputStream.ComputeStringSize(20, CppTrigraph); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestExtremeDefaultValues ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestExtremeDefaultValues ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestExtremeDefaultValues ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestExtremeDefaultValues ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestExtremeDefaultValues ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestExtremeDefaultValues ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestExtremeDefaultValues ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestExtremeDefaultValues ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestExtremeDefaultValues ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestExtremeDefaultValues ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestExtremeDefaultValues MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestExtremeDefaultValues prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestExtremeDefaultValues cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestExtremeDefaultValues result; - - private TestExtremeDefaultValues PrepareBuilder() { - if (resultIsReadOnly) { - TestExtremeDefaultValues original = result; - result = new TestExtremeDefaultValues(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestExtremeDefaultValues MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues.Descriptor; } - } - - public override TestExtremeDefaultValues DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues.DefaultInstance; } - } - - public override TestExtremeDefaultValues BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestExtremeDefaultValues) { - return MergeFrom((TestExtremeDefaultValues) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestExtremeDefaultValues other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasEscapedBytes) { - EscapedBytes = other.EscapedBytes; - } - if (other.HasLargeUint32) { - LargeUint32 = other.LargeUint32; - } - if (other.HasLargeUint64) { - LargeUint64 = other.LargeUint64; - } - if (other.HasSmallInt32) { - SmallInt32 = other.SmallInt32; - } - if (other.HasSmallInt64) { - SmallInt64 = other.SmallInt64; - } - if (other.HasUtf8String) { - Utf8String = other.Utf8String; - } - if (other.HasZeroFloat) { - ZeroFloat = other.ZeroFloat; - } - if (other.HasOneFloat) { - OneFloat = other.OneFloat; - } - if (other.HasSmallFloat) { - SmallFloat = other.SmallFloat; - } - if (other.HasNegativeOneFloat) { - NegativeOneFloat = other.NegativeOneFloat; - } - if (other.HasNegativeFloat) { - NegativeFloat = other.NegativeFloat; - } - if (other.HasLargeFloat) { - LargeFloat = other.LargeFloat; - } - if (other.HasSmallNegativeFloat) { - SmallNegativeFloat = other.SmallNegativeFloat; - } - if (other.HasInfDouble) { - InfDouble = other.InfDouble; - } - if (other.HasNegInfDouble) { - NegInfDouble = other.NegInfDouble; - } - if (other.HasNanDouble) { - NanDouble = other.NanDouble; - } - if (other.HasInfFloat) { - InfFloat = other.InfFloat; - } - if (other.HasNegInfFloat) { - NegInfFloat = other.NegInfFloat; - } - if (other.HasNanFloat) { - NanFloat = other.NanFloat; - } - if (other.HasCppTrigraph) { - CppTrigraph = other.CppTrigraph; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testExtremeDefaultValuesFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testExtremeDefaultValuesFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasEscapedBytes = input.ReadBytes(ref result.escapedBytes_); - break; - } - case 16: { - result.hasLargeUint32 = input.ReadUInt32(ref result.largeUint32_); - break; - } - case 24: { - result.hasLargeUint64 = input.ReadUInt64(ref result.largeUint64_); - break; - } - case 32: { - result.hasSmallInt32 = input.ReadInt32(ref result.smallInt32_); - break; - } - case 40: { - result.hasSmallInt64 = input.ReadInt64(ref result.smallInt64_); - break; - } - case 50: { - result.hasUtf8String = input.ReadString(ref result.utf8String_); - break; - } - case 61: { - result.hasZeroFloat = input.ReadFloat(ref result.zeroFloat_); - break; - } - case 69: { - result.hasOneFloat = input.ReadFloat(ref result.oneFloat_); - break; - } - case 77: { - result.hasSmallFloat = input.ReadFloat(ref result.smallFloat_); - break; - } - case 85: { - result.hasNegativeOneFloat = input.ReadFloat(ref result.negativeOneFloat_); - break; - } - case 93: { - result.hasNegativeFloat = input.ReadFloat(ref result.negativeFloat_); - break; - } - case 101: { - result.hasLargeFloat = input.ReadFloat(ref result.largeFloat_); - break; - } - case 109: { - result.hasSmallNegativeFloat = input.ReadFloat(ref result.smallNegativeFloat_); - break; - } - case 113: { - result.hasInfDouble = input.ReadDouble(ref result.infDouble_); - break; - } - case 121: { - result.hasNegInfDouble = input.ReadDouble(ref result.negInfDouble_); - break; - } - case 129: { - result.hasNanDouble = input.ReadDouble(ref result.nanDouble_); - break; - } - case 141: { - result.hasInfFloat = input.ReadFloat(ref result.infFloat_); - break; - } - case 149: { - result.hasNegInfFloat = input.ReadFloat(ref result.negInfFloat_); - break; - } - case 157: { - result.hasNanFloat = input.ReadFloat(ref result.nanFloat_); - break; - } - case 162: { - result.hasCppTrigraph = input.ReadString(ref result.cppTrigraph_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasEscapedBytes { - get { return result.hasEscapedBytes; } - } - public pb::ByteString EscapedBytes { - get { return result.EscapedBytes; } - set { SetEscapedBytes(value); } - } - public Builder SetEscapedBytes(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasEscapedBytes = true; - result.escapedBytes_ = value; - return this; - } - public Builder ClearEscapedBytes() { - PrepareBuilder(); - result.hasEscapedBytes = false; - result.escapedBytes_ = (pb::ByteString) global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues.Descriptor.Fields[0].DefaultValue; - return this; - } - - public bool HasLargeUint32 { - get { return result.hasLargeUint32; } - } - [global::System.CLSCompliant(false)] - public uint LargeUint32 { - get { return result.LargeUint32; } - set { SetLargeUint32(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetLargeUint32(uint value) { - PrepareBuilder(); - result.hasLargeUint32 = true; - result.largeUint32_ = value; - return this; - } - public Builder ClearLargeUint32() { - PrepareBuilder(); - result.hasLargeUint32 = false; - result.largeUint32_ = 4294967295; - return this; - } - - public bool HasLargeUint64 { - get { return result.hasLargeUint64; } - } - [global::System.CLSCompliant(false)] - public ulong LargeUint64 { - get { return result.LargeUint64; } - set { SetLargeUint64(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetLargeUint64(ulong value) { - PrepareBuilder(); - result.hasLargeUint64 = true; - result.largeUint64_ = value; - return this; - } - public Builder ClearLargeUint64() { - PrepareBuilder(); - result.hasLargeUint64 = false; - result.largeUint64_ = 18446744073709551615UL; - return this; - } - - public bool HasSmallInt32 { - get { return result.hasSmallInt32; } - } - public int SmallInt32 { - get { return result.SmallInt32; } - set { SetSmallInt32(value); } - } - public Builder SetSmallInt32(int value) { - PrepareBuilder(); - result.hasSmallInt32 = true; - result.smallInt32_ = value; - return this; - } - public Builder ClearSmallInt32() { - PrepareBuilder(); - result.hasSmallInt32 = false; - result.smallInt32_ = -2147483647; - return this; - } - - public bool HasSmallInt64 { - get { return result.hasSmallInt64; } - } - public long SmallInt64 { - get { return result.SmallInt64; } - set { SetSmallInt64(value); } - } - public Builder SetSmallInt64(long value) { - PrepareBuilder(); - result.hasSmallInt64 = true; - result.smallInt64_ = value; - return this; - } - public Builder ClearSmallInt64() { - PrepareBuilder(); - result.hasSmallInt64 = false; - result.smallInt64_ = -9223372036854775807L; - return this; - } - - public bool HasUtf8String { - get { return result.hasUtf8String; } - } - public string Utf8String { - get { return result.Utf8String; } - set { SetUtf8String(value); } - } - public Builder SetUtf8String(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasUtf8String = true; - result.utf8String_ = value; - return this; - } - public Builder ClearUtf8String() { - PrepareBuilder(); - result.hasUtf8String = false; - result.utf8String_ = (string) global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues.Descriptor.Fields[5].DefaultValue; - return this; - } - - public bool HasZeroFloat { - get { return result.hasZeroFloat; } - } - public float ZeroFloat { - get { return result.ZeroFloat; } - set { SetZeroFloat(value); } - } - public Builder SetZeroFloat(float value) { - PrepareBuilder(); - result.hasZeroFloat = true; - result.zeroFloat_ = value; - return this; - } - public Builder ClearZeroFloat() { - PrepareBuilder(); - result.hasZeroFloat = false; - result.zeroFloat_ = 0F; - return this; - } - - public bool HasOneFloat { - get { return result.hasOneFloat; } - } - public float OneFloat { - get { return result.OneFloat; } - set { SetOneFloat(value); } - } - public Builder SetOneFloat(float value) { - PrepareBuilder(); - result.hasOneFloat = true; - result.oneFloat_ = value; - return this; - } - public Builder ClearOneFloat() { - PrepareBuilder(); - result.hasOneFloat = false; - result.oneFloat_ = 1F; - return this; - } - - public bool HasSmallFloat { - get { return result.hasSmallFloat; } - } - public float SmallFloat { - get { return result.SmallFloat; } - set { SetSmallFloat(value); } - } - public Builder SetSmallFloat(float value) { - PrepareBuilder(); - result.hasSmallFloat = true; - result.smallFloat_ = value; - return this; - } - public Builder ClearSmallFloat() { - PrepareBuilder(); - result.hasSmallFloat = false; - result.smallFloat_ = 1.5F; - return this; - } - - public bool HasNegativeOneFloat { - get { return result.hasNegativeOneFloat; } - } - public float NegativeOneFloat { - get { return result.NegativeOneFloat; } - set { SetNegativeOneFloat(value); } - } - public Builder SetNegativeOneFloat(float value) { - PrepareBuilder(); - result.hasNegativeOneFloat = true; - result.negativeOneFloat_ = value; - return this; - } - public Builder ClearNegativeOneFloat() { - PrepareBuilder(); - result.hasNegativeOneFloat = false; - result.negativeOneFloat_ = -1F; - return this; - } - - public bool HasNegativeFloat { - get { return result.hasNegativeFloat; } - } - public float NegativeFloat { - get { return result.NegativeFloat; } - set { SetNegativeFloat(value); } - } - public Builder SetNegativeFloat(float value) { - PrepareBuilder(); - result.hasNegativeFloat = true; - result.negativeFloat_ = value; - return this; - } - public Builder ClearNegativeFloat() { - PrepareBuilder(); - result.hasNegativeFloat = false; - result.negativeFloat_ = -1.5F; - return this; - } - - public bool HasLargeFloat { - get { return result.hasLargeFloat; } - } - public float LargeFloat { - get { return result.LargeFloat; } - set { SetLargeFloat(value); } - } - public Builder SetLargeFloat(float value) { - PrepareBuilder(); - result.hasLargeFloat = true; - result.largeFloat_ = value; - return this; - } - public Builder ClearLargeFloat() { - PrepareBuilder(); - result.hasLargeFloat = false; - result.largeFloat_ = 2E+08F; - return this; - } - - public bool HasSmallNegativeFloat { - get { return result.hasSmallNegativeFloat; } - } - public float SmallNegativeFloat { - get { return result.SmallNegativeFloat; } - set { SetSmallNegativeFloat(value); } - } - public Builder SetSmallNegativeFloat(float value) { - PrepareBuilder(); - result.hasSmallNegativeFloat = true; - result.smallNegativeFloat_ = value; - return this; - } - public Builder ClearSmallNegativeFloat() { - PrepareBuilder(); - result.hasSmallNegativeFloat = false; - result.smallNegativeFloat_ = -8E-28F; - return this; - } - - public bool HasInfDouble { - get { return result.hasInfDouble; } - } - public double InfDouble { - get { return result.InfDouble; } - set { SetInfDouble(value); } - } - public Builder SetInfDouble(double value) { - PrepareBuilder(); - result.hasInfDouble = true; - result.infDouble_ = value; - return this; - } - public Builder ClearInfDouble() { - PrepareBuilder(); - result.hasInfDouble = false; - result.infDouble_ = double.PositiveInfinity; - return this; - } - - public bool HasNegInfDouble { - get { return result.hasNegInfDouble; } - } - public double NegInfDouble { - get { return result.NegInfDouble; } - set { SetNegInfDouble(value); } - } - public Builder SetNegInfDouble(double value) { - PrepareBuilder(); - result.hasNegInfDouble = true; - result.negInfDouble_ = value; - return this; - } - public Builder ClearNegInfDouble() { - PrepareBuilder(); - result.hasNegInfDouble = false; - result.negInfDouble_ = double.NegativeInfinity; - return this; - } - - public bool HasNanDouble { - get { return result.hasNanDouble; } - } - public double NanDouble { - get { return result.NanDouble; } - set { SetNanDouble(value); } - } - public Builder SetNanDouble(double value) { - PrepareBuilder(); - result.hasNanDouble = true; - result.nanDouble_ = value; - return this; - } - public Builder ClearNanDouble() { - PrepareBuilder(); - result.hasNanDouble = false; - result.nanDouble_ = double.NaN; - return this; - } - - public bool HasInfFloat { - get { return result.hasInfFloat; } - } - public float InfFloat { - get { return result.InfFloat; } - set { SetInfFloat(value); } - } - public Builder SetInfFloat(float value) { - PrepareBuilder(); - result.hasInfFloat = true; - result.infFloat_ = value; - return this; - } - public Builder ClearInfFloat() { - PrepareBuilder(); - result.hasInfFloat = false; - result.infFloat_ = float.PositiveInfinity; - return this; - } - - public bool HasNegInfFloat { - get { return result.hasNegInfFloat; } - } - public float NegInfFloat { - get { return result.NegInfFloat; } - set { SetNegInfFloat(value); } - } - public Builder SetNegInfFloat(float value) { - PrepareBuilder(); - result.hasNegInfFloat = true; - result.negInfFloat_ = value; - return this; - } - public Builder ClearNegInfFloat() { - PrepareBuilder(); - result.hasNegInfFloat = false; - result.negInfFloat_ = float.NegativeInfinity; - return this; - } - - public bool HasNanFloat { - get { return result.hasNanFloat; } - } - public float NanFloat { - get { return result.NanFloat; } - set { SetNanFloat(value); } - } - public Builder SetNanFloat(float value) { - PrepareBuilder(); - result.hasNanFloat = true; - result.nanFloat_ = value; - return this; - } - public Builder ClearNanFloat() { - PrepareBuilder(); - result.hasNanFloat = false; - result.nanFloat_ = float.NaN; - return this; - } - - public bool HasCppTrigraph { - get { return result.hasCppTrigraph; } - } - public string CppTrigraph { - get { return result.CppTrigraph; } - set { SetCppTrigraph(value); } - } - public Builder SetCppTrigraph(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasCppTrigraph = true; - result.cppTrigraph_ = value; - return this; - } - public Builder ClearCppTrigraph() { - PrepareBuilder(); - result.hasCppTrigraph = false; - result.cppTrigraph_ = "? ? ?? ?? ??? ??/ ??-"; - return this; - } - } - static TestExtremeDefaultValues() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class SparseEnumMessage : pb::GeneratedMessage { - private SparseEnumMessage() { } - private static readonly SparseEnumMessage defaultInstance = new SparseEnumMessage().MakeReadOnly(); - private static readonly string[] _sparseEnumMessageFieldNames = new string[] { "sparse_enum" }; - private static readonly uint[] _sparseEnumMessageFieldTags = new uint[] { 8 }; - public static SparseEnumMessage DefaultInstance { - get { return defaultInstance; } - } - - public override SparseEnumMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override SparseEnumMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_SparseEnumMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_SparseEnumMessage__FieldAccessorTable; } - } - - public const int SparseEnumFieldNumber = 1; - private bool hasSparseEnum; - private global::Google.ProtocolBuffers.TestProtos.TestSparseEnum sparseEnum_ = global::Google.ProtocolBuffers.TestProtos.TestSparseEnum.SPARSE_A; - public bool HasSparseEnum { - get { return hasSparseEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.TestSparseEnum SparseEnum { - get { return sparseEnum_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _sparseEnumMessageFieldNames; - if (hasSparseEnum) { - output.WriteEnum(1, field_names[0], (int) SparseEnum, SparseEnum); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasSparseEnum) { - size += pb::CodedOutputStream.ComputeEnumSize(1, (int) SparseEnum); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static SparseEnumMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SparseEnumMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SparseEnumMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SparseEnumMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SparseEnumMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SparseEnumMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SparseEnumMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SparseEnumMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SparseEnumMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SparseEnumMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private SparseEnumMessage MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SparseEnumMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(SparseEnumMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private SparseEnumMessage result; - - private SparseEnumMessage PrepareBuilder() { - if (resultIsReadOnly) { - SparseEnumMessage original = result; - result = new SparseEnumMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override SparseEnumMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.SparseEnumMessage.Descriptor; } - } - - public override SparseEnumMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.SparseEnumMessage.DefaultInstance; } - } - - public override SparseEnumMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SparseEnumMessage) { - return MergeFrom((SparseEnumMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SparseEnumMessage other) { - if (other == global::Google.ProtocolBuffers.TestProtos.SparseEnumMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasSparseEnum) { - SparseEnum = other.SparseEnum; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_sparseEnumMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _sparseEnumMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - object unknown; - if(input.ReadEnum(ref result.sparseEnum_, out unknown)) { - result.hasSparseEnum = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(1, (ulong)(int)unknown); - } - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasSparseEnum { - get { return result.hasSparseEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.TestSparseEnum SparseEnum { - get { return result.SparseEnum; } - set { SetSparseEnum(value); } - } - public Builder SetSparseEnum(global::Google.ProtocolBuffers.TestProtos.TestSparseEnum value) { - PrepareBuilder(); - result.hasSparseEnum = true; - result.sparseEnum_ = value; - return this; - } - public Builder ClearSparseEnum() { - PrepareBuilder(); - result.hasSparseEnum = false; - result.sparseEnum_ = global::Google.ProtocolBuffers.TestProtos.TestSparseEnum.SPARSE_A; - return this; - } - } - static SparseEnumMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class OneString : pb::GeneratedMessage { - private OneString() { } - private static readonly OneString defaultInstance = new OneString().MakeReadOnly(); - private static readonly string[] _oneStringFieldNames = new string[] { "data" }; - private static readonly uint[] _oneStringFieldTags = new uint[] { 10 }; - public static OneString DefaultInstance { - get { return defaultInstance; } - } - - public override OneString DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override OneString ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_OneString__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_OneString__FieldAccessorTable; } - } - - public const int DataFieldNumber = 1; - private bool hasData; - private string data_ = ""; - public bool HasData { - get { return hasData; } - } - public string Data { - get { return data_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _oneStringFieldNames; - if (hasData) { - output.WriteString(1, field_names[0], Data); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasData) { - size += pb::CodedOutputStream.ComputeStringSize(1, Data); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static OneString ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OneString ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OneString ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OneString ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OneString ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OneString ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static OneString ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static OneString ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static OneString ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OneString ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private OneString MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(OneString prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(OneString cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private OneString result; - - private OneString PrepareBuilder() { - if (resultIsReadOnly) { - OneString original = result; - result = new OneString(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override OneString MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.OneString.Descriptor; } - } - - public override OneString DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.OneString.DefaultInstance; } - } - - public override OneString BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is OneString) { - return MergeFrom((OneString) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(OneString other) { - if (other == global::Google.ProtocolBuffers.TestProtos.OneString.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasData) { - Data = other.Data; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_oneStringFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _oneStringFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasData = input.ReadString(ref result.data_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasData { - get { return result.hasData; } - } - public string Data { - get { return result.Data; } - set { SetData(value); } - } - public Builder SetData(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasData = true; - result.data_ = value; - return this; - } - public Builder ClearData() { - PrepareBuilder(); - result.hasData = false; - result.data_ = ""; - return this; - } - } - static OneString() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class OneBytes : pb::GeneratedMessage { - private OneBytes() { } - private static readonly OneBytes defaultInstance = new OneBytes().MakeReadOnly(); - private static readonly string[] _oneBytesFieldNames = new string[] { "data" }; - private static readonly uint[] _oneBytesFieldTags = new uint[] { 10 }; - public static OneBytes DefaultInstance { - get { return defaultInstance; } - } - - public override OneBytes DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override OneBytes ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_OneBytes__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_OneBytes__FieldAccessorTable; } - } - - public const int DataFieldNumber = 1; - private bool hasData; - private pb::ByteString data_ = pb::ByteString.Empty; - public bool HasData { - get { return hasData; } - } - public pb::ByteString Data { - get { return data_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _oneBytesFieldNames; - if (hasData) { - output.WriteBytes(1, field_names[0], Data); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasData) { - size += pb::CodedOutputStream.ComputeBytesSize(1, Data); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static OneBytes ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OneBytes ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OneBytes ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OneBytes ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OneBytes ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OneBytes ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static OneBytes ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static OneBytes ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static OneBytes ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OneBytes ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private OneBytes MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(OneBytes prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(OneBytes cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private OneBytes result; - - private OneBytes PrepareBuilder() { - if (resultIsReadOnly) { - OneBytes original = result; - result = new OneBytes(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override OneBytes MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.OneBytes.Descriptor; } - } - - public override OneBytes DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.OneBytes.DefaultInstance; } - } - - public override OneBytes BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is OneBytes) { - return MergeFrom((OneBytes) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(OneBytes other) { - if (other == global::Google.ProtocolBuffers.TestProtos.OneBytes.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasData) { - Data = other.Data; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_oneBytesFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _oneBytesFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasData = input.ReadBytes(ref result.data_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasData { - get { return result.hasData; } - } - public pb::ByteString Data { - get { return result.Data; } - set { SetData(value); } - } - public Builder SetData(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasData = true; - result.data_ = value; - return this; - } - public Builder ClearData() { - PrepareBuilder(); - result.hasData = false; - result.data_ = pb::ByteString.Empty; - return this; - } - } - static OneBytes() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestPackedTypes : pb::GeneratedMessage { - private TestPackedTypes() { } - private static readonly TestPackedTypes defaultInstance = new TestPackedTypes().MakeReadOnly(); - private static readonly string[] _testPackedTypesFieldNames = new string[] { "packed_bool", "packed_double", "packed_enum", "packed_fixed32", "packed_fixed64", "packed_float", "packed_int32", "packed_int64", "packed_sfixed32", "packed_sfixed64", "packed_sint32", "packed_sint64", "packed_uint32", "packed_uint64" }; - private static readonly uint[] _testPackedTypesFieldTags = new uint[] { 818, 810, 826, 770, 778, 802, 722, 730, 786, 794, 754, 762, 738, 746 }; - public static TestPackedTypes DefaultInstance { - get { return defaultInstance; } - } - - public override TestPackedTypes DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestPackedTypes ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestPackedTypes__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestPackedTypes__FieldAccessorTable; } - } - - public const int PackedInt32FieldNumber = 90; - private int packedInt32MemoizedSerializedSize; - private pbc::PopsicleList packedInt32_ = new pbc::PopsicleList(); - public scg::IList PackedInt32List { - get { return pbc::Lists.AsReadOnly(packedInt32_); } - } - public int PackedInt32Count { - get { return packedInt32_.Count; } - } - public int GetPackedInt32(int index) { - return packedInt32_[index]; - } - - public const int PackedInt64FieldNumber = 91; - private int packedInt64MemoizedSerializedSize; - private pbc::PopsicleList packedInt64_ = new pbc::PopsicleList(); - public scg::IList PackedInt64List { - get { return pbc::Lists.AsReadOnly(packedInt64_); } - } - public int PackedInt64Count { - get { return packedInt64_.Count; } - } - public long GetPackedInt64(int index) { - return packedInt64_[index]; - } - - public const int PackedUint32FieldNumber = 92; - private int packedUint32MemoizedSerializedSize; - private pbc::PopsicleList packedUint32_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList PackedUint32List { - get { return pbc::Lists.AsReadOnly(packedUint32_); } - } - public int PackedUint32Count { - get { return packedUint32_.Count; } - } - [global::System.CLSCompliant(false)] - public uint GetPackedUint32(int index) { - return packedUint32_[index]; - } - - public const int PackedUint64FieldNumber = 93; - private int packedUint64MemoizedSerializedSize; - private pbc::PopsicleList packedUint64_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList PackedUint64List { - get { return pbc::Lists.AsReadOnly(packedUint64_); } - } - public int PackedUint64Count { - get { return packedUint64_.Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetPackedUint64(int index) { - return packedUint64_[index]; - } - - public const int PackedSint32FieldNumber = 94; - private int packedSint32MemoizedSerializedSize; - private pbc::PopsicleList packedSint32_ = new pbc::PopsicleList(); - public scg::IList PackedSint32List { - get { return pbc::Lists.AsReadOnly(packedSint32_); } - } - public int PackedSint32Count { - get { return packedSint32_.Count; } - } - public int GetPackedSint32(int index) { - return packedSint32_[index]; - } - - public const int PackedSint64FieldNumber = 95; - private int packedSint64MemoizedSerializedSize; - private pbc::PopsicleList packedSint64_ = new pbc::PopsicleList(); - public scg::IList PackedSint64List { - get { return pbc::Lists.AsReadOnly(packedSint64_); } - } - public int PackedSint64Count { - get { return packedSint64_.Count; } - } - public long GetPackedSint64(int index) { - return packedSint64_[index]; - } - - public const int PackedFixed32FieldNumber = 96; - private int packedFixed32MemoizedSerializedSize; - private pbc::PopsicleList packedFixed32_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList PackedFixed32List { - get { return pbc::Lists.AsReadOnly(packedFixed32_); } - } - public int PackedFixed32Count { - get { return packedFixed32_.Count; } - } - [global::System.CLSCompliant(false)] - public uint GetPackedFixed32(int index) { - return packedFixed32_[index]; - } - - public const int PackedFixed64FieldNumber = 97; - private int packedFixed64MemoizedSerializedSize; - private pbc::PopsicleList packedFixed64_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList PackedFixed64List { - get { return pbc::Lists.AsReadOnly(packedFixed64_); } - } - public int PackedFixed64Count { - get { return packedFixed64_.Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetPackedFixed64(int index) { - return packedFixed64_[index]; - } - - public const int PackedSfixed32FieldNumber = 98; - private int packedSfixed32MemoizedSerializedSize; - private pbc::PopsicleList packedSfixed32_ = new pbc::PopsicleList(); - public scg::IList PackedSfixed32List { - get { return pbc::Lists.AsReadOnly(packedSfixed32_); } - } - public int PackedSfixed32Count { - get { return packedSfixed32_.Count; } - } - public int GetPackedSfixed32(int index) { - return packedSfixed32_[index]; - } - - public const int PackedSfixed64FieldNumber = 99; - private int packedSfixed64MemoizedSerializedSize; - private pbc::PopsicleList packedSfixed64_ = new pbc::PopsicleList(); - public scg::IList PackedSfixed64List { - get { return pbc::Lists.AsReadOnly(packedSfixed64_); } - } - public int PackedSfixed64Count { - get { return packedSfixed64_.Count; } - } - public long GetPackedSfixed64(int index) { - return packedSfixed64_[index]; - } - - public const int PackedFloatFieldNumber = 100; - private int packedFloatMemoizedSerializedSize; - private pbc::PopsicleList packedFloat_ = new pbc::PopsicleList(); - public scg::IList PackedFloatList { - get { return pbc::Lists.AsReadOnly(packedFloat_); } - } - public int PackedFloatCount { - get { return packedFloat_.Count; } - } - public float GetPackedFloat(int index) { - return packedFloat_[index]; - } - - public const int PackedDoubleFieldNumber = 101; - private int packedDoubleMemoizedSerializedSize; - private pbc::PopsicleList packedDouble_ = new pbc::PopsicleList(); - public scg::IList PackedDoubleList { - get { return pbc::Lists.AsReadOnly(packedDouble_); } - } - public int PackedDoubleCount { - get { return packedDouble_.Count; } - } - public double GetPackedDouble(int index) { - return packedDouble_[index]; - } - - public const int PackedBoolFieldNumber = 102; - private int packedBoolMemoizedSerializedSize; - private pbc::PopsicleList packedBool_ = new pbc::PopsicleList(); - public scg::IList PackedBoolList { - get { return pbc::Lists.AsReadOnly(packedBool_); } - } - public int PackedBoolCount { - get { return packedBool_.Count; } - } - public bool GetPackedBool(int index) { - return packedBool_[index]; - } - - public const int PackedEnumFieldNumber = 103; - private int packedEnumMemoizedSerializedSize; - private pbc::PopsicleList packedEnum_ = new pbc::PopsicleList(); - public scg::IList PackedEnumList { - get { return pbc::Lists.AsReadOnly(packedEnum_); } - } - public int PackedEnumCount { - get { return packedEnum_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum GetPackedEnum(int index) { - return packedEnum_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testPackedTypesFieldNames; - if (packedInt32_.Count > 0) { - output.WritePackedInt32Array(90, field_names[6], packedInt32MemoizedSerializedSize, packedInt32_); - } - if (packedInt64_.Count > 0) { - output.WritePackedInt64Array(91, field_names[7], packedInt64MemoizedSerializedSize, packedInt64_); - } - if (packedUint32_.Count > 0) { - output.WritePackedUInt32Array(92, field_names[12], packedUint32MemoizedSerializedSize, packedUint32_); - } - if (packedUint64_.Count > 0) { - output.WritePackedUInt64Array(93, field_names[13], packedUint64MemoizedSerializedSize, packedUint64_); - } - if (packedSint32_.Count > 0) { - output.WritePackedSInt32Array(94, field_names[10], packedSint32MemoizedSerializedSize, packedSint32_); - } - if (packedSint64_.Count > 0) { - output.WritePackedSInt64Array(95, field_names[11], packedSint64MemoizedSerializedSize, packedSint64_); - } - if (packedFixed32_.Count > 0) { - output.WritePackedFixed32Array(96, field_names[3], packedFixed32MemoizedSerializedSize, packedFixed32_); - } - if (packedFixed64_.Count > 0) { - output.WritePackedFixed64Array(97, field_names[4], packedFixed64MemoizedSerializedSize, packedFixed64_); - } - if (packedSfixed32_.Count > 0) { - output.WritePackedSFixed32Array(98, field_names[8], packedSfixed32MemoizedSerializedSize, packedSfixed32_); - } - if (packedSfixed64_.Count > 0) { - output.WritePackedSFixed64Array(99, field_names[9], packedSfixed64MemoizedSerializedSize, packedSfixed64_); - } - if (packedFloat_.Count > 0) { - output.WritePackedFloatArray(100, field_names[5], packedFloatMemoizedSerializedSize, packedFloat_); - } - if (packedDouble_.Count > 0) { - output.WritePackedDoubleArray(101, field_names[1], packedDoubleMemoizedSerializedSize, packedDouble_); - } - if (packedBool_.Count > 0) { - output.WritePackedBoolArray(102, field_names[0], packedBoolMemoizedSerializedSize, packedBool_); - } - if (packedEnum_.Count > 0) { - output.WritePackedEnumArray(103, field_names[2], packedEnumMemoizedSerializedSize, packedEnum_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - foreach (int element in PackedInt32List) { - dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); - } - size += dataSize; - if (packedInt32_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedInt32MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - foreach (long element in PackedInt64List) { - dataSize += pb::CodedOutputStream.ComputeInt64SizeNoTag(element); - } - size += dataSize; - if (packedInt64_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedInt64MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - foreach (uint element in PackedUint32List) { - dataSize += pb::CodedOutputStream.ComputeUInt32SizeNoTag(element); - } - size += dataSize; - if (packedUint32_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedUint32MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - foreach (ulong element in PackedUint64List) { - dataSize += pb::CodedOutputStream.ComputeUInt64SizeNoTag(element); - } - size += dataSize; - if (packedUint64_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedUint64MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - foreach (int element in PackedSint32List) { - dataSize += pb::CodedOutputStream.ComputeSInt32SizeNoTag(element); - } - size += dataSize; - if (packedSint32_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedSint32MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - foreach (long element in PackedSint64List) { - dataSize += pb::CodedOutputStream.ComputeSInt64SizeNoTag(element); - } - size += dataSize; - if (packedSint64_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedSint64MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 4 * packedFixed32_.Count; - size += dataSize; - if (packedFixed32_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedFixed32MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 8 * packedFixed64_.Count; - size += dataSize; - if (packedFixed64_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedFixed64MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 4 * packedSfixed32_.Count; - size += dataSize; - if (packedSfixed32_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedSfixed32MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 8 * packedSfixed64_.Count; - size += dataSize; - if (packedSfixed64_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedSfixed64MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 4 * packedFloat_.Count; - size += dataSize; - if (packedFloat_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedFloatMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 8 * packedDouble_.Count; - size += dataSize; - if (packedDouble_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedDoubleMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 1 * packedBool_.Count; - size += dataSize; - if (packedBool_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedBoolMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - if (packedEnum_.Count > 0) { - foreach (global::Google.ProtocolBuffers.TestProtos.ForeignEnum element in packedEnum_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 2; - size += pb::CodedOutputStream.ComputeRawVarint32Size((uint) dataSize); - } - packedEnumMemoizedSerializedSize = dataSize; - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestPackedTypes ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestPackedTypes ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestPackedTypes ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestPackedTypes ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestPackedTypes ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestPackedTypes ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestPackedTypes ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestPackedTypes ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestPackedTypes ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestPackedTypes ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestPackedTypes MakeReadOnly() { - packedInt32_.MakeReadOnly(); - packedInt64_.MakeReadOnly(); - packedUint32_.MakeReadOnly(); - packedUint64_.MakeReadOnly(); - packedSint32_.MakeReadOnly(); - packedSint64_.MakeReadOnly(); - packedFixed32_.MakeReadOnly(); - packedFixed64_.MakeReadOnly(); - packedSfixed32_.MakeReadOnly(); - packedSfixed64_.MakeReadOnly(); - packedFloat_.MakeReadOnly(); - packedDouble_.MakeReadOnly(); - packedBool_.MakeReadOnly(); - packedEnum_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestPackedTypes prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestPackedTypes cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestPackedTypes result; - - private TestPackedTypes PrepareBuilder() { - if (resultIsReadOnly) { - TestPackedTypes original = result; - result = new TestPackedTypes(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestPackedTypes MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestPackedTypes.Descriptor; } - } - - public override TestPackedTypes DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestPackedTypes.DefaultInstance; } - } - - public override TestPackedTypes BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestPackedTypes) { - return MergeFrom((TestPackedTypes) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestPackedTypes other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestPackedTypes.DefaultInstance) return this; - PrepareBuilder(); - if (other.packedInt32_.Count != 0) { - result.packedInt32_.Add(other.packedInt32_); - } - if (other.packedInt64_.Count != 0) { - result.packedInt64_.Add(other.packedInt64_); - } - if (other.packedUint32_.Count != 0) { - result.packedUint32_.Add(other.packedUint32_); - } - if (other.packedUint64_.Count != 0) { - result.packedUint64_.Add(other.packedUint64_); - } - if (other.packedSint32_.Count != 0) { - result.packedSint32_.Add(other.packedSint32_); - } - if (other.packedSint64_.Count != 0) { - result.packedSint64_.Add(other.packedSint64_); - } - if (other.packedFixed32_.Count != 0) { - result.packedFixed32_.Add(other.packedFixed32_); - } - if (other.packedFixed64_.Count != 0) { - result.packedFixed64_.Add(other.packedFixed64_); - } - if (other.packedSfixed32_.Count != 0) { - result.packedSfixed32_.Add(other.packedSfixed32_); - } - if (other.packedSfixed64_.Count != 0) { - result.packedSfixed64_.Add(other.packedSfixed64_); - } - if (other.packedFloat_.Count != 0) { - result.packedFloat_.Add(other.packedFloat_); - } - if (other.packedDouble_.Count != 0) { - result.packedDouble_.Add(other.packedDouble_); - } - if (other.packedBool_.Count != 0) { - result.packedBool_.Add(other.packedBool_); - } - if (other.packedEnum_.Count != 0) { - result.packedEnum_.Add(other.packedEnum_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testPackedTypesFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testPackedTypesFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 722: - case 720: { - input.ReadInt32Array(tag, field_name, result.packedInt32_); - break; - } - case 730: - case 728: { - input.ReadInt64Array(tag, field_name, result.packedInt64_); - break; - } - case 738: - case 736: { - input.ReadUInt32Array(tag, field_name, result.packedUint32_); - break; - } - case 746: - case 744: { - input.ReadUInt64Array(tag, field_name, result.packedUint64_); - break; - } - case 754: - case 752: { - input.ReadSInt32Array(tag, field_name, result.packedSint32_); - break; - } - case 762: - case 760: { - input.ReadSInt64Array(tag, field_name, result.packedSint64_); - break; - } - case 770: - case 773: { - input.ReadFixed32Array(tag, field_name, result.packedFixed32_); - break; - } - case 778: - case 777: { - input.ReadFixed64Array(tag, field_name, result.packedFixed64_); - break; - } - case 786: - case 789: { - input.ReadSFixed32Array(tag, field_name, result.packedSfixed32_); - break; - } - case 794: - case 793: { - input.ReadSFixed64Array(tag, field_name, result.packedSfixed64_); - break; - } - case 802: - case 805: { - input.ReadFloatArray(tag, field_name, result.packedFloat_); - break; - } - case 810: - case 809: { - input.ReadDoubleArray(tag, field_name, result.packedDouble_); - break; - } - case 818: - case 816: { - input.ReadBoolArray(tag, field_name, result.packedBool_); - break; - } - case 826: - case 824: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.packedEnum_, out unknownItems); - if (unknownItems != null) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - foreach (object rawValue in unknownItems) - if (rawValue is int) - unknownFields.MergeVarintField(103, (ulong)(int)rawValue); - } - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public pbc::IPopsicleList PackedInt32List { - get { return PrepareBuilder().packedInt32_; } - } - public int PackedInt32Count { - get { return result.PackedInt32Count; } - } - public int GetPackedInt32(int index) { - return result.GetPackedInt32(index); - } - public Builder SetPackedInt32(int index, int value) { - PrepareBuilder(); - result.packedInt32_[index] = value; - return this; - } - public Builder AddPackedInt32(int value) { - PrepareBuilder(); - result.packedInt32_.Add(value); - return this; - } - public Builder AddRangePackedInt32(scg::IEnumerable values) { - PrepareBuilder(); - result.packedInt32_.Add(values); - return this; - } - public Builder ClearPackedInt32() { - PrepareBuilder(); - result.packedInt32_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedInt64List { - get { return PrepareBuilder().packedInt64_; } - } - public int PackedInt64Count { - get { return result.PackedInt64Count; } - } - public long GetPackedInt64(int index) { - return result.GetPackedInt64(index); - } - public Builder SetPackedInt64(int index, long value) { - PrepareBuilder(); - result.packedInt64_[index] = value; - return this; - } - public Builder AddPackedInt64(long value) { - PrepareBuilder(); - result.packedInt64_.Add(value); - return this; - } - public Builder AddRangePackedInt64(scg::IEnumerable values) { - PrepareBuilder(); - result.packedInt64_.Add(values); - return this; - } - public Builder ClearPackedInt64() { - PrepareBuilder(); - result.packedInt64_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList PackedUint32List { - get { return PrepareBuilder().packedUint32_; } - } - public int PackedUint32Count { - get { return result.PackedUint32Count; } - } - [global::System.CLSCompliant(false)] - public uint GetPackedUint32(int index) { - return result.GetPackedUint32(index); - } - [global::System.CLSCompliant(false)] - public Builder SetPackedUint32(int index, uint value) { - PrepareBuilder(); - result.packedUint32_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddPackedUint32(uint value) { - PrepareBuilder(); - result.packedUint32_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangePackedUint32(scg::IEnumerable values) { - PrepareBuilder(); - result.packedUint32_.Add(values); - return this; - } - public Builder ClearPackedUint32() { - PrepareBuilder(); - result.packedUint32_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList PackedUint64List { - get { return PrepareBuilder().packedUint64_; } - } - public int PackedUint64Count { - get { return result.PackedUint64Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetPackedUint64(int index) { - return result.GetPackedUint64(index); - } - [global::System.CLSCompliant(false)] - public Builder SetPackedUint64(int index, ulong value) { - PrepareBuilder(); - result.packedUint64_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddPackedUint64(ulong value) { - PrepareBuilder(); - result.packedUint64_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangePackedUint64(scg::IEnumerable values) { - PrepareBuilder(); - result.packedUint64_.Add(values); - return this; - } - public Builder ClearPackedUint64() { - PrepareBuilder(); - result.packedUint64_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedSint32List { - get { return PrepareBuilder().packedSint32_; } - } - public int PackedSint32Count { - get { return result.PackedSint32Count; } - } - public int GetPackedSint32(int index) { - return result.GetPackedSint32(index); - } - public Builder SetPackedSint32(int index, int value) { - PrepareBuilder(); - result.packedSint32_[index] = value; - return this; - } - public Builder AddPackedSint32(int value) { - PrepareBuilder(); - result.packedSint32_.Add(value); - return this; - } - public Builder AddRangePackedSint32(scg::IEnumerable values) { - PrepareBuilder(); - result.packedSint32_.Add(values); - return this; - } - public Builder ClearPackedSint32() { - PrepareBuilder(); - result.packedSint32_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedSint64List { - get { return PrepareBuilder().packedSint64_; } - } - public int PackedSint64Count { - get { return result.PackedSint64Count; } - } - public long GetPackedSint64(int index) { - return result.GetPackedSint64(index); - } - public Builder SetPackedSint64(int index, long value) { - PrepareBuilder(); - result.packedSint64_[index] = value; - return this; - } - public Builder AddPackedSint64(long value) { - PrepareBuilder(); - result.packedSint64_.Add(value); - return this; - } - public Builder AddRangePackedSint64(scg::IEnumerable values) { - PrepareBuilder(); - result.packedSint64_.Add(values); - return this; - } - public Builder ClearPackedSint64() { - PrepareBuilder(); - result.packedSint64_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList PackedFixed32List { - get { return PrepareBuilder().packedFixed32_; } - } - public int PackedFixed32Count { - get { return result.PackedFixed32Count; } - } - [global::System.CLSCompliant(false)] - public uint GetPackedFixed32(int index) { - return result.GetPackedFixed32(index); - } - [global::System.CLSCompliant(false)] - public Builder SetPackedFixed32(int index, uint value) { - PrepareBuilder(); - result.packedFixed32_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddPackedFixed32(uint value) { - PrepareBuilder(); - result.packedFixed32_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangePackedFixed32(scg::IEnumerable values) { - PrepareBuilder(); - result.packedFixed32_.Add(values); - return this; - } - public Builder ClearPackedFixed32() { - PrepareBuilder(); - result.packedFixed32_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList PackedFixed64List { - get { return PrepareBuilder().packedFixed64_; } - } - public int PackedFixed64Count { - get { return result.PackedFixed64Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetPackedFixed64(int index) { - return result.GetPackedFixed64(index); - } - [global::System.CLSCompliant(false)] - public Builder SetPackedFixed64(int index, ulong value) { - PrepareBuilder(); - result.packedFixed64_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddPackedFixed64(ulong value) { - PrepareBuilder(); - result.packedFixed64_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangePackedFixed64(scg::IEnumerable values) { - PrepareBuilder(); - result.packedFixed64_.Add(values); - return this; - } - public Builder ClearPackedFixed64() { - PrepareBuilder(); - result.packedFixed64_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedSfixed32List { - get { return PrepareBuilder().packedSfixed32_; } - } - public int PackedSfixed32Count { - get { return result.PackedSfixed32Count; } - } - public int GetPackedSfixed32(int index) { - return result.GetPackedSfixed32(index); - } - public Builder SetPackedSfixed32(int index, int value) { - PrepareBuilder(); - result.packedSfixed32_[index] = value; - return this; - } - public Builder AddPackedSfixed32(int value) { - PrepareBuilder(); - result.packedSfixed32_.Add(value); - return this; - } - public Builder AddRangePackedSfixed32(scg::IEnumerable values) { - PrepareBuilder(); - result.packedSfixed32_.Add(values); - return this; - } - public Builder ClearPackedSfixed32() { - PrepareBuilder(); - result.packedSfixed32_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedSfixed64List { - get { return PrepareBuilder().packedSfixed64_; } - } - public int PackedSfixed64Count { - get { return result.PackedSfixed64Count; } - } - public long GetPackedSfixed64(int index) { - return result.GetPackedSfixed64(index); - } - public Builder SetPackedSfixed64(int index, long value) { - PrepareBuilder(); - result.packedSfixed64_[index] = value; - return this; - } - public Builder AddPackedSfixed64(long value) { - PrepareBuilder(); - result.packedSfixed64_.Add(value); - return this; - } - public Builder AddRangePackedSfixed64(scg::IEnumerable values) { - PrepareBuilder(); - result.packedSfixed64_.Add(values); - return this; - } - public Builder ClearPackedSfixed64() { - PrepareBuilder(); - result.packedSfixed64_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedFloatList { - get { return PrepareBuilder().packedFloat_; } - } - public int PackedFloatCount { - get { return result.PackedFloatCount; } - } - public float GetPackedFloat(int index) { - return result.GetPackedFloat(index); - } - public Builder SetPackedFloat(int index, float value) { - PrepareBuilder(); - result.packedFloat_[index] = value; - return this; - } - public Builder AddPackedFloat(float value) { - PrepareBuilder(); - result.packedFloat_.Add(value); - return this; - } - public Builder AddRangePackedFloat(scg::IEnumerable values) { - PrepareBuilder(); - result.packedFloat_.Add(values); - return this; - } - public Builder ClearPackedFloat() { - PrepareBuilder(); - result.packedFloat_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedDoubleList { - get { return PrepareBuilder().packedDouble_; } - } - public int PackedDoubleCount { - get { return result.PackedDoubleCount; } - } - public double GetPackedDouble(int index) { - return result.GetPackedDouble(index); - } - public Builder SetPackedDouble(int index, double value) { - PrepareBuilder(); - result.packedDouble_[index] = value; - return this; - } - public Builder AddPackedDouble(double value) { - PrepareBuilder(); - result.packedDouble_.Add(value); - return this; - } - public Builder AddRangePackedDouble(scg::IEnumerable values) { - PrepareBuilder(); - result.packedDouble_.Add(values); - return this; - } - public Builder ClearPackedDouble() { - PrepareBuilder(); - result.packedDouble_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedBoolList { - get { return PrepareBuilder().packedBool_; } - } - public int PackedBoolCount { - get { return result.PackedBoolCount; } - } - public bool GetPackedBool(int index) { - return result.GetPackedBool(index); - } - public Builder SetPackedBool(int index, bool value) { - PrepareBuilder(); - result.packedBool_[index] = value; - return this; - } - public Builder AddPackedBool(bool value) { - PrepareBuilder(); - result.packedBool_.Add(value); - return this; - } - public Builder AddRangePackedBool(scg::IEnumerable values) { - PrepareBuilder(); - result.packedBool_.Add(values); - return this; - } - public Builder ClearPackedBool() { - PrepareBuilder(); - result.packedBool_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedEnumList { - get { return PrepareBuilder().packedEnum_; } - } - public int PackedEnumCount { - get { return result.PackedEnumCount; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum GetPackedEnum(int index) { - return result.GetPackedEnum(index); - } - public Builder SetPackedEnum(int index, global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) { - PrepareBuilder(); - result.packedEnum_[index] = value; - return this; - } - public Builder AddPackedEnum(global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) { - PrepareBuilder(); - result.packedEnum_.Add(value); - return this; - } - public Builder AddRangePackedEnum(scg::IEnumerable values) { - PrepareBuilder(); - result.packedEnum_.Add(values); - return this; - } - public Builder ClearPackedEnum() { - PrepareBuilder(); - result.packedEnum_.Clear(); - return this; - } - } - static TestPackedTypes() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestUnpackedTypes : pb::GeneratedMessage { - private TestUnpackedTypes() { } - private static readonly TestUnpackedTypes defaultInstance = new TestUnpackedTypes().MakeReadOnly(); - private static readonly string[] _testUnpackedTypesFieldNames = new string[] { "unpacked_bool", "unpacked_double", "unpacked_enum", "unpacked_fixed32", "unpacked_fixed64", "unpacked_float", "unpacked_int32", "unpacked_int64", "unpacked_sfixed32", "unpacked_sfixed64", "unpacked_sint32", "unpacked_sint64", "unpacked_uint32", "unpacked_uint64" }; - private static readonly uint[] _testUnpackedTypesFieldTags = new uint[] { 816, 809, 824, 773, 777, 805, 720, 728, 789, 793, 752, 760, 736, 744 }; - public static TestUnpackedTypes DefaultInstance { - get { return defaultInstance; } - } - - public override TestUnpackedTypes DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestUnpackedTypes ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestUnpackedTypes__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestUnpackedTypes__FieldAccessorTable; } - } - - public const int UnpackedInt32FieldNumber = 90; - private pbc::PopsicleList unpackedInt32_ = new pbc::PopsicleList(); - public scg::IList UnpackedInt32List { - get { return pbc::Lists.AsReadOnly(unpackedInt32_); } - } - public int UnpackedInt32Count { - get { return unpackedInt32_.Count; } - } - public int GetUnpackedInt32(int index) { - return unpackedInt32_[index]; - } - - public const int UnpackedInt64FieldNumber = 91; - private pbc::PopsicleList unpackedInt64_ = new pbc::PopsicleList(); - public scg::IList UnpackedInt64List { - get { return pbc::Lists.AsReadOnly(unpackedInt64_); } - } - public int UnpackedInt64Count { - get { return unpackedInt64_.Count; } - } - public long GetUnpackedInt64(int index) { - return unpackedInt64_[index]; - } - - public const int UnpackedUint32FieldNumber = 92; - private pbc::PopsicleList unpackedUint32_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList UnpackedUint32List { - get { return pbc::Lists.AsReadOnly(unpackedUint32_); } - } - public int UnpackedUint32Count { - get { return unpackedUint32_.Count; } - } - [global::System.CLSCompliant(false)] - public uint GetUnpackedUint32(int index) { - return unpackedUint32_[index]; - } - - public const int UnpackedUint64FieldNumber = 93; - private pbc::PopsicleList unpackedUint64_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList UnpackedUint64List { - get { return pbc::Lists.AsReadOnly(unpackedUint64_); } - } - public int UnpackedUint64Count { - get { return unpackedUint64_.Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetUnpackedUint64(int index) { - return unpackedUint64_[index]; - } - - public const int UnpackedSint32FieldNumber = 94; - private pbc::PopsicleList unpackedSint32_ = new pbc::PopsicleList(); - public scg::IList UnpackedSint32List { - get { return pbc::Lists.AsReadOnly(unpackedSint32_); } - } - public int UnpackedSint32Count { - get { return unpackedSint32_.Count; } - } - public int GetUnpackedSint32(int index) { - return unpackedSint32_[index]; - } - - public const int UnpackedSint64FieldNumber = 95; - private pbc::PopsicleList unpackedSint64_ = new pbc::PopsicleList(); - public scg::IList UnpackedSint64List { - get { return pbc::Lists.AsReadOnly(unpackedSint64_); } - } - public int UnpackedSint64Count { - get { return unpackedSint64_.Count; } - } - public long GetUnpackedSint64(int index) { - return unpackedSint64_[index]; - } - - public const int UnpackedFixed32FieldNumber = 96; - private pbc::PopsicleList unpackedFixed32_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList UnpackedFixed32List { - get { return pbc::Lists.AsReadOnly(unpackedFixed32_); } - } - public int UnpackedFixed32Count { - get { return unpackedFixed32_.Count; } - } - [global::System.CLSCompliant(false)] - public uint GetUnpackedFixed32(int index) { - return unpackedFixed32_[index]; - } - - public const int UnpackedFixed64FieldNumber = 97; - private pbc::PopsicleList unpackedFixed64_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList UnpackedFixed64List { - get { return pbc::Lists.AsReadOnly(unpackedFixed64_); } - } - public int UnpackedFixed64Count { - get { return unpackedFixed64_.Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetUnpackedFixed64(int index) { - return unpackedFixed64_[index]; - } - - public const int UnpackedSfixed32FieldNumber = 98; - private pbc::PopsicleList unpackedSfixed32_ = new pbc::PopsicleList(); - public scg::IList UnpackedSfixed32List { - get { return pbc::Lists.AsReadOnly(unpackedSfixed32_); } - } - public int UnpackedSfixed32Count { - get { return unpackedSfixed32_.Count; } - } - public int GetUnpackedSfixed32(int index) { - return unpackedSfixed32_[index]; - } - - public const int UnpackedSfixed64FieldNumber = 99; - private pbc::PopsicleList unpackedSfixed64_ = new pbc::PopsicleList(); - public scg::IList UnpackedSfixed64List { - get { return pbc::Lists.AsReadOnly(unpackedSfixed64_); } - } - public int UnpackedSfixed64Count { - get { return unpackedSfixed64_.Count; } - } - public long GetUnpackedSfixed64(int index) { - return unpackedSfixed64_[index]; - } - - public const int UnpackedFloatFieldNumber = 100; - private pbc::PopsicleList unpackedFloat_ = new pbc::PopsicleList(); - public scg::IList UnpackedFloatList { - get { return pbc::Lists.AsReadOnly(unpackedFloat_); } - } - public int UnpackedFloatCount { - get { return unpackedFloat_.Count; } - } - public float GetUnpackedFloat(int index) { - return unpackedFloat_[index]; - } - - public const int UnpackedDoubleFieldNumber = 101; - private pbc::PopsicleList unpackedDouble_ = new pbc::PopsicleList(); - public scg::IList UnpackedDoubleList { - get { return pbc::Lists.AsReadOnly(unpackedDouble_); } - } - public int UnpackedDoubleCount { - get { return unpackedDouble_.Count; } - } - public double GetUnpackedDouble(int index) { - return unpackedDouble_[index]; - } - - public const int UnpackedBoolFieldNumber = 102; - private pbc::PopsicleList unpackedBool_ = new pbc::PopsicleList(); - public scg::IList UnpackedBoolList { - get { return pbc::Lists.AsReadOnly(unpackedBool_); } - } - public int UnpackedBoolCount { - get { return unpackedBool_.Count; } - } - public bool GetUnpackedBool(int index) { - return unpackedBool_[index]; - } - - public const int UnpackedEnumFieldNumber = 103; - private pbc::PopsicleList unpackedEnum_ = new pbc::PopsicleList(); - public scg::IList UnpackedEnumList { - get { return pbc::Lists.AsReadOnly(unpackedEnum_); } - } - public int UnpackedEnumCount { - get { return unpackedEnum_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum GetUnpackedEnum(int index) { - return unpackedEnum_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testUnpackedTypesFieldNames; - if (unpackedInt32_.Count > 0) { - output.WriteInt32Array(90, field_names[6], unpackedInt32_); - } - if (unpackedInt64_.Count > 0) { - output.WriteInt64Array(91, field_names[7], unpackedInt64_); - } - if (unpackedUint32_.Count > 0) { - output.WriteUInt32Array(92, field_names[12], unpackedUint32_); - } - if (unpackedUint64_.Count > 0) { - output.WriteUInt64Array(93, field_names[13], unpackedUint64_); - } - if (unpackedSint32_.Count > 0) { - output.WriteSInt32Array(94, field_names[10], unpackedSint32_); - } - if (unpackedSint64_.Count > 0) { - output.WriteSInt64Array(95, field_names[11], unpackedSint64_); - } - if (unpackedFixed32_.Count > 0) { - output.WriteFixed32Array(96, field_names[3], unpackedFixed32_); - } - if (unpackedFixed64_.Count > 0) { - output.WriteFixed64Array(97, field_names[4], unpackedFixed64_); - } - if (unpackedSfixed32_.Count > 0) { - output.WriteSFixed32Array(98, field_names[8], unpackedSfixed32_); - } - if (unpackedSfixed64_.Count > 0) { - output.WriteSFixed64Array(99, field_names[9], unpackedSfixed64_); - } - if (unpackedFloat_.Count > 0) { - output.WriteFloatArray(100, field_names[5], unpackedFloat_); - } - if (unpackedDouble_.Count > 0) { - output.WriteDoubleArray(101, field_names[1], unpackedDouble_); - } - if (unpackedBool_.Count > 0) { - output.WriteBoolArray(102, field_names[0], unpackedBool_); - } - if (unpackedEnum_.Count > 0) { - output.WriteEnumArray(103, field_names[2], unpackedEnum_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - foreach (int element in UnpackedInt32List) { - dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); - } - size += dataSize; - size += 2 * unpackedInt32_.Count; - } - { - int dataSize = 0; - foreach (long element in UnpackedInt64List) { - dataSize += pb::CodedOutputStream.ComputeInt64SizeNoTag(element); - } - size += dataSize; - size += 2 * unpackedInt64_.Count; - } - { - int dataSize = 0; - foreach (uint element in UnpackedUint32List) { - dataSize += pb::CodedOutputStream.ComputeUInt32SizeNoTag(element); - } - size += dataSize; - size += 2 * unpackedUint32_.Count; - } - { - int dataSize = 0; - foreach (ulong element in UnpackedUint64List) { - dataSize += pb::CodedOutputStream.ComputeUInt64SizeNoTag(element); - } - size += dataSize; - size += 2 * unpackedUint64_.Count; - } - { - int dataSize = 0; - foreach (int element in UnpackedSint32List) { - dataSize += pb::CodedOutputStream.ComputeSInt32SizeNoTag(element); - } - size += dataSize; - size += 2 * unpackedSint32_.Count; - } - { - int dataSize = 0; - foreach (long element in UnpackedSint64List) { - dataSize += pb::CodedOutputStream.ComputeSInt64SizeNoTag(element); - } - size += dataSize; - size += 2 * unpackedSint64_.Count; - } - { - int dataSize = 0; - dataSize = 4 * unpackedFixed32_.Count; - size += dataSize; - size += 2 * unpackedFixed32_.Count; - } - { - int dataSize = 0; - dataSize = 8 * unpackedFixed64_.Count; - size += dataSize; - size += 2 * unpackedFixed64_.Count; - } - { - int dataSize = 0; - dataSize = 4 * unpackedSfixed32_.Count; - size += dataSize; - size += 2 * unpackedSfixed32_.Count; - } - { - int dataSize = 0; - dataSize = 8 * unpackedSfixed64_.Count; - size += dataSize; - size += 2 * unpackedSfixed64_.Count; - } - { - int dataSize = 0; - dataSize = 4 * unpackedFloat_.Count; - size += dataSize; - size += 2 * unpackedFloat_.Count; - } - { - int dataSize = 0; - dataSize = 8 * unpackedDouble_.Count; - size += dataSize; - size += 2 * unpackedDouble_.Count; - } - { - int dataSize = 0; - dataSize = 1 * unpackedBool_.Count; - size += dataSize; - size += 2 * unpackedBool_.Count; - } - { - int dataSize = 0; - if (unpackedEnum_.Count > 0) { - foreach (global::Google.ProtocolBuffers.TestProtos.ForeignEnum element in unpackedEnum_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 2 * unpackedEnum_.Count; - } - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestUnpackedTypes ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestUnpackedTypes ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestUnpackedTypes ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestUnpackedTypes ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestUnpackedTypes ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestUnpackedTypes ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestUnpackedTypes ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestUnpackedTypes ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestUnpackedTypes ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestUnpackedTypes ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestUnpackedTypes MakeReadOnly() { - unpackedInt32_.MakeReadOnly(); - unpackedInt64_.MakeReadOnly(); - unpackedUint32_.MakeReadOnly(); - unpackedUint64_.MakeReadOnly(); - unpackedSint32_.MakeReadOnly(); - unpackedSint64_.MakeReadOnly(); - unpackedFixed32_.MakeReadOnly(); - unpackedFixed64_.MakeReadOnly(); - unpackedSfixed32_.MakeReadOnly(); - unpackedSfixed64_.MakeReadOnly(); - unpackedFloat_.MakeReadOnly(); - unpackedDouble_.MakeReadOnly(); - unpackedBool_.MakeReadOnly(); - unpackedEnum_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestUnpackedTypes prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestUnpackedTypes cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestUnpackedTypes result; - - private TestUnpackedTypes PrepareBuilder() { - if (resultIsReadOnly) { - TestUnpackedTypes original = result; - result = new TestUnpackedTypes(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestUnpackedTypes MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestUnpackedTypes.Descriptor; } - } - - public override TestUnpackedTypes DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestUnpackedTypes.DefaultInstance; } - } - - public override TestUnpackedTypes BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestUnpackedTypes) { - return MergeFrom((TestUnpackedTypes) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestUnpackedTypes other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestUnpackedTypes.DefaultInstance) return this; - PrepareBuilder(); - if (other.unpackedInt32_.Count != 0) { - result.unpackedInt32_.Add(other.unpackedInt32_); - } - if (other.unpackedInt64_.Count != 0) { - result.unpackedInt64_.Add(other.unpackedInt64_); - } - if (other.unpackedUint32_.Count != 0) { - result.unpackedUint32_.Add(other.unpackedUint32_); - } - if (other.unpackedUint64_.Count != 0) { - result.unpackedUint64_.Add(other.unpackedUint64_); - } - if (other.unpackedSint32_.Count != 0) { - result.unpackedSint32_.Add(other.unpackedSint32_); - } - if (other.unpackedSint64_.Count != 0) { - result.unpackedSint64_.Add(other.unpackedSint64_); - } - if (other.unpackedFixed32_.Count != 0) { - result.unpackedFixed32_.Add(other.unpackedFixed32_); - } - if (other.unpackedFixed64_.Count != 0) { - result.unpackedFixed64_.Add(other.unpackedFixed64_); - } - if (other.unpackedSfixed32_.Count != 0) { - result.unpackedSfixed32_.Add(other.unpackedSfixed32_); - } - if (other.unpackedSfixed64_.Count != 0) { - result.unpackedSfixed64_.Add(other.unpackedSfixed64_); - } - if (other.unpackedFloat_.Count != 0) { - result.unpackedFloat_.Add(other.unpackedFloat_); - } - if (other.unpackedDouble_.Count != 0) { - result.unpackedDouble_.Add(other.unpackedDouble_); - } - if (other.unpackedBool_.Count != 0) { - result.unpackedBool_.Add(other.unpackedBool_); - } - if (other.unpackedEnum_.Count != 0) { - result.unpackedEnum_.Add(other.unpackedEnum_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testUnpackedTypesFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testUnpackedTypesFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 722: - case 720: { - input.ReadInt32Array(tag, field_name, result.unpackedInt32_); - break; - } - case 730: - case 728: { - input.ReadInt64Array(tag, field_name, result.unpackedInt64_); - break; - } - case 738: - case 736: { - input.ReadUInt32Array(tag, field_name, result.unpackedUint32_); - break; - } - case 746: - case 744: { - input.ReadUInt64Array(tag, field_name, result.unpackedUint64_); - break; - } - case 754: - case 752: { - input.ReadSInt32Array(tag, field_name, result.unpackedSint32_); - break; - } - case 762: - case 760: { - input.ReadSInt64Array(tag, field_name, result.unpackedSint64_); - break; - } - case 770: - case 773: { - input.ReadFixed32Array(tag, field_name, result.unpackedFixed32_); - break; - } - case 778: - case 777: { - input.ReadFixed64Array(tag, field_name, result.unpackedFixed64_); - break; - } - case 786: - case 789: { - input.ReadSFixed32Array(tag, field_name, result.unpackedSfixed32_); - break; - } - case 794: - case 793: { - input.ReadSFixed64Array(tag, field_name, result.unpackedSfixed64_); - break; - } - case 802: - case 805: { - input.ReadFloatArray(tag, field_name, result.unpackedFloat_); - break; - } - case 810: - case 809: { - input.ReadDoubleArray(tag, field_name, result.unpackedDouble_); - break; - } - case 818: - case 816: { - input.ReadBoolArray(tag, field_name, result.unpackedBool_); - break; - } - case 826: - case 824: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.unpackedEnum_, out unknownItems); - if (unknownItems != null) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - foreach (object rawValue in unknownItems) - if (rawValue is int) - unknownFields.MergeVarintField(103, (ulong)(int)rawValue); - } - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public pbc::IPopsicleList UnpackedInt32List { - get { return PrepareBuilder().unpackedInt32_; } - } - public int UnpackedInt32Count { - get { return result.UnpackedInt32Count; } - } - public int GetUnpackedInt32(int index) { - return result.GetUnpackedInt32(index); - } - public Builder SetUnpackedInt32(int index, int value) { - PrepareBuilder(); - result.unpackedInt32_[index] = value; - return this; - } - public Builder AddUnpackedInt32(int value) { - PrepareBuilder(); - result.unpackedInt32_.Add(value); - return this; - } - public Builder AddRangeUnpackedInt32(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedInt32_.Add(values); - return this; - } - public Builder ClearUnpackedInt32() { - PrepareBuilder(); - result.unpackedInt32_.Clear(); - return this; - } - - public pbc::IPopsicleList UnpackedInt64List { - get { return PrepareBuilder().unpackedInt64_; } - } - public int UnpackedInt64Count { - get { return result.UnpackedInt64Count; } - } - public long GetUnpackedInt64(int index) { - return result.GetUnpackedInt64(index); - } - public Builder SetUnpackedInt64(int index, long value) { - PrepareBuilder(); - result.unpackedInt64_[index] = value; - return this; - } - public Builder AddUnpackedInt64(long value) { - PrepareBuilder(); - result.unpackedInt64_.Add(value); - return this; - } - public Builder AddRangeUnpackedInt64(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedInt64_.Add(values); - return this; - } - public Builder ClearUnpackedInt64() { - PrepareBuilder(); - result.unpackedInt64_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList UnpackedUint32List { - get { return PrepareBuilder().unpackedUint32_; } - } - public int UnpackedUint32Count { - get { return result.UnpackedUint32Count; } - } - [global::System.CLSCompliant(false)] - public uint GetUnpackedUint32(int index) { - return result.GetUnpackedUint32(index); - } - [global::System.CLSCompliant(false)] - public Builder SetUnpackedUint32(int index, uint value) { - PrepareBuilder(); - result.unpackedUint32_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddUnpackedUint32(uint value) { - PrepareBuilder(); - result.unpackedUint32_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeUnpackedUint32(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedUint32_.Add(values); - return this; - } - public Builder ClearUnpackedUint32() { - PrepareBuilder(); - result.unpackedUint32_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList UnpackedUint64List { - get { return PrepareBuilder().unpackedUint64_; } - } - public int UnpackedUint64Count { - get { return result.UnpackedUint64Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetUnpackedUint64(int index) { - return result.GetUnpackedUint64(index); - } - [global::System.CLSCompliant(false)] - public Builder SetUnpackedUint64(int index, ulong value) { - PrepareBuilder(); - result.unpackedUint64_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddUnpackedUint64(ulong value) { - PrepareBuilder(); - result.unpackedUint64_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeUnpackedUint64(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedUint64_.Add(values); - return this; - } - public Builder ClearUnpackedUint64() { - PrepareBuilder(); - result.unpackedUint64_.Clear(); - return this; - } - - public pbc::IPopsicleList UnpackedSint32List { - get { return PrepareBuilder().unpackedSint32_; } - } - public int UnpackedSint32Count { - get { return result.UnpackedSint32Count; } - } - public int GetUnpackedSint32(int index) { - return result.GetUnpackedSint32(index); - } - public Builder SetUnpackedSint32(int index, int value) { - PrepareBuilder(); - result.unpackedSint32_[index] = value; - return this; - } - public Builder AddUnpackedSint32(int value) { - PrepareBuilder(); - result.unpackedSint32_.Add(value); - return this; - } - public Builder AddRangeUnpackedSint32(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedSint32_.Add(values); - return this; - } - public Builder ClearUnpackedSint32() { - PrepareBuilder(); - result.unpackedSint32_.Clear(); - return this; - } - - public pbc::IPopsicleList UnpackedSint64List { - get { return PrepareBuilder().unpackedSint64_; } - } - public int UnpackedSint64Count { - get { return result.UnpackedSint64Count; } - } - public long GetUnpackedSint64(int index) { - return result.GetUnpackedSint64(index); - } - public Builder SetUnpackedSint64(int index, long value) { - PrepareBuilder(); - result.unpackedSint64_[index] = value; - return this; - } - public Builder AddUnpackedSint64(long value) { - PrepareBuilder(); - result.unpackedSint64_.Add(value); - return this; - } - public Builder AddRangeUnpackedSint64(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedSint64_.Add(values); - return this; - } - public Builder ClearUnpackedSint64() { - PrepareBuilder(); - result.unpackedSint64_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList UnpackedFixed32List { - get { return PrepareBuilder().unpackedFixed32_; } - } - public int UnpackedFixed32Count { - get { return result.UnpackedFixed32Count; } - } - [global::System.CLSCompliant(false)] - public uint GetUnpackedFixed32(int index) { - return result.GetUnpackedFixed32(index); - } - [global::System.CLSCompliant(false)] - public Builder SetUnpackedFixed32(int index, uint value) { - PrepareBuilder(); - result.unpackedFixed32_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddUnpackedFixed32(uint value) { - PrepareBuilder(); - result.unpackedFixed32_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeUnpackedFixed32(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedFixed32_.Add(values); - return this; - } - public Builder ClearUnpackedFixed32() { - PrepareBuilder(); - result.unpackedFixed32_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList UnpackedFixed64List { - get { return PrepareBuilder().unpackedFixed64_; } - } - public int UnpackedFixed64Count { - get { return result.UnpackedFixed64Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetUnpackedFixed64(int index) { - return result.GetUnpackedFixed64(index); - } - [global::System.CLSCompliant(false)] - public Builder SetUnpackedFixed64(int index, ulong value) { - PrepareBuilder(); - result.unpackedFixed64_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddUnpackedFixed64(ulong value) { - PrepareBuilder(); - result.unpackedFixed64_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeUnpackedFixed64(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedFixed64_.Add(values); - return this; - } - public Builder ClearUnpackedFixed64() { - PrepareBuilder(); - result.unpackedFixed64_.Clear(); - return this; - } - - public pbc::IPopsicleList UnpackedSfixed32List { - get { return PrepareBuilder().unpackedSfixed32_; } - } - public int UnpackedSfixed32Count { - get { return result.UnpackedSfixed32Count; } - } - public int GetUnpackedSfixed32(int index) { - return result.GetUnpackedSfixed32(index); - } - public Builder SetUnpackedSfixed32(int index, int value) { - PrepareBuilder(); - result.unpackedSfixed32_[index] = value; - return this; - } - public Builder AddUnpackedSfixed32(int value) { - PrepareBuilder(); - result.unpackedSfixed32_.Add(value); - return this; - } - public Builder AddRangeUnpackedSfixed32(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedSfixed32_.Add(values); - return this; - } - public Builder ClearUnpackedSfixed32() { - PrepareBuilder(); - result.unpackedSfixed32_.Clear(); - return this; - } - - public pbc::IPopsicleList UnpackedSfixed64List { - get { return PrepareBuilder().unpackedSfixed64_; } - } - public int UnpackedSfixed64Count { - get { return result.UnpackedSfixed64Count; } - } - public long GetUnpackedSfixed64(int index) { - return result.GetUnpackedSfixed64(index); - } - public Builder SetUnpackedSfixed64(int index, long value) { - PrepareBuilder(); - result.unpackedSfixed64_[index] = value; - return this; - } - public Builder AddUnpackedSfixed64(long value) { - PrepareBuilder(); - result.unpackedSfixed64_.Add(value); - return this; - } - public Builder AddRangeUnpackedSfixed64(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedSfixed64_.Add(values); - return this; - } - public Builder ClearUnpackedSfixed64() { - PrepareBuilder(); - result.unpackedSfixed64_.Clear(); - return this; - } - - public pbc::IPopsicleList UnpackedFloatList { - get { return PrepareBuilder().unpackedFloat_; } - } - public int UnpackedFloatCount { - get { return result.UnpackedFloatCount; } - } - public float GetUnpackedFloat(int index) { - return result.GetUnpackedFloat(index); - } - public Builder SetUnpackedFloat(int index, float value) { - PrepareBuilder(); - result.unpackedFloat_[index] = value; - return this; - } - public Builder AddUnpackedFloat(float value) { - PrepareBuilder(); - result.unpackedFloat_.Add(value); - return this; - } - public Builder AddRangeUnpackedFloat(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedFloat_.Add(values); - return this; - } - public Builder ClearUnpackedFloat() { - PrepareBuilder(); - result.unpackedFloat_.Clear(); - return this; - } - - public pbc::IPopsicleList UnpackedDoubleList { - get { return PrepareBuilder().unpackedDouble_; } - } - public int UnpackedDoubleCount { - get { return result.UnpackedDoubleCount; } - } - public double GetUnpackedDouble(int index) { - return result.GetUnpackedDouble(index); - } - public Builder SetUnpackedDouble(int index, double value) { - PrepareBuilder(); - result.unpackedDouble_[index] = value; - return this; - } - public Builder AddUnpackedDouble(double value) { - PrepareBuilder(); - result.unpackedDouble_.Add(value); - return this; - } - public Builder AddRangeUnpackedDouble(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedDouble_.Add(values); - return this; - } - public Builder ClearUnpackedDouble() { - PrepareBuilder(); - result.unpackedDouble_.Clear(); - return this; - } - - public pbc::IPopsicleList UnpackedBoolList { - get { return PrepareBuilder().unpackedBool_; } - } - public int UnpackedBoolCount { - get { return result.UnpackedBoolCount; } - } - public bool GetUnpackedBool(int index) { - return result.GetUnpackedBool(index); - } - public Builder SetUnpackedBool(int index, bool value) { - PrepareBuilder(); - result.unpackedBool_[index] = value; - return this; - } - public Builder AddUnpackedBool(bool value) { - PrepareBuilder(); - result.unpackedBool_.Add(value); - return this; - } - public Builder AddRangeUnpackedBool(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedBool_.Add(values); - return this; - } - public Builder ClearUnpackedBool() { - PrepareBuilder(); - result.unpackedBool_.Clear(); - return this; - } - - public pbc::IPopsicleList UnpackedEnumList { - get { return PrepareBuilder().unpackedEnum_; } - } - public int UnpackedEnumCount { - get { return result.UnpackedEnumCount; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum GetUnpackedEnum(int index) { - return result.GetUnpackedEnum(index); - } - public Builder SetUnpackedEnum(int index, global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) { - PrepareBuilder(); - result.unpackedEnum_[index] = value; - return this; - } - public Builder AddUnpackedEnum(global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) { - PrepareBuilder(); - result.unpackedEnum_.Add(value); - return this; - } - public Builder AddRangeUnpackedEnum(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedEnum_.Add(values); - return this; - } - public Builder ClearUnpackedEnum() { - PrepareBuilder(); - result.unpackedEnum_.Clear(); - return this; - } - } - static TestUnpackedTypes() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestPackedExtensions : pb::ExtendableMessage { - private TestPackedExtensions() { } - private static readonly TestPackedExtensions defaultInstance = new TestPackedExtensions().MakeReadOnly(); - private static readonly string[] _testPackedExtensionsFieldNames = new string[] { }; - private static readonly uint[] _testPackedExtensionsFieldTags = new uint[] { }; - public static TestPackedExtensions DefaultInstance { - get { return defaultInstance; } - } - - public override TestPackedExtensions DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestPackedExtensions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestPackedExtensions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestPackedExtensions__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testPackedExtensionsFieldNames; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - extensionWriter.WriteUntil(536870912, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestPackedExtensions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestPackedExtensions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestPackedExtensions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestPackedExtensions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestPackedExtensions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestPackedExtensions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestPackedExtensions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestPackedExtensions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestPackedExtensions ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestPackedExtensions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestPackedExtensions MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestPackedExtensions prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestPackedExtensions cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestPackedExtensions result; - - private TestPackedExtensions PrepareBuilder() { - if (resultIsReadOnly) { - TestPackedExtensions original = result; - result = new TestPackedExtensions(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestPackedExtensions MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestPackedExtensions.Descriptor; } - } - - public override TestPackedExtensions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestPackedExtensions.DefaultInstance; } - } - - public override TestPackedExtensions BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestPackedExtensions) { - return MergeFrom((TestPackedExtensions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestPackedExtensions other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestPackedExtensions.DefaultInstance) return this; - PrepareBuilder(); - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testPackedExtensionsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testPackedExtensionsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static TestPackedExtensions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestDynamicExtensions : pb::GeneratedMessage { - private TestDynamicExtensions() { } - private static readonly TestDynamicExtensions defaultInstance = new TestDynamicExtensions().MakeReadOnly(); - private static readonly string[] _testDynamicExtensionsFieldNames = new string[] { "dynamic_enum_extension", "dynamic_message_extension", "enum_extension", "message_extension", "packed_extension", "repeated_extension", "scalar_extension" }; - private static readonly uint[] _testDynamicExtensionsFieldTags = new uint[] { 16016, 16034, 16008, 16026, 16050, 16042, 16005 }; - public static TestDynamicExtensions DefaultInstance { - get { return defaultInstance; } - } - - public override TestDynamicExtensions DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestDynamicExtensions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDynamicExtensions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDynamicExtensions__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - public enum DynamicEnumType { - DYNAMIC_FOO = 2200, - DYNAMIC_BAR = 2201, - DYNAMIC_BAZ = 2202, - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class DynamicMessageType : pb::GeneratedMessage { - private DynamicMessageType() { } - private static readonly DynamicMessageType defaultInstance = new DynamicMessageType().MakeReadOnly(); - private static readonly string[] _dynamicMessageTypeFieldNames = new string[] { "dynamic_field" }; - private static readonly uint[] _dynamicMessageTypeFieldTags = new uint[] { 16800 }; - public static DynamicMessageType DefaultInstance { - get { return defaultInstance; } - } - - public override DynamicMessageType DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override DynamicMessageType ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDynamicExtensions_DynamicMessageType__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDynamicExtensions_DynamicMessageType__FieldAccessorTable; } - } - - public const int DynamicFieldFieldNumber = 2100; - private bool hasDynamicField; - private int dynamicField_; - public bool HasDynamicField { - get { return hasDynamicField; } - } - public int DynamicField { - get { return dynamicField_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _dynamicMessageTypeFieldNames; - if (hasDynamicField) { - output.WriteInt32(2100, field_names[0], DynamicField); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasDynamicField) { - size += pb::CodedOutputStream.ComputeInt32Size(2100, DynamicField); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static DynamicMessageType ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static DynamicMessageType ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static DynamicMessageType ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static DynamicMessageType ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static DynamicMessageType ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static DynamicMessageType ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static DynamicMessageType ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static DynamicMessageType ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static DynamicMessageType ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static DynamicMessageType ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private DynamicMessageType MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(DynamicMessageType prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(DynamicMessageType cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private DynamicMessageType result; - - private DynamicMessageType PrepareBuilder() { - if (resultIsReadOnly) { - DynamicMessageType original = result; - result = new DynamicMessageType(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override DynamicMessageType MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType.Descriptor; } - } - - public override DynamicMessageType DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType.DefaultInstance; } - } - - public override DynamicMessageType BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is DynamicMessageType) { - return MergeFrom((DynamicMessageType) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(DynamicMessageType other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasDynamicField) { - DynamicField = other.DynamicField; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_dynamicMessageTypeFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _dynamicMessageTypeFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 16800: { - result.hasDynamicField = input.ReadInt32(ref result.dynamicField_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasDynamicField { - get { return result.hasDynamicField; } - } - public int DynamicField { - get { return result.DynamicField; } - set { SetDynamicField(value); } - } - public Builder SetDynamicField(int value) { - PrepareBuilder(); - result.hasDynamicField = true; - result.dynamicField_ = value; - return this; - } - public Builder ClearDynamicField() { - PrepareBuilder(); - result.hasDynamicField = false; - result.dynamicField_ = 0; - return this; - } - } - static DynamicMessageType() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - } - #endregion - - public const int ScalarExtensionFieldNumber = 2000; - private bool hasScalarExtension; - private uint scalarExtension_; - public bool HasScalarExtension { - get { return hasScalarExtension; } - } - [global::System.CLSCompliant(false)] - public uint ScalarExtension { - get { return scalarExtension_; } - } - - public const int EnumExtensionFieldNumber = 2001; - private bool hasEnumExtension; - private global::Google.ProtocolBuffers.TestProtos.ForeignEnum enumExtension_ = global::Google.ProtocolBuffers.TestProtos.ForeignEnum.FOREIGN_FOO; - public bool HasEnumExtension { - get { return hasEnumExtension; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum EnumExtension { - get { return enumExtension_; } - } - - public const int DynamicEnumExtensionFieldNumber = 2002; - private bool hasDynamicEnumExtension; - private global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicEnumType dynamicEnumExtension_ = global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicEnumType.DYNAMIC_FOO; - public bool HasDynamicEnumExtension { - get { return hasDynamicEnumExtension; } - } - public global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicEnumType DynamicEnumExtension { - get { return dynamicEnumExtension_; } - } - - public const int MessageExtensionFieldNumber = 2003; - private bool hasMessageExtension; - private global::Google.ProtocolBuffers.TestProtos.ForeignMessage messageExtension_; - public bool HasMessageExtension { - get { return hasMessageExtension; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage MessageExtension { - get { return messageExtension_ ?? global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance; } - } - - public const int DynamicMessageExtensionFieldNumber = 2004; - private bool hasDynamicMessageExtension; - private global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType dynamicMessageExtension_; - public bool HasDynamicMessageExtension { - get { return hasDynamicMessageExtension; } - } - public global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType DynamicMessageExtension { - get { return dynamicMessageExtension_ ?? global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType.DefaultInstance; } - } - - public const int RepeatedExtensionFieldNumber = 2005; - private pbc::PopsicleList repeatedExtension_ = new pbc::PopsicleList(); - public scg::IList RepeatedExtensionList { - get { return pbc::Lists.AsReadOnly(repeatedExtension_); } - } - public int RepeatedExtensionCount { - get { return repeatedExtension_.Count; } - } - public string GetRepeatedExtension(int index) { - return repeatedExtension_[index]; - } - - public const int PackedExtensionFieldNumber = 2006; - private int packedExtensionMemoizedSerializedSize; - private pbc::PopsicleList packedExtension_ = new pbc::PopsicleList(); - public scg::IList PackedExtensionList { - get { return pbc::Lists.AsReadOnly(packedExtension_); } - } - public int PackedExtensionCount { - get { return packedExtension_.Count; } - } - public int GetPackedExtension(int index) { - return packedExtension_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testDynamicExtensionsFieldNames; - if (hasScalarExtension) { - output.WriteFixed32(2000, field_names[6], ScalarExtension); - } - if (hasEnumExtension) { - output.WriteEnum(2001, field_names[2], (int) EnumExtension, EnumExtension); - } - if (hasDynamicEnumExtension) { - output.WriteEnum(2002, field_names[0], (int) DynamicEnumExtension, DynamicEnumExtension); - } - if (hasMessageExtension) { - output.WriteMessage(2003, field_names[3], MessageExtension); - } - if (hasDynamicMessageExtension) { - output.WriteMessage(2004, field_names[1], DynamicMessageExtension); - } - if (repeatedExtension_.Count > 0) { - output.WriteStringArray(2005, field_names[5], repeatedExtension_); - } - if (packedExtension_.Count > 0) { - output.WritePackedSInt32Array(2006, field_names[4], packedExtensionMemoizedSerializedSize, packedExtension_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasScalarExtension) { - size += pb::CodedOutputStream.ComputeFixed32Size(2000, ScalarExtension); - } - if (hasEnumExtension) { - size += pb::CodedOutputStream.ComputeEnumSize(2001, (int) EnumExtension); - } - if (hasDynamicEnumExtension) { - size += pb::CodedOutputStream.ComputeEnumSize(2002, (int) DynamicEnumExtension); - } - if (hasMessageExtension) { - size += pb::CodedOutputStream.ComputeMessageSize(2003, MessageExtension); - } - if (hasDynamicMessageExtension) { - size += pb::CodedOutputStream.ComputeMessageSize(2004, DynamicMessageExtension); - } - { - int dataSize = 0; - foreach (string element in RepeatedExtensionList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedExtension_.Count; - } - { - int dataSize = 0; - foreach (int element in PackedExtensionList) { - dataSize += pb::CodedOutputStream.ComputeSInt32SizeNoTag(element); - } - size += dataSize; - if (packedExtension_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedExtensionMemoizedSerializedSize = dataSize; - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestDynamicExtensions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestDynamicExtensions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestDynamicExtensions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestDynamicExtensions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestDynamicExtensions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestDynamicExtensions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestDynamicExtensions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestDynamicExtensions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestDynamicExtensions ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestDynamicExtensions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestDynamicExtensions MakeReadOnly() { - repeatedExtension_.MakeReadOnly(); - packedExtension_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestDynamicExtensions prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestDynamicExtensions cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestDynamicExtensions result; - - private TestDynamicExtensions PrepareBuilder() { - if (resultIsReadOnly) { - TestDynamicExtensions original = result; - result = new TestDynamicExtensions(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestDynamicExtensions MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Descriptor; } - } - - public override TestDynamicExtensions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.DefaultInstance; } - } - - public override TestDynamicExtensions BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestDynamicExtensions) { - return MergeFrom((TestDynamicExtensions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestDynamicExtensions other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasScalarExtension) { - ScalarExtension = other.ScalarExtension; - } - if (other.HasEnumExtension) { - EnumExtension = other.EnumExtension; - } - if (other.HasDynamicEnumExtension) { - DynamicEnumExtension = other.DynamicEnumExtension; - } - if (other.HasMessageExtension) { - MergeMessageExtension(other.MessageExtension); - } - if (other.HasDynamicMessageExtension) { - MergeDynamicMessageExtension(other.DynamicMessageExtension); - } - if (other.repeatedExtension_.Count != 0) { - result.repeatedExtension_.Add(other.repeatedExtension_); - } - if (other.packedExtension_.Count != 0) { - result.packedExtension_.Add(other.packedExtension_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testDynamicExtensionsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testDynamicExtensionsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 16005: { - result.hasScalarExtension = input.ReadFixed32(ref result.scalarExtension_); - break; - } - case 16008: { - object unknown; - if(input.ReadEnum(ref result.enumExtension_, out unknown)) { - result.hasEnumExtension = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(2001, (ulong)(int)unknown); - } - break; - } - case 16016: { - object unknown; - if(input.ReadEnum(ref result.dynamicEnumExtension_, out unknown)) { - result.hasDynamicEnumExtension = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(2002, (ulong)(int)unknown); - } - break; - } - case 16026: { - global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.ForeignMessage.CreateBuilder(); - if (result.hasMessageExtension) { - subBuilder.MergeFrom(MessageExtension); - } - input.ReadMessage(subBuilder, extensionRegistry); - MessageExtension = subBuilder.BuildPartial(); - break; - } - case 16034: { - global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType.CreateBuilder(); - if (result.hasDynamicMessageExtension) { - subBuilder.MergeFrom(DynamicMessageExtension); - } - input.ReadMessage(subBuilder, extensionRegistry); - DynamicMessageExtension = subBuilder.BuildPartial(); - break; - } - case 16042: { - input.ReadStringArray(tag, field_name, result.repeatedExtension_); - break; - } - case 16050: - case 16048: { - input.ReadSInt32Array(tag, field_name, result.packedExtension_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasScalarExtension { - get { return result.hasScalarExtension; } - } - [global::System.CLSCompliant(false)] - public uint ScalarExtension { - get { return result.ScalarExtension; } - set { SetScalarExtension(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetScalarExtension(uint value) { - PrepareBuilder(); - result.hasScalarExtension = true; - result.scalarExtension_ = value; - return this; - } - public Builder ClearScalarExtension() { - PrepareBuilder(); - result.hasScalarExtension = false; - result.scalarExtension_ = 0; - return this; - } - - public bool HasEnumExtension { - get { return result.hasEnumExtension; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum EnumExtension { - get { return result.EnumExtension; } - set { SetEnumExtension(value); } - } - public Builder SetEnumExtension(global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) { - PrepareBuilder(); - result.hasEnumExtension = true; - result.enumExtension_ = value; - return this; - } - public Builder ClearEnumExtension() { - PrepareBuilder(); - result.hasEnumExtension = false; - result.enumExtension_ = global::Google.ProtocolBuffers.TestProtos.ForeignEnum.FOREIGN_FOO; - return this; - } - - public bool HasDynamicEnumExtension { - get { return result.hasDynamicEnumExtension; } - } - public global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicEnumType DynamicEnumExtension { - get { return result.DynamicEnumExtension; } - set { SetDynamicEnumExtension(value); } - } - public Builder SetDynamicEnumExtension(global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicEnumType value) { - PrepareBuilder(); - result.hasDynamicEnumExtension = true; - result.dynamicEnumExtension_ = value; - return this; - } - public Builder ClearDynamicEnumExtension() { - PrepareBuilder(); - result.hasDynamicEnumExtension = false; - result.dynamicEnumExtension_ = global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicEnumType.DYNAMIC_FOO; - return this; - } - - public bool HasMessageExtension { - get { return result.hasMessageExtension; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage MessageExtension { - get { return result.MessageExtension; } - set { SetMessageExtension(value); } - } - public Builder SetMessageExtension(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasMessageExtension = true; - result.messageExtension_ = value; - return this; - } - public Builder SetMessageExtension(global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasMessageExtension = true; - result.messageExtension_ = builderForValue.Build(); - return this; - } - public Builder MergeMessageExtension(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasMessageExtension && - result.messageExtension_ != global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance) { - result.messageExtension_ = global::Google.ProtocolBuffers.TestProtos.ForeignMessage.CreateBuilder(result.messageExtension_).MergeFrom(value).BuildPartial(); - } else { - result.messageExtension_ = value; - } - result.hasMessageExtension = true; - return this; - } - public Builder ClearMessageExtension() { - PrepareBuilder(); - result.hasMessageExtension = false; - result.messageExtension_ = null; - return this; - } - - public bool HasDynamicMessageExtension { - get { return result.hasDynamicMessageExtension; } - } - public global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType DynamicMessageExtension { - get { return result.DynamicMessageExtension; } - set { SetDynamicMessageExtension(value); } - } - public Builder SetDynamicMessageExtension(global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasDynamicMessageExtension = true; - result.dynamicMessageExtension_ = value; - return this; - } - public Builder SetDynamicMessageExtension(global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasDynamicMessageExtension = true; - result.dynamicMessageExtension_ = builderForValue.Build(); - return this; - } - public Builder MergeDynamicMessageExtension(global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasDynamicMessageExtension && - result.dynamicMessageExtension_ != global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType.DefaultInstance) { - result.dynamicMessageExtension_ = global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType.CreateBuilder(result.dynamicMessageExtension_).MergeFrom(value).BuildPartial(); - } else { - result.dynamicMessageExtension_ = value; - } - result.hasDynamicMessageExtension = true; - return this; - } - public Builder ClearDynamicMessageExtension() { - PrepareBuilder(); - result.hasDynamicMessageExtension = false; - result.dynamicMessageExtension_ = null; - return this; - } - - public pbc::IPopsicleList RepeatedExtensionList { - get { return PrepareBuilder().repeatedExtension_; } - } - public int RepeatedExtensionCount { - get { return result.RepeatedExtensionCount; } - } - public string GetRepeatedExtension(int index) { - return result.GetRepeatedExtension(index); - } - public Builder SetRepeatedExtension(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedExtension_[index] = value; - return this; - } - public Builder AddRepeatedExtension(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedExtension_.Add(value); - return this; - } - public Builder AddRangeRepeatedExtension(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedExtension_.Add(values); - return this; - } - public Builder ClearRepeatedExtension() { - PrepareBuilder(); - result.repeatedExtension_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedExtensionList { - get { return PrepareBuilder().packedExtension_; } - } - public int PackedExtensionCount { - get { return result.PackedExtensionCount; } - } - public int GetPackedExtension(int index) { - return result.GetPackedExtension(index); - } - public Builder SetPackedExtension(int index, int value) { - PrepareBuilder(); - result.packedExtension_[index] = value; - return this; - } - public Builder AddPackedExtension(int value) { - PrepareBuilder(); - result.packedExtension_.Add(value); - return this; - } - public Builder AddRangePackedExtension(scg::IEnumerable values) { - PrepareBuilder(); - result.packedExtension_.Add(values); - return this; - } - public Builder ClearPackedExtension() { - PrepareBuilder(); - result.packedExtension_.Clear(); - return this; - } - } - static TestDynamicExtensions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestRepeatedScalarDifferentTagSizes : pb::GeneratedMessage { - private TestRepeatedScalarDifferentTagSizes() { } - private static readonly TestRepeatedScalarDifferentTagSizes defaultInstance = new TestRepeatedScalarDifferentTagSizes().MakeReadOnly(); - private static readonly string[] _testRepeatedScalarDifferentTagSizesFieldNames = new string[] { "repeated_fixed32", "repeated_fixed64", "repeated_float", "repeated_int32", "repeated_int64", "repeated_uint64" }; - private static readonly uint[] _testRepeatedScalarDifferentTagSizesFieldTags = new uint[] { 101, 16369, 2097141, 104, 16376, 2097144 }; - public static TestRepeatedScalarDifferentTagSizes DefaultInstance { - get { return defaultInstance; } - } - - public override TestRepeatedScalarDifferentTagSizes DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestRepeatedScalarDifferentTagSizes ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestRepeatedScalarDifferentTagSizes__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestRepeatedScalarDifferentTagSizes__FieldAccessorTable; } - } - - public const int RepeatedFixed32FieldNumber = 12; - private pbc::PopsicleList repeatedFixed32_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList RepeatedFixed32List { - get { return pbc::Lists.AsReadOnly(repeatedFixed32_); } - } - public int RepeatedFixed32Count { - get { return repeatedFixed32_.Count; } - } - [global::System.CLSCompliant(false)] - public uint GetRepeatedFixed32(int index) { - return repeatedFixed32_[index]; - } - - public const int RepeatedInt32FieldNumber = 13; - private pbc::PopsicleList repeatedInt32_ = new pbc::PopsicleList(); - public scg::IList RepeatedInt32List { - get { return pbc::Lists.AsReadOnly(repeatedInt32_); } - } - public int RepeatedInt32Count { - get { return repeatedInt32_.Count; } - } - public int GetRepeatedInt32(int index) { - return repeatedInt32_[index]; - } - - public const int RepeatedFixed64FieldNumber = 2046; - private pbc::PopsicleList repeatedFixed64_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList RepeatedFixed64List { - get { return pbc::Lists.AsReadOnly(repeatedFixed64_); } - } - public int RepeatedFixed64Count { - get { return repeatedFixed64_.Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetRepeatedFixed64(int index) { - return repeatedFixed64_[index]; - } - - public const int RepeatedInt64FieldNumber = 2047; - private pbc::PopsicleList repeatedInt64_ = new pbc::PopsicleList(); - public scg::IList RepeatedInt64List { - get { return pbc::Lists.AsReadOnly(repeatedInt64_); } - } - public int RepeatedInt64Count { - get { return repeatedInt64_.Count; } - } - public long GetRepeatedInt64(int index) { - return repeatedInt64_[index]; - } - - public const int RepeatedFloatFieldNumber = 262142; - private pbc::PopsicleList repeatedFloat_ = new pbc::PopsicleList(); - public scg::IList RepeatedFloatList { - get { return pbc::Lists.AsReadOnly(repeatedFloat_); } - } - public int RepeatedFloatCount { - get { return repeatedFloat_.Count; } - } - public float GetRepeatedFloat(int index) { - return repeatedFloat_[index]; - } - - public const int RepeatedUint64FieldNumber = 262143; - private pbc::PopsicleList repeatedUint64_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList RepeatedUint64List { - get { return pbc::Lists.AsReadOnly(repeatedUint64_); } - } - public int RepeatedUint64Count { - get { return repeatedUint64_.Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetRepeatedUint64(int index) { - return repeatedUint64_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testRepeatedScalarDifferentTagSizesFieldNames; - if (repeatedFixed32_.Count > 0) { - output.WriteFixed32Array(12, field_names[0], repeatedFixed32_); - } - if (repeatedInt32_.Count > 0) { - output.WriteInt32Array(13, field_names[3], repeatedInt32_); - } - if (repeatedFixed64_.Count > 0) { - output.WriteFixed64Array(2046, field_names[1], repeatedFixed64_); - } - if (repeatedInt64_.Count > 0) { - output.WriteInt64Array(2047, field_names[4], repeatedInt64_); - } - if (repeatedFloat_.Count > 0) { - output.WriteFloatArray(262142, field_names[2], repeatedFloat_); - } - if (repeatedUint64_.Count > 0) { - output.WriteUInt64Array(262143, field_names[5], repeatedUint64_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - dataSize = 4 * repeatedFixed32_.Count; - size += dataSize; - size += 1 * repeatedFixed32_.Count; - } - { - int dataSize = 0; - foreach (int element in RepeatedInt32List) { - dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); - } - size += dataSize; - size += 1 * repeatedInt32_.Count; - } - { - int dataSize = 0; - dataSize = 8 * repeatedFixed64_.Count; - size += dataSize; - size += 2 * repeatedFixed64_.Count; - } - { - int dataSize = 0; - foreach (long element in RepeatedInt64List) { - dataSize += pb::CodedOutputStream.ComputeInt64SizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedInt64_.Count; - } - { - int dataSize = 0; - dataSize = 4 * repeatedFloat_.Count; - size += dataSize; - size += 3 * repeatedFloat_.Count; - } - { - int dataSize = 0; - foreach (ulong element in RepeatedUint64List) { - dataSize += pb::CodedOutputStream.ComputeUInt64SizeNoTag(element); - } - size += dataSize; - size += 3 * repeatedUint64_.Count; - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestRepeatedScalarDifferentTagSizes ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestRepeatedScalarDifferentTagSizes ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestRepeatedScalarDifferentTagSizes ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestRepeatedScalarDifferentTagSizes ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestRepeatedScalarDifferentTagSizes ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestRepeatedScalarDifferentTagSizes ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestRepeatedScalarDifferentTagSizes ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestRepeatedScalarDifferentTagSizes ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestRepeatedScalarDifferentTagSizes ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestRepeatedScalarDifferentTagSizes ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestRepeatedScalarDifferentTagSizes MakeReadOnly() { - repeatedFixed32_.MakeReadOnly(); - repeatedInt32_.MakeReadOnly(); - repeatedFixed64_.MakeReadOnly(); - repeatedInt64_.MakeReadOnly(); - repeatedFloat_.MakeReadOnly(); - repeatedUint64_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestRepeatedScalarDifferentTagSizes prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestRepeatedScalarDifferentTagSizes cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestRepeatedScalarDifferentTagSizes result; - - private TestRepeatedScalarDifferentTagSizes PrepareBuilder() { - if (resultIsReadOnly) { - TestRepeatedScalarDifferentTagSizes original = result; - result = new TestRepeatedScalarDifferentTagSizes(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestRepeatedScalarDifferentTagSizes MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestRepeatedScalarDifferentTagSizes.Descriptor; } - } - - public override TestRepeatedScalarDifferentTagSizes DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestRepeatedScalarDifferentTagSizes.DefaultInstance; } - } - - public override TestRepeatedScalarDifferentTagSizes BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestRepeatedScalarDifferentTagSizes) { - return MergeFrom((TestRepeatedScalarDifferentTagSizes) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestRepeatedScalarDifferentTagSizes other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestRepeatedScalarDifferentTagSizes.DefaultInstance) return this; - PrepareBuilder(); - if (other.repeatedFixed32_.Count != 0) { - result.repeatedFixed32_.Add(other.repeatedFixed32_); - } - if (other.repeatedInt32_.Count != 0) { - result.repeatedInt32_.Add(other.repeatedInt32_); - } - if (other.repeatedFixed64_.Count != 0) { - result.repeatedFixed64_.Add(other.repeatedFixed64_); - } - if (other.repeatedInt64_.Count != 0) { - result.repeatedInt64_.Add(other.repeatedInt64_); - } - if (other.repeatedFloat_.Count != 0) { - result.repeatedFloat_.Add(other.repeatedFloat_); - } - if (other.repeatedUint64_.Count != 0) { - result.repeatedUint64_.Add(other.repeatedUint64_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testRepeatedScalarDifferentTagSizesFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testRepeatedScalarDifferentTagSizesFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 98: - case 101: { - input.ReadFixed32Array(tag, field_name, result.repeatedFixed32_); - break; - } - case 106: - case 104: { - input.ReadInt32Array(tag, field_name, result.repeatedInt32_); - break; - } - case 16370: - case 16369: { - input.ReadFixed64Array(tag, field_name, result.repeatedFixed64_); - break; - } - case 16378: - case 16376: { - input.ReadInt64Array(tag, field_name, result.repeatedInt64_); - break; - } - case 2097138: - case 2097141: { - input.ReadFloatArray(tag, field_name, result.repeatedFloat_); - break; - } - case 2097146: - case 2097144: { - input.ReadUInt64Array(tag, field_name, result.repeatedUint64_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList RepeatedFixed32List { - get { return PrepareBuilder().repeatedFixed32_; } - } - public int RepeatedFixed32Count { - get { return result.RepeatedFixed32Count; } - } - [global::System.CLSCompliant(false)] - public uint GetRepeatedFixed32(int index) { - return result.GetRepeatedFixed32(index); - } - [global::System.CLSCompliant(false)] - public Builder SetRepeatedFixed32(int index, uint value) { - PrepareBuilder(); - result.repeatedFixed32_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRepeatedFixed32(uint value) { - PrepareBuilder(); - result.repeatedFixed32_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeRepeatedFixed32(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedFixed32_.Add(values); - return this; - } - public Builder ClearRepeatedFixed32() { - PrepareBuilder(); - result.repeatedFixed32_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedInt32List { - get { return PrepareBuilder().repeatedInt32_; } - } - public int RepeatedInt32Count { - get { return result.RepeatedInt32Count; } - } - public int GetRepeatedInt32(int index) { - return result.GetRepeatedInt32(index); - } - public Builder SetRepeatedInt32(int index, int value) { - PrepareBuilder(); - result.repeatedInt32_[index] = value; - return this; - } - public Builder AddRepeatedInt32(int value) { - PrepareBuilder(); - result.repeatedInt32_.Add(value); - return this; - } - public Builder AddRangeRepeatedInt32(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedInt32_.Add(values); - return this; - } - public Builder ClearRepeatedInt32() { - PrepareBuilder(); - result.repeatedInt32_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList RepeatedFixed64List { - get { return PrepareBuilder().repeatedFixed64_; } - } - public int RepeatedFixed64Count { - get { return result.RepeatedFixed64Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetRepeatedFixed64(int index) { - return result.GetRepeatedFixed64(index); - } - [global::System.CLSCompliant(false)] - public Builder SetRepeatedFixed64(int index, ulong value) { - PrepareBuilder(); - result.repeatedFixed64_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRepeatedFixed64(ulong value) { - PrepareBuilder(); - result.repeatedFixed64_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeRepeatedFixed64(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedFixed64_.Add(values); - return this; - } - public Builder ClearRepeatedFixed64() { - PrepareBuilder(); - result.repeatedFixed64_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedInt64List { - get { return PrepareBuilder().repeatedInt64_; } - } - public int RepeatedInt64Count { - get { return result.RepeatedInt64Count; } - } - public long GetRepeatedInt64(int index) { - return result.GetRepeatedInt64(index); - } - public Builder SetRepeatedInt64(int index, long value) { - PrepareBuilder(); - result.repeatedInt64_[index] = value; - return this; - } - public Builder AddRepeatedInt64(long value) { - PrepareBuilder(); - result.repeatedInt64_.Add(value); - return this; - } - public Builder AddRangeRepeatedInt64(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedInt64_.Add(values); - return this; - } - public Builder ClearRepeatedInt64() { - PrepareBuilder(); - result.repeatedInt64_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedFloatList { - get { return PrepareBuilder().repeatedFloat_; } - } - public int RepeatedFloatCount { - get { return result.RepeatedFloatCount; } - } - public float GetRepeatedFloat(int index) { - return result.GetRepeatedFloat(index); - } - public Builder SetRepeatedFloat(int index, float value) { - PrepareBuilder(); - result.repeatedFloat_[index] = value; - return this; - } - public Builder AddRepeatedFloat(float value) { - PrepareBuilder(); - result.repeatedFloat_.Add(value); - return this; - } - public Builder AddRangeRepeatedFloat(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedFloat_.Add(values); - return this; - } - public Builder ClearRepeatedFloat() { - PrepareBuilder(); - result.repeatedFloat_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList RepeatedUint64List { - get { return PrepareBuilder().repeatedUint64_; } - } - public int RepeatedUint64Count { - get { return result.RepeatedUint64Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetRepeatedUint64(int index) { - return result.GetRepeatedUint64(index); - } - [global::System.CLSCompliant(false)] - public Builder SetRepeatedUint64(int index, ulong value) { - PrepareBuilder(); - result.repeatedUint64_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRepeatedUint64(ulong value) { - PrepareBuilder(); - result.repeatedUint64_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeRepeatedUint64(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedUint64_.Add(values); - return this; - } - public Builder ClearRepeatedUint64() { - PrepareBuilder(); - result.repeatedUint64_.Clear(); - return this; - } - } - static TestRepeatedScalarDifferentTagSizes() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class FooRequest : pb::GeneratedMessage { - private FooRequest() { } - private static readonly FooRequest defaultInstance = new FooRequest().MakeReadOnly(); - private static readonly string[] _fooRequestFieldNames = new string[] { }; - private static readonly uint[] _fooRequestFieldTags = new uint[] { }; - public static FooRequest DefaultInstance { - get { return defaultInstance; } - } - - public override FooRequest DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override FooRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_FooRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_FooRequest__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _fooRequestFieldNames; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static FooRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FooRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FooRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FooRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FooRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FooRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static FooRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static FooRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static FooRequest ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FooRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private FooRequest MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(FooRequest prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(FooRequest cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private FooRequest result; - - private FooRequest PrepareBuilder() { - if (resultIsReadOnly) { - FooRequest original = result; - result = new FooRequest(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override FooRequest MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.FooRequest.Descriptor; } - } - - public override FooRequest DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.FooRequest.DefaultInstance; } - } - - public override FooRequest BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is FooRequest) { - return MergeFrom((FooRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(FooRequest other) { - if (other == global::Google.ProtocolBuffers.TestProtos.FooRequest.DefaultInstance) return this; - PrepareBuilder(); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_fooRequestFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _fooRequestFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static FooRequest() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class FooResponse : pb::GeneratedMessage { - private FooResponse() { } - private static readonly FooResponse defaultInstance = new FooResponse().MakeReadOnly(); - private static readonly string[] _fooResponseFieldNames = new string[] { }; - private static readonly uint[] _fooResponseFieldTags = new uint[] { }; - public static FooResponse DefaultInstance { - get { return defaultInstance; } - } - - public override FooResponse DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override FooResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_FooResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_FooResponse__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _fooResponseFieldNames; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static FooResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FooResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FooResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FooResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FooResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FooResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static FooResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static FooResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static FooResponse ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FooResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private FooResponse MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(FooResponse prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(FooResponse cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private FooResponse result; - - private FooResponse PrepareBuilder() { - if (resultIsReadOnly) { - FooResponse original = result; - result = new FooResponse(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override FooResponse MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.FooResponse.Descriptor; } - } - - public override FooResponse DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.FooResponse.DefaultInstance; } - } - - public override FooResponse BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is FooResponse) { - return MergeFrom((FooResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(FooResponse other) { - if (other == global::Google.ProtocolBuffers.TestProtos.FooResponse.DefaultInstance) return this; - PrepareBuilder(); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_fooResponseFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _fooResponseFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static FooResponse() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class BarRequest : pb::GeneratedMessage { - private BarRequest() { } - private static readonly BarRequest defaultInstance = new BarRequest().MakeReadOnly(); - private static readonly string[] _barRequestFieldNames = new string[] { }; - private static readonly uint[] _barRequestFieldTags = new uint[] { }; - public static BarRequest DefaultInstance { - get { return defaultInstance; } - } - - public override BarRequest DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override BarRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_BarRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_BarRequest__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _barRequestFieldNames; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static BarRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static BarRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static BarRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static BarRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static BarRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static BarRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static BarRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static BarRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static BarRequest ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static BarRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private BarRequest MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(BarRequest prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(BarRequest cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private BarRequest result; - - private BarRequest PrepareBuilder() { - if (resultIsReadOnly) { - BarRequest original = result; - result = new BarRequest(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override BarRequest MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.BarRequest.Descriptor; } - } - - public override BarRequest DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.BarRequest.DefaultInstance; } - } - - public override BarRequest BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is BarRequest) { - return MergeFrom((BarRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(BarRequest other) { - if (other == global::Google.ProtocolBuffers.TestProtos.BarRequest.DefaultInstance) return this; - PrepareBuilder(); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_barRequestFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _barRequestFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static BarRequest() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class BarResponse : pb::GeneratedMessage { - private BarResponse() { } - private static readonly BarResponse defaultInstance = new BarResponse().MakeReadOnly(); - private static readonly string[] _barResponseFieldNames = new string[] { }; - private static readonly uint[] _barResponseFieldTags = new uint[] { }; - public static BarResponse DefaultInstance { - get { return defaultInstance; } - } - - public override BarResponse DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override BarResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_BarResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_BarResponse__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _barResponseFieldNames; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static BarResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static BarResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static BarResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static BarResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static BarResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static BarResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static BarResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static BarResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static BarResponse ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static BarResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private BarResponse MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(BarResponse prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(BarResponse cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private BarResponse result; - - private BarResponse PrepareBuilder() { - if (resultIsReadOnly) { - BarResponse original = result; - result = new BarResponse(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override BarResponse MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.BarResponse.Descriptor; } - } - - public override BarResponse DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.BarResponse.DefaultInstance; } - } - - public override BarResponse BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is BarResponse) { - return MergeFrom((BarResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(BarResponse other) { - if (other == global::Google.ProtocolBuffers.TestProtos.BarResponse.DefaultInstance) return this; - PrepareBuilder(); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_barResponseFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _barResponseFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static BarResponse() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - #endregion - - #region Services - /* - * Service generation is now disabled by default, use the following option to enable: - * option (google.protobuf.csharp_file_options).service_generator_type = GENERIC; - */ - #endregion - -} - -#endregion Designer generated code diff --git a/src/ProtoBench/google_message1.dat b/src/ProtoBench/google_message1.dat deleted file mode 100644 index bc0f064..0000000 Binary files a/src/ProtoBench/google_message1.dat and /dev/null differ diff --git a/src/ProtoBench/google_message2.dat b/src/ProtoBench/google_message2.dat deleted file mode 100644 index 06c0944..0000000 Binary files a/src/ProtoBench/google_message2.dat and /dev/null differ diff --git a/src/ProtoDump/Program.cs b/src/ProtoDump/Program.cs deleted file mode 100644 index a935e78..0000000 --- a/src/ProtoDump/Program.cs +++ /dev/null @@ -1,88 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.IO; - -namespace Google.ProtocolBuffers.ProtoDump -{ - /// - /// Small utility to load a binary message and dump it in text form - /// - internal class Program - { - private static int Main(string[] args) - { - if (args.Length != 2) - { - Console.Error.WriteLine("Usage: ProtoDump "); - Console.Error.WriteLine("The descriptor type name is the fully-qualified message name,"); - Console.Error.WriteLine("including assembly e.g. ProjectNamespace.Message,Company.Project"); - return 1; - } - IMessage defaultMessage; - try - { - defaultMessage = MessageUtil.GetDefaultMessage(args[0]); - } - catch (ArgumentException e) - { - Console.Error.WriteLine(e.Message); - return 1; - } - try - { - IBuilder builder = defaultMessage.WeakCreateBuilderForType(); - if (builder == null) - { - Console.Error.WriteLine("Unable to create builder"); - return 1; - } - byte[] inputData = File.ReadAllBytes(args[1]); - builder.WeakMergeFrom(ByteString.CopyFrom(inputData)); - Console.WriteLine(TextFormat.PrintToString(builder.WeakBuild())); - return 0; - } - catch (Exception e) - { - Console.Error.WriteLine("Error: {0}", e.Message); - Console.Error.WriteLine(); - Console.Error.WriteLine("Detailed exception information: {0}", e); - return 1; - } - } - } -} \ No newline at end of file diff --git a/src/ProtoDump/Properties/AssemblyInfo.cs b/src/ProtoDump/Properties/AssemblyInfo.cs deleted file mode 100644 index a8ce8ea..0000000 --- a/src/ProtoDump/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. - -[assembly: AssemblyTitle("ProtoDump")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ProtoDump")] -[assembly: AssemblyCopyright("Copyright © 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("2.4.1.555")] - -[assembly: AssemblyVersion("2.4.1.555")] -[assembly: AssemblyFileVersion("2.4.1.555")] \ No newline at end of file diff --git a/src/ProtoDump/ProtoDump.csproj b/src/ProtoDump/ProtoDump.csproj deleted file mode 100644 index f040d95..0000000 --- a/src/ProtoDump/ProtoDump.csproj +++ /dev/null @@ -1,65 +0,0 @@ - - - - CLIENTPROFILE - NET35 - Debug - AnyCPU - 9.0.30729 - 2.0 - {D7282E99-2DC3-405B-946F-177DB2FD2AE2} - Exe - Properties - Google.ProtocolBuffers.ProtoDump - ProtoDump - v3.5 - 512 - - - true - full - false - bin\NET35\Debug - obj\NET35\Debug\ - DEBUG;TRACE - prompt - 4 - true - true - Off - - - pdbonly - true - bin\NET35\Release - obj\NET35\Release\ - TRACE - prompt - 4 - true - true - Off - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - \ No newline at end of file diff --git a/src/ProtoGen.Test/DependencyResolutionTest.cs b/src/ProtoGen.Test/DependencyResolutionTest.cs deleted file mode 100644 index 47c6f1a..0000000 --- a/src/ProtoGen.Test/DependencyResolutionTest.cs +++ /dev/null @@ -1,150 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System.Collections.Generic; -using Google.ProtocolBuffers.DescriptorProtos; -using Google.ProtocolBuffers.Descriptors; -using NUnit.Framework; - -namespace Google.ProtocolBuffers.ProtoGen -{ - /// - /// Tests for the dependency resolution in Generator. - /// - [TestFixture] - public class DependencyResolutionTest - { - [Test] - public void TwoDistinctFiles() - { - FileDescriptorProto first = new FileDescriptorProto.Builder {Name = "First"}.Build(); - FileDescriptorProto second = new FileDescriptorProto.Builder {Name = "Second"}.Build(); - var set = new List { first, second }; - - IList converted = Generator.ConvertDescriptors(CSharpFileOptions.DefaultInstance, set); - Assert.AreEqual(2, converted.Count); - Assert.AreEqual("First", converted[0].Name); - Assert.AreEqual(0, converted[0].Dependencies.Count); - Assert.AreEqual("Second", converted[1].Name); - Assert.AreEqual(0, converted[1].Dependencies.Count); - } - - [Test] - public void FirstDependsOnSecond() - { - FileDescriptorProto first = - new FileDescriptorProto.Builder {Name = "First", DependencyList = {"Second"}}.Build(); - FileDescriptorProto second = new FileDescriptorProto.Builder {Name = "Second"}.Build(); - var set = new List { first, second }; - IList converted = Generator.ConvertDescriptors(CSharpFileOptions.DefaultInstance, set); - Assert.AreEqual(2, converted.Count); - Assert.AreEqual("First", converted[0].Name); - Assert.AreEqual(1, converted[0].Dependencies.Count); - Assert.AreEqual(converted[1], converted[0].Dependencies[0]); - Assert.AreEqual("Second", converted[1].Name); - Assert.AreEqual(0, converted[1].Dependencies.Count); - } - - [Test] - public void SecondDependsOnFirst() - { - FileDescriptorProto first = new FileDescriptorProto.Builder {Name = "First"}.Build(); - FileDescriptorProto second = - new FileDescriptorProto.Builder {Name = "Second", DependencyList = {"First"}}.Build(); - var set = new List { first, second }; - IList converted = Generator.ConvertDescriptors(CSharpFileOptions.DefaultInstance, set); - Assert.AreEqual(2, converted.Count); - Assert.AreEqual("First", converted[0].Name); - Assert.AreEqual(0, converted[0].Dependencies.Count); - Assert.AreEqual("Second", converted[1].Name); - Assert.AreEqual(1, converted[1].Dependencies.Count); - Assert.AreEqual(converted[0], converted[1].Dependencies[0]); - } - - [Test] - public void CircularDependency() - { - FileDescriptorProto first = - new FileDescriptorProto.Builder {Name = "First", DependencyList = {"Second"}}.Build(); - FileDescriptorProto second = - new FileDescriptorProto.Builder {Name = "Second", DependencyList = {"First"}}.Build(); - var set = new List { first, second }; - try - { - Generator.ConvertDescriptors(CSharpFileOptions.DefaultInstance, set); - Assert.Fail("Expected exception"); - } - catch (DependencyResolutionException) - { - // Expected - } - } - - [Test] - public void MissingDependency() - { - FileDescriptorProto first = - new FileDescriptorProto.Builder {Name = "First", DependencyList = {"Second"}}.Build(); - var set = new List { first }; - try - { - Generator.ConvertDescriptors(CSharpFileOptions.DefaultInstance, set); - Assert.Fail("Expected exception"); - } - catch (DependencyResolutionException) - { - // Expected - } - } - - [Test] - public void SelfDependency() - { - FileDescriptorProto first = - new FileDescriptorProto.Builder {Name = "First", DependencyList = {"First"}}.Build(); - var set = new List { first }; - try - { - Generator.ConvertDescriptors(CSharpFileOptions.DefaultInstance, set); - Assert.Fail("Expected exception"); - } - catch (DependencyResolutionException) - { - // Expected - } - } - } -} \ No newline at end of file diff --git a/src/ProtoGen.Test/Properties/AssemblyInfo.cs b/src/ProtoGen.Test/Properties/AssemblyInfo.cs deleted file mode 100644 index 0b632bc..0000000 --- a/src/ProtoGen.Test/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. - -[assembly: AssemblyTitle("ProtoGen.Test")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ProtoGen.Test")] -[assembly: AssemblyCopyright("Copyright © 2008")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("2.4.1.555")] - -[assembly: AssemblyVersion("2.4.1.555")] -[assembly: AssemblyFileVersion("2.4.1.555")] \ No newline at end of file diff --git a/src/ProtoGen.Test/ProtoGen.Test.csproj b/src/ProtoGen.Test/ProtoGen.Test.csproj deleted file mode 100644 index 81f8479..0000000 --- a/src/ProtoGen.Test/ProtoGen.Test.csproj +++ /dev/null @@ -1,99 +0,0 @@ - - - - CLIENTPROFILE - NET35 - Debug - AnyCPU - 9.0.30729 - 2.0 - {C268DA4C-4004-47DA-AF23-44C983281A68} - Library - Properties - Google.ProtocolBuffers.ProtoGen - Google.ProtocolBuffers.ProtoGen.Test - v3.5 - 512 - - - true - full - false - bin\NET35\Debug - obj\NET35\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - true - Off - - - pdbonly - true - bin\NET35\Release - obj\NET35\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - true - Off - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - {250ADE34-82FD-4BAE-86D5-985FBE589C4A} - ProtoGen - - - - - protoc.exe - PreserveNewest - - - - - google\protobuf\csharp_options.proto - PreserveNewest - - - google\protobuf\descriptor.proto - PreserveNewest - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/src/ProtoGen.Test/ProtocGenCsUnittests.cs b/src/ProtoGen.Test/ProtocGenCsUnittests.cs deleted file mode 100644 index 8ee56de..0000000 --- a/src/ProtoGen.Test/ProtocGenCsUnittests.cs +++ /dev/null @@ -1,683 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using NUnit.Framework; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Reflection; -using System.Text; - -namespace Google.ProtocolBuffers.ProtoGen -{ - /// - /// Tests protoc-gen-cs plugin. - /// - [TestFixture] - [Category("Preprocessor")] - public partial class ProtocGenCsUnittests - { - private static readonly string TempPath = Path.Combine(Path.GetTempPath(), "protoc-gen-cs.Test"); - - private const string DefaultProto = - @" -package nunit.simple; -// Test a very simple message. -message MyMessage { - optional string name = 1; -}"; - - #region TestFixture SetUp/TearDown - - private static readonly string OriginalWorkingDirectory = Environment.CurrentDirectory; - - private StringBuilder buffer = new StringBuilder(); - - [TestFixtureSetUp] - public virtual void Setup() - { - Teardown(); - Directory.CreateDirectory(TempPath); - Environment.CurrentDirectory = TempPath; - this.buffer.Length = 0; - } - - [TestFixtureTearDown] - public virtual void Teardown() - { - Environment.CurrentDirectory = OriginalWorkingDirectory; - if (Directory.Exists(TempPath)) - { - Directory.Delete(TempPath, true); - } - } - - #endregion - - #region Helper Methods RunProtoGen / RunCsc - - private void RunProtoc(int expect, string protoFile, params string[] args) - { - string protoPath = string.Format("-I. -I\"{0}\"", OriginalWorkingDirectory); - string plugin = string.Format("--plugin=\"{0}\"", Path.Combine(OriginalWorkingDirectory, "protoc-gen-cs.exe")); - string csOut = args.Length == 0 ? "--cs_out=." : string.Format("--cs_out=\"{0}:.\"", string.Join(" ", args)); - // Start the child process. - Process p = new Process(); - // Redirect the output stream of the child process. - p.StartInfo.CreateNoWindow = true; - p.StartInfo.UseShellExecute = false; - p.StartInfo.RedirectStandardError = true; - p.StartInfo.RedirectStandardOutput = true; - p.StartInfo.WorkingDirectory = TempPath; - p.StartInfo.FileName = Path.Combine(OriginalWorkingDirectory, "protoc.exe"); - p.StartInfo.Arguments = string.Join(" ", new string[] { plugin, csOut, protoPath, protoFile }); - p.Start(); - // Read the output stream first and then wait. - buffer.AppendLine(string.Format("{0}> \"{1}\" {2}", p.StartInfo.WorkingDirectory, p.StartInfo.FileName, p.StartInfo.Arguments)); - buffer.AppendLine(p.StandardError.ReadToEnd()); - buffer.AppendLine(p.StandardOutput.ReadToEnd()); - p.WaitForExit(); - Assert.AreEqual(expect, p.ExitCode, this.buffer.ToString()); - } - - private Assembly RunCsc(int expect, params string[] sources) - { - using (TempFile tempDll = new TempFile(String.Empty)) - { - tempDll.ChangeExtension(".dll"); - List args = new List(); - args.Add("/nologo"); - args.Add("/target:library"); - args.Add("/debug-"); - args.Add(String.Format(@"""/out:{0}""", tempDll.TempPath)); - args.Add("/r:System.dll"); - args.Add(String.Format(@"""/r:{0}""", - typeof(Google.ProtocolBuffers.DescriptorProtos.DescriptorProto).Assembly. - Location)); - args.AddRange(sources); - - string exe = Path.Combine(System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory(), - "csc.exe"); - ProcessStartInfo psi = new ProcessStartInfo(exe); - psi.WorkingDirectory = TempPath; - psi.CreateNoWindow = true; - psi.UseShellExecute = false; - psi.RedirectStandardOutput = true; - psi.RedirectStandardError = true; - psi.Arguments = string.Join(" ", args.ToArray()); - Process p = Process.Start(psi); - buffer.AppendLine(string.Format("{0}> \"{1}\" {2}", p.StartInfo.WorkingDirectory, p.StartInfo.FileName, p.StartInfo.Arguments)); - buffer.AppendLine(p.StandardError.ReadToEnd()); - buffer.AppendLine(p.StandardOutput.ReadToEnd()); - p.WaitForExit(); - Assert.AreEqual(expect, p.ExitCode, this.buffer.ToString()); - - Assembly asm = null; - if (p.ExitCode == 0) - { - byte[] allbytes = File.ReadAllBytes(tempDll.TempPath); - asm = Assembly.Load(allbytes); - - foreach (Type t in asm.GetTypes()) - { - Debug.WriteLine(t.FullName, asm.FullName); - } - } - return asm; - } - } - - #endregion - - // ******************************************************************* - // The following tests excercise options for protogen.exe - // ******************************************************************* - - [Test] - public void TestProtoFile() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - RunProtoc(0, proto.TempPath); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple." + test, true, true); - } - } - - [Test] - public void TestProtoFileWithConflictingType() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using ( - ProtoFile proto = new ProtoFile(test + ".proto", - @" -package nunit.simple; -// Test a very simple message. -message " + - test + @" { - optional string name = 1; -} ")) - { - RunProtoc(0, proto.TempPath); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple." + test, true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple.Proto." + test, true, true); - } - } - - [Test] - public void TestProtoFileWithNamespace() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - RunProtoc(0, proto.TempPath, "-namespace=MyNewNamespace"); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("MyNewNamespace.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("MyNewNamespace." + test, true, true); - } - } - - [Test] - public void TestProtoFileWithUmbrellaClassName() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach("MyUmbrellaClassname.cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - RunProtoc(0, proto.TempPath, "/umbrella_classname=MyUmbrellaClassname"); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple.MyUmbrellaClassname", true, true); - } - } - - [Test] - public void TestProtoFileWithNestedClass() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - RunProtoc(0, proto.TempPath, "-nest_classes=true"); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple." + test + "+MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple." + test, true, true); - } - } - - [Test] - public void TestProtoFileWithExpandedNsDirectories() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(@"nunit\simple\" + test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - RunProtoc(0, proto.TempPath, "-expand_namespace_directories=true"); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple." + test, true, true); - } - } - - [Test] - public void TestProtoFileWithNewExtension() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".Generated.cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - RunProtoc(0, proto.TempPath, "-file_extension=.Generated.cs"); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple." + test, true, true); - } - } - - [Test] - public void TestProtoFileWithUmbrellaNamespace() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - RunProtoc(0, proto.TempPath, "-umbrella_namespace=MyUmbrella.Namespace"); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple.MyUmbrella.Namespace." + test, true, true); - } - } - - [Test] - public void TestProtoFileWithIgnoredUmbrellaNamespaceDueToNesting() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - RunProtoc(0, proto.TempPath, "-nest_classes=true", "-umbrella_namespace=MyUmbrella.Namespace"); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple." + test + "+MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple." + test, true, true); - } - } - - [Test] - public void TestProtoFileWithExplicitEmptyUmbrellaNamespace() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using ( - ProtoFile proto = new ProtoFile(test + ".proto", - @" -package nunit.simple; -// Test a very simple message. -message " + - test + @" { - optional string name = 1; -} ")) - { - //Forces the umbrella class to not use a namespace even if a collision with a type is detected. - RunProtoc(0, proto.TempPath, "-umbrella_namespace="); - //error CS0441: 'nunit.simple.TestProtoFileWithExplicitEmptyUmbrellaNamespace': a class cannot be both static and sealed - RunCsc(1, source.TempPath); - } - } - - [Test] - public void TestProtoFileWithNewOutputFolder() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(@"generated-code\" + test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - RunProtoc(1, proto.TempPath, "-output_directory=generated-code"); - Directory.CreateDirectory("generated-code"); - RunProtoc(0, proto.TempPath, "-output_directory=generated-code"); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple." + test, true, true); - } - } - - [Test] - public void TestProtoFileAndIgnoreGoogleProtobuf() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using ( - ProtoFile proto = new ProtoFile(test + ".proto", - @" -import ""google/protobuf/csharp_options.proto""; -option (google.protobuf.csharp_file_options).namespace = ""MyNewNamespace""; -" + - DefaultProto)) - { - string google = Path.Combine(TempPath, "google\\protobuf"); - Directory.CreateDirectory(google); - foreach (string file in Directory.GetFiles(Path.Combine(OriginalWorkingDirectory, "google\\protobuf"))) - { - File.Copy(file, Path.Combine(google, Path.GetFileName(file))); - } - - Assert.AreEqual(0, Directory.GetFiles(TempPath, "*.cs").Length); - RunProtoc(0, proto.TempPath); - Assert.AreEqual(1, Directory.GetFiles(TempPath, "*.cs").Length); - - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("MyNewNamespace.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("MyNewNamespace." + test, true, true); - } - } - - [Test] - public void TestProtoFileWithoutIgnoreGoogleProtobuf() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using ( - ProtoFile proto = new ProtoFile(test + ".proto", - @" -import ""google/protobuf/csharp_options.proto""; -option (google.protobuf.csharp_file_options).namespace = ""MyNewNamespace""; -" + - DefaultProto)) - { - string google = Path.Combine(TempPath, "google\\protobuf"); - Directory.CreateDirectory(google); - foreach (string file in Directory.GetFiles(Path.Combine(OriginalWorkingDirectory, "google\\protobuf"))) - { - File.Copy(file, Path.Combine(google, Path.GetFileName(file))); - } - - Assert.AreEqual(0, Directory.GetFiles(TempPath, "*.cs").Length); - //Without the option this fails due to being unable to resolve google/protobuf descriptors - RunProtoc(0, proto.TempPath); - } - } - - // ******************************************************************* - // The following tests excercise options for protoc.exe - // ******************************************************************* - - [Test] - public void TestProtoFileWithIncludeImports() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using ( - ProtoFile proto = new ProtoFile(test + ".proto", - @" -import ""google/protobuf/csharp_options.proto""; -option (google.protobuf.csharp_file_options).namespace = ""MyNewNamespace""; - -package nunit.simple; -// Test a very simple message. -message MyMessage { - optional string name = 1; -} ") - ) - { - string google = Path.Combine(TempPath, "google\\protobuf"); - Directory.CreateDirectory(google); - foreach (string file in Directory.GetFiles(Path.Combine(OriginalWorkingDirectory, "google\\protobuf"))) - { - File.Copy(file, Path.Combine(google, Path.GetFileName(file))); - } - - Assert.AreEqual(0, Directory.GetFiles(TempPath, "*.cs").Length); - //if you specify the protoc option --include_imports this should build three source files - RunProtoc(0, proto.TempPath); - Assert.AreEqual(1, Directory.GetFiles(TempPath, "*.cs").Length); - - //you can (and should) simply omit the inclusion of the extra source files in your project - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("MyNewNamespace.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("MyNewNamespace." + test, true, true); - } - } - - //Seems the --proto_path or -I option is non-functional for me. Maybe others have luck? - [Test] - public void TestProtoFileInDifferentDirectory() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - Environment.CurrentDirectory = OriginalWorkingDirectory; - RunProtoc(0, proto.TempPath); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple." + test, true, true); - } - } - - // ******************************************************************* - // Handling of mutliple input files - // ******************************************************************* - - [Test] - public void TestMultipleProtoFiles() - { - Setup(); - using (TempFile source1 = TempFile.Attach("MyMessage.cs")) - using ( - ProtoFile proto1 = new ProtoFile("MyMessage.proto", - @" -package nunit.simple; -// Test a very simple message. -message MyMessage { - optional string name = 1; -}") - ) - using (TempFile source2 = TempFile.Attach("MyMessageList.cs")) - using ( - ProtoFile proto2 = new ProtoFile("MyMessageList.proto", - @" -package nunit.simple; -import ""MyMessage.proto""; -// Test a very simple message. -message MyMessageList { - repeated MyMessage messages = 1; -}") - ) - { - RunProtoc(0, proto1.TempPath); - RunProtoc(0, proto2.TempPath); - Assembly a = RunCsc(0, source1.TempPath, source2.TempPath); - //assert that the message type is in the expected namespace - Type t1 = a.GetType("nunit.simple.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t1), "Expect an IMessage"); - //assert that the message type is in the expected namespace - Type t2 = a.GetType("nunit.simple.MyMessageList", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t2), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple.Proto.MyMessage", true, true); - a.GetType("nunit.simple.Proto.MyMessageList", true, true); - } - } - - [Test] - public void TestOneProtoFileWithBufferFile() - { - Setup(); - using (TempFile source1 = TempFile.Attach("MyMessage.cs")) - using ( - ProtoFile proto1 = new ProtoFile("MyMessage.proto", - @" -package nunit.simple; -// Test a very simple message. -message MyMessage { - optional string name = 1; -}") - ) - using (TempFile source2 = TempFile.Attach("MyMessageList.cs")) - using ( - ProtoFile proto2 = new ProtoFile("MyMessageList.proto", - @" -package nunit.simple; -import ""MyMessage.proto""; -// Test a very simple message. -message MyMessageList { - repeated MyMessage messages = 1; -}") - ) - { - //build the proto buffer for MyMessage - RunProtoc(0, proto1.TempPath); - //build the MyMessageList proto-buffer and generate code by including MyMessage.pb - RunProtoc(0, proto2.TempPath); - Assembly a = RunCsc(0, source1.TempPath, source2.TempPath); - //assert that the message type is in the expected namespace - Type t1 = a.GetType("nunit.simple.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t1), "Expect an IMessage"); - //assert that the message type is in the expected namespace - Type t2 = a.GetType("nunit.simple.MyMessageList", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t2), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple.Proto.MyMessage", true, true); - a.GetType("nunit.simple.Proto.MyMessageList", true, true); - } - } - - [Test] - public void TestProtoFileWithService() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", -@" -import ""google/protobuf/csharp_options.proto""; -option (google.protobuf.csharp_file_options).service_generator_type = GENERIC; - -package nunit.simple; -// Test a very simple message. -message MyMessage { - optional string name = 1; -} -// test a very simple service. -service TestService { - rpc Execute (MyMessage) returns (MyMessage); -}")) - { - CopyInGoogleProtoFiles(); - - RunProtoc(0, proto.TempPath, "-nest_classes=false"); - Assert.AreEqual(1, Directory.GetFiles(TempPath, "*.cs").Length); - - Assembly a = RunCsc(0, source.TempPath); - //assert that the service type is in the expected namespace - Type t1 = a.GetType("nunit.simple.TestService", true, true); - Assert.IsTrue(typeof(IService).IsAssignableFrom(t1), "Expect an IService"); - Assert.IsTrue(t1.IsAbstract, "Expect abstract class"); - //assert that the Stub subclass type is in the expected namespace - Type t2 = a.GetType("nunit.simple.TestService+Stub", true, true); - Assert.IsTrue(t1.IsAssignableFrom(t2), "Expect a sub of TestService"); - Assert.IsFalse(t2.IsAbstract, "Expect concrete class"); - } - } - - [Test] - public void TestProtoFileWithServiceInternal() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", -@" -import ""google/protobuf/csharp_options.proto""; -option (google.protobuf.csharp_file_options).service_generator_type = GENERIC; - -package nunit.simple; -// Test a very simple message. -message MyMessage { - optional string name = 1; -} -// test a very simple service. -service TestService { - rpc Execute (MyMessage) returns (MyMessage); -}")) - { - CopyInGoogleProtoFiles(); - - RunProtoc(0, proto.TempPath, "-nest_classes=false", "-public_classes=false"); - Assert.AreEqual(1, Directory.GetFiles(TempPath, "*.cs").Length); - - Assembly a = RunCsc(0, source.TempPath); - //assert that the service type is in the expected namespace - Type t1 = a.GetType("nunit.simple.TestService", true, true); - Assert.IsTrue(typeof(IService).IsAssignableFrom(t1), "Expect an IService"); - Assert.IsTrue(t1.IsAbstract, "Expect abstract class"); - //assert that the Stub subclass type is in the expected namespace - Type t2 = a.GetType("nunit.simple.TestService+Stub", true, true); - Assert.IsTrue(t1.IsAssignableFrom(t2), "Expect a sub of TestService"); - Assert.IsFalse(t2.IsAbstract, "Expect concrete class"); - } - } - - private static void CopyInGoogleProtoFiles() - { - string google = Path.Combine(TempPath, "google\\protobuf"); - Directory.CreateDirectory(google); - foreach (string file in Directory.GetFiles(Path.Combine(OriginalWorkingDirectory, "google\\protobuf"))) - { - File.Copy(file, Path.Combine(google, Path.GetFileName(file))); - } - } - } -} \ No newline at end of file diff --git a/src/ProtoGen.Test/TempFile.cs b/src/ProtoGen.Test/TempFile.cs deleted file mode 100644 index 74a183f..0000000 --- a/src/ProtoGen.Test/TempFile.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; - -namespace Google.ProtocolBuffers.ProtoGen -{ - internal class ProtoFile : TempFile - { - public ProtoFile(string filename, string contents) - : base(filename, contents) - { - } - } - - internal class TempFile : IDisposable - { - private string tempFile; - - public static TempFile Attach(string path) - { - return new TempFile(path, null); - } - - protected TempFile(string filename, string contents) - { - tempFile = filename; - if (contents != null) - { - File.WriteAllText(tempFile, contents, new UTF8Encoding(false)); - } - } - - public TempFile(string contents) - : this(Path.GetTempFileName(), contents) - { - } - - public string TempPath - { - get { return tempFile; } - } - - public void ChangeExtension(string ext) - { - string newFile = Path.ChangeExtension(tempFile, ext); - File.Move(tempFile, newFile); - tempFile = newFile; - } - - public void Dispose() - { - if (File.Exists(tempFile)) - { - File.Delete(tempFile); - } - } - } -} \ No newline at end of file diff --git a/src/ProtoGen.Test/TestPreprocessing.cs b/src/ProtoGen.Test/TestPreprocessing.cs deleted file mode 100644 index 8b3b066..0000000 --- a/src/ProtoGen.Test/TestPreprocessing.cs +++ /dev/null @@ -1,733 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Reflection; -using NUnit.Framework; - -namespace Google.ProtocolBuffers.ProtoGen -{ - [TestFixture] - [Category("Preprocessor")] - public partial class TestPreprocessing - { - private static readonly string TempPath = Path.Combine(Path.GetTempPath(), "proto-gen-test"); - - private const string DefaultProto = - @" -package nunit.simple; -// Test a very simple message. -message MyMessage { - optional string name = 1; -}"; - - #region TestFixture SetUp/TearDown - - private static readonly string OriginalWorkingDirectory = Environment.CurrentDirectory; - - [TestFixtureSetUp] - public virtual void Setup() - { - Teardown(); - Directory.CreateDirectory(TempPath); - Environment.CurrentDirectory = TempPath; - } - - [TestFixtureTearDown] - public virtual void Teardown() - { - Environment.CurrentDirectory = OriginalWorkingDirectory; - if (Directory.Exists(TempPath)) - { - Directory.Delete(TempPath, true); - } - } - - #endregion - - #region Helper Methods RunProtoGen / RunCsc - - private void RunProtoGen(int expect, params string[] args) - { - TextWriter tout = Console.Out, terr = Console.Error; - StringWriter temp = new StringWriter(); - Console.SetOut(temp); - Console.SetError(temp); - try - { - Assert.AreEqual(expect, ProgramPreprocess.Run(args), "ProtoGen Failed: {0}", temp); - } - finally - { - Console.SetOut(tout); - Console.SetError(terr); - } - } - - private Assembly RunCsc(int expect, params string[] sources) - { - using (TempFile tempDll = new TempFile(String.Empty)) - { - tempDll.ChangeExtension(".dll"); - List args = new List(); - args.Add("/nologo"); - args.Add("/target:library"); - args.Add("/debug-"); - args.Add(String.Format(@"""/out:{0}""", tempDll.TempPath)); - args.Add("/r:System.dll"); - args.Add(String.Format(@"""/r:{0}""", - typeof(Google.ProtocolBuffers.DescriptorProtos.DescriptorProto).Assembly. - Location)); - args.AddRange(sources); - - string exe = Path.Combine(System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory(), - "csc.exe"); - ProcessStartInfo psi = new ProcessStartInfo(exe); - psi.CreateNoWindow = true; - psi.UseShellExecute = false; - psi.RedirectStandardOutput = true; - psi.RedirectStandardError = true; - psi.Arguments = string.Join(" ", args.ToArray()); - Process p = Process.Start(psi); - p.WaitForExit(); - string errorText = p.StandardOutput.ReadToEnd() + p.StandardError.ReadToEnd(); - Assert.AreEqual(expect, p.ExitCode, "CSC.exe Failed: {0}", errorText); - - Assembly asm = null; - if (p.ExitCode == 0) - { - byte[] allbytes = File.ReadAllBytes(tempDll.TempPath); - asm = Assembly.Load(allbytes); - - foreach (Type t in asm.GetTypes()) - { - Debug.WriteLine(t.FullName, asm.FullName); - } - } - return asm; - } - } - - #endregion - - // ******************************************************************* - // The following tests excercise options for protogen.exe - // ******************************************************************* - - [Test] - public void TestProtoFile() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - RunProtoGen(0, proto.TempPath); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple." + test, true, true); - } - } - - [Test] - public void TestProtoFileWithConflictingType() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using ( - ProtoFile proto = new ProtoFile(test + ".proto", - @" -package nunit.simple; -// Test a very simple message. -message " + - test + @" { - optional string name = 1; -} ")) - { - RunProtoGen(0, proto.TempPath); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple." + test, true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple.Proto." + test, true, true); - } - } - - [Test] - public void TestProtoFileWithNamespace() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - RunProtoGen(0, proto.TempPath, "-namespace:MyNewNamespace"); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("MyNewNamespace.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("MyNewNamespace." + test, true, true); - } - } - - [Test] - public void TestProtoFileWithUmbrellaClassName() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach("MyUmbrellaClassname.cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - RunProtoGen(0, proto.TempPath, "/umbrella_classname=MyUmbrellaClassname"); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple.MyUmbrellaClassname", true, true); - } - } - - [Test] - public void TestProtoFileWithNestedClass() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - RunProtoGen(0, proto.TempPath, "-nest_classes:true"); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple." + test + "+MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple." + test, true, true); - } - } - - [Test] - public void TestProtoFileWithExpandedNsDirectories() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(@"nunit\simple\" + test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - RunProtoGen(0, proto.TempPath, "-expand_namespace_directories:true"); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple." + test, true, true); - } - } - - [Test] - public void TestProtoFileWithNewExtension() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".Generated.cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - RunProtoGen(0, proto.TempPath, "-file_extension:.Generated.cs"); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple." + test, true, true); - } - } - - [Test] - public void TestProtoFileWithUmbrellaNamespace() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - RunProtoGen(0, proto.TempPath, "-umbrella_namespace:MyUmbrella.Namespace"); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple.MyUmbrella.Namespace." + test, true, true); - } - } - - [Test] - public void TestProtoFileWithIgnoredUmbrellaNamespaceDueToNesting() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - RunProtoGen(0, proto.TempPath, "-nest_classes:true", "-umbrella_namespace:MyUmbrella.Namespace"); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple." + test + "+MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple." + test, true, true); - } - } - - [Test] - public void TestProtoFileWithExplicitEmptyUmbrellaNamespace() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using ( - ProtoFile proto = new ProtoFile(test + ".proto", - @" -package nunit.simple; -// Test a very simple message. -message " + - test + @" { - optional string name = 1; -} ")) - { - //Forces the umbrella class to not use a namespace even if a collision with a type is detected. - RunProtoGen(0, proto.TempPath, "-umbrella_namespace:"); - //error CS0441: 'nunit.simple.TestProtoFileWithExplicitEmptyUmbrellaNamespace': a class cannot be both static and sealed - RunCsc(1, source.TempPath); - } - } - - [Test] - public void TestProtoFileWithNewOutputFolder() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(@"generated-code\" + test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - RunProtoGen(1, proto.TempPath, "-output_directory:generated-code"); - Directory.CreateDirectory("generated-code"); - RunProtoGen(0, proto.TempPath, "-output_directory:generated-code"); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple." + test, true, true); - } - } - - [Test] - public void TestProtoFileAndIgnoreGoogleProtobuf() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using ( - ProtoFile proto = new ProtoFile(test + ".proto", - @" -import ""google/protobuf/csharp_options.proto""; -option (google.protobuf.csharp_file_options).namespace = ""MyNewNamespace""; -" + - DefaultProto)) - { - string google = Path.Combine(TempPath, "google\\protobuf"); - Directory.CreateDirectory(google); - foreach (string file in Directory.GetFiles(Path.Combine(OriginalWorkingDirectory, "google\\protobuf"))) - { - File.Copy(file, Path.Combine(google, Path.GetFileName(file))); - } - - Assert.AreEqual(0, Directory.GetFiles(TempPath, "*.cs").Length); - RunProtoGen(0, proto.TempPath, "-ignore_google_protobuf:true"); - Assert.AreEqual(1, Directory.GetFiles(TempPath, "*.cs").Length); - - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("MyNewNamespace.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("MyNewNamespace." + test, true, true); - } - } - - [Test] - public void TestProtoFileWithoutIgnoreGoogleProtobuf() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using ( - ProtoFile proto = new ProtoFile(test + ".proto", - @" -import ""google/protobuf/csharp_options.proto""; -option (google.protobuf.csharp_file_options).namespace = ""MyNewNamespace""; -" + - DefaultProto)) - { - string google = Path.Combine(TempPath, "google\\protobuf"); - Directory.CreateDirectory(google); - foreach (string file in Directory.GetFiles(Path.Combine(OriginalWorkingDirectory, "google\\protobuf"))) - { - File.Copy(file, Path.Combine(google, Path.GetFileName(file))); - } - - Assert.AreEqual(0, Directory.GetFiles(TempPath, "*.cs").Length); - //Without the option this fails due to being unable to resolve google/protobuf descriptors - RunProtoGen(1, proto.TempPath, "-ignore_google_protobuf:false"); - } - } - - // ******************************************************************* - // The following tests excercise options for protoc.exe - // ******************************************************************* - - [Test] - public void TestProtoFileWithIncludeImports() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using ( - ProtoFile proto = new ProtoFile(test + ".proto", - @" -import ""google/protobuf/csharp_options.proto""; -option (google.protobuf.csharp_file_options).namespace = ""MyNewNamespace""; - -package nunit.simple; -// Test a very simple message. -message MyMessage { - optional string name = 1; -} ") - ) - { - string google = Path.Combine(TempPath, "google\\protobuf"); - Directory.CreateDirectory(google); - foreach (string file in Directory.GetFiles(Path.Combine(OriginalWorkingDirectory, "google\\protobuf"))) - { - File.Copy(file, Path.Combine(google, Path.GetFileName(file))); - } - - Assert.AreEqual(0, Directory.GetFiles(TempPath, "*.cs").Length); - //if you specify the protoc option --include_imports this should build three source files - RunProtoGen(0, proto.TempPath, "--include_imports"); - Assert.AreEqual(3, Directory.GetFiles(TempPath, "*.cs").Length); - - //you can (and should) simply omit the inclusion of the extra source files in your project - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("MyNewNamespace.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("MyNewNamespace." + test, true, true); - } - } - - [Test] - public void TestProtoFileWithIncludeImportsAndIgnoreGoogleProtobuf() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using ( - ProtoFile proto = new ProtoFile(test + ".proto", - @" -import ""google/protobuf/csharp_options.proto""; -option (google.protobuf.csharp_file_options).namespace = ""MyNewNamespace""; - -package nunit.simple; -// Test a very simple message. -message MyMessage { - optional string name = 1; -} ") - ) - { - string google = Path.Combine(TempPath, "google\\protobuf"); - Directory.CreateDirectory(google); - foreach (string file in Directory.GetFiles(Path.Combine(OriginalWorkingDirectory, "google\\protobuf"))) - File.Copy(file, Path.Combine(google, Path.GetFileName(file))); - - Assert.AreEqual(0, Directory.GetFiles(TempPath, "*.cs").Length); - //Even with --include_imports, if you provide -ignore_google_protobuf:true you only get the one source file - RunProtoGen(0, proto.TempPath, "-ignore_google_protobuf:true", "--include_imports"); - Assert.AreEqual(1, Directory.GetFiles(TempPath, "*.cs").Length); - - //you can (and should) simply omit the inclusion of the extra source files in your project - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("MyNewNamespace.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("MyNewNamespace." + test, true, true); - } - } - - [Test] - public void TestProtoFileKeepingTheProtoBuffer() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile protobuf = TempFile.Attach(test + ".pb")) - using (TempFile source = TempFile.Attach(test + ".cs")) - using ( - ProtoFile proto = new ProtoFile(test + ".proto", - @" -package nunit.simple; -// Test a very simple message. -message MyMessage { - optional string name = 1; -} ") - ) - { - RunProtoGen(0, proto.TempPath, "--descriptor_set_out=" + protobuf.TempPath); - Assert.IsTrue(File.Exists(protobuf.TempPath), "Missing: " + protobuf.TempPath); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple." + test, true, true); - } - } - - //Seems the --proto_path or -I option is non-functional for me. Maybe others have luck? - [Test] - public void TestProtoFileInDifferentDirectory() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", DefaultProto)) - { - Environment.CurrentDirectory = OriginalWorkingDirectory; - RunProtoGen(0, proto.TempPath, "--proto_path=" + TempPath); - Assembly a = RunCsc(0, source.TempPath); - //assert that the message type is in the expected namespace - Type t = a.GetType("nunit.simple.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple." + test, true, true); - } - } - - // ******************************************************************* - // Handling of mutliple input files - // ******************************************************************* - - [Test] - public void TestMultipleProtoFiles() - { - Setup(); - using (TempFile source1 = TempFile.Attach("MyMessage.cs")) - using ( - ProtoFile proto1 = new ProtoFile("MyMessage.proto", - @" -package nunit.simple; -// Test a very simple message. -message MyMessage { - optional string name = 1; -}") - ) - using (TempFile source2 = TempFile.Attach("MyMessageList.cs")) - using ( - ProtoFile proto2 = new ProtoFile("MyMessageList.proto", - @" -package nunit.simple; -import ""MyMessage.proto""; -// Test a very simple message. -message MyMessageList { - repeated MyMessage messages = 1; -}") - ) - { - RunProtoGen(0, proto1.TempPath, proto2.TempPath); - Assembly a = RunCsc(0, source1.TempPath, source2.TempPath); - //assert that the message type is in the expected namespace - Type t1 = a.GetType("nunit.simple.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t1), "Expect an IMessage"); - //assert that the message type is in the expected namespace - Type t2 = a.GetType("nunit.simple.MyMessageList", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t2), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple.Proto.MyMessage", true, true); - a.GetType("nunit.simple.Proto.MyMessageList", true, true); - } - } - - [Test] - public void TestOneProtoFileWithBufferFile() - { - Setup(); - using (TempFile source1 = TempFile.Attach("MyMessage.cs")) - using (TempFile protobuf = TempFile.Attach("MyMessage.pb")) - using ( - ProtoFile proto1 = new ProtoFile("MyMessage.proto", - @" -package nunit.simple; -// Test a very simple message. -message MyMessage { - optional string name = 1; -}") - ) - using (TempFile source2 = TempFile.Attach("MyMessageList.cs")) - using ( - ProtoFile proto2 = new ProtoFile("MyMessageList.proto", - @" -package nunit.simple; -import ""MyMessage.proto""; -// Test a very simple message. -message MyMessageList { - repeated MyMessage messages = 1; -}") - ) - { - //build the proto buffer for MyMessage - RunProtoGen(0, proto1.TempPath, "--descriptor_set_out=" + protobuf.TempPath); - //build the MyMessageList proto-buffer and generate code by including MyMessage.pb - RunProtoGen(0, proto2.TempPath, protobuf.TempPath); - Assembly a = RunCsc(0, source1.TempPath, source2.TempPath); - //assert that the message type is in the expected namespace - Type t1 = a.GetType("nunit.simple.MyMessage", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t1), "Expect an IMessage"); - //assert that the message type is in the expected namespace - Type t2 = a.GetType("nunit.simple.MyMessageList", true, true); - Assert.IsTrue(typeof(IMessage).IsAssignableFrom(t2), "Expect an IMessage"); - //assert that we can find the static descriptor type - a.GetType("nunit.simple.Proto.MyMessage", true, true); - a.GetType("nunit.simple.Proto.MyMessageList", true, true); - } - } - - [Test] - public void TestProtoFileWithService() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", -@" -import ""google/protobuf/csharp_options.proto""; -option (google.protobuf.csharp_file_options).service_generator_type = GENERIC; - -package nunit.simple; -// Test a very simple message. -message MyMessage { - optional string name = 1; -} -// test a very simple service. -service TestService { - rpc Execute (MyMessage) returns (MyMessage); -}")) - { - CopyInGoogleProtoFiles(); - - RunProtoGen(0, proto.TempPath, "-ignore_google_protobuf:true", "-nest_classes=false"); - Assert.AreEqual(1, Directory.GetFiles(TempPath, "*.cs").Length); - - Assembly a = RunCsc(0, source.TempPath); - //assert that the service type is in the expected namespace - Type t1 = a.GetType("nunit.simple.TestService", true, true); - Assert.IsTrue(typeof(IService).IsAssignableFrom(t1), "Expect an IService"); - Assert.IsTrue(t1.IsAbstract, "Expect abstract class"); - //assert that the Stub subclass type is in the expected namespace - Type t2 = a.GetType("nunit.simple.TestService+Stub", true, true); - Assert.IsTrue(t1.IsAssignableFrom(t2), "Expect a sub of TestService"); - Assert.IsFalse(t2.IsAbstract, "Expect concrete class"); - } - } - - [Test] - public void TestProtoFileWithServiceInternal() - { - string test = new StackFrame(false).GetMethod().Name; - Setup(); - using (TempFile source = TempFile.Attach(test + ".cs")) - using (ProtoFile proto = new ProtoFile(test + ".proto", -@" -import ""google/protobuf/csharp_options.proto""; -option (google.protobuf.csharp_file_options).service_generator_type = GENERIC; - -package nunit.simple; -// Test a very simple message. -message MyMessage { - optional string name = 1; -} -// test a very simple service. -service TestService { - rpc Execute (MyMessage) returns (MyMessage); -}")) - { - CopyInGoogleProtoFiles(); - - RunProtoGen(0, proto.TempPath, "-ignore_google_protobuf:true", "-nest_classes=false", "-public_classes=false"); - Assert.AreEqual(1, Directory.GetFiles(TempPath, "*.cs").Length); - - Assembly a = RunCsc(0, source.TempPath); - //assert that the service type is in the expected namespace - Type t1 = a.GetType("nunit.simple.TestService", true, true); - Assert.IsTrue(typeof(IService).IsAssignableFrom(t1), "Expect an IService"); - Assert.IsTrue(t1.IsAbstract, "Expect abstract class"); - //assert that the Stub subclass type is in the expected namespace - Type t2 = a.GetType("nunit.simple.TestService+Stub", true, true); - Assert.IsTrue(t1.IsAssignableFrom(t2), "Expect a sub of TestService"); - Assert.IsFalse(t2.IsAbstract, "Expect concrete class"); - } - } - - private static void CopyInGoogleProtoFiles() - { - string google = Path.Combine(TempPath, "google\\protobuf"); - Directory.CreateDirectory(google); - foreach (string file in Directory.GetFiles(Path.Combine(OriginalWorkingDirectory, "google\\protobuf"))) - { - File.Copy(file, Path.Combine(google, Path.GetFileName(file))); - } - } - } -} \ No newline at end of file diff --git a/src/ProtoGen.Test/protoc-gen-cs.Test.csproj b/src/ProtoGen.Test/protoc-gen-cs.Test.csproj deleted file mode 100644 index 2e81611..0000000 --- a/src/ProtoGen.Test/protoc-gen-cs.Test.csproj +++ /dev/null @@ -1,101 +0,0 @@ - - - - CLIENTPROFILE - NET35 - Debug - AnyCPU - 9.0.30729 - 2.0 - {C1024C9C-8176-48C3-B547-B9F6DF6B80A6} - Library - Properties - Google.ProtocolBuffers.ProtoGen - protoc-gen-cs.Test - v3.5 - 512 - - - true - full - false - bin\NET35\Debug - obj\NET35\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - true - Off - - - pdbonly - true - bin\NET35\Release - obj\NET35\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - true - Off - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - - - - - - - - - - {6908bdce-d925-43f3-94ac-a531e6df2591} - ProtocolBuffers - - - {250ade34-82fd-4bae-86d5-985fbe589c4b} - protoc-gen-cs - - - - - protoc.exe - PreserveNewest - - - - - google\protobuf\csharp_options.proto - PreserveNewest - - - google\protobuf\descriptor.proto - PreserveNewest - - - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/src/ProtoGen/DependencyResolutionException.cs b/src/ProtoGen/DependencyResolutionException.cs deleted file mode 100644 index aef192e..0000000 --- a/src/ProtoGen/DependencyResolutionException.cs +++ /dev/null @@ -1,55 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; - -namespace Google.ProtocolBuffers.ProtoGen -{ - /// - /// Exception thrown when dependencies within a descriptor set can't be resolved. - /// - public sealed class DependencyResolutionException : Exception - { - public DependencyResolutionException(string message) : base(message) - { - } - - public DependencyResolutionException(string format, params object[] args) - : base(string.Format(format, args)) - { - } - } -} \ No newline at end of file diff --git a/src/ProtoGen/DescriptorUtil.cs b/src/ProtoGen/DescriptorUtil.cs deleted file mode 100644 index 0666bb9..0000000 --- a/src/ProtoGen/DescriptorUtil.cs +++ /dev/null @@ -1,106 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using Google.ProtocolBuffers.DescriptorProtos; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.ProtoGen -{ - /// - /// Utility class for determining namespaces etc. - /// - internal static class DescriptorUtil - { - internal static string GetFullUmbrellaClassName(IDescriptor descriptor) - { - CSharpFileOptions options = descriptor.File.CSharpOptions; - string result = options.Namespace; - if (result != "") - { - result += '.'; - } - result += GetQualifiedUmbrellaClassName(options); - return "global::" + result; - } - - /// - /// Evaluates the options and returns the qualified name of the umbrella class - /// relative to the descriptor type's namespace. Basically concatenates the - /// UmbrellaNamespace + UmbrellaClassname fields. - /// - internal static string GetQualifiedUmbrellaClassName(CSharpFileOptions options) - { - string fullName = options.UmbrellaClassname; - if (!options.NestClasses && options.UmbrellaNamespace != "") - { - fullName = String.Format("{0}.{1}", options.UmbrellaNamespace, options.UmbrellaClassname); - } - return fullName; - } - - internal static string GetMappedTypeName(MappedType type) - { - switch (type) - { - case MappedType.Int32: - return "int"; - case MappedType.Int64: - return "long"; - case MappedType.UInt32: - return "uint"; - case MappedType.UInt64: - return "ulong"; - case MappedType.Single: - return "float"; - case MappedType.Double: - return "double"; - case MappedType.Boolean: - return "bool"; - case MappedType.String: - return "string"; - case MappedType.ByteString: - return "pb::ByteString"; - case MappedType.Enum: - return null; - case MappedType.Message: - return null; - default: - throw new ArgumentOutOfRangeException("Unknown mapped type " + type); - } - } - } -} \ No newline at end of file diff --git a/src/ProtoGen/EnumFieldGenerator.cs b/src/ProtoGen/EnumFieldGenerator.cs deleted file mode 100644 index 8d70bc6..0000000 --- a/src/ProtoGen/EnumFieldGenerator.cs +++ /dev/null @@ -1,148 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.ProtoGen -{ - internal class EnumFieldGenerator : FieldGeneratorBase, IFieldSourceGenerator - { - internal EnumFieldGenerator(FieldDescriptor descriptor, int fieldOrdinal) - : base(descriptor, fieldOrdinal) - { - } - - public void GenerateMembers(TextGenerator writer) - { - writer.WriteLine("private bool has{0};", PropertyName); - writer.WriteLine("private {0} {1}_ = {2};", TypeName, Name, DefaultValue); - AddDeprecatedFlag(writer); - writer.WriteLine("public bool Has{0} {{", PropertyName); - writer.WriteLine(" get {{ return has{0}; }}", PropertyName); - writer.WriteLine("}"); - AddPublicMemberAttributes(writer); - writer.WriteLine("public {0} {1} {{", TypeName, PropertyName); - writer.WriteLine(" get {{ return {0}_; }}", Name); - writer.WriteLine("}"); - } - - public void GenerateBuilderMembers(TextGenerator writer) - { - AddDeprecatedFlag(writer); - writer.WriteLine("public bool Has{0} {{", PropertyName); - writer.WriteLine(" get {{ return result.has{0}; }}", PropertyName); - writer.WriteLine("}"); - AddPublicMemberAttributes(writer); - writer.WriteLine("public {0} {1} {{", TypeName, PropertyName); - writer.WriteLine(" get {{ return result.{0}; }}", PropertyName); - writer.WriteLine(" set {{ Set{0}(value); }}", PropertyName); - writer.WriteLine("}"); - AddPublicMemberAttributes(writer); - writer.WriteLine("public Builder Set{0}({1} value) {{", PropertyName, TypeName); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.has{0} = true;", PropertyName); - writer.WriteLine(" result.{0}_ = value;", Name); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public Builder Clear{0}() {{", PropertyName); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.has{0} = false;", PropertyName); - writer.WriteLine(" result.{0}_ = {1};", Name, DefaultValue); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - } - - public void GenerateMergingCode(TextGenerator writer) - { - writer.WriteLine("if (other.Has{0}) {{", PropertyName); - writer.WriteLine(" {0} = other.{0};", PropertyName); - writer.WriteLine("}"); - } - - public void GenerateBuildingCode(TextGenerator writer) - { - // Nothing to do here for enum types - } - - public void GenerateParsingCode(TextGenerator writer) - { - writer.WriteLine("object unknown;"); - writer.WriteLine("if(input.ReadEnum(ref result.{0}_, out unknown)) {{", Name); - writer.WriteLine(" result.has{0} = true;", PropertyName); - writer.WriteLine("} else if(unknown is int) {"); - if (!UseLiteRuntime) - { - writer.WriteLine(" if (unknownFields == null) {"); // First unknown field - create builder now - writer.WriteLine(" unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);"); - writer.WriteLine(" }"); - writer.WriteLine(" unknownFields.MergeVarintField({0}, (ulong)(int)unknown);", Number); - } - writer.WriteLine("}"); - } - - public void GenerateSerializationCode(TextGenerator writer) - { - writer.WriteLine("if (has{0}) {{", PropertyName); - writer.WriteLine(" output.WriteEnum({0}, field_names[{2}], (int) {1}, {1});", Number, PropertyName, - FieldOrdinal); - writer.WriteLine("}"); - } - - public void GenerateSerializedSizeCode(TextGenerator writer) - { - writer.WriteLine("if (has{0}) {{", PropertyName); - writer.WriteLine(" size += pb::CodedOutputStream.ComputeEnumSize({0}, (int) {1});", Number, PropertyName); - writer.WriteLine("}"); - } - - public override void WriteHash(TextGenerator writer) - { - writer.WriteLine("if (has{0}) hash ^= {1}_.GetHashCode();", PropertyName, Name); - } - - public override void WriteEquals(TextGenerator writer) - { - writer.WriteLine("if (has{0} != other.has{0} || (has{0} && !{1}_.Equals(other.{1}_))) return false;", - PropertyName, Name); - } - - public override void WriteToString(TextGenerator writer) - { - writer.WriteLine("PrintField(\"{0}\", has{1}, {2}_, writer);", Descriptor.Name, PropertyName, Name); - } - } -} \ No newline at end of file diff --git a/src/ProtoGen/EnumGenerator.cs b/src/ProtoGen/EnumGenerator.cs deleted file mode 100644 index a6ed45d..0000000 --- a/src/ProtoGen/EnumGenerator.cs +++ /dev/null @@ -1,62 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.ProtoGen -{ - internal class EnumGenerator : SourceGeneratorBase, ISourceGenerator - { - internal EnumGenerator(EnumDescriptor descriptor) : base(descriptor) - { - } - - // TODO(jonskeet): Write out enum descriptors? Can be retrieved from file... - public void Generate(TextGenerator writer) - { - WriteGeneratedCodeAttributes(writer); - writer.WriteLine("{0} enum {1} {{", ClassAccessLevel, Descriptor.Name); - writer.Indent(); - foreach (EnumValueDescriptor value in Descriptor.Values) - { - writer.WriteLine("{0} = {1},", value.Name, value.Number); - } - writer.Outdent(); - writer.WriteLine("}"); - writer.WriteLine(); - } - } -} \ No newline at end of file diff --git a/src/ProtoGen/ExtensionGenerator.cs b/src/ProtoGen/ExtensionGenerator.cs deleted file mode 100644 index a862a7a..0000000 --- a/src/ProtoGen/ExtensionGenerator.cs +++ /dev/null @@ -1,183 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.ProtoGen -{ - internal class ExtensionGenerator : FieldGeneratorBase, ISourceGenerator - { - private readonly string extends; - private readonly string scope; - private readonly string type; - private readonly string name; - - internal ExtensionGenerator(FieldDescriptor descriptor) - : base(descriptor, 0) - { - if (Descriptor.ExtensionScope != null) - { - scope = GetClassName(Descriptor.ExtensionScope); - } - else - { - scope = DescriptorUtil.GetFullUmbrellaClassName(Descriptor.File); - } - switch (Descriptor.MappedType) - { - case MappedType.Message: - type = GetClassName(Descriptor.MessageType); - break; - case MappedType.Enum: - type = GetClassName(Descriptor.EnumType); - break; - default: - type = DescriptorUtil.GetMappedTypeName(Descriptor.MappedType); - break; - } - extends = GetClassName(Descriptor.ContainingType); - name = Descriptor.CSharpOptions.PropertyName; - } - - public void Generate(TextGenerator writer) - { - if (Descriptor.File.CSharpOptions.ClsCompliance && GetFieldConstantName(Descriptor).StartsWith("_")) - { - writer.WriteLine("[global::System.CLSCompliant(false)]"); - } - - writer.WriteLine("public const int {0} = {1};", GetFieldConstantName(Descriptor), Descriptor.FieldNumber); - - if (UseLiteRuntime) - { - if (Descriptor.MappedType == MappedType.Message && Descriptor.MessageType.Options.MessageSetWireFormat) - { - throw new ArgumentException( - "option message_set_wire_format = true; is not supported in Lite runtime extensions."); - } - if (!Descriptor.IsCLSCompliant && Descriptor.File.CSharpOptions.ClsCompliance) - { - writer.WriteLine("[global::System.CLSCompliant(false)]"); - } - writer.WriteLine("{0} static pb::{4}<{1}, {2}> {3};", ClassAccessLevel, extends, type, name, - Descriptor.IsRepeated ? "GeneratedRepeatExtensionLite" : "GeneratedExtensionLite"); - } - else if (Descriptor.IsRepeated) - { - if (!Descriptor.IsCLSCompliant && Descriptor.File.CSharpOptions.ClsCompliance) - { - writer.WriteLine("[global::System.CLSCompliant(false)]"); - } - writer.WriteLine("{0} static pb::GeneratedExtensionBase> {2};", ClassAccessLevel, type, - name); - } - else - { - if (!Descriptor.IsCLSCompliant && Descriptor.File.CSharpOptions.ClsCompliance) - { - writer.WriteLine("[global::System.CLSCompliant(false)]"); - } - writer.WriteLine("{0} static pb::GeneratedExtensionBase<{1}> {2};", ClassAccessLevel, type, name); - } - } - - internal void GenerateStaticVariableInitializers(TextGenerator writer) - { - if (UseLiteRuntime) - { - writer.WriteLine("{0}.{1} = ", scope, name); - writer.Indent(); - writer.WriteLine("new pb::{0}<{1}, {2}>(", - Descriptor.IsRepeated ? "GeneratedRepeatExtensionLite" : "GeneratedExtensionLite", - extends, type); - writer.Indent(); - writer.WriteLine("\"{0}\",", Descriptor.FullName); - writer.WriteLine("{0}.DefaultInstance,", extends); - if (!Descriptor.IsRepeated) - { - writer.WriteLine("{0},", - Descriptor.HasDefaultValue - ? DefaultValue - : IsNullableType ? "null" : "default(" + type + ")"); - } - writer.WriteLine("{0},", - (Descriptor.MappedType == MappedType.Message) ? type + ".DefaultInstance" : "null"); - writer.WriteLine("{0},", - (Descriptor.MappedType == MappedType.Enum) ? "new EnumLiteMap<" + type + ">()" : "null"); - writer.WriteLine("{0}.{1}FieldNumber,", scope, name); - writer.Write("pbd::FieldType.{0}", Descriptor.FieldType); - if (Descriptor.IsRepeated) - { - writer.WriteLine(","); - writer.Write(Descriptor.IsPacked ? "true" : "false"); - } - writer.Outdent(); - writer.WriteLine(");"); - writer.Outdent(); - } - else if (Descriptor.IsRepeated) - { - writer.WriteLine( - "{0}.{1} = pb::GeneratedRepeatExtension<{2}>.CreateInstance({0}.Descriptor.Extensions[{3}]);", scope, - name, type, Descriptor.Index); - } - else - { - writer.WriteLine( - "{0}.{1} = pb::GeneratedSingleExtension<{2}>.CreateInstance({0}.Descriptor.Extensions[{3}]);", scope, - name, type, Descriptor.Index); - } - } - - internal void GenerateExtensionRegistrationCode(TextGenerator writer) - { - writer.WriteLine("registry.Add({0}.{1});", scope, name); - } - - public override void WriteHash(TextGenerator writer) - { - } - - public override void WriteEquals(TextGenerator writer) - { - } - - public override void WriteToString(TextGenerator writer) - { - } - } -} \ No newline at end of file diff --git a/src/ProtoGen/FieldGeneratorBase.cs b/src/ProtoGen/FieldGeneratorBase.cs deleted file mode 100644 index 93aee6c..0000000 --- a/src/ProtoGen/FieldGeneratorBase.cs +++ /dev/null @@ -1,389 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Globalization; -using System.Text; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.ProtoGen -{ - internal abstract class FieldGeneratorBase : SourceGeneratorBase - { - private readonly int _fieldOrdinal; - - protected FieldGeneratorBase(FieldDescriptor descriptor, int fieldOrdinal) - : base(descriptor) - { - _fieldOrdinal = fieldOrdinal; - } - - public abstract void WriteHash(TextGenerator writer); - public abstract void WriteEquals(TextGenerator writer); - public abstract void WriteToString(TextGenerator writer); - - public int FieldOrdinal - { - get { return _fieldOrdinal; } - } - - private static bool AllPrintableAscii(string text) - { - foreach (char c in text) - { - if (c < 0x20 || c > 0x7e) - { - return false; - } - } - return true; - } - - /// - /// This returns true if the field has a non-default default value. For instance this returns - /// false for numerics with a default of zero '0', or booleans with a default of false. - /// - protected bool HasDefaultValue - { - get - { - switch (Descriptor.FieldType) - { - case FieldType.Float: - case FieldType.Double: - case FieldType.Int32: - case FieldType.Int64: - case FieldType.SInt32: - case FieldType.SInt64: - case FieldType.SFixed32: - case FieldType.SFixed64: - case FieldType.UInt32: - case FieldType.UInt64: - case FieldType.Fixed32: - case FieldType.Fixed64: - { - IConvertible value = (IConvertible) Descriptor.DefaultValue; - return value.ToString(CultureInfo.InvariantCulture) != "0"; - } - case FieldType.Bool: - return ((bool) Descriptor.DefaultValue) == true; - default: - return true; - } - } - } - - /// Copy exists in ExtensionGenerator.cs - protected string DefaultValue - { - get - { - string suffix = ""; - switch (Descriptor.FieldType) - { - case FieldType.Float: - suffix = "F"; - break; - case FieldType.Double: - suffix = "D"; - break; - case FieldType.Int64: - suffix = "L"; - break; - case FieldType.UInt64: - suffix = "UL"; - break; - } - switch (Descriptor.FieldType) - { - case FieldType.Float: - case FieldType.Double: - case FieldType.Int32: - case FieldType.Int64: - case FieldType.SInt32: - case FieldType.SInt64: - case FieldType.SFixed32: - case FieldType.SFixed64: - case FieldType.UInt32: - case FieldType.UInt64: - case FieldType.Fixed32: - case FieldType.Fixed64: - { - // The simple Object.ToString converts using the current culture. - // We want to always use the invariant culture so it's predictable. - IConvertible value = (IConvertible) Descriptor.DefaultValue; - //a few things that must be handled explicitly - if (Descriptor.FieldType == FieldType.Double && value is double) - { - if (double.IsNaN((double) value)) - { - return "double.NaN"; - } - if (double.IsPositiveInfinity((double) value)) - { - return "double.PositiveInfinity"; - } - if (double.IsNegativeInfinity((double) value)) - { - return "double.NegativeInfinity"; - } - } - else if (Descriptor.FieldType == FieldType.Float && value is float) - { - if (float.IsNaN((float) value)) - { - return "float.NaN"; - } - if (float.IsPositiveInfinity((float) value)) - { - return "float.PositiveInfinity"; - } - if (float.IsNegativeInfinity((float) value)) - { - return "float.NegativeInfinity"; - } - } - return value.ToString(CultureInfo.InvariantCulture) + suffix; - } - case FieldType.Bool: - return (bool) Descriptor.DefaultValue ? "true" : "false"; - - case FieldType.Bytes: - if (!Descriptor.HasDefaultValue) - { - return "pb::ByteString.Empty"; - } - if (UseLiteRuntime && Descriptor.DefaultValue is ByteString) - { - string temp = (((ByteString) Descriptor.DefaultValue).ToBase64()); - return String.Format("pb::ByteString.FromBase64(\"{0}\")", temp); - } - return string.Format("(pb::ByteString) {0}.Descriptor.Fields[{1}].DefaultValue", - GetClassName(Descriptor.ContainingType), Descriptor.Index); - case FieldType.String: - if (AllPrintableAscii(Descriptor.Proto.DefaultValue)) - { - // All chars are ASCII and printable. In this case we only - // need to escape quotes and backslashes. - return "\"" + Descriptor.Proto.DefaultValue - .Replace("\\", "\\\\") - .Replace("'", "\\'") - .Replace("\"", "\\\"") - + "\""; - } - if (UseLiteRuntime && Descriptor.DefaultValue is String) - { - string temp = Convert.ToBase64String( - Encoding.UTF8.GetBytes((String) Descriptor.DefaultValue)); - return String.Format("pb::ByteString.FromBase64(\"{0}\").ToStringUtf8()", temp); - } - return string.Format("(string) {0}.Descriptor.Fields[{1}].DefaultValue", - GetClassName(Descriptor.ContainingType), Descriptor.Index); - case FieldType.Enum: - return TypeName + "." + ((EnumValueDescriptor) Descriptor.DefaultValue).Name; - case FieldType.Message: - case FieldType.Group: - return TypeName + ".DefaultInstance"; - default: - throw new InvalidOperationException("Invalid field descriptor type"); - } - } - } - - protected string PropertyName - { - get { return Descriptor.CSharpOptions.PropertyName; } - } - - protected string Name - { - get { return NameHelpers.UnderscoresToCamelCase(GetFieldName(Descriptor)); } - } - - protected int Number - { - get { return Descriptor.FieldNumber; } - } - - protected void AddNullCheck(TextGenerator writer) - { - AddNullCheck(writer, "value"); - } - - protected void AddNullCheck(TextGenerator writer, string name) - { - if (IsNullableType) - { - writer.WriteLine(" pb::ThrowHelper.ThrowIfNull({0}, \"{0}\");", name); - } - } - - protected void AddPublicMemberAttributes(TextGenerator writer) - { - AddDeprecatedFlag(writer); - AddClsComplianceCheck(writer); - } - - protected void AddClsComplianceCheck(TextGenerator writer) - { - if (!Descriptor.IsCLSCompliant && Descriptor.File.CSharpOptions.ClsCompliance) - { - writer.WriteLine("[global::System.CLSCompliant(false)]"); - } - } - - protected bool IsObsolete { get { return Descriptor.Options.Deprecated; } } - - /// - /// Writes [global::System.ObsoleteAttribute()] if the member is obsolete - /// - protected void AddDeprecatedFlag(TextGenerator writer) - { - if (IsObsolete) - { - writer.WriteLine("[global::System.ObsoleteAttribute()]"); - } - } - - /// - /// For encodings with fixed sizes, returns that size in bytes. Otherwise - /// returns -1. TODO(jonskeet): Make this less ugly. - /// - protected int FixedSize - { - get - { - switch (Descriptor.FieldType) - { - case FieldType.UInt32: - case FieldType.UInt64: - case FieldType.Int32: - case FieldType.Int64: - case FieldType.SInt32: - case FieldType.SInt64: - case FieldType.Enum: - case FieldType.Bytes: - case FieldType.String: - case FieldType.Message: - case FieldType.Group: - return -1; - case FieldType.Float: - return WireFormat.FloatSize; - case FieldType.SFixed32: - return WireFormat.SFixed32Size; - case FieldType.Fixed32: - return WireFormat.Fixed32Size; - case FieldType.Double: - return WireFormat.DoubleSize; - case FieldType.SFixed64: - return WireFormat.SFixed64Size; - case FieldType.Fixed64: - return WireFormat.Fixed64Size; - case FieldType.Bool: - return WireFormat.BoolSize; - default: - throw new InvalidOperationException("Invalid field descriptor type"); - } - } - } - - protected bool IsNullableType - { - get - { - switch (Descriptor.FieldType) - { - case FieldType.Float: - case FieldType.Double: - case FieldType.Int32: - case FieldType.Int64: - case FieldType.SInt32: - case FieldType.SInt64: - case FieldType.SFixed32: - case FieldType.SFixed64: - case FieldType.UInt32: - case FieldType.UInt64: - case FieldType.Fixed32: - case FieldType.Fixed64: - case FieldType.Bool: - case FieldType.Enum: - return false; - case FieldType.Bytes: - case FieldType.String: - case FieldType.Message: - case FieldType.Group: - return true; - default: - throw new InvalidOperationException("Invalid field descriptor type"); - } - } - } - - protected string TypeName - { - get - { - switch (Descriptor.FieldType) - { - case FieldType.Enum: - return GetClassName(Descriptor.EnumType); - case FieldType.Message: - case FieldType.Group: - return GetClassName(Descriptor.MessageType); - default: - return DescriptorUtil.GetMappedTypeName(Descriptor.MappedType); - } - } - } - - protected string MessageOrGroup - { - get { return Descriptor.FieldType == FieldType.Group ? "Group" : "Message"; } - } - - /// - /// Returns the type name as used in CodedInputStream method names: SFixed32, UInt32 etc. - /// - protected string CapitalizedTypeName - { - get - { - // Our enum names match perfectly. How serendipitous. - return Descriptor.FieldType.ToString(); - } - } - } -} \ No newline at end of file diff --git a/src/ProtoGen/Generator.cs b/src/ProtoGen/Generator.cs deleted file mode 100644 index bc481ec..0000000 --- a/src/ProtoGen/Generator.cs +++ /dev/null @@ -1,267 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using Google.ProtocolBuffers.Collections; -using Google.ProtocolBuffers.Compiler.PluginProto; -using Google.ProtocolBuffers.DescriptorProtos; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.ProtoGen -{ - /// - /// Code generator for protocol buffers. Only C# is supported at the moment. - /// - public sealed class Generator - { - private readonly GeneratorOptions options; - - private Generator(GeneratorOptions options) - { - options.Validate(); - this.options = options; - } - - /// - /// Returns a generator configured with the specified options. - /// - public static Generator CreateGenerator(GeneratorOptions options) - { - return new Generator(options); - } - - public void Generate(CodeGeneratorRequest request, CodeGeneratorResponse.Builder response) - { - IList descriptors = ConvertDescriptors(options.FileOptions, request.ProtoFileList); - - // Combine with options from command line - foreach (FileDescriptor descriptor in descriptors) - { - descriptor.ConfigureWithDefaultOptions(options.FileOptions); - } - - bool duplicates = false; - Dictionary names = new Dictionary(StringComparer.OrdinalIgnoreCase); - foreach (FileDescriptor descriptor in descriptors) - { - string file = GetOutputFile(descriptor, false); - if (names.ContainsKey(file)) - { - duplicates = true; - break; - } - names.Add(file, true); - } - - //ROK - Changed to dictionary from HashSet to allow 2.0 compile - var filesToGenerate = new Dictionary(StringComparer.OrdinalIgnoreCase); - foreach (var item in request.FileToGenerateList) - { - filesToGenerate[item] = null; - } - foreach (FileDescriptor descriptor in descriptors) - { - // Optionally exclude descriptors in google.protobuf - if (descriptor.CSharpOptions.IgnoreGoogleProtobuf && descriptor.Package == "google.protobuf") - { - continue; - } - if (filesToGenerate.ContainsKey(descriptor.Name)) - { - Generate(descriptor, duplicates, response); - } - } - } - - /// - /// Generates code for a particular file. All dependencies must - /// already have been resolved. - /// - private void Generate(FileDescriptor descriptor, bool duplicates, CodeGeneratorResponse.Builder response) - { - var code = new StringBuilder(); - var ucg = new UmbrellaClassGenerator(descriptor); - using (StringWriter textWriter = new StringWriter(code)) - { - TextGenerator writer = new TextGenerator(textWriter, options.LineBreak); - ucg.Generate(writer); - } - response.AddFile(new CodeGeneratorResponse.Types.File.Builder - { - Name = GetOutputFile(descriptor, duplicates), - Content = code.ToString(), - }.Build()); - } - - private string GetOutputFile(FileDescriptor descriptor, bool duplicates) - { - CSharpFileOptions fileOptions = descriptor.CSharpOptions; - - string filename = descriptor.CSharpOptions.UmbrellaClassname + descriptor.CSharpOptions.FileExtension; - if (duplicates) - { - string namepart; - if (String.IsNullOrEmpty(descriptor.Name) || String.IsNullOrEmpty(namepart = Path.GetFileNameWithoutExtension(descriptor.Name))) - throw new ApplicationException("Duplicate UmbrellaClassname options created a file name collision."); - - filename = namepart + descriptor.CSharpOptions.FileExtension; - } - - string outputDirectory = descriptor.CSharpOptions.OutputDirectory; - if (fileOptions.ExpandNamespaceDirectories) - { - string package = fileOptions.Namespace; - if (!string.IsNullOrEmpty(package)) - { - string[] bits = package.Split('.'); - foreach (string bit in bits) - { - outputDirectory = Path.Combine(outputDirectory, bit); - } - } - } - - // As the directory can be explicitly specified in options, we need to make sure it exists - Directory.CreateDirectory(outputDirectory); - return Path.Combine(outputDirectory, filename); - } - - /// - /// Resolves any dependencies and converts FileDescriptorProtos into FileDescriptors. - /// The list returned is in the same order as the protos are listed in the descriptor set. - /// Note: this method is internal rather than private to allow testing. - /// - /// Not all dependencies could be resolved. - public static IList ConvertDescriptors(CSharpFileOptions options, - IList fileList) - { - FileDescriptor[] converted = new FileDescriptor[fileList.Count]; - - Dictionary convertedMap = new Dictionary(); - - int totalConverted = 0; - - bool madeProgress = true; - while (madeProgress && totalConverted < converted.Length) - { - madeProgress = false; - for (int i = 0; i < converted.Length; i++) - { - if (converted[i] != null) - { - // Already done this one - continue; - } - FileDescriptorProto candidate = fileList[i]; - FileDescriptor[] dependencies = new FileDescriptor[candidate.DependencyList.Count]; - - - CSharpFileOptions.Builder builder = options.ToBuilder(); - if (candidate.Options.HasExtension(CSharpOptions.CSharpFileOptions)) - { - builder.MergeFrom( - candidate.Options.GetExtension(CSharpOptions.CSharpFileOptions)); - } - CSharpFileOptions localOptions = builder.Build(); - - bool foundAllDependencies = true; - for (int j = 0; j < dependencies.Length; j++) - { - if (!convertedMap.TryGetValue(candidate.DependencyList[j], out dependencies[j])) - { - // We can auto-magically resolve these since we already have their description - // This way if the file is only referencing options it does not need to be built with the - // --include_imports definition. - if (localOptions.IgnoreGoogleProtobuf && - (candidate.DependencyList[j] == "google/protobuf/csharp_options.proto")) - { - dependencies[j] = CSharpOptions.Descriptor; - continue; - } - if (localOptions.IgnoreGoogleProtobuf && - (candidate.DependencyList[j] == "google/protobuf/descriptor.proto")) - { - dependencies[j] = DescriptorProtoFile.Descriptor; - continue; - } - foundAllDependencies = false; - break; - } - } - if (!foundAllDependencies) - { - continue; - } - madeProgress = true; - totalConverted++; - converted[i] = FileDescriptor.BuildFrom(candidate, dependencies); - convertedMap[candidate.Name] = converted[i]; - } - } - if (!madeProgress) - { - StringBuilder remaining = new StringBuilder(); - for (int i = 0; i < converted.Length; i++) - { - if (converted[i] == null) - { - if (remaining.Length != 0) - { - remaining.Append(", "); - } - FileDescriptorProto failure = fileList[i]; - remaining.Append(failure.Name); - remaining.Append(":"); - foreach (string dependency in failure.DependencyList) - { - if (!convertedMap.ContainsKey(dependency)) - { - remaining.Append(" "); - remaining.Append(dependency); - } - } - remaining.Append(";"); - } - } - throw new DependencyResolutionException("Unable to resolve all dependencies: " + remaining); - } - return Lists.AsReadOnly(converted); - } - } -} \ No newline at end of file diff --git a/src/ProtoGen/GeneratorOptions.cs b/src/ProtoGen/GeneratorOptions.cs deleted file mode 100644 index ec500d8..0000000 --- a/src/ProtoGen/GeneratorOptions.cs +++ /dev/null @@ -1,330 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using System.IO; -using System.Text.RegularExpressions; -using Google.ProtocolBuffers.DescriptorProtos; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.ProtoGen -{ - /// - /// All the configuration required for the generator - where to generate - /// output files, the location of input files etc. While this isn't immutable - /// in practice, the contents shouldn't be changed after being passed to - /// the generator. - /// - public sealed class GeneratorOptions - { - private static Dictionary LineBreaks = - new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - {"Windows", "\r\n"}, - {"Unix", "\n"}, - {"Default", Environment.NewLine} - }; - - public IList InputFiles { get; set; } - - public GeneratorOptions() - { - LineBreak = Environment.NewLine; - } - - /// - /// Attempts to validate the options, but doesn't throw an exception if they're invalid. - /// Instead, when this method returns false, the output variable will contain a collection - /// of reasons for the validation failure. - /// - /// Variable to receive a list of reasons in case of validation failure. - /// true if the options are valid; false otherwise - public bool TryValidate(out IList reasons) - { - List tmpReasons = new List(); - - ParseArguments(tmpReasons); - - // Output directory validation - if (string.IsNullOrEmpty(FileOptions.OutputDirectory)) - { - tmpReasons.Add("No output directory specified"); - } - else - { - if (!Directory.Exists(FileOptions.OutputDirectory)) - { - tmpReasons.Add("Specified output directory (" + FileOptions.OutputDirectory + " doesn't exist."); - } - } - - // Input file validation (just in terms of presence) - if (InputFiles == null || InputFiles.Count == 0) - { - tmpReasons.Add("No input files specified"); - } - else - { - foreach (string input in InputFiles) - { - FileInfo fi = new FileInfo(input); - if (!fi.Exists) - { - tmpReasons.Add("Input file " + input + " doesn't exist."); - } - } - } - - if (tmpReasons.Count != 0) - { - reasons = tmpReasons; - return false; - } - - reasons = null; - return true; - } - - /// - /// Validates that all the options have been set and are valid, - /// throwing an exception if they haven't. - /// - /// The options are invalid. - public void Validate() - { - IList reasons; - if (!TryValidate(out reasons)) - { - throw new InvalidOptionsException(reasons); - } - } - - // Raw arguments, used to provide defaults for proto file options - public IList Arguments { get; set; } - - [Obsolete("Please use GeneratorOptions.FileOptions.OutputDirectory instead")] - public string OutputDirectory - { - get { return FileOptions.OutputDirectory; } - set - { - CSharpFileOptions.Builder bld = FileOptions.ToBuilder(); - bld.OutputDirectory = value; - FileOptions = bld.Build(); - } - } - - private static readonly Regex ArgMatch = new Regex(@"^[-/](?[\w_]+?)[:=](?.*)$"); - private CSharpFileOptions fileOptions; - - public CSharpFileOptions FileOptions - { - get { return fileOptions ?? (fileOptions = CSharpFileOptions.DefaultInstance); } - set { fileOptions = value; } - } - - public string LineBreak { get; set; } - - private void ParseArguments(IList tmpReasons) - { - bool doHelp = Arguments.Count == 0; - - InputFiles = new List(); - CSharpFileOptions.Builder builder = FileOptions.ToBuilder(); - Dictionary fields = - new Dictionary(StringComparer.OrdinalIgnoreCase); - foreach (FieldDescriptor fld in builder.DescriptorForType.Fields) - { - fields.Add(fld.Name, fld); - } - - foreach (string argument in Arguments) - { - if (StringComparer.OrdinalIgnoreCase.Equals("-help", argument) || - StringComparer.OrdinalIgnoreCase.Equals("/help", argument) || - StringComparer.OrdinalIgnoreCase.Equals("-?", argument) || - StringComparer.OrdinalIgnoreCase.Equals("/?", argument)) - { - doHelp = true; - break; - } - - Match m = ArgMatch.Match(argument); - if (m.Success) - { - FieldDescriptor fld; - string name = m.Groups["name"].Value; - string value = m.Groups["value"].Value; - - if (fields.TryGetValue(name, out fld)) - { - object obj; - if (TryCoerceType(value, fld, out obj, tmpReasons)) - { - builder[fld] = obj; - } - } - else if (name == "line_break") - { - string tmp; - if (LineBreaks.TryGetValue(value, out tmp)) - { - LineBreak = tmp; - } - else - { - tmpReasons.Add("Invalid value for 'line_break': " + value + "."); - } - } - else if (!File.Exists(argument)) - { - doHelp = true; - tmpReasons.Add("Unknown argument '" + name + "'."); - } - else - { - InputFiles.Add(argument); - } - } - else - { - InputFiles.Add(argument); - } - } - - if (doHelp || InputFiles.Count == 0) - { - tmpReasons.Add("Arguments:"); - foreach (KeyValuePair field in fields) - { - tmpReasons.Add(String.Format("-{0}=[{1}]", field.Key, field.Value.FieldType)); - } - tmpReasons.Add("-line_break=[" + string.Join("|", new List(LineBreaks.Keys).ToArray()) + "]"); - tmpReasons.Add("followed by one or more file paths."); - } - else - { - FileOptions = builder.Build(); - } - } - - private static bool TryCoerceType(string text, FieldDescriptor field, out object value, IList tmpReasons) - { - value = null; - - switch (field.FieldType) - { - case FieldType.Int32: - case FieldType.SInt32: - case FieldType.SFixed32: - value = Int32.Parse(text); - break; - - case FieldType.Int64: - case FieldType.SInt64: - case FieldType.SFixed64: - value = Int64.Parse(text); - break; - - case FieldType.UInt32: - case FieldType.Fixed32: - value = UInt32.Parse(text); - break; - - case FieldType.UInt64: - case FieldType.Fixed64: - value = UInt64.Parse(text); - break; - - case FieldType.Float: - value = float.Parse(text); - break; - - case FieldType.Double: - value = Double.Parse(text); - break; - - case FieldType.Bool: - value = Boolean.Parse(text); - break; - - case FieldType.String: - value = text; - break; - - case FieldType.Enum: - { - EnumDescriptor enumType = field.EnumType; - - int number; - if (int.TryParse(text, out number)) - { - value = enumType.FindValueByNumber(number); - if (value == null) - { - tmpReasons.Add( - "Enum type \"" + enumType.FullName + - "\" has no value with number " + number + "."); - return false; - } - } - else - { - value = enumType.FindValueByName(text); - if (value == null) - { - tmpReasons.Add( - "Enum type \"" + enumType.FullName + - "\" has no value named \"" + text + "\"."); - return false; - } - } - - break; - } - - case FieldType.Bytes: - case FieldType.Message: - case FieldType.Group: - tmpReasons.Add("Unhandled field type " + field.FieldType.ToString() + "."); - return false; - } - - return true; - } - } -} \ No newline at end of file diff --git a/src/ProtoGen/Helpers.cs b/src/ProtoGen/Helpers.cs deleted file mode 100644 index 3c00115..0000000 --- a/src/ProtoGen/Helpers.cs +++ /dev/null @@ -1,45 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -namespace Google.ProtocolBuffers.ProtoGen -{ - /// - /// Helpers to resolve class names etc. - /// - internal static class Helpers - { - } -} \ No newline at end of file diff --git a/src/ProtoGen/IFieldSourceGenerator.cs b/src/ProtoGen/IFieldSourceGenerator.cs deleted file mode 100644 index f53ae5e..0000000 --- a/src/ProtoGen/IFieldSourceGenerator.cs +++ /dev/null @@ -1,53 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -namespace Google.ProtocolBuffers.ProtoGen -{ - internal interface IFieldSourceGenerator - { - void GenerateMembers(TextGenerator writer); - void GenerateBuilderMembers(TextGenerator writer); - void GenerateMergingCode(TextGenerator writer); - void GenerateBuildingCode(TextGenerator writer); - void GenerateParsingCode(TextGenerator writer); - void GenerateSerializationCode(TextGenerator writer); - void GenerateSerializedSizeCode(TextGenerator writer); - - void WriteHash(TextGenerator writer); - void WriteEquals(TextGenerator writer); - void WriteToString(TextGenerator writer); - } -} \ No newline at end of file diff --git a/src/ProtoGen/ISourceGenerator.cs b/src/ProtoGen/ISourceGenerator.cs deleted file mode 100644 index 452d854..0000000 --- a/src/ProtoGen/ISourceGenerator.cs +++ /dev/null @@ -1,43 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -namespace Google.ProtocolBuffers.ProtoGen -{ - internal interface ISourceGenerator - { - void Generate(TextGenerator writer); - } -} \ No newline at end of file diff --git a/src/ProtoGen/InvalidOptionsException.cs b/src/ProtoGen/InvalidOptionsException.cs deleted file mode 100644 index fb69849..0000000 --- a/src/ProtoGen/InvalidOptionsException.cs +++ /dev/null @@ -1,77 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using System.Text; -using Google.ProtocolBuffers.Collections; - -namespace Google.ProtocolBuffers.ProtoGen -{ - /// - /// Exception thrown to indicate that the options passed were invalid. - /// - public sealed class InvalidOptionsException : Exception - { - private readonly IList reasons; - - /// - /// An immutable list of reasons why the options were invalid. - /// - public IList Reasons - { - get { return reasons; } - } - - public InvalidOptionsException(IList reasons) - : base(BuildMessage(reasons)) - { - this.reasons = Lists.AsReadOnly(reasons); - } - - private static string BuildMessage(IEnumerable reasons) - { - StringBuilder builder = new StringBuilder("Invalid options:"); - builder.AppendLine(); - foreach (string reason in reasons) - { - builder.Append(" "); - builder.AppendLine(reason); - } - return builder.ToString(); - } - } -} \ No newline at end of file diff --git a/src/ProtoGen/MessageFieldGenerator.cs b/src/ProtoGen/MessageFieldGenerator.cs deleted file mode 100644 index 25b58a6..0000000 --- a/src/ProtoGen/MessageFieldGenerator.cs +++ /dev/null @@ -1,174 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.ProtoGen -{ - internal class MessageFieldGenerator : FieldGeneratorBase, IFieldSourceGenerator - { - internal MessageFieldGenerator(FieldDescriptor descriptor, int fieldOrdinal) - : base(descriptor, fieldOrdinal) - { - } - - public void GenerateMembers(TextGenerator writer) - { - writer.WriteLine("private bool has{0};", PropertyName); - writer.WriteLine("private {0} {1}_;", TypeName, Name); - AddDeprecatedFlag(writer); - writer.WriteLine("public bool Has{0} {{", PropertyName); - writer.WriteLine(" get {{ return has{0}; }}", PropertyName); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public {0} {1} {{", TypeName, PropertyName); - writer.WriteLine(" get {{ return {0}_ ?? {1}; }}", Name, DefaultValue); - writer.WriteLine("}"); - } - - public void GenerateBuilderMembers(TextGenerator writer) - { - AddDeprecatedFlag(writer); - writer.WriteLine("public bool Has{0} {{", PropertyName); - writer.WriteLine(" get {{ return result.has{0}; }}", PropertyName); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public {0} {1} {{", TypeName, PropertyName); - writer.WriteLine(" get {{ return result.{0}; }}", PropertyName); - writer.WriteLine(" set {{ Set{0}(value); }}", PropertyName); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public Builder Set{0}({1} value) {{", PropertyName, TypeName); - AddNullCheck(writer); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.has{0} = true;", PropertyName); - writer.WriteLine(" result.{0}_ = value;", Name); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public Builder Set{0}({1}.Builder builderForValue) {{", PropertyName, TypeName); - AddNullCheck(writer, "builderForValue"); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.has{0} = true;", PropertyName); - writer.WriteLine(" result.{0}_ = builderForValue.Build();", Name); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public Builder Merge{0}({1} value) {{", PropertyName, TypeName); - AddNullCheck(writer); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" if (result.has{0} &&", PropertyName); - writer.WriteLine(" result.{0}_ != {1}) {{", Name, DefaultValue); - writer.WriteLine(" result.{0}_ = {1}.CreateBuilder(result.{0}_).MergeFrom(value).BuildPartial();", Name, - TypeName); - writer.WriteLine(" } else {"); - writer.WriteLine(" result.{0}_ = value;", Name); - writer.WriteLine(" }"); - writer.WriteLine(" result.has{0} = true;", PropertyName); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public Builder Clear{0}() {{", PropertyName); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.has{0} = false;", PropertyName); - writer.WriteLine(" result.{0}_ = null;", Name); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - } - - public void GenerateMergingCode(TextGenerator writer) - { - writer.WriteLine("if (other.Has{0}) {{", PropertyName); - writer.WriteLine(" Merge{0}(other.{0});", PropertyName); - writer.WriteLine("}"); - } - - public void GenerateBuildingCode(TextGenerator writer) - { - // Nothing to do for singular fields - } - - public void GenerateParsingCode(TextGenerator writer) - { - writer.WriteLine("{0}.Builder subBuilder = {0}.CreateBuilder();", TypeName); - writer.WriteLine("if (result.has{0}) {{", PropertyName); - writer.WriteLine(" subBuilder.MergeFrom({0});", PropertyName); - writer.WriteLine("}"); - if (Descriptor.FieldType == FieldType.Group) - { - writer.WriteLine("input.ReadGroup({0}, subBuilder, extensionRegistry);", Number); - } - else - { - writer.WriteLine("input.ReadMessage(subBuilder, extensionRegistry);"); - } - writer.WriteLine("{0} = subBuilder.BuildPartial();", PropertyName); - } - - public void GenerateSerializationCode(TextGenerator writer) - { - writer.WriteLine("if (has{0}) {{", PropertyName); - writer.WriteLine(" output.Write{0}({1}, field_names[{3}], {2});", MessageOrGroup, Number, PropertyName, - FieldOrdinal); - writer.WriteLine("}"); - } - - public void GenerateSerializedSizeCode(TextGenerator writer) - { - writer.WriteLine("if (has{0}) {{", PropertyName); - writer.WriteLine(" size += pb::CodedOutputStream.Compute{0}Size({1}, {2});", - MessageOrGroup, Number, PropertyName); - writer.WriteLine("}"); - } - - public override void WriteHash(TextGenerator writer) - { - writer.WriteLine("if (has{0}) hash ^= {1}_.GetHashCode();", PropertyName, Name); - } - - public override void WriteEquals(TextGenerator writer) - { - writer.WriteLine("if (has{0} != other.has{0} || (has{0} && !{1}_.Equals(other.{1}_))) return false;", - PropertyName, Name); - } - - public override void WriteToString(TextGenerator writer) - { - writer.WriteLine("PrintField(\"{2}\", has{0}, {1}_, writer);", PropertyName, Name, - Descriptor.FieldType == FieldType.Group ? Descriptor.MessageType.Name : Descriptor.Name); - } - } -} \ No newline at end of file diff --git a/src/ProtoGen/MessageGenerator.cs b/src/ProtoGen/MessageGenerator.cs deleted file mode 100644 index e7ed1e8..0000000 --- a/src/ProtoGen/MessageGenerator.cs +++ /dev/null @@ -1,893 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using Google.ProtocolBuffers.DescriptorProtos; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.ProtoGen -{ - internal class MessageGenerator : SourceGeneratorBase, ISourceGenerator - { - private string[] _fieldNames; - - internal MessageGenerator(MessageDescriptor descriptor) : base(descriptor) - { - } - - private string ClassName - { - get { return Descriptor.Name; } - } - - private string FullClassName - { - get { return GetClassName(Descriptor); } - } - - /// - /// Get an identifier that uniquely identifies this type within the file. - /// This is used to declare static variables related to this type at the - /// outermost file scope. - /// - private static string GetUniqueFileScopeIdentifier(IDescriptor descriptor) - { - return "static_" + descriptor.FullName.Replace(".", "_"); - } - - internal void GenerateStaticVariables(TextGenerator writer) - { - // Because descriptor.proto (Google.ProtocolBuffers.DescriptorProtos) is - // used in the construction of descriptors, we have a tricky bootstrapping - // problem. To help control static initialization order, we make sure all - // descriptors and other static data that depends on them are members of - // the proto-descriptor class. This way, they will be initialized in - // a deterministic order. - - string identifier = GetUniqueFileScopeIdentifier(Descriptor); - - if (!UseLiteRuntime) - { - // The descriptor for this type. - string access = Descriptor.File.CSharpOptions.NestClasses ? "private" : "internal"; - writer.WriteLine("{0} static pbd::MessageDescriptor internal__{1}__Descriptor;", access, identifier); - writer.WriteLine( - "{0} static pb::FieldAccess.FieldAccessorTable<{1}, {1}.Builder> internal__{2}__FieldAccessorTable;", - access, FullClassName, identifier); - } - // Generate static members for all nested types. - foreach (MessageDescriptor nestedMessage in Descriptor.NestedTypes) - { - new MessageGenerator(nestedMessage).GenerateStaticVariables(writer); - } - } - - internal void GenerateStaticVariableInitializers(TextGenerator writer) - { - string identifier = GetUniqueFileScopeIdentifier(Descriptor); - - if (!UseLiteRuntime) - { - writer.Write("internal__{0}__Descriptor = ", identifier); - if (Descriptor.ContainingType == null) - { - writer.WriteLine("Descriptor.MessageTypes[{0}];", Descriptor.Index); - } - else - { - writer.WriteLine("internal__{0}__Descriptor.NestedTypes[{1}];", - GetUniqueFileScopeIdentifier(Descriptor.ContainingType), Descriptor.Index); - } - - writer.WriteLine("internal__{0}__FieldAccessorTable = ", identifier); - writer.WriteLine( - " new pb::FieldAccess.FieldAccessorTable<{1}, {1}.Builder>(internal__{0}__Descriptor,", - identifier, FullClassName); - writer.Print(" new string[] { "); - foreach (FieldDescriptor field in Descriptor.Fields) - { - writer.Write("\"{0}\", ", field.CSharpOptions.PropertyName); - } - writer.WriteLine("});"); - } - - // Generate static member initializers for all nested types. - foreach (MessageDescriptor nestedMessage in Descriptor.NestedTypes) - { - new MessageGenerator(nestedMessage).GenerateStaticVariableInitializers(writer); - } - - foreach (FieldDescriptor extension in Descriptor.Extensions) - { - new ExtensionGenerator(extension).GenerateStaticVariableInitializers(writer); - } - } - - public string[] FieldNames - { - get - { - if (_fieldNames == null) - { - List names = new List(); - foreach (FieldDescriptor fieldDescriptor in Descriptor.Fields) - { - names.Add(fieldDescriptor.Name); - } - //if you change this, the search must also change in GenerateBuilderParsingMethods - names.Sort(StringComparer.Ordinal); - _fieldNames = names.ToArray(); - } - return _fieldNames; - } - } - - internal int FieldOrdinal(FieldDescriptor field) - { - return Array.BinarySearch(FieldNames, field.Name, StringComparer.Ordinal); - } - - private IFieldSourceGenerator CreateFieldGenerator(FieldDescriptor fieldDescriptor) - { - return SourceGenerators.CreateFieldGenerator(fieldDescriptor, FieldOrdinal(fieldDescriptor)); - } - - public void Generate(TextGenerator writer) - { - if (Descriptor.File.CSharpOptions.AddSerializable) - { - writer.WriteLine("[global::System.SerializableAttribute()]"); - } - writer.WriteLine("[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]"); - WriteGeneratedCodeAttributes(writer); - writer.WriteLine("{0} sealed partial class {1} : pb::{2}Message{3}<{1}, {1}.Builder> {{", - ClassAccessLevel, ClassName, - Descriptor.Proto.ExtensionRangeCount > 0 ? "Extendable" : "Generated", - RuntimeSuffix); - writer.Indent(); - if (Descriptor.File.CSharpOptions.GeneratePrivateCtor) - { - writer.WriteLine("private {0}() {{ }}", ClassName); - } - // Must call MakeReadOnly() to make sure all lists are made read-only - writer.WriteLine("private static readonly {0} defaultInstance = new {0}().MakeReadOnly();", ClassName); - - if (OptimizeSpeed) - { - writer.WriteLine("private static readonly string[] _{0}FieldNames = new string[] {{ {2}{1}{2} }};", - NameHelpers.UnderscoresToCamelCase(ClassName), String.Join("\", \"", FieldNames), - FieldNames.Length > 0 ? "\"" : ""); - List tags = new List(); - foreach (string name in FieldNames) - { - tags.Add(WireFormat.MakeTag(Descriptor.FindFieldByName(name)).ToString()); - } - - writer.WriteLine("private static readonly uint[] _{0}FieldTags = new uint[] {{ {1} }};", - NameHelpers.UnderscoresToCamelCase(ClassName), String.Join(", ", tags.ToArray())); - } - writer.WriteLine("public static {0} DefaultInstance {{", ClassName); - writer.WriteLine(" get { return defaultInstance; }"); - writer.WriteLine("}"); - writer.WriteLine(); - writer.WriteLine("public override {0} DefaultInstanceForType {{", ClassName); - writer.WriteLine(" get { return DefaultInstance; }"); - writer.WriteLine("}"); - writer.WriteLine(); - writer.WriteLine("protected override {0} ThisMessage {{", ClassName); - writer.WriteLine(" get { return this; }"); - writer.WriteLine("}"); - writer.WriteLine(); - if (!UseLiteRuntime) - { - writer.WriteLine("public static pbd::MessageDescriptor Descriptor {"); - writer.WriteLine(" get {{ return {0}.internal__{1}__Descriptor; }}", - DescriptorUtil.GetFullUmbrellaClassName(Descriptor), - GetUniqueFileScopeIdentifier(Descriptor)); - writer.WriteLine("}"); - writer.WriteLine(); - writer.WriteLine( - "protected override pb::FieldAccess.FieldAccessorTable<{0}, {0}.Builder> InternalFieldAccessors {{", - ClassName); - writer.WriteLine(" get {{ return {0}.internal__{1}__FieldAccessorTable; }}", - DescriptorUtil.GetFullUmbrellaClassName(Descriptor), - GetUniqueFileScopeIdentifier(Descriptor)); - writer.WriteLine("}"); - writer.WriteLine(); - } - - // Extensions don't need to go in an extra nested type - WriteChildren(writer, null, Descriptor.Extensions); - - if (Descriptor.EnumTypes.Count + Descriptor.NestedTypes.Count > 0) - { - writer.WriteLine("#region Nested types"); - writer.WriteLine("[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]"); - WriteGeneratedCodeAttributes(writer); - writer.WriteLine("public static partial class Types {"); - writer.Indent(); - WriteChildren(writer, null, Descriptor.EnumTypes); - WriteChildren(writer, null, Descriptor.NestedTypes); - writer.Outdent(); - writer.WriteLine("}"); - writer.WriteLine("#endregion"); - writer.WriteLine(); - } - - foreach (FieldDescriptor fieldDescriptor in Descriptor.Fields) - { - if (Descriptor.File.CSharpOptions.ClsCompliance && GetFieldConstantName(fieldDescriptor).StartsWith("_")) - { - writer.WriteLine("[global::System.CLSCompliant(false)]"); - } - - // Rats: we lose the debug comment here :( - writer.WriteLine("public const int {0} = {1};", GetFieldConstantName(fieldDescriptor), - fieldDescriptor.FieldNumber); - CreateFieldGenerator(fieldDescriptor).GenerateMembers(writer); - writer.WriteLine(); - } - - if (OptimizeSpeed) - { - GenerateIsInitialized(writer); - GenerateMessageSerializationMethods(writer); - } - if (UseLiteRuntime) - { - GenerateLiteRuntimeMethods(writer); - } - - GenerateParseFromMethods(writer); - GenerateBuilder(writer); - - // Force the static initialization code for the file to run, since it may - // initialize static variables declared in this class. - writer.WriteLine("static {0}() {{", ClassName); - // We call object.ReferenceEquals() just to make it a valid statement on its own. - // Another option would be GetType(), but that causes problems in DescriptorProtoFile, - // where the bootstrapping is somewhat recursive - type initializers call - // each other, effectively. We temporarily see Descriptor as null. - writer.WriteLine(" object.ReferenceEquals({0}.Descriptor, null);", - DescriptorUtil.GetFullUmbrellaClassName(Descriptor)); - writer.WriteLine("}"); - - writer.Outdent(); - writer.WriteLine("}"); - writer.WriteLine(); - } - - private void GenerateLiteRuntimeMethods(TextGenerator writer) - { - bool callbase = Descriptor.Proto.ExtensionRangeCount > 0; - writer.WriteLine("#region Lite runtime methods"); - writer.WriteLine("public override int GetHashCode() {"); - writer.Indent(); - writer.WriteLine("int hash = GetType().GetHashCode();"); - foreach (FieldDescriptor fieldDescriptor in Descriptor.Fields) - { - CreateFieldGenerator(fieldDescriptor).WriteHash(writer); - } - if (callbase) - { - writer.WriteLine("hash ^= base.GetHashCode();"); - } - writer.WriteLine("return hash;"); - writer.Outdent(); - writer.WriteLine("}"); - writer.WriteLine(); - - writer.WriteLine("public override bool Equals(object obj) {"); - writer.Indent(); - writer.WriteLine("{0} other = obj as {0};", ClassName); - writer.WriteLine("if (other == null) return false;"); - foreach (FieldDescriptor fieldDescriptor in Descriptor.Fields) - { - CreateFieldGenerator(fieldDescriptor).WriteEquals(writer); - } - if (callbase) - { - writer.WriteLine("if (!base.Equals(other)) return false;"); - } - writer.WriteLine("return true;"); - writer.Outdent(); - writer.WriteLine("}"); - writer.WriteLine(); - - writer.WriteLine("public override void PrintTo(global::System.IO.TextWriter writer) {"); - writer.Indent(); - List sorted = new List(Descriptor.Fields); - sorted.Sort( - new Comparison( - delegate(FieldDescriptor a, FieldDescriptor b) { return a.FieldNumber.CompareTo(b.FieldNumber); })); - foreach (FieldDescriptor fieldDescriptor in sorted) - { - CreateFieldGenerator(fieldDescriptor).WriteToString(writer); - } - if (callbase) - { - writer.WriteLine("base.PrintTo(writer);"); - } - writer.Outdent(); - writer.WriteLine("}"); - writer.WriteLine("#endregion"); - writer.WriteLine(); - } - - private void GenerateMessageSerializationMethods(TextGenerator writer) - { - List sortedFields = new List(Descriptor.Fields); - sortedFields.Sort((f1, f2) => f1.FieldNumber.CompareTo(f2.FieldNumber)); - - List sortedExtensions = - new List(Descriptor.Proto.ExtensionRangeList); - sortedExtensions.Sort((r1, r2) => (r1.Start.CompareTo(r2.Start))); - - writer.WriteLine("public override void WriteTo(pb::ICodedOutputStream output) {"); - writer.Indent(); - // Make sure we've computed the serialized length, so that packed fields are generated correctly. - writer.WriteLine("CalcSerializedSize();"); - writer.WriteLine("string[] field_names = _{0}FieldNames;", NameHelpers.UnderscoresToCamelCase(ClassName)); - if (Descriptor.Proto.ExtensionRangeList.Count > 0) - { - writer.WriteLine( - "pb::ExtendableMessage{1}<{0}, {0}.Builder>.ExtensionWriter extensionWriter = CreateExtensionWriter(this);", - ClassName, RuntimeSuffix); - } - - // Merge the fields and the extension ranges, both sorted by field number. - for (int i = 0, j = 0; i < Descriptor.Fields.Count || j < sortedExtensions.Count;) - { - if (i == Descriptor.Fields.Count) - { - GenerateSerializeOneExtensionRange(writer, sortedExtensions[j++]); - } - else if (j == sortedExtensions.Count) - { - GenerateSerializeOneField(writer, sortedFields[i++]); - } - else if (sortedFields[i].FieldNumber < sortedExtensions[j].Start) - { - GenerateSerializeOneField(writer, sortedFields[i++]); - } - else - { - GenerateSerializeOneExtensionRange(writer, sortedExtensions[j++]); - } - } - - if (!UseLiteRuntime) - { - if (Descriptor.Proto.Options.MessageSetWireFormat) - { - writer.WriteLine("UnknownFields.WriteAsMessageSetTo(output);"); - } - else - { - writer.WriteLine("UnknownFields.WriteTo(output);"); - } - } - - writer.Outdent(); - writer.WriteLine("}"); - writer.WriteLine(); - writer.WriteLine("private int memoizedSerializedSize = -1;"); - writer.WriteLine("public override int SerializedSize {"); - writer.Indent(); - writer.WriteLine("get {"); - writer.Indent(); - writer.WriteLine("int size = memoizedSerializedSize;"); - writer.WriteLine("if (size != -1) return size;"); - writer.WriteLine("return CalcSerializedSize();"); - writer.Outdent(); - writer.WriteLine("}"); - writer.Outdent(); - writer.WriteLine("}"); - writer.WriteLine(); - - writer.WriteLine("private int CalcSerializedSize() {"); - writer.Indent(); - writer.WriteLine("int size = memoizedSerializedSize;"); - writer.WriteLine("if (size != -1) return size;"); - writer.WriteLine(); - writer.WriteLine("size = 0;"); - foreach (FieldDescriptor field in Descriptor.Fields) - { - CreateFieldGenerator(field).GenerateSerializedSizeCode(writer); - } - if (Descriptor.Proto.ExtensionRangeCount > 0) - { - writer.WriteLine("size += ExtensionsSerializedSize;"); - } - - if (!UseLiteRuntime) - { - if (Descriptor.Options.MessageSetWireFormat) - { - writer.WriteLine("size += UnknownFields.SerializedSizeAsMessageSet;"); - } - else - { - writer.WriteLine("size += UnknownFields.SerializedSize;"); - } - } - writer.WriteLine("memoizedSerializedSize = size;"); - writer.WriteLine("return size;"); - writer.Outdent(); - writer.WriteLine("}"); - } - - private void GenerateSerializeOneField(TextGenerator writer, FieldDescriptor fieldDescriptor) - { - CreateFieldGenerator(fieldDescriptor).GenerateSerializationCode(writer); - } - - private static void GenerateSerializeOneExtensionRange(TextGenerator writer, - DescriptorProto.Types.ExtensionRange extensionRange) - { - writer.WriteLine("extensionWriter.WriteUntil({0}, output);", extensionRange.End); - } - - private void GenerateParseFromMethods(TextGenerator writer) - { - // Note: These are separate from GenerateMessageSerializationMethods() - // because they need to be generated even for messages that are optimized - // for code size. - - writer.WriteLine("public static {0} ParseFrom(pb::ByteString data) {{", ClassName); - writer.WriteLine(" return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();"); - writer.WriteLine("}"); - writer.WriteLine( - "public static {0} ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {{", - ClassName); - writer.WriteLine(" return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();"); - writer.WriteLine("}"); - writer.WriteLine("public static {0} ParseFrom(byte[] data) {{", ClassName); - writer.WriteLine(" return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();"); - writer.WriteLine("}"); - writer.WriteLine("public static {0} ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {{", - ClassName); - writer.WriteLine(" return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();"); - writer.WriteLine("}"); - writer.WriteLine("public static {0} ParseFrom(global::System.IO.Stream input) {{", ClassName); - writer.WriteLine(" return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();"); - writer.WriteLine("}"); - writer.WriteLine( - "public static {0} ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {{", - ClassName); - writer.WriteLine(" return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();"); - writer.WriteLine("}"); - writer.WriteLine("public static {0} ParseDelimitedFrom(global::System.IO.Stream input) {{", ClassName); - writer.WriteLine(" return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();"); - writer.WriteLine("}"); - writer.WriteLine( - "public static {0} ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {{", - ClassName); - writer.WriteLine(" return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();"); - writer.WriteLine("}"); - writer.WriteLine("public static {0} ParseFrom(pb::ICodedInputStream input) {{", ClassName); - writer.WriteLine(" return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();"); - writer.WriteLine("}"); - writer.WriteLine( - "public static {0} ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) {{", - ClassName); - writer.WriteLine(" return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();"); - writer.WriteLine("}"); - } - - /// - /// Returns whether or not the specified message type has any required fields. - /// If it doesn't, calls to check for initialization can be optimised. - /// TODO(jonskeet): Move this into MessageDescriptor? - /// - private static bool HasRequiredFields(MessageDescriptor descriptor, - Dictionary alreadySeen) - { - if (alreadySeen.ContainsKey(descriptor)) - { - // The type is already in cache. This means that either: - // a. The type has no required fields. - // b. We are in the midst of checking if the type has required fields, - // somewhere up the stack. In this case, we know that if the type - // has any required fields, they'll be found when we return to it, - // and the whole call to HasRequiredFields() will return true. - // Therefore, we don't have to check if this type has required fields - // here. - return false; - } - alreadySeen[descriptor] = descriptor; // Value is irrelevant - - // If the type has extensions, an extension with message type could contain - // required fields, so we have to be conservative and assume such an - // extension exists. - if (descriptor.Extensions.Count > 0) - { - return true; - } - - foreach (FieldDescriptor field in descriptor.Fields) - { - if (field.IsRequired) - { - return true; - } - // Message or group - if (field.MappedType == MappedType.Message) - { - if (HasRequiredFields(field.MessageType, alreadySeen)) - { - return true; - } - } - } - return false; - } - - private void GenerateBuilder(TextGenerator writer) - { - writer.WriteLine("private {0} MakeReadOnly() {{", ClassName); - writer.Indent(); - foreach (FieldDescriptor field in Descriptor.Fields) - { - CreateFieldGenerator(field).GenerateBuildingCode(writer); - } - writer.WriteLine("return this;"); - writer.Outdent(); - writer.WriteLine("}"); - writer.WriteLine(); - - writer.WriteLine("public static Builder CreateBuilder() { return new Builder(); }"); - writer.WriteLine("public override Builder ToBuilder() { return CreateBuilder(this); }"); - writer.WriteLine("public override Builder CreateBuilderForType() { return new Builder(); }"); - writer.WriteLine("public static Builder CreateBuilder({0} prototype) {{", ClassName); - writer.WriteLine(" return new Builder(prototype);"); - writer.WriteLine("}"); - writer.WriteLine(); - if (Descriptor.File.CSharpOptions.AddSerializable) - { - writer.WriteLine("[global::System.SerializableAttribute()]"); - } - writer.WriteLine("[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]"); - WriteGeneratedCodeAttributes(writer); - writer.WriteLine("{0} sealed partial class Builder : pb::{2}Builder{3}<{1}, Builder> {{", - ClassAccessLevel, ClassName, - Descriptor.Proto.ExtensionRangeCount > 0 ? "Extendable" : "Generated", RuntimeSuffix); - writer.Indent(); - writer.WriteLine("protected override Builder ThisBuilder {"); - writer.WriteLine(" get { return this; }"); - writer.WriteLine("}"); - GenerateCommonBuilderMethods(writer); - if (OptimizeSpeed) - { - GenerateBuilderParsingMethods(writer); - } - foreach (FieldDescriptor field in Descriptor.Fields) - { - writer.WriteLine(); - // No field comment :( - CreateFieldGenerator(field).GenerateBuilderMembers(writer); - } - writer.Outdent(); - writer.WriteLine("}"); - } - - private void GenerateCommonBuilderMethods(TextGenerator writer) - { - //default constructor - writer.WriteLine("public Builder() {"); - //Durring static initialization of message, DefaultInstance is expected to return null. - writer.WriteLine(" result = DefaultInstance;"); - writer.WriteLine(" resultIsReadOnly = true;"); - writer.WriteLine("}"); - //clone constructor - writer.WriteLine("internal Builder({0} cloneFrom) {{", ClassName); - writer.WriteLine(" result = cloneFrom;"); - writer.WriteLine(" resultIsReadOnly = true;"); - writer.WriteLine("}"); - writer.WriteLine(); - writer.WriteLine("private bool resultIsReadOnly;"); - writer.WriteLine("private {0} result;", ClassName); - writer.WriteLine(); - writer.WriteLine("private {0} PrepareBuilder() {{", ClassName); - writer.WriteLine(" if (resultIsReadOnly) {"); - writer.WriteLine(" {0} original = result;", ClassName); - writer.WriteLine(" result = new {0}();", ClassName); - writer.WriteLine(" resultIsReadOnly = false;"); - writer.WriteLine(" MergeFrom(original);"); - writer.WriteLine(" }"); - writer.WriteLine(" return result;"); - writer.WriteLine("}"); - writer.WriteLine(); - writer.WriteLine("public override bool IsInitialized {"); - writer.WriteLine(" get { return result.IsInitialized; }"); - writer.WriteLine("}"); - writer.WriteLine(); - writer.WriteLine("protected override {0} MessageBeingBuilt {{", ClassName); - writer.WriteLine(" get { return PrepareBuilder(); }"); - writer.WriteLine("}"); - writer.WriteLine(); - //Not actually expecting that DefaultInstance would ever be null here; however, we will ensure it does not break - writer.WriteLine("public override Builder Clear() {"); - writer.WriteLine(" result = DefaultInstance;", ClassName); - writer.WriteLine(" resultIsReadOnly = true;"); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - writer.WriteLine(); - writer.WriteLine("public override Builder Clone() {"); - writer.WriteLine(" if (resultIsReadOnly) {"); - writer.WriteLine(" return new Builder(result);"); - writer.WriteLine(" } else {"); - writer.WriteLine(" return new Builder().MergeFrom(result);"); - writer.WriteLine(" }"); - writer.WriteLine("}"); - writer.WriteLine(); - if (!UseLiteRuntime) - { - writer.WriteLine("public override pbd::MessageDescriptor DescriptorForType {"); - writer.WriteLine(" get {{ return {0}.Descriptor; }}", FullClassName); - writer.WriteLine("}"); - writer.WriteLine(); - } - writer.WriteLine("public override {0} DefaultInstanceForType {{", ClassName); - writer.WriteLine(" get {{ return {0}.DefaultInstance; }}", FullClassName); - writer.WriteLine("}"); - writer.WriteLine(); - - writer.WriteLine("public override {0} BuildPartial() {{", ClassName); - writer.Indent(); - writer.WriteLine("if (resultIsReadOnly) {"); - writer.WriteLine(" return result;"); - writer.WriteLine("}"); - writer.WriteLine("resultIsReadOnly = true;"); - writer.WriteLine("return result.MakeReadOnly();"); - writer.Outdent(); - writer.WriteLine("}"); - writer.WriteLine(); - - if (OptimizeSpeed) - { - writer.WriteLine("public override Builder MergeFrom(pb::IMessage{0} other) {{", RuntimeSuffix); - writer.WriteLine(" if (other is {0}) {{", ClassName); - writer.WriteLine(" return MergeFrom(({0}) other);", ClassName); - writer.WriteLine(" } else {"); - writer.WriteLine(" base.MergeFrom(other);"); - writer.WriteLine(" return this;"); - writer.WriteLine(" }"); - writer.WriteLine("}"); - writer.WriteLine(); - writer.WriteLine("public override Builder MergeFrom({0} other) {{", ClassName); - // Optimization: If other is the default instance, we know none of its - // fields are set so we can skip the merge. - writer.Indent(); - writer.WriteLine("if (other == {0}.DefaultInstance) return this;", FullClassName); - writer.WriteLine("PrepareBuilder();"); - foreach (FieldDescriptor field in Descriptor.Fields) - { - CreateFieldGenerator(field).GenerateMergingCode(writer); - } - // if message type has extensions - if (Descriptor.Proto.ExtensionRangeCount > 0) - { - writer.WriteLine(" this.MergeExtensionFields(other);"); - } - if (!UseLiteRuntime) - { - writer.WriteLine("this.MergeUnknownFields(other.UnknownFields);"); - } - writer.WriteLine("return this;"); - writer.Outdent(); - writer.WriteLine("}"); - writer.WriteLine(); - } - } - - private void GenerateBuilderParsingMethods(TextGenerator writer) - { - List sortedFields = new List(Descriptor.Fields); - sortedFields.Sort((f1, f2) => f1.FieldNumber.CompareTo(f2.FieldNumber)); - - writer.WriteLine("public override Builder MergeFrom(pb::ICodedInputStream input) {"); - writer.WriteLine(" return MergeFrom(input, pb::ExtensionRegistry.Empty);"); - writer.WriteLine("}"); - writer.WriteLine(); - writer.WriteLine( - "public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) {"); - writer.Indent(); - writer.WriteLine("PrepareBuilder();"); - if (!UseLiteRuntime) - { - writer.WriteLine("pb::UnknownFieldSet.Builder unknownFields = null;"); - } - writer.WriteLine("uint tag;"); - writer.WriteLine("string field_name;"); - writer.WriteLine("while (input.ReadTag(out tag, out field_name)) {"); - writer.Indent(); - writer.WriteLine("if(tag == 0 && field_name != null) {"); - writer.Indent(); - //if you change from StringComparer.Ordinal, the array sort in FieldNames { get; } must also change - writer.WriteLine( - "int field_ordinal = global::System.Array.BinarySearch(_{0}FieldNames, field_name, global::System.StringComparer.Ordinal);", - NameHelpers.UnderscoresToCamelCase(ClassName)); - writer.WriteLine("if(field_ordinal >= 0)"); - writer.WriteLine(" tag = _{0}FieldTags[field_ordinal];", NameHelpers.UnderscoresToCamelCase(ClassName)); - writer.WriteLine("else {"); - if (!UseLiteRuntime) - { - writer.WriteLine(" if (unknownFields == null) {"); // First unknown field - create builder now - writer.WriteLine(" unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);"); - writer.WriteLine(" }"); - } - writer.WriteLine(" ParseUnknownField(input, {0}extensionRegistry, tag, field_name);", - UseLiteRuntime ? "" : "unknownFields, "); - writer.WriteLine(" continue;"); - writer.WriteLine("}"); - writer.Outdent(); - writer.WriteLine("}"); - - writer.WriteLine("switch (tag) {"); - writer.Indent(); - writer.WriteLine("case 0: {"); // 0 signals EOF / limit reached - writer.WriteLine(" throw pb::InvalidProtocolBufferException.InvalidTag();"); - writer.WriteLine("}"); - writer.WriteLine("default: {"); - writer.WriteLine(" if (pb::WireFormat.IsEndGroupTag(tag)) {"); - if (!UseLiteRuntime) - { - writer.WriteLine(" if (unknownFields != null) {"); - writer.WriteLine(" this.UnknownFields = unknownFields.Build();"); - writer.WriteLine(" }"); - } - writer.WriteLine(" return this;"); // it's an endgroup tag - writer.WriteLine(" }"); - if (!UseLiteRuntime) - { - writer.WriteLine(" if (unknownFields == null) {"); // First unknown field - create builder now - writer.WriteLine(" unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);"); - writer.WriteLine(" }"); - } - writer.WriteLine(" ParseUnknownField(input, {0}extensionRegistry, tag, field_name);", - UseLiteRuntime ? "" : "unknownFields, "); - writer.WriteLine(" break;"); - writer.WriteLine("}"); - foreach (FieldDescriptor field in sortedFields) - { - WireFormat.WireType wt = WireFormat.GetWireType(field.FieldType); - uint tag = WireFormat.MakeTag(field.FieldNumber, wt); - - if (field.IsRepeated && - (wt == WireFormat.WireType.Varint || wt == WireFormat.WireType.Fixed32 || - wt == WireFormat.WireType.Fixed64)) - { - writer.WriteLine("case {0}:", - WireFormat.MakeTag(field.FieldNumber, WireFormat.WireType.LengthDelimited)); - } - - writer.WriteLine("case {0}: {{", tag); - writer.Indent(); - CreateFieldGenerator(field).GenerateParsingCode(writer); - writer.WriteLine("break;"); - writer.Outdent(); - writer.WriteLine("}"); - } - writer.Outdent(); - writer.WriteLine("}"); - writer.Outdent(); - writer.WriteLine("}"); - writer.WriteLine(); - if (!UseLiteRuntime) - { - writer.WriteLine("if (unknownFields != null) {"); - writer.WriteLine(" this.UnknownFields = unknownFields.Build();"); - writer.WriteLine("}"); - } - writer.WriteLine("return this;"); - writer.Outdent(); - writer.WriteLine("}"); - writer.WriteLine(); - } - - private void GenerateIsInitialized(TextGenerator writer) - { - writer.WriteLine("public override bool IsInitialized {"); - writer.Indent(); - writer.WriteLine("get {"); - writer.Indent(); - - // Check that all required fields in this message are set. - // TODO(kenton): We can optimize this when we switch to putting all the - // "has" fields into a single bitfield. - foreach (FieldDescriptor field in Descriptor.Fields) - { - if (field.IsRequired) - { - writer.WriteLine("if (!has{0}) return false;", field.CSharpOptions.PropertyName); - } - } - - // Now check that all embedded messages are initialized. - foreach (FieldDescriptor field in Descriptor.Fields) - { - if (field.FieldType != FieldType.Message || - !HasRequiredFields(field.MessageType, new Dictionary())) - { - continue; - } - string propertyName = NameHelpers.UnderscoresToPascalCase(GetFieldName(field)); - if (field.IsRepeated) - { - writer.WriteLine("foreach ({0} element in {1}List) {{", GetClassName(field.MessageType), - propertyName); - writer.WriteLine(" if (!element.IsInitialized) return false;"); - writer.WriteLine("}"); - } - else if (field.IsOptional) - { - writer.WriteLine("if (Has{0}) {{", propertyName); - writer.WriteLine(" if (!{0}.IsInitialized) return false;", propertyName); - writer.WriteLine("}"); - } - else - { - writer.WriteLine("if (!{0}.IsInitialized) return false;", propertyName); - } - } - - if (Descriptor.Proto.ExtensionRangeCount > 0) - { - writer.WriteLine("if (!ExtensionsAreInitialized) return false;"); - } - writer.WriteLine("return true;"); - writer.Outdent(); - writer.WriteLine("}"); - writer.Outdent(); - writer.WriteLine("}"); - writer.WriteLine(); - } - - internal void GenerateExtensionRegistrationCode(TextGenerator writer) - { - foreach (FieldDescriptor extension in Descriptor.Extensions) - { - new ExtensionGenerator(extension).GenerateExtensionRegistrationCode(writer); - } - foreach (MessageDescriptor nestedMessage in Descriptor.NestedTypes) - { - new MessageGenerator(nestedMessage).GenerateExtensionRegistrationCode(writer); - } - } - } -} \ No newline at end of file diff --git a/src/ProtoGen/PluginProtoFile.cs b/src/ProtoGen/PluginProtoFile.cs deleted file mode 100644 index e0fed5c..0000000 --- a/src/ProtoGen/PluginProtoFile.cs +++ /dev/null @@ -1,1187 +0,0 @@ -// Generated by protoc-gen-cs, Version=2.4.1.521, Culture=neutral, PublicKeyToken=17b3b1f090c3ea48. DO NOT EDIT! -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.Compiler.PluginProto { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Plugin { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_google_protobuf_compiler_CodeGeneratorRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_compiler_CodeGeneratorRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_compiler_CodeGeneratorResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_compiler_CodeGeneratorResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_compiler_CodeGeneratorResponse_File__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_compiler_CodeGeneratorResponse_File__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static Plugin() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CiVnb29nbGUvcHJvdG9idWYvY29tcGlsZXIvcGx1Z2luLnByb3RvEhhnb29n", - "bGUucHJvdG9idWYuY29tcGlsZXIaIGdvb2dsZS9wcm90b2J1Zi9kZXNjcmlw", - "dG9yLnByb3RvIn0KFENvZGVHZW5lcmF0b3JSZXF1ZXN0EhgKEGZpbGVfdG9f", - "Z2VuZXJhdGUYASADKAkSEQoJcGFyYW1ldGVyGAIgASgJEjgKCnByb3RvX2Zp", - "bGUYDyADKAsyJC5nb29nbGUucHJvdG9idWYuRmlsZURlc2NyaXB0b3JQcm90", - "byKqAQoVQ29kZUdlbmVyYXRvclJlc3BvbnNlEg0KBWVycm9yGAEgASgJEkIK", - "BGZpbGUYDyADKAsyNC5nb29nbGUucHJvdG9idWYuY29tcGlsZXIuQ29kZUdl", - "bmVyYXRvclJlc3BvbnNlLkZpbGUaPgoERmlsZRIMCgRuYW1lGAEgASgJEhcK", - "D2luc2VydGlvbl9wb2ludBgCIAEoCRIPCgdjb250ZW50GA8gASgJQiwKHGNv", - "bS5nb29nbGUucHJvdG9idWYuY29tcGlsZXJCDFBsdWdpblByb3Rvcw==")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_google_protobuf_compiler_CodeGeneratorRequest__Descriptor = Descriptor.MessageTypes[0]; - internal__static_google_protobuf_compiler_CodeGeneratorRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_compiler_CodeGeneratorRequest__Descriptor, - new string[] { "FileToGenerate", "Parameter", "ProtoFile", }); - internal__static_google_protobuf_compiler_CodeGeneratorResponse__Descriptor = Descriptor.MessageTypes[1]; - internal__static_google_protobuf_compiler_CodeGeneratorResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_compiler_CodeGeneratorResponse__Descriptor, - new string[] { "Error", "File", }); - internal__static_google_protobuf_compiler_CodeGeneratorResponse_File__Descriptor = internal__static_google_protobuf_compiler_CodeGeneratorResponse__Descriptor.NestedTypes[0]; - internal__static_google_protobuf_compiler_CodeGeneratorResponse_File__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_compiler_CodeGeneratorResponse_File__Descriptor, - new string[] { "Name", "InsertionPoint", "Content", }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, - }, assigner); - } - #endregion - - } - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class CodeGeneratorRequest : pb::GeneratedMessage { - private CodeGeneratorRequest() { } - private static readonly CodeGeneratorRequest defaultInstance = new CodeGeneratorRequest().MakeReadOnly(); - private static readonly string[] _codeGeneratorRequestFieldNames = new string[] { "file_to_generate", "parameter", "proto_file" }; - private static readonly uint[] _codeGeneratorRequestFieldTags = new uint[] { 10, 18, 122 }; - public static CodeGeneratorRequest DefaultInstance { - get { return defaultInstance; } - } - - public override CodeGeneratorRequest DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override CodeGeneratorRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.Compiler.PluginProto.Plugin.internal__static_google_protobuf_compiler_CodeGeneratorRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.Compiler.PluginProto.Plugin.internal__static_google_protobuf_compiler_CodeGeneratorRequest__FieldAccessorTable; } - } - - public const int FileToGenerateFieldNumber = 1; - private pbc::PopsicleList fileToGenerate_ = new pbc::PopsicleList(); - public scg::IList FileToGenerateList { - get { return pbc::Lists.AsReadOnly(fileToGenerate_); } - } - public int FileToGenerateCount { - get { return fileToGenerate_.Count; } - } - public string GetFileToGenerate(int index) { - return fileToGenerate_[index]; - } - - public const int ParameterFieldNumber = 2; - private bool hasParameter; - private string parameter_ = ""; - public bool HasParameter { - get { return hasParameter; } - } - public string Parameter { - get { return parameter_; } - } - - public const int ProtoFileFieldNumber = 15; - private pbc::PopsicleList protoFile_ = new pbc::PopsicleList(); - public scg::IList ProtoFileList { - get { return protoFile_; } - } - public int ProtoFileCount { - get { return protoFile_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto GetProtoFile(int index) { - return protoFile_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto element in ProtoFileList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - int size = SerializedSize; - string[] field_names = _codeGeneratorRequestFieldNames; - if (fileToGenerate_.Count > 0) { - output.WriteStringArray(1, field_names[0], fileToGenerate_); - } - if (hasParameter) { - output.WriteString(2, field_names[1], Parameter); - } - if (protoFile_.Count > 0) { - output.WriteMessageArray(15, field_names[2], protoFile_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - foreach (string element in FileToGenerateList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 1 * fileToGenerate_.Count; - } - if (hasParameter) { - size += pb::CodedOutputStream.ComputeStringSize(2, Parameter); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto element in ProtoFileList) { - size += pb::CodedOutputStream.ComputeMessageSize(15, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static CodeGeneratorRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CodeGeneratorRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CodeGeneratorRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CodeGeneratorRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CodeGeneratorRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CodeGeneratorRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static CodeGeneratorRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static CodeGeneratorRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static CodeGeneratorRequest ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CodeGeneratorRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private CodeGeneratorRequest MakeReadOnly() { - fileToGenerate_.MakeReadOnly(); - protoFile_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(CodeGeneratorRequest prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(CodeGeneratorRequest cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private CodeGeneratorRequest result; - - private CodeGeneratorRequest PrepareBuilder() { - if (resultIsReadOnly) { - CodeGeneratorRequest original = result; - result = new CodeGeneratorRequest(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override CodeGeneratorRequest MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.Compiler.PluginProto.CodeGeneratorRequest.Descriptor; } - } - - public override CodeGeneratorRequest DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.Compiler.PluginProto.CodeGeneratorRequest.DefaultInstance; } - } - - public override CodeGeneratorRequest BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is CodeGeneratorRequest) { - return MergeFrom((CodeGeneratorRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(CodeGeneratorRequest other) { - if (other == global::Google.ProtocolBuffers.Compiler.PluginProto.CodeGeneratorRequest.DefaultInstance) return this; - PrepareBuilder(); - if (other.fileToGenerate_.Count != 0) { - result.fileToGenerate_.Add(other.fileToGenerate_); - } - if (other.HasParameter) { - Parameter = other.Parameter; - } - if (other.protoFile_.Count != 0) { - result.protoFile_.Add(other.protoFile_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_codeGeneratorRequestFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _codeGeneratorRequestFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - input.ReadStringArray(tag, field_name, result.fileToGenerate_); - break; - } - case 18: { - result.hasParameter = input.ReadString(ref result.parameter_); - break; - } - case 122: { - input.ReadMessageArray(tag, field_name, result.protoFile_, global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto.DefaultInstance, extensionRegistry); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public pbc::IPopsicleList FileToGenerateList { - get { return PrepareBuilder().fileToGenerate_; } - } - public int FileToGenerateCount { - get { return result.FileToGenerateCount; } - } - public string GetFileToGenerate(int index) { - return result.GetFileToGenerate(index); - } - public Builder SetFileToGenerate(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.fileToGenerate_[index] = value; - return this; - } - public Builder AddFileToGenerate(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.fileToGenerate_.Add(value); - return this; - } - public Builder AddRangeFileToGenerate(scg::IEnumerable values) { - PrepareBuilder(); - result.fileToGenerate_.Add(values); - return this; - } - public Builder ClearFileToGenerate() { - PrepareBuilder(); - result.fileToGenerate_.Clear(); - return this; - } - - public bool HasParameter { - get { return result.hasParameter; } - } - public string Parameter { - get { return result.Parameter; } - set { SetParameter(value); } - } - public Builder SetParameter(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasParameter = true; - result.parameter_ = value; - return this; - } - public Builder ClearParameter() { - PrepareBuilder(); - result.hasParameter = false; - result.parameter_ = ""; - return this; - } - - public pbc::IPopsicleList ProtoFileList { - get { return PrepareBuilder().protoFile_; } - } - public int ProtoFileCount { - get { return result.ProtoFileCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto GetProtoFile(int index) { - return result.GetProtoFile(index); - } - public Builder SetProtoFile(int index, global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.protoFile_[index] = value; - return this; - } - public Builder SetProtoFile(int index, global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.protoFile_[index] = builderForValue.Build(); - return this; - } - public Builder AddProtoFile(global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.protoFile_.Add(value); - return this; - } - public Builder AddProtoFile(global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.protoFile_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeProtoFile(scg::IEnumerable values) { - PrepareBuilder(); - result.protoFile_.Add(values); - return this; - } - public Builder ClearProtoFile() { - PrepareBuilder(); - result.protoFile_.Clear(); - return this; - } - } - static CodeGeneratorRequest() { - object.ReferenceEquals(global::Google.ProtocolBuffers.Compiler.PluginProto.Plugin.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class CodeGeneratorResponse : pb::GeneratedMessage { - private CodeGeneratorResponse() { } - private static readonly CodeGeneratorResponse defaultInstance = new CodeGeneratorResponse().MakeReadOnly(); - private static readonly string[] _codeGeneratorResponseFieldNames = new string[] { "error", "file" }; - private static readonly uint[] _codeGeneratorResponseFieldTags = new uint[] { 10, 122 }; - public static CodeGeneratorResponse DefaultInstance { - get { return defaultInstance; } - } - - public override CodeGeneratorResponse DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override CodeGeneratorResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.Compiler.PluginProto.Plugin.internal__static_google_protobuf_compiler_CodeGeneratorResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.Compiler.PluginProto.Plugin.internal__static_google_protobuf_compiler_CodeGeneratorResponse__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class File : pb::GeneratedMessage { - private File() { } - private static readonly File defaultInstance = new File().MakeReadOnly(); - private static readonly string[] _fileFieldNames = new string[] { "content", "insertion_point", "name" }; - private static readonly uint[] _fileFieldTags = new uint[] { 122, 18, 10 }; - public static File DefaultInstance { - get { return defaultInstance; } - } - - public override File DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override File ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.Compiler.PluginProto.Plugin.internal__static_google_protobuf_compiler_CodeGeneratorResponse_File__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.Compiler.PluginProto.Plugin.internal__static_google_protobuf_compiler_CodeGeneratorResponse_File__FieldAccessorTable; } - } - - public const int NameFieldNumber = 1; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public const int InsertionPointFieldNumber = 2; - private bool hasInsertionPoint; - private string insertionPoint_ = ""; - public bool HasInsertionPoint { - get { return hasInsertionPoint; } - } - public string InsertionPoint { - get { return insertionPoint_; } - } - - public const int ContentFieldNumber = 15; - private bool hasContent; - private string content_ = ""; - public bool HasContent { - get { return hasContent; } - } - public string Content { - get { return content_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - int size = SerializedSize; - string[] field_names = _fileFieldNames; - if (hasName) { - output.WriteString(1, field_names[2], Name); - } - if (hasInsertionPoint) { - output.WriteString(2, field_names[1], InsertionPoint); - } - if (hasContent) { - output.WriteString(15, field_names[0], Content); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasName) { - size += pb::CodedOutputStream.ComputeStringSize(1, Name); - } - if (hasInsertionPoint) { - size += pb::CodedOutputStream.ComputeStringSize(2, InsertionPoint); - } - if (hasContent) { - size += pb::CodedOutputStream.ComputeStringSize(15, Content); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static File ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static File ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static File ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static File ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static File ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static File ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static File ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static File ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static File ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static File ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private File MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(File prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(File cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private File result; - - private File PrepareBuilder() { - if (resultIsReadOnly) { - File original = result; - result = new File(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override File MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.Compiler.PluginProto.CodeGeneratorResponse.Types.File.Descriptor; } - } - - public override File DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.Compiler.PluginProto.CodeGeneratorResponse.Types.File.DefaultInstance; } - } - - public override File BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is File) { - return MergeFrom((File) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(File other) { - if (other == global::Google.ProtocolBuffers.Compiler.PluginProto.CodeGeneratorResponse.Types.File.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasName) { - Name = other.Name; - } - if (other.HasInsertionPoint) { - InsertionPoint = other.InsertionPoint; - } - if (other.HasContent) { - Content = other.Content; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_fileFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _fileFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasName = input.ReadString(ref result.name_); - break; - } - case 18: { - result.hasInsertionPoint = input.ReadString(ref result.insertionPoint_); - break; - } - case 122: { - result.hasContent = input.ReadString(ref result.content_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasName { - get { return result.hasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - PrepareBuilder(); - result.hasName = false; - result.name_ = ""; - return this; - } - - public bool HasInsertionPoint { - get { return result.hasInsertionPoint; } - } - public string InsertionPoint { - get { return result.InsertionPoint; } - set { SetInsertionPoint(value); } - } - public Builder SetInsertionPoint(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasInsertionPoint = true; - result.insertionPoint_ = value; - return this; - } - public Builder ClearInsertionPoint() { - PrepareBuilder(); - result.hasInsertionPoint = false; - result.insertionPoint_ = ""; - return this; - } - - public bool HasContent { - get { return result.hasContent; } - } - public string Content { - get { return result.Content; } - set { SetContent(value); } - } - public Builder SetContent(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasContent = true; - result.content_ = value; - return this; - } - public Builder ClearContent() { - PrepareBuilder(); - result.hasContent = false; - result.content_ = ""; - return this; - } - } - static File() { - object.ReferenceEquals(global::Google.ProtocolBuffers.Compiler.PluginProto.Plugin.Descriptor, null); - } - } - - } - #endregion - - public const int ErrorFieldNumber = 1; - private bool hasError; - private string error_ = ""; - public bool HasError { - get { return hasError; } - } - public string Error { - get { return error_; } - } - - public const int FileFieldNumber = 15; - private pbc::PopsicleList file_ = new pbc::PopsicleList(); - public scg::IList FileList { - get { return file_; } - } - public int FileCount { - get { return file_.Count; } - } - public global::Google.ProtocolBuffers.Compiler.PluginProto.CodeGeneratorResponse.Types.File GetFile(int index) { - return file_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - int size = SerializedSize; - string[] field_names = _codeGeneratorResponseFieldNames; - if (hasError) { - output.WriteString(1, field_names[0], Error); - } - if (file_.Count > 0) { - output.WriteMessageArray(15, field_names[1], file_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasError) { - size += pb::CodedOutputStream.ComputeStringSize(1, Error); - } - foreach (global::Google.ProtocolBuffers.Compiler.PluginProto.CodeGeneratorResponse.Types.File element in FileList) { - size += pb::CodedOutputStream.ComputeMessageSize(15, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static CodeGeneratorResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CodeGeneratorResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CodeGeneratorResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CodeGeneratorResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CodeGeneratorResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CodeGeneratorResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static CodeGeneratorResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static CodeGeneratorResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static CodeGeneratorResponse ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CodeGeneratorResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private CodeGeneratorResponse MakeReadOnly() { - file_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(CodeGeneratorResponse prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(CodeGeneratorResponse cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private CodeGeneratorResponse result; - - private CodeGeneratorResponse PrepareBuilder() { - if (resultIsReadOnly) { - CodeGeneratorResponse original = result; - result = new CodeGeneratorResponse(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override CodeGeneratorResponse MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.Compiler.PluginProto.CodeGeneratorResponse.Descriptor; } - } - - public override CodeGeneratorResponse DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.Compiler.PluginProto.CodeGeneratorResponse.DefaultInstance; } - } - - public override CodeGeneratorResponse BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is CodeGeneratorResponse) { - return MergeFrom((CodeGeneratorResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(CodeGeneratorResponse other) { - if (other == global::Google.ProtocolBuffers.Compiler.PluginProto.CodeGeneratorResponse.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasError) { - Error = other.Error; - } - if (other.file_.Count != 0) { - result.file_.Add(other.file_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_codeGeneratorResponseFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _codeGeneratorResponseFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasError = input.ReadString(ref result.error_); - break; - } - case 122: { - input.ReadMessageArray(tag, field_name, result.file_, global::Google.ProtocolBuffers.Compiler.PluginProto.CodeGeneratorResponse.Types.File.DefaultInstance, extensionRegistry); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasError { - get { return result.hasError; } - } - public string Error { - get { return result.Error; } - set { SetError(value); } - } - public Builder SetError(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasError = true; - result.error_ = value; - return this; - } - public Builder ClearError() { - PrepareBuilder(); - result.hasError = false; - result.error_ = ""; - return this; - } - - public pbc::IPopsicleList FileList { - get { return PrepareBuilder().file_; } - } - public int FileCount { - get { return result.FileCount; } - } - public global::Google.ProtocolBuffers.Compiler.PluginProto.CodeGeneratorResponse.Types.File GetFile(int index) { - return result.GetFile(index); - } - public Builder SetFile(int index, global::Google.ProtocolBuffers.Compiler.PluginProto.CodeGeneratorResponse.Types.File value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.file_[index] = value; - return this; - } - public Builder SetFile(int index, global::Google.ProtocolBuffers.Compiler.PluginProto.CodeGeneratorResponse.Types.File.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.file_[index] = builderForValue.Build(); - return this; - } - public Builder AddFile(global::Google.ProtocolBuffers.Compiler.PluginProto.CodeGeneratorResponse.Types.File value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.file_.Add(value); - return this; - } - public Builder AddFile(global::Google.ProtocolBuffers.Compiler.PluginProto.CodeGeneratorResponse.Types.File.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.file_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeFile(scg::IEnumerable values) { - PrepareBuilder(); - result.file_.Add(values); - return this; - } - public Builder ClearFile() { - PrepareBuilder(); - result.file_.Clear(); - return this; - } - } - static CodeGeneratorResponse() { - object.ReferenceEquals(global::Google.ProtocolBuffers.Compiler.PluginProto.Plugin.Descriptor, null); - } - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/ProtoGen/PrimitiveFieldGenerator.cs b/src/ProtoGen/PrimitiveFieldGenerator.cs deleted file mode 100644 index 69e0d4d..0000000 --- a/src/ProtoGen/PrimitiveFieldGenerator.cs +++ /dev/null @@ -1,140 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.ProtoGen -{ - // TODO(jonskeet): Refactor this. There's loads of common code here. - internal class PrimitiveFieldGenerator : FieldGeneratorBase, IFieldSourceGenerator - { - internal PrimitiveFieldGenerator(FieldDescriptor descriptor, int fieldOrdinal) - : base(descriptor, fieldOrdinal) - { - } - - public void GenerateMembers(TextGenerator writer) - { - writer.WriteLine("private bool has{0};", PropertyName); - writer.WriteLine("private {0} {1}_{2};", TypeName, Name, HasDefaultValue ? " = " + DefaultValue : ""); - AddDeprecatedFlag(writer); - writer.WriteLine("public bool Has{0} {{", PropertyName); - writer.WriteLine(" get {{ return has{0}; }}", PropertyName); - writer.WriteLine("}"); - AddPublicMemberAttributes(writer); - writer.WriteLine("public {0} {1} {{", TypeName, PropertyName); - writer.WriteLine(" get {{ return {0}_; }}", Name); - writer.WriteLine("}"); - } - - public void GenerateBuilderMembers(TextGenerator writer) - { - AddDeprecatedFlag(writer); - writer.WriteLine("public bool Has{0} {{", PropertyName); - writer.WriteLine(" get {{ return result.has{0}; }}", PropertyName); - writer.WriteLine("}"); - AddPublicMemberAttributes(writer); - writer.WriteLine("public {0} {1} {{", TypeName, PropertyName); - writer.WriteLine(" get {{ return result.{0}; }}", PropertyName); - writer.WriteLine(" set {{ Set{0}(value); }}", PropertyName); - writer.WriteLine("}"); - AddPublicMemberAttributes(writer); - writer.WriteLine("public Builder Set{0}({1} value) {{", PropertyName, TypeName); - AddNullCheck(writer); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.has{0} = true;", PropertyName); - writer.WriteLine(" result.{0}_ = value;", Name); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public Builder Clear{0}() {{", PropertyName); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.has{0} = false;", PropertyName); - writer.WriteLine(" result.{0}_ = {1};", Name, DefaultValue); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - } - - public void GenerateMergingCode(TextGenerator writer) - { - writer.WriteLine("if (other.Has{0}) {{", PropertyName); - writer.WriteLine(" {0} = other.{0};", PropertyName); - writer.WriteLine("}"); - } - - public void GenerateBuildingCode(TextGenerator writer) - { - // Nothing to do here for primitive types - } - - public void GenerateParsingCode(TextGenerator writer) - { - writer.WriteLine("result.has{0} = input.Read{1}(ref result.{2}_);", PropertyName, CapitalizedTypeName, Name); - } - - public void GenerateSerializationCode(TextGenerator writer) - { - writer.WriteLine("if (has{0}) {{", PropertyName); - writer.WriteLine(" output.Write{0}({1}, field_names[{3}], {2});", CapitalizedTypeName, Number, PropertyName, - FieldOrdinal); - writer.WriteLine("}"); - } - - public void GenerateSerializedSizeCode(TextGenerator writer) - { - writer.WriteLine("if (has{0}) {{", PropertyName); - writer.WriteLine(" size += pb::CodedOutputStream.Compute{0}Size({1}, {2});", - CapitalizedTypeName, Number, PropertyName); - writer.WriteLine("}"); - } - - public override void WriteHash(TextGenerator writer) - { - writer.WriteLine("if (has{0}) hash ^= {1}_.GetHashCode();", PropertyName, Name); - } - - public override void WriteEquals(TextGenerator writer) - { - writer.WriteLine("if (has{0} != other.has{0} || (has{0} && !{1}_.Equals(other.{1}_))) return false;", - PropertyName, Name); - } - - public override void WriteToString(TextGenerator writer) - { - writer.WriteLine("PrintField(\"{0}\", has{1}, {2}_, writer);", Descriptor.Name, PropertyName, Name); - } - } -} \ No newline at end of file diff --git a/src/ProtoGen/Program.cs b/src/ProtoGen/Program.cs deleted file mode 100644 index b11d32e..0000000 --- a/src/ProtoGen/Program.cs +++ /dev/null @@ -1,105 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.IO; -using System.Collections.Generic; -using Google.ProtocolBuffers.Compiler.PluginProto; -using Google.ProtocolBuffers.DescriptorProtos; - -namespace Google.ProtocolBuffers.ProtoGen -{ - /// - /// Entry point for the Protocol Buffers generator. - /// - internal class Program - { - internal static int Main(string[] args) - { - try - { - // Hack to make sure everything's initialized - DescriptorProtoFile.Descriptor.ToString(); - GeneratorOptions options = new GeneratorOptions {Arguments = args}; - - IList validationFailures; - if (!options.TryValidate(out validationFailures)) - { - // We've already got the message-building logic in the exception... - InvalidOptionsException exception = new InvalidOptionsException(validationFailures); - Console.WriteLine(exception.Message); - return 1; - } - - var request = new CodeGeneratorRequest.Builder(); - foreach (string inputFile in options.InputFiles) - { - ExtensionRegistry extensionRegistry = ExtensionRegistry.CreateInstance(); - CSharpOptions.RegisterAllExtensions(extensionRegistry); - using (Stream inputStream = File.OpenRead(inputFile)) - { - var fileSet = FileDescriptorSet.ParseFrom(inputStream, extensionRegistry); - foreach (var fileProto in fileSet.FileList) - { - request.AddFileToGenerate(fileProto.Name); - request.AddProtoFile(fileProto); - } - } - } - - Generator generator = Generator.CreateGenerator(options); - var response = new CodeGeneratorResponse.Builder(); - generator.Generate(request.Build(), response); - if (response.HasError) - { - throw new Exception(response.Error); - } - foreach (var file in response.FileList) - { - File.WriteAllText(file.Name, file.Content); - } - return 0; - } - catch (Exception e) - { - Console.Error.WriteLine("Error: {0}", e.Message); - Console.Error.WriteLine(); - Console.Error.WriteLine("Detailed exception information: {0}", e); - return 1; - } - } - } -} \ No newline at end of file diff --git a/src/ProtoGen/ProgramPreprocess.cs b/src/ProtoGen/ProgramPreprocess.cs deleted file mode 100644 index 343e1f2..0000000 --- a/src/ProtoGen/ProgramPreprocess.cs +++ /dev/null @@ -1,276 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Text; -using System.Text.RegularExpressions; - -namespace Google.ProtocolBuffers.ProtoGen -{ - /// - /// Preprocesses any input files with an extension of '.proto' by running protoc.exe. If arguments - /// are supplied with '--' prefix they are provided to protoc.exe, otherwise they are assumed to - /// be used for ProtoGen.exe which is run on the resulting output proto buffer. If the option - /// --descriptor_set_out= is specified the proto buffer file is kept, otherwise it will be removed - /// after code generation. - /// - public class ProgramPreprocess - { - private const string ProtocExecutable = "protoc.exe"; - private const string ProtocDirectoryArg = "--protoc_dir="; - - private static int Main(string[] args) - { - try - { - return Environment.ExitCode = Run(args); - } - catch (Exception ex) - { - Console.Error.WriteLine(ex); - return Environment.ExitCode = 2; - } - } - - public static int Run(params string[] args) - { - bool deleteFile = false; - string tempFile = null; - int result; - bool doHelp = args.Length == 0; - try - { - List protocArgs = new List(); - List protoGenArgs = new List(); - - string protocFile = GuessProtocFile(args); - - foreach (string arg in args) - { - doHelp |= StringComparer.OrdinalIgnoreCase.Equals(arg, "/?"); - doHelp |= StringComparer.OrdinalIgnoreCase.Equals(arg, "/help"); - doHelp |= StringComparer.OrdinalIgnoreCase.Equals(arg, "-?"); - doHelp |= StringComparer.OrdinalIgnoreCase.Equals(arg, "-help"); - - if (arg.StartsWith("--descriptor_set_out=")) - { - tempFile = arg.Substring("--descriptor_set_out=".Length); - protoGenArgs.Add(tempFile); - } - } - - if (doHelp) - { - Console.WriteLine(); - Console.WriteLine("PROTOC.exe: Use any of the following options that begin with '--':"); - Console.WriteLine(); - try - { - RunProtoc(protocFile, "--help"); - } - catch (Exception ex) - { - Console.Error.WriteLine(ex.Message); - } - Console.WriteLine(); - Console.WriteLine(); - Console.WriteLine( - "PROTOGEN.exe: The following options are used to specify defaults for code generation."); - Console.WriteLine(); - Program.Main(new string[0]); - Console.WriteLine(); - Console.WriteLine("The following option enables PROTOGEN.exe to find PROTOC.exe"); - Console.WriteLine("{0}", ProtocDirectoryArg); - return 0; - } - - string pathRoot = Environment.CurrentDirectory; - foreach(string arg in args) - { - if (arg.StartsWith("--proto_path=", StringComparison.InvariantCultureIgnoreCase)) - { - pathRoot = arg.Substring(13); - } - } - - foreach (string arg in args) - { - if (arg.StartsWith(ProtocDirectoryArg)) - { - // Handled earlier - continue; - } - if (arg.StartsWith("--")) - { - protocArgs.Add(arg); - } - else if ((File.Exists(arg) || File.Exists(Path.Combine(pathRoot, arg))) && - StringComparer.OrdinalIgnoreCase.Equals(".proto", Path.GetExtension(arg))) - { - if (tempFile == null) - { - deleteFile = true; - tempFile = Path.GetTempFileName(); - protocArgs.Add(String.Format("--descriptor_set_out={0}", tempFile)); - protoGenArgs.Add(tempFile); - } - string patharg = arg; - if (!File.Exists(patharg)) - { - patharg = Path.Combine(pathRoot, arg); - } - - protocArgs.Add(patharg); - } - else - { - protoGenArgs.Add(arg); - } - } - - if (tempFile != null) - { - result = RunProtoc(protocFile, protocArgs.ToArray()); - if (result != 0) - { - return result; - } - } - - result = Program.Main(protoGenArgs.ToArray()); - } - finally - { - if (deleteFile && tempFile != null && File.Exists(tempFile)) - { - File.Delete(tempFile); - } - } - return result; - } - - /// - /// Tries to work out where protoc is based on command line arguments, the current - /// directory, the directory containing protogen, and the path. - /// - /// The path to protoc.exe, or null if it can't be found. - private static string GuessProtocFile(params string[] args) - { - // Why oh why is this not in System.IO.Path or Environment...? - List searchPath = new List(); - foreach (string arg in args) - { - if (arg.StartsWith("--protoc_dir=")) - { - searchPath.Add(arg.Substring(ProtocDirectoryArg.Length)); - } - } - searchPath.Add(Environment.CurrentDirectory); - searchPath.Add(AppDomain.CurrentDomain.BaseDirectory); - searchPath.AddRange((Environment.GetEnvironmentVariable("PATH") ?? String.Empty).Split(Path.PathSeparator)); - - foreach (string path in searchPath) - { - string exeFile = Path.Combine(path, ProtocExecutable); - if (File.Exists(exeFile)) - { - return exeFile; - } - } - return null; - } - - private static int RunProtoc(string exeFile, params string[] args) - { - if (exeFile == null) - { - throw new FileNotFoundException( - "Unable to locate " + ProtocExecutable + - " make sure it is in the PATH, cwd, or exe dir, or use --protoc_dir=..."); - } - - ProcessStartInfo psi = new ProcessStartInfo(exeFile); - psi.Arguments = EscapeArguments(args); - psi.RedirectStandardError = true; - psi.RedirectStandardInput = false; - psi.RedirectStandardOutput = true; - psi.ErrorDialog = false; - psi.CreateNoWindow = true; - psi.UseShellExecute = false; - psi.WorkingDirectory = Environment.CurrentDirectory; - - Process process = Process.Start(psi); - if (process == null) - { - return 1; - } - - process.WaitForExit(); - - string tmp = process.StandardOutput.ReadToEnd(); - if (tmp.Trim().Length > 0) - { - Console.Out.WriteLine(tmp); - } - tmp = process.StandardError.ReadToEnd(); - if (tmp.Trim().Length > 0) - { - // Replace protoc output with something more amenable to Visual Studio. - var regexMsvs = new Regex(@"(.*)\((\d+)\).* column=(\d+)\s*:\s*(.*)"); - tmp = regexMsvs.Replace(tmp, "$1($2,$3): error CS9999: $4"); - var regexGcc = new Regex(@"(.*):(\d+):(\d+):\s*(.*)"); - tmp = regexGcc.Replace(tmp, "$1($2,$3): error CS9999: $4"); - Console.Error.WriteLine(tmp); - } - return process.ExitCode; - } - - /// - /// Quotes all arguments that contain whitespace, or begin with a quote and returns a single - /// argument string for use with Process.Start(). - /// - /// http://csharptest.net/?p=529 - /// A list of strings for arguments, may not contain null, '\0', '\r', or '\n' - /// The combined list of escaped/quoted strings - /// Raised when one of the arguments is null - /// Raised if an argument contains '\0', '\r', or '\n' - public static string EscapeArguments(params string[] args) - { - StringBuilder arguments = new StringBuilder(); - Regex invalidChar = new Regex("[\x00\x0a\x0d]");// these can not be escaped - Regex needsQuotes = new Regex(@"\s|""");// contains whitespace or two quote characters - Regex escapeQuote = new Regex(@"(\\*)(""|$)");// one or more '\' followed with a quote or end of string - for (int carg = 0; args != null && carg < args.Length; carg++) - { - if (args[carg] == null) - { - throw new ArgumentNullException("args[" + carg + "]"); - } - if (invalidChar.IsMatch(args[carg])) - { - throw new ArgumentOutOfRangeException("args[" + carg + "]"); - } - if (args[carg] == String.Empty) - { - arguments.Append("\"\""); - } - else if (!needsQuotes.IsMatch(args[carg])) { arguments.Append(args[carg]); } - else - { - arguments.Append('"'); - arguments.Append(escapeQuote.Replace(args[carg], - m => - m.Groups[1].Value + m.Groups[1].Value + - (m.Groups[2].Value == "\"" ? "\\\"" : "") - )); - arguments.Append('"'); - } - if (carg + 1 < args.Length) - { - arguments.Append(' '); - } - } - return arguments.ToString(); - } - } -} \ No newline at end of file diff --git a/src/ProtoGen/Properties/AssemblyInfo.cs b/src/ProtoGen/Properties/AssemblyInfo.cs deleted file mode 100644 index 565894f..0000000 --- a/src/ProtoGen/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. - -[assembly: AssemblyTitle("ProtoGen")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ProtoGen")] -[assembly: AssemblyCopyright("Copyright © 2008")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("2.4.1.555")] - -[assembly: AssemblyVersion("2.4.1.555")] -[assembly: AssemblyFileVersion("2.4.1.555")] \ No newline at end of file diff --git a/src/ProtoGen/ProtoGen.csproj b/src/ProtoGen/ProtoGen.csproj deleted file mode 100644 index 2de44ae..0000000 --- a/src/ProtoGen/ProtoGen.csproj +++ /dev/null @@ -1,98 +0,0 @@ - - - - CLIENTPROFILE - NET35 - Debug - AnyCPU - 9.0.30729 - 2.0 - {250ADE34-82FD-4BAE-86D5-985FBE589C4A} - Exe - Properties - Google.ProtocolBuffers.ProtoGen - ProtoGen - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - Google.ProtocolBuffers.ProtoGen.ProgramPreprocess - - - true - full - false - bin\NET35\Debug - obj\NET35\Debug\ - DEBUG;TRACE - prompt - 4 - true - true - Off - - - pdbonly - true - bin\NET35\Release - obj\NET35\Release\ - TRACE - prompt - 4 - true - true - Off - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - - - - \ No newline at end of file diff --git a/src/ProtoGen/ProtocGenCs.cs b/src/ProtoGen/ProtocGenCs.cs deleted file mode 100644 index 2926420..0000000 --- a/src/ProtoGen/ProtocGenCs.cs +++ /dev/null @@ -1,76 +0,0 @@ -using Google.ProtocolBuffers.Compiler.PluginProto; -using Google.ProtocolBuffers.DescriptorProtos; -using System; -using System.Collections.Generic; - -// Usage example: -// protoc.exe -// --plugin=path\to\protoc-gen-cs.exe -// --cs_out="-generated_code_attributes=true umbrella_namespace=TutorialProto :." -// --proto_path=.\protos\ -// protos\tutorial\addressbook.proto - -namespace Google.ProtocolBuffers.ProtoGen -{ - public static class ProtocGenCs - { - internal static void Run(CodeGeneratorRequest request, CodeGeneratorResponse.Builder response) - { - var arguments = new List(); - foreach (var arg in request.Parameter.Split(' ')) - { - var timmedArg = (arg ?? "").Trim(); - if (!string.IsNullOrEmpty(timmedArg)) - { - arguments.Add(timmedArg); - } - } - // Adding fake input file to make TryValidate happy. - arguments.Add(System.Reflection.Assembly.GetExecutingAssembly().Location); - - GeneratorOptions options = new GeneratorOptions - { - Arguments = arguments - }; - IList validationFailures; - if (!options.TryValidate(out validationFailures)) - { - response.Error += new InvalidOptionsException(validationFailures).Message; - return; - } - - Generator generator = Generator.CreateGenerator(options); - generator.Generate(request, response); - } - - public static int Main(string[] args) - { - // Hack to make sure everything's initialized - DescriptorProtoFile.Descriptor.ToString(); - ExtensionRegistry extensionRegistry = ExtensionRegistry.CreateInstance(); - CSharpOptions.RegisterAllExtensions(extensionRegistry); - - CodeGeneratorRequest request; - var response = new CodeGeneratorResponse.Builder(); - try - { - using (var input = Console.OpenStandardInput()) - { - request = CodeGeneratorRequest.ParseFrom(input, extensionRegistry); - } - Run(request, response); - } - catch (Exception e) - { - response.Error += e.ToString(); - } - - using (var output = Console.OpenStandardOutput()) - { - response.Build().WriteTo(output); - output.Flush(); - } - return 0; - } - } -} diff --git a/src/ProtoGen/RepeatedEnumFieldGenerator.cs b/src/ProtoGen/RepeatedEnumFieldGenerator.cs deleted file mode 100644 index 8c9f17b..0000000 --- a/src/ProtoGen/RepeatedEnumFieldGenerator.cs +++ /dev/null @@ -1,212 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.ProtoGen -{ - internal class RepeatedEnumFieldGenerator : FieldGeneratorBase, IFieldSourceGenerator - { - internal RepeatedEnumFieldGenerator(FieldDescriptor descriptor, int fieldOrdinal) - : base(descriptor, fieldOrdinal) - { - } - - public void GenerateMembers(TextGenerator writer) - { - if (Descriptor.IsPacked && OptimizeSpeed) - { - writer.WriteLine("private int {0}MemoizedSerializedSize;", Name); - } - writer.WriteLine("private pbc::PopsicleList<{0}> {1}_ = new pbc::PopsicleList<{0}>();", TypeName, Name); - AddDeprecatedFlag(writer); - writer.WriteLine("public scg::IList<{0}> {1}List {{", TypeName, PropertyName); - writer.WriteLine(" get {{ return pbc::Lists.AsReadOnly({0}_); }}", Name); - writer.WriteLine("}"); - - // TODO(jonskeet): Redundant API calls? Possibly - include for portability though. Maybe create an option. - AddDeprecatedFlag(writer); - writer.WriteLine("public int {0}Count {{", PropertyName); - writer.WriteLine(" get {{ return {0}_.Count; }}", Name); - writer.WriteLine("}"); - - AddDeprecatedFlag(writer); - writer.WriteLine("public {0} Get{1}(int index) {{", TypeName, PropertyName); - writer.WriteLine(" return {0}_[index];", Name); - writer.WriteLine("}"); - } - - public void GenerateBuilderMembers(TextGenerator writer) - { - // Note: We can return the original list here, because we make it unmodifiable when we build - // We return it via IPopsicleList so that collection initializers work more pleasantly. - AddDeprecatedFlag(writer); - writer.WriteLine("public pbc::IPopsicleList<{0}> {1}List {{", TypeName, PropertyName); - writer.WriteLine(" get {{ return PrepareBuilder().{0}_; }}", Name); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public int {0}Count {{", PropertyName); - writer.WriteLine(" get {{ return result.{0}Count; }}", PropertyName); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public {0} Get{1}(int index) {{", TypeName, PropertyName); - writer.WriteLine(" return result.Get{0}(index);", PropertyName); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public Builder Set{0}(int index, {1} value) {{", PropertyName, TypeName); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.{0}_[index] = value;", Name); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public Builder Add{0}({1} value) {{", PropertyName, TypeName); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.{0}_.Add(value);", Name, TypeName); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public Builder AddRange{0}(scg::IEnumerable<{1}> values) {{", PropertyName, TypeName); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.{0}_.Add(values);", Name); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public Builder Clear{0}() {{", PropertyName); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.{0}_.Clear();", Name); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - } - - public void GenerateMergingCode(TextGenerator writer) - { - writer.WriteLine("if (other.{0}_.Count != 0) {{", Name); - writer.WriteLine(" result.{0}_.Add(other.{0}_);", Name); - writer.WriteLine("}"); - } - - public void GenerateBuildingCode(TextGenerator writer) - { - writer.WriteLine("{0}_.MakeReadOnly();", Name); - } - - public void GenerateParsingCode(TextGenerator writer) - { - writer.WriteLine("scg::ICollection unknownItems;"); - writer.WriteLine("input.ReadEnumArray<{0}>(tag, field_name, result.{1}_, out unknownItems);", TypeName, Name); - if (!UseLiteRuntime) - { - writer.WriteLine("if (unknownItems != null) {"); - writer.WriteLine(" if (unknownFields == null) {"); - writer.WriteLine(" unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);"); - writer.WriteLine(" }"); - writer.WriteLine(" foreach (object rawValue in unknownItems)"); - writer.WriteLine(" if (rawValue is int)"); - writer.WriteLine(" unknownFields.MergeVarintField({0}, (ulong)(int)rawValue);", Number); - writer.WriteLine("}"); - } - } - - public void GenerateSerializationCode(TextGenerator writer) - { - writer.WriteLine("if ({0}_.Count > 0) {{", Name); - writer.Indent(); - if (Descriptor.IsPacked) - { - writer.WriteLine( - "output.WritePackedEnumArray({0}, field_names[{2}], {1}MemoizedSerializedSize, {1}_);", Number, Name, - FieldOrdinal, Descriptor.FieldType); - } - else - { - writer.WriteLine("output.WriteEnumArray({0}, field_names[{2}], {1}_);", Number, Name, FieldOrdinal, - Descriptor.FieldType); - } - writer.Outdent(); - writer.WriteLine("}"); - } - - public void GenerateSerializedSizeCode(TextGenerator writer) - { - writer.WriteLine("{"); - writer.Indent(); - writer.WriteLine("int dataSize = 0;"); - writer.WriteLine("if ({0}_.Count > 0) {{", Name); - writer.Indent(); - writer.WriteLine("foreach ({0} element in {1}_) {{", TypeName, Name); - writer.WriteLine(" dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element);"); - writer.WriteLine("}"); - writer.WriteLine("size += dataSize;"); - int tagSize = CodedOutputStream.ComputeTagSize(Descriptor.FieldNumber); - if (Descriptor.IsPacked) - { - writer.WriteLine("size += {0};", tagSize); - writer.WriteLine("size += pb::CodedOutputStream.ComputeRawVarint32Size((uint) dataSize);"); - } - else - { - writer.WriteLine("size += {0} * {1}_.Count;", tagSize, Name); - } - writer.Outdent(); - writer.WriteLine("}"); - // cache the data size for packed fields. - if (Descriptor.IsPacked) - { - writer.WriteLine("{0}MemoizedSerializedSize = dataSize;", Name); - } - writer.Outdent(); - writer.WriteLine("}"); - } - - public override void WriteHash(TextGenerator writer) - { - writer.WriteLine("foreach({0} i in {1}_)", TypeName, Name); - writer.WriteLine(" hash ^= i.GetHashCode();"); - } - - public override void WriteEquals(TextGenerator writer) - { - writer.WriteLine("if({0}_.Count != other.{0}_.Count) return false;", Name); - writer.WriteLine("for(int ix=0; ix < {0}_.Count; ix++)", Name); - writer.WriteLine(" if(!{0}_[ix].Equals(other.{0}_[ix])) return false;", Name); - } - - public override void WriteToString(TextGenerator writer) - { - writer.WriteLine("PrintField(\"{0}\", {1}_, writer);", Descriptor.Name, Name); - } - } -} \ No newline at end of file diff --git a/src/ProtoGen/RepeatedMessageFieldGenerator.cs b/src/ProtoGen/RepeatedMessageFieldGenerator.cs deleted file mode 100644 index a9a0143..0000000 --- a/src/ProtoGen/RepeatedMessageFieldGenerator.cs +++ /dev/null @@ -1,184 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.ProtoGen -{ - internal class RepeatedMessageFieldGenerator : FieldGeneratorBase, IFieldSourceGenerator - { - internal RepeatedMessageFieldGenerator(FieldDescriptor descriptor, int fieldOrdinal) - : base(descriptor, fieldOrdinal) - { - } - - public void GenerateMembers(TextGenerator writer) - { - writer.WriteLine("private pbc::PopsicleList<{0}> {1}_ = new pbc::PopsicleList<{0}>();", TypeName, Name); - AddDeprecatedFlag(writer); - writer.WriteLine("public scg::IList<{0}> {1}List {{", TypeName, PropertyName); - writer.WriteLine(" get {{ return {0}_; }}", Name); - writer.WriteLine("}"); - - // TODO(jonskeet): Redundant API calls? Possibly - include for portability though. Maybe create an option. - AddDeprecatedFlag(writer); - writer.WriteLine("public int {0}Count {{", PropertyName); - writer.WriteLine(" get {{ return {0}_.Count; }}", Name); - writer.WriteLine("}"); - - AddDeprecatedFlag(writer); - writer.WriteLine("public {0} Get{1}(int index) {{", TypeName, PropertyName); - writer.WriteLine(" return {0}_[index];", Name); - writer.WriteLine("}"); - } - - public void GenerateBuilderMembers(TextGenerator writer) - { - // Note: We can return the original list here, because we make it unmodifiable when we build - // We return it via IPopsicleList so that collection initializers work more pleasantly. - AddDeprecatedFlag(writer); - writer.WriteLine("public pbc::IPopsicleList<{0}> {1}List {{", TypeName, PropertyName); - writer.WriteLine(" get {{ return PrepareBuilder().{0}_; }}", Name); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public int {0}Count {{", PropertyName); - writer.WriteLine(" get {{ return result.{0}Count; }}", PropertyName); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public {0} Get{1}(int index) {{", TypeName, PropertyName); - writer.WriteLine(" return result.Get{0}(index);", PropertyName); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public Builder Set{0}(int index, {1} value) {{", PropertyName, TypeName); - AddNullCheck(writer); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.{0}_[index] = value;", Name); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - // Extra overload for builder (just on messages) - AddDeprecatedFlag(writer); - writer.WriteLine("public Builder Set{0}(int index, {1}.Builder builderForValue) {{", PropertyName, TypeName); - AddNullCheck(writer, "builderForValue"); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.{0}_[index] = builderForValue.Build();", Name); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public Builder Add{0}({1} value) {{", PropertyName, TypeName); - AddNullCheck(writer); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.{0}_.Add(value);", Name, TypeName); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - // Extra overload for builder (just on messages) - AddDeprecatedFlag(writer); - writer.WriteLine("public Builder Add{0}({1}.Builder builderForValue) {{", PropertyName, TypeName); - AddNullCheck(writer, "builderForValue"); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.{0}_.Add(builderForValue.Build());", Name); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public Builder AddRange{0}(scg::IEnumerable<{1}> values) {{", PropertyName, TypeName); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.{0}_.Add(values);", Name); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public Builder Clear{0}() {{", PropertyName); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.{0}_.Clear();", Name); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - } - - public void GenerateMergingCode(TextGenerator writer) - { - writer.WriteLine("if (other.{0}_.Count != 0) {{", Name); - writer.WriteLine(" result.{0}_.Add(other.{0}_);", Name); - writer.WriteLine("}"); - } - - public void GenerateBuildingCode(TextGenerator writer) - { - writer.WriteLine("{0}_.MakeReadOnly();", Name); - } - - public void GenerateParsingCode(TextGenerator writer) - { - writer.WriteLine( - "input.Read{0}Array(tag, field_name, result.{1}_, {2}.DefaultInstance, extensionRegistry);", - MessageOrGroup, Name, TypeName); - } - - public void GenerateSerializationCode(TextGenerator writer) - { - writer.WriteLine("if ({0}_.Count > 0) {{", Name); - writer.Indent(); - writer.WriteLine("output.Write{0}Array({1}, field_names[{3}], {2}_);", MessageOrGroup, Number, Name, - FieldOrdinal, Descriptor.FieldType); - writer.Outdent(); - writer.WriteLine("}"); - } - - public void GenerateSerializedSizeCode(TextGenerator writer) - { - writer.WriteLine("foreach ({0} element in {1}List) {{", TypeName, PropertyName); - writer.WriteLine(" size += pb::CodedOutputStream.Compute{0}Size({1}, element);", MessageOrGroup, Number); - writer.WriteLine("}"); - } - - public override void WriteHash(TextGenerator writer) - { - writer.WriteLine("foreach({0} i in {1}_)", TypeName, Name); - writer.WriteLine(" hash ^= i.GetHashCode();"); - } - - public override void WriteEquals(TextGenerator writer) - { - writer.WriteLine("if({0}_.Count != other.{0}_.Count) return false;", Name); - writer.WriteLine("for(int ix=0; ix < {0}_.Count; ix++)", Name); - writer.WriteLine(" if(!{0}_[ix].Equals(other.{0}_[ix])) return false;", Name); - } - - public override void WriteToString(TextGenerator writer) - { - writer.WriteLine("PrintField(\"{0}\", {1}_, writer);", - Descriptor.FieldType == FieldType.Group ? Descriptor.MessageType.Name : Descriptor.Name, - Name); - } - } -} \ No newline at end of file diff --git a/src/ProtoGen/RepeatedPrimitiveFieldGenerator.cs b/src/ProtoGen/RepeatedPrimitiveFieldGenerator.cs deleted file mode 100644 index b795f3b..0000000 --- a/src/ProtoGen/RepeatedPrimitiveFieldGenerator.cs +++ /dev/null @@ -1,207 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.ProtoGen -{ - internal class RepeatedPrimitiveFieldGenerator : FieldGeneratorBase, IFieldSourceGenerator - { - internal RepeatedPrimitiveFieldGenerator(FieldDescriptor descriptor, int fieldOrdinal) - : base(descriptor, fieldOrdinal) - { - } - - public void GenerateMembers(TextGenerator writer) - { - if (Descriptor.IsPacked && OptimizeSpeed) - { - writer.WriteLine("private int {0}MemoizedSerializedSize;", Name); - } - writer.WriteLine("private pbc::PopsicleList<{0}> {1}_ = new pbc::PopsicleList<{0}>();", TypeName, Name); - AddPublicMemberAttributes(writer); - writer.WriteLine("public scg::IList<{0}> {1}List {{", TypeName, PropertyName); - writer.WriteLine(" get {{ return pbc::Lists.AsReadOnly({0}_); }}", Name); - writer.WriteLine("}"); - - // TODO(jonskeet): Redundant API calls? Possibly - include for portability though. Maybe create an option. - AddDeprecatedFlag(writer); - writer.WriteLine("public int {0}Count {{", PropertyName); - writer.WriteLine(" get {{ return {0}_.Count; }}", Name); - writer.WriteLine("}"); - - AddPublicMemberAttributes(writer); - writer.WriteLine("public {0} Get{1}(int index) {{", TypeName, PropertyName); - writer.WriteLine(" return {0}_[index];", Name); - writer.WriteLine("}"); - } - - public void GenerateBuilderMembers(TextGenerator writer) - { - // Note: We can return the original list here, because we make it unmodifiable when we build - // We return it via IPopsicleList so that collection initializers work more pleasantly. - AddPublicMemberAttributes(writer); - writer.WriteLine("public pbc::IPopsicleList<{0}> {1}List {{", TypeName, PropertyName); - writer.WriteLine(" get {{ return PrepareBuilder().{0}_; }}", Name); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public int {0}Count {{", PropertyName); - writer.WriteLine(" get {{ return result.{0}Count; }}", PropertyName); - writer.WriteLine("}"); - AddPublicMemberAttributes(writer); - writer.WriteLine("public {0} Get{1}(int index) {{", TypeName, PropertyName); - writer.WriteLine(" return result.Get{0}(index);", PropertyName); - writer.WriteLine("}"); - AddPublicMemberAttributes(writer); - writer.WriteLine("public Builder Set{0}(int index, {1} value) {{", PropertyName, TypeName); - AddNullCheck(writer); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.{0}_[index] = value;", Name); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - AddPublicMemberAttributes(writer); - writer.WriteLine("public Builder Add{0}({1} value) {{", PropertyName, TypeName); - AddNullCheck(writer); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.{0}_.Add(value);", Name, TypeName); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - AddPublicMemberAttributes(writer); - writer.WriteLine("public Builder AddRange{0}(scg::IEnumerable<{1}> values) {{", PropertyName, TypeName); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.{0}_.Add(values);", Name); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - AddDeprecatedFlag(writer); - writer.WriteLine("public Builder Clear{0}() {{", PropertyName); - writer.WriteLine(" PrepareBuilder();"); - writer.WriteLine(" result.{0}_.Clear();", Name); - writer.WriteLine(" return this;"); - writer.WriteLine("}"); - } - - public void GenerateMergingCode(TextGenerator writer) - { - writer.WriteLine("if (other.{0}_.Count != 0) {{", Name); - writer.WriteLine(" result.{0}_.Add(other.{0}_);", Name); - writer.WriteLine("}"); - } - - public void GenerateBuildingCode(TextGenerator writer) - { - writer.WriteLine("{0}_.MakeReadOnly();", Name); - } - - public void GenerateParsingCode(TextGenerator writer) - { - writer.WriteLine("input.Read{0}Array(tag, field_name, result.{1}_);", CapitalizedTypeName, Name, - Descriptor.FieldType); - } - - public void GenerateSerializationCode(TextGenerator writer) - { - writer.WriteLine("if ({0}_.Count > 0) {{", Name); - writer.Indent(); - if (Descriptor.IsPacked) - { - writer.WriteLine("output.WritePacked{0}Array({1}, field_names[{3}], {2}MemoizedSerializedSize, {2}_);", - CapitalizedTypeName, Number, Name, FieldOrdinal, Descriptor.FieldType); - } - else - { - writer.WriteLine("output.Write{0}Array({1}, field_names[{3}], {2}_);", CapitalizedTypeName, Number, Name, - FieldOrdinal, Descriptor.FieldType); - } - writer.Outdent(); - writer.WriteLine("}"); - } - - public void GenerateSerializedSizeCode(TextGenerator writer) - { - writer.WriteLine("{"); - writer.Indent(); - writer.WriteLine("int dataSize = 0;"); - if (FixedSize == -1) - { - writer.WriteLine("foreach ({0} element in {1}List) {{", TypeName, PropertyName); - writer.WriteLine(" dataSize += pb::CodedOutputStream.Compute{0}SizeNoTag(element);", - CapitalizedTypeName, Number); - writer.WriteLine("}"); - } - else - { - writer.WriteLine("dataSize = {0} * {1}_.Count;", FixedSize, Name); - } - writer.WriteLine("size += dataSize;"); - int tagSize = CodedOutputStream.ComputeTagSize(Descriptor.FieldNumber); - if (Descriptor.IsPacked) - { - writer.WriteLine("if ({0}_.Count != 0) {{", Name); - writer.WriteLine(" size += {0} + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);", tagSize); - writer.WriteLine("}"); - } - else - { - writer.WriteLine("size += {0} * {1}_.Count;", tagSize, Name); - } - // cache the data size for packed fields. - if (Descriptor.IsPacked) - { - writer.WriteLine("{0}MemoizedSerializedSize = dataSize;", Name); - } - writer.Outdent(); - writer.WriteLine("}"); - } - - public override void WriteHash(TextGenerator writer) - { - writer.WriteLine("foreach({0} i in {1}_)", TypeName, Name); - writer.WriteLine(" hash ^= i.GetHashCode();"); - } - - public override void WriteEquals(TextGenerator writer) - { - writer.WriteLine("if({0}_.Count != other.{0}_.Count) return false;", Name); - writer.WriteLine("for(int ix=0; ix < {0}_.Count; ix++)", Name); - writer.WriteLine(" if(!{0}_[ix].Equals(other.{0}_[ix])) return false;", Name); - } - - public override void WriteToString(TextGenerator writer) - { - writer.WriteLine("PrintField(\"{0}\", {1}_, writer);", Descriptor.Name, Name); - } - } -} \ No newline at end of file diff --git a/src/ProtoGen/ServiceGenerator.cs b/src/ProtoGen/ServiceGenerator.cs deleted file mode 100644 index a6b9eb2..0000000 --- a/src/ProtoGen/ServiceGenerator.cs +++ /dev/null @@ -1,190 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.ProtoGen -{ - internal class GenericServiceGenerator : SourceGeneratorBase, ISourceGenerator - { - private enum RequestOrResponse - { - Request, - Response - } - - internal GenericServiceGenerator(ServiceDescriptor descriptor) - : base(descriptor) - { - } - - public void Generate(TextGenerator writer) - { - writer.WriteLine("[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]"); - WriteGeneratedCodeAttributes(writer); - writer.WriteLine("{0} abstract class {1} : pb::IService {{", ClassAccessLevel, Descriptor.Name); - writer.Indent(); - - foreach (MethodDescriptor method in Descriptor.Methods) - { - writer.WriteLine("{0} abstract void {1}(", ClassAccessLevel, - NameHelpers.UnderscoresToPascalCase(method.Name)); - writer.WriteLine(" pb::IRpcController controller,"); - writer.WriteLine(" {0} request,", GetClassName(method.InputType)); - writer.WriteLine(" global::System.Action<{0}> done);", GetClassName(method.OutputType)); - } - - // Generate Descriptor and DescriptorForType. - writer.WriteLine(); - writer.WriteLine("{0} static pbd::ServiceDescriptor Descriptor {{", ClassAccessLevel); - writer.WriteLine(" get {{ return {0}.Descriptor.Services[{1}]; }}", - DescriptorUtil.GetQualifiedUmbrellaClassName(Descriptor.File.CSharpOptions), - Descriptor.Index); - writer.WriteLine("}"); - writer.WriteLine("public pbd::ServiceDescriptor DescriptorForType {"); - writer.WriteLine(" get { return Descriptor; }"); - writer.WriteLine("}"); - - GenerateCallMethod(writer); - GenerateGetPrototype(RequestOrResponse.Request, writer); - GenerateGetPrototype(RequestOrResponse.Response, writer); - GenerateStub(writer); - - writer.Outdent(); - writer.WriteLine("}"); - } - - private void GenerateCallMethod(TextGenerator writer) - { - writer.WriteLine(); - writer.WriteLine("public void CallMethod("); - writer.WriteLine(" pbd::MethodDescriptor method,"); - writer.WriteLine(" pb::IRpcController controller,"); - writer.WriteLine(" pb::IMessage request,"); - writer.WriteLine(" global::System.Action done) {"); - writer.Indent(); - writer.WriteLine("if (method.Service != Descriptor) {"); - writer.WriteLine(" throw new global::System.ArgumentException("); - writer.WriteLine(" \"Service.CallMethod() given method descriptor for wrong service type.\");"); - writer.WriteLine("}"); - writer.WriteLine("switch(method.Index) {"); - writer.Indent(); - foreach (MethodDescriptor method in Descriptor.Methods) - { - writer.WriteLine("case {0}:", method.Index); - writer.WriteLine(" this.{0}(controller, ({1}) request,", - NameHelpers.UnderscoresToPascalCase(method.Name), GetClassName(method.InputType)); - writer.WriteLine(" pb::RpcUtil.SpecializeCallback<{0}>(", GetClassName(method.OutputType)); - writer.WriteLine(" done));"); - writer.WriteLine(" return;"); - } - writer.WriteLine("default:"); - writer.WriteLine(" throw new global::System.InvalidOperationException(\"Can't get here.\");"); - writer.Outdent(); - writer.WriteLine("}"); - writer.Outdent(); - writer.WriteLine("}"); - writer.WriteLine(); - } - - private void GenerateGetPrototype(RequestOrResponse which, TextGenerator writer) - { - writer.WriteLine("public pb::IMessage Get{0}Prototype(pbd::MethodDescriptor method) {{", which); - writer.Indent(); - writer.WriteLine("if (method.Service != Descriptor) {"); - writer.WriteLine(" throw new global::System.ArgumentException("); - writer.WriteLine(" \"Service.Get{0}Prototype() given method descriptor for wrong service type.\");", - which); - writer.WriteLine("}"); - writer.WriteLine("switch(method.Index) {"); - writer.Indent(); - - foreach (MethodDescriptor method in Descriptor.Methods) - { - writer.WriteLine("case {0}:", method.Index); - writer.WriteLine(" return {0}.DefaultInstance;", - GetClassName(which == RequestOrResponse.Request ? method.InputType : method.OutputType)); - } - writer.WriteLine("default:"); - writer.WriteLine(" throw new global::System.InvalidOperationException(\"Can't get here.\");"); - writer.Outdent(); - writer.WriteLine("}"); - writer.Outdent(); - writer.WriteLine("}"); - writer.WriteLine(); - } - - private void GenerateStub(TextGenerator writer) - { - writer.WriteLine("public static Stub CreateStub(pb::IRpcChannel channel) {"); - writer.WriteLine(" return new Stub(channel);"); - writer.WriteLine("}"); - writer.WriteLine(); - writer.WriteLine("[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]"); - WriteGeneratedCodeAttributes(writer); - writer.WriteLine("{0} class Stub : {1} {{", ClassAccessLevel, GetClassName(Descriptor)); - writer.Indent(); - writer.WriteLine("internal Stub(pb::IRpcChannel channel) {"); - writer.WriteLine(" this.channel = channel;"); - writer.WriteLine("}"); - writer.WriteLine(); - writer.WriteLine("private readonly pb::IRpcChannel channel;"); - writer.WriteLine(); - writer.WriteLine("public pb::IRpcChannel Channel {"); - writer.WriteLine(" get { return channel; }"); - writer.WriteLine("}"); - - foreach (MethodDescriptor method in Descriptor.Methods) - { - writer.WriteLine(); - writer.WriteLine("{0} override void {1}(", ClassAccessLevel, - NameHelpers.UnderscoresToPascalCase(method.Name)); - writer.WriteLine(" pb::IRpcController controller,"); - writer.WriteLine(" {0} request,", GetClassName(method.InputType)); - writer.WriteLine(" global::System.Action<{0}> done) {{", GetClassName(method.OutputType)); - writer.Indent(); - writer.WriteLine("channel.CallMethod(Descriptor.Methods[{0}],", method.Index); - writer.WriteLine(" controller, request, {0}.DefaultInstance,", GetClassName(method.OutputType)); - writer.WriteLine(" pb::RpcUtil.GeneralizeCallback<{0}, {0}.Builder>(done, {0}.DefaultInstance));", - GetClassName(method.OutputType)); - writer.Outdent(); - writer.WriteLine("}"); - } - writer.Outdent(); - writer.WriteLine("}"); - } - } -} \ No newline at end of file diff --git a/src/ProtoGen/ServiceInterfaceGenerator.cs b/src/ProtoGen/ServiceInterfaceGenerator.cs deleted file mode 100644 index 11e3d3d..0000000 --- a/src/ProtoGen/ServiceInterfaceGenerator.cs +++ /dev/null @@ -1,300 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using Google.ProtocolBuffers.DescriptorProtos; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.ProtoGen -{ - internal class ServiceGenerator : SourceGeneratorBase, ISourceGenerator - { - private readonly CSharpServiceType svcType; - private ISourceGenerator _generator; - - internal ServiceGenerator(ServiceDescriptor descriptor) - : base(descriptor) - { - svcType = descriptor.File.CSharpOptions.ServiceGeneratorType; - switch (svcType) - { - case CSharpServiceType.NONE: - _generator = new NoServicesGenerator(descriptor); - break; - case CSharpServiceType.GENERIC: - _generator = new GenericServiceGenerator(descriptor); - break; - case CSharpServiceType.INTERFACE: - _generator = new ServiceInterfaceGenerator(descriptor); - break; - case CSharpServiceType.IRPCDISPATCH: - _generator = new RpcServiceGenerator(descriptor); - break; - default: - throw new ApplicationException("Unknown ServiceGeneratorType = " + svcType.ToString()); - } - } - - public void Generate(TextGenerator writer) - { - _generator.Generate(writer); - } - - private class NoServicesGenerator : SourceGeneratorBase, ISourceGenerator - { - public NoServicesGenerator(ServiceDescriptor descriptor) - : base(descriptor) - { - } - - public virtual void Generate(TextGenerator writer) - { - writer.WriteLine("/*"); - writer.WriteLine("* Service generation is now disabled by default, use the following option to enable:"); - writer.WriteLine("* option (google.protobuf.csharp_file_options).service_generator_type = GENERIC;"); - writer.WriteLine("*/"); - } - } - - private class ServiceInterfaceGenerator : SourceGeneratorBase, ISourceGenerator - { - public ServiceInterfaceGenerator(ServiceDescriptor descriptor) - : base(descriptor) - { - } - - public virtual void Generate(TextGenerator writer) - { - CSharpServiceOptions options = Descriptor.Options.GetExtension(CSharpOptions.CsharpServiceOptions); - if (options != null && options.HasInterfaceId) - { - writer.WriteLine("[global::System.Runtime.InteropServices.GuidAttribute(\"{0}\")]", - new Guid(options.InterfaceId)); - } - WriteGeneratedCodeAttributes(writer); - writer.WriteLine("{0} partial interface I{1} {{", ClassAccessLevel, Descriptor.Name); - writer.Indent(); - - foreach (MethodDescriptor method in Descriptor.Methods) - { - CSharpMethodOptions mth = method.Options.GetExtension(CSharpOptions.CsharpMethodOptions); - if (mth.HasDispatchId) - { - writer.WriteLine("[global::System.Runtime.InteropServices.DispId({0})]", mth.DispatchId); - } - writer.WriteLine("{0} {1}({2} {3});", GetClassName(method.OutputType), - NameHelpers.UnderscoresToPascalCase(method.Name), GetClassName(method.InputType), - NameHelpers.UnderscoresToCamelCase(method.InputType.Name)); - } - - writer.Outdent(); - writer.WriteLine("}"); - } - } - - private class RpcServiceGenerator : ServiceInterfaceGenerator - { - public RpcServiceGenerator(ServiceDescriptor descriptor) - : base(descriptor) - { - } - - public override void Generate(TextGenerator writer) - { - base.Generate(writer); - - writer.WriteLine(); - - // CLIENT Proxy - { - if (Descriptor.File.CSharpOptions.ClsCompliance) - { - writer.WriteLine("[global::System.CLSCompliant(false)]"); - } - writer.WriteLine("[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]"); - WriteGeneratedCodeAttributes(writer); - writer.WriteLine("{0} partial class {1} : I{1}, pb::IRpcDispatch, global::System.IDisposable {{", - ClassAccessLevel, Descriptor.Name); - writer.Indent(); - writer.WriteLine("private readonly bool dispose;"); - writer.WriteLine("private readonly pb::IRpcDispatch dispatch;"); - - writer.WriteLine("public {0}(pb::IRpcDispatch dispatch) : this(dispatch, true) {{", Descriptor.Name); - writer.WriteLine("}"); - writer.WriteLine("public {0}(pb::IRpcDispatch dispatch, bool dispose) {{", Descriptor.Name); - writer.WriteLine(" pb::ThrowHelper.ThrowIfNull(this.dispatch = dispatch, \"dispatch\");"); - writer.WriteLine(" this.dispose = dispose && dispatch is global::System.IDisposable;"); - writer.WriteLine("}"); - writer.WriteLine(); - - writer.WriteLine("public void Dispose() {"); - writer.WriteLine(" if (dispose) ((global::System.IDisposable)dispatch).Dispose();"); - writer.WriteLine("}"); - writer.WriteLine(); - writer.WriteLine( - "TMessage pb::IRpcDispatch.CallMethod(string method, pb::IMessageLite request, pb::IBuilderLite response) {"); - writer.WriteLine(" return dispatch.CallMethod(method, request, response);"); - writer.WriteLine("}"); - writer.WriteLine(); - - foreach (MethodDescriptor method in Descriptor.Methods) - { - writer.WriteLine("public {0} {1}({2} {3}) {{", GetClassName(method.OutputType), - NameHelpers.UnderscoresToPascalCase(method.Name), - GetClassName(method.InputType), - NameHelpers.UnderscoresToCamelCase(method.InputType.Name)); - writer.WriteLine(" return dispatch.CallMethod(\"{0}\", {1}, {2}.CreateBuilder());", - method.Name, - NameHelpers.UnderscoresToCamelCase(method.InputType.Name), - GetClassName(method.OutputType) - ); - writer.WriteLine("}"); - writer.WriteLine(); - } - } - // SERVER - DISPATCH - { - if (Descriptor.File.CSharpOptions.ClsCompliance) - { - writer.WriteLine("[global::System.CLSCompliant(false)]"); - } - writer.WriteLine("[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]"); - WriteGeneratedCodeAttributes(writer); - writer.WriteLine("public partial class Dispatch : pb::IRpcDispatch, global::System.IDisposable {"); - writer.Indent(); - writer.WriteLine("private readonly bool dispose;"); - writer.WriteLine("private readonly I{0} implementation;", Descriptor.Name); - - writer.WriteLine("public Dispatch(I{0} implementation) : this(implementation, true) {{", - Descriptor.Name); - writer.WriteLine("}"); - writer.WriteLine("public Dispatch(I{0} implementation, bool dispose) {{", Descriptor.Name); - writer.WriteLine(" pb::ThrowHelper.ThrowIfNull(this.implementation = implementation, \"implementation\");"); - writer.WriteLine(" this.dispose = dispose && implementation is global::System.IDisposable;"); - writer.WriteLine("}"); - writer.WriteLine(); - - writer.WriteLine("public void Dispose() {"); - writer.WriteLine(" if (dispose) ((global::System.IDisposable)implementation).Dispose();"); - writer.WriteLine("}"); - writer.WriteLine(); - - writer.WriteLine( - "public TMessage CallMethod(string methodName, pb::IMessageLite request, pb::IBuilderLite response)"); - writer.WriteLine(" where TMessage : pb::IMessageLite"); - writer.WriteLine(" where TBuilder : pb::IBuilderLite {"); - writer.Indent(); - writer.WriteLine("switch(methodName) {"); - writer.Indent(); - - foreach (MethodDescriptor method in Descriptor.Methods) - { - writer.WriteLine( - "case \"{0}\": return response.MergeFrom(implementation.{1}(({2})request)).Build();", - method.Name, NameHelpers.UnderscoresToPascalCase(method.Name), - GetClassName(method.InputType)); - } - writer.WriteLine("default: throw pb::ThrowHelper.CreateMissingMethod(typeof(I{0}), methodName);", Descriptor.Name); - writer.Outdent(); - writer.WriteLine("}"); //end switch - writer.Outdent(); - writer.WriteLine("}"); //end invoke - writer.Outdent(); - writer.WriteLine("}"); //end server - } - // SERVER - STUB - { - if (Descriptor.File.CSharpOptions.ClsCompliance) - { - writer.WriteLine("[global::System.CLSCompliant(false)]"); - } - writer.WriteLine("[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]"); - WriteGeneratedCodeAttributes(writer); - writer.WriteLine( - "public partial class ServerStub : pb::IRpcServerStub, global::System.IDisposable {"); - writer.Indent(); - writer.WriteLine("private readonly bool dispose;"); - writer.WriteLine("private readonly pb::IRpcDispatch implementation;", Descriptor.Name); - - writer.WriteLine("public ServerStub(I{0} implementation) : this(implementation, true) {{", - Descriptor.Name); - writer.WriteLine("}"); - writer.WriteLine( - "public ServerStub(I{0} implementation, bool dispose) : this(new Dispatch(implementation, dispose), dispose) {{", - Descriptor.Name); - writer.WriteLine("}"); - - writer.WriteLine("public ServerStub(pb::IRpcDispatch implementation) : this(implementation, true) {"); - writer.WriteLine("}"); - writer.WriteLine("public ServerStub(pb::IRpcDispatch implementation, bool dispose) {"); - writer.WriteLine(" pb::ThrowHelper.ThrowIfNull(this.implementation = implementation, \"implementation\");"); - writer.WriteLine(" this.dispose = dispose && implementation is global::System.IDisposable;"); - writer.WriteLine("}"); - writer.WriteLine(); - - writer.WriteLine("public void Dispose() {"); - writer.WriteLine(" if (dispose) ((global::System.IDisposable)implementation).Dispose();"); - writer.WriteLine("}"); - writer.WriteLine(); - - writer.WriteLine( - "public pb::IMessageLite CallMethod(string methodName, pb::ICodedInputStream input, pb::ExtensionRegistry registry) {{", - Descriptor.Name); - writer.Indent(); - writer.WriteLine("switch(methodName) {"); - writer.Indent(); - - foreach (MethodDescriptor method in Descriptor.Methods) - { - writer.WriteLine( - "case \"{0}\": return implementation.CallMethod(methodName, {1}.ParseFrom(input, registry), {2}.CreateBuilder());", - method.Name, GetClassName(method.InputType), GetClassName(method.OutputType)); - } - writer.WriteLine("default: throw pb::ThrowHelper.CreateMissingMethod(typeof(I{0}), methodName);", Descriptor.Name); - writer.Outdent(); - writer.WriteLine("}"); //end switch - writer.Outdent(); - writer.WriteLine("}"); //end invoke - writer.Outdent(); - writer.WriteLine("}"); //end server - } - - writer.Outdent(); - writer.WriteLine("}"); - } - } - } -} \ No newline at end of file diff --git a/src/ProtoGen/SourceGeneratorBase.cs b/src/ProtoGen/SourceGeneratorBase.cs deleted file mode 100644 index 535c6f7..0000000 --- a/src/ProtoGen/SourceGeneratorBase.cs +++ /dev/null @@ -1,167 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System.Collections.Generic; -using Google.ProtocolBuffers.DescriptorProtos; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.ProtoGen -{ - internal abstract class SourceGeneratorBase where T : IDescriptor - { - private readonly T descriptor; - - protected readonly bool OptimizeSpeed; - protected readonly bool OptimizeSize; - protected readonly bool UseLiteRuntime; - protected readonly string RuntimeSuffix; - - protected SourceGeneratorBase(T descriptor) - { - this.descriptor = descriptor; - - OptimizeSize = descriptor.File.Options.OptimizeFor == - FileOptions.Types.OptimizeMode.CODE_SIZE; - OptimizeSpeed = descriptor.File.Options.OptimizeFor == - FileOptions.Types.OptimizeMode.SPEED; - UseLiteRuntime = descriptor.File.Options.OptimizeFor == - FileOptions.Types.OptimizeMode.LITE_RUNTIME; - //Lite runtime uses OptimizeSpeed code branches - OptimizeSpeed |= UseLiteRuntime; - RuntimeSuffix = UseLiteRuntime ? "Lite" : ""; - } - - protected T Descriptor - { - get { return descriptor; } - } - - internal static string GetClassName(IDescriptor descriptor) - { - return ToCSharpName(descriptor.FullName, descriptor.File); - } - - // Groups are hacky: The name of the field is just the lower-cased name - // of the group type. In C#, though, we would like to retain the original - // capitalization of the type name. - internal static string GetFieldName(FieldDescriptor descriptor) - { - if (descriptor.FieldType == FieldType.Group) - { - return descriptor.MessageType.Name; - } - else - { - return descriptor.Name; - } - } - - internal static string GetFieldConstantName(FieldDescriptor field) - { - return field.CSharpOptions.PropertyName + "FieldNumber"; - } - - private static string ToCSharpName(string name, FileDescriptor file) - { - string result = file.CSharpOptions.Namespace; - if (file.CSharpOptions.NestClasses) - { - if (result != "") - { - result += "."; - } - result += file.CSharpOptions.UmbrellaClassname; - } - if (result != "") - { - result += '.'; - } - string classname; - if (file.Package == "") - { - classname = name; - } - else - { - // Strip the proto package from full_name since we've replaced it with - // the C# namespace. - classname = name.Substring(file.Package.Length + 1); - } - result += classname.Replace(".", ".Types."); - return "global::" + result; - } - - protected string ClassAccessLevel - { - get { return descriptor.File.CSharpOptions.PublicClasses ? "public" : "internal"; } - } - - protected void WriteGeneratedCodeAttributes(TextGenerator writer) - { - if (descriptor.File.CSharpOptions.GeneratedCodeAttributes) - { - writer.WriteLine("[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]"); - writer.WriteLine("[global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"{0}\", \"{1}\")]", - GetType().Assembly.GetName().Name, GetType().Assembly.GetName().Version); - } - } - - protected void WriteChildren(TextGenerator writer, string region, IEnumerable children) - where TChild : IDescriptor - { - // Copy the set of children; makes access easier - List copy = new List(children); - if (copy.Count == 0) - { - return; - } - - if (region != null) - { - writer.WriteLine("#region {0}", region); - } - foreach (TChild child in children) - { - SourceGenerators.CreateGenerator(child).Generate(writer); - } - if (region != null) - { - writer.WriteLine("#endregion"); - writer.WriteLine(); - } - } - } -} \ No newline at end of file diff --git a/src/ProtoGen/SourceGenerators.cs b/src/ProtoGen/SourceGenerators.cs deleted file mode 100644 index 38458f0..0000000 --- a/src/ProtoGen/SourceGenerators.cs +++ /dev/null @@ -1,87 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.ProtoGen -{ - public delegate TResult Func(T arg); - - internal static class SourceGenerators - { - private static readonly Dictionary> GeneratorFactories = - new Dictionary> - { - {typeof(FileDescriptor), descriptor => new UmbrellaClassGenerator((FileDescriptor) descriptor)}, - {typeof(EnumDescriptor), descriptor => new EnumGenerator((EnumDescriptor) descriptor)}, - {typeof(ServiceDescriptor), descriptor => new ServiceGenerator((ServiceDescriptor) descriptor)}, - {typeof(MessageDescriptor), descriptor => new MessageGenerator((MessageDescriptor) descriptor)}, - // For other fields, we have IFieldSourceGenerators. - {typeof(FieldDescriptor), descriptor => new ExtensionGenerator((FieldDescriptor) descriptor)} - }; - - public static IFieldSourceGenerator CreateFieldGenerator(FieldDescriptor field, int fieldOrdinal) - { - switch (field.MappedType) - { - case MappedType.Message: - return field.IsRepeated - ? (IFieldSourceGenerator) new RepeatedMessageFieldGenerator(field, fieldOrdinal) - : new MessageFieldGenerator(field, fieldOrdinal); - case MappedType.Enum: - return field.IsRepeated - ? (IFieldSourceGenerator) new RepeatedEnumFieldGenerator(field, fieldOrdinal) - : new EnumFieldGenerator(field, fieldOrdinal); - default: - return field.IsRepeated - ? (IFieldSourceGenerator) new RepeatedPrimitiveFieldGenerator(field, fieldOrdinal) - : new PrimitiveFieldGenerator(field, fieldOrdinal); - } - } - - public static ISourceGenerator CreateGenerator(T descriptor) where T : IDescriptor - { - Func factory; - if (!GeneratorFactories.TryGetValue(typeof(T), out factory)) - { - throw new ArgumentException("No generator registered for " + typeof(T).Name); - } - return factory(descriptor); - } - } -} \ No newline at end of file diff --git a/src/ProtoGen/UmbrellaClassGenerator.cs b/src/ProtoGen/UmbrellaClassGenerator.cs deleted file mode 100644 index d83b2db..0000000 --- a/src/ProtoGen/UmbrellaClassGenerator.cs +++ /dev/null @@ -1,294 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -using System; -using System.Collections; -using System.Collections.Generic; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.ProtoGen -{ - /// - /// Generator for the class describing the .proto file in general, - /// containing things like the message descriptor. - /// - internal sealed class UmbrellaClassGenerator : SourceGeneratorBase, ISourceGenerator - { - internal UmbrellaClassGenerator(FileDescriptor descriptor) - : base(descriptor) - { - } - - // Recursively searches the given message to see if it contains any extensions. - private static bool UsesExtensions(IMessage message) - { - // We conservatively assume that unknown fields are extensions. - if (message.UnknownFields.FieldDictionary.Count > 0) - { - return true; - } - - foreach (KeyValuePair keyValue in message.AllFields) - { - FieldDescriptor field = keyValue.Key; - if (field.IsExtension) - { - return true; - } - if (field.MappedType == MappedType.Message) - { - if (field.IsRepeated) - { - foreach (IMessage subMessage in (IEnumerable) keyValue.Value) - { - if (UsesExtensions(subMessage)) - { - return true; - } - } - } - else - { - if (UsesExtensions((IMessage) keyValue.Value)) - { - return true; - } - } - } - } - return false; - } - - public void Generate(TextGenerator writer) - { - WriteIntroduction(writer); - WriteExtensionRegistration(writer); - WriteChildren(writer, "Extensions", Descriptor.Extensions); - writer.WriteLine("#region Static variables"); - foreach (MessageDescriptor message in Descriptor.MessageTypes) - { - new MessageGenerator(message).GenerateStaticVariables(writer); - } - writer.WriteLine("#endregion"); - if (!UseLiteRuntime) - { - WriteDescriptor(writer); - } - else - { - WriteLiteExtensions(writer); - } - // The class declaration either gets closed before or after the children are written. - if (!Descriptor.CSharpOptions.NestClasses) - { - writer.Outdent(); - writer.WriteLine("}"); - - // Close the namespace around the umbrella class if defined - if (!Descriptor.CSharpOptions.NestClasses && Descriptor.CSharpOptions.UmbrellaNamespace != "") - { - writer.Outdent(); - writer.WriteLine("}"); - } - } - WriteChildren(writer, "Enums", Descriptor.EnumTypes); - WriteChildren(writer, "Messages", Descriptor.MessageTypes); - WriteChildren(writer, "Services", Descriptor.Services); - if (Descriptor.CSharpOptions.NestClasses) - { - writer.Outdent(); - writer.WriteLine("}"); - } - if (Descriptor.CSharpOptions.Namespace != "") - { - writer.Outdent(); - writer.WriteLine("}"); - } - writer.WriteLine(); - writer.WriteLine("#endregion Designer generated code"); - } - - private void WriteIntroduction(TextGenerator writer) - { - writer.WriteLine("// Generated by {0}. DO NOT EDIT!", this.GetType().Assembly.FullName); - writer.WriteLine("#pragma warning disable 1591, 0612, 3021"); - writer.WriteLine("#region Designer generated code"); - - writer.WriteLine(); - writer.WriteLine("using pb = global::Google.ProtocolBuffers;"); - writer.WriteLine("using pbc = global::Google.ProtocolBuffers.Collections;"); - writer.WriteLine("using pbd = global::Google.ProtocolBuffers.Descriptors;"); - writer.WriteLine("using scg = global::System.Collections.Generic;"); - - if (Descriptor.CSharpOptions.Namespace != "") - { - writer.WriteLine("namespace {0} {{", Descriptor.CSharpOptions.Namespace); - writer.Indent(); - writer.WriteLine(); - } - // Add the namespace around the umbrella class if defined - if (!Descriptor.CSharpOptions.NestClasses && Descriptor.CSharpOptions.UmbrellaNamespace != "") - { - writer.WriteLine("namespace {0} {{", Descriptor.CSharpOptions.UmbrellaNamespace); - writer.Indent(); - writer.WriteLine(); - } - - if (Descriptor.CSharpOptions.CodeContracts) - { - writer.WriteLine("[global::System.Diagnostics.Contracts.ContractVerificationAttribute(false)]"); - } - writer.WriteLine("[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]"); - WriteGeneratedCodeAttributes(writer); - writer.WriteLine("{0} static partial class {1} {{", ClassAccessLevel, - Descriptor.CSharpOptions.UmbrellaClassname); - writer.WriteLine(); - writer.Indent(); - } - - private void WriteExtensionRegistration(TextGenerator writer) - { - writer.WriteLine("#region Extension registration"); - writer.WriteLine("public static void RegisterAllExtensions(pb::ExtensionRegistry registry) {"); - writer.Indent(); - foreach (FieldDescriptor extension in Descriptor.Extensions) - { - new ExtensionGenerator(extension).GenerateExtensionRegistrationCode(writer); - } - foreach (MessageDescriptor message in Descriptor.MessageTypes) - { - new MessageGenerator(message).GenerateExtensionRegistrationCode(writer); - } - writer.Outdent(); - writer.WriteLine("}"); - writer.WriteLine("#endregion"); - } - - private void WriteDescriptor(TextGenerator writer) - { - writer.WriteLine("#region Descriptor"); - - writer.WriteLine("public static pbd::FileDescriptor Descriptor {"); - writer.WriteLine(" get { return descriptor; }"); - writer.WriteLine("}"); - writer.WriteLine("private static pbd::FileDescriptor descriptor;"); - writer.WriteLine(); - writer.WriteLine("static {0}() {{", Descriptor.CSharpOptions.UmbrellaClassname); - writer.Indent(); - writer.WriteLine("byte[] descriptorData = global::System.Convert.FromBase64String("); - writer.Indent(); - writer.Indent(); - 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)); - base64 = base64.Substring(60); - } - writer.Outdent(); - writer.WriteLine("\"{0}\"));", base64); - writer.Outdent(); - writer.Outdent(); - writer.WriteLine( - "pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) {"); - writer.Indent(); - writer.WriteLine("descriptor = root;"); - foreach (MessageDescriptor message in Descriptor.MessageTypes) - { - new MessageGenerator(message).GenerateStaticVariableInitializers(writer); - } - foreach (FieldDescriptor extension in Descriptor.Extensions) - { - new ExtensionGenerator(extension).GenerateStaticVariableInitializers(writer); - } - - if (UsesExtensions(Descriptor.Proto)) - { - // Must construct an ExtensionRegistry containing all possible extensions - // and return it. - writer.WriteLine("pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance();"); - writer.WriteLine("RegisterAllExtensions(registry);"); - foreach (FileDescriptor dependency in Descriptor.Dependencies) - { - writer.WriteLine("{0}.RegisterAllExtensions(registry);", - DescriptorUtil.GetFullUmbrellaClassName(dependency)); - } - writer.WriteLine("return registry;"); - } - else - { - writer.WriteLine("return null;"); - } - writer.Outdent(); - writer.WriteLine("};"); - - // ----------------------------------------------------------------- - // Invoke internalBuildGeneratedFileFrom() to build the file. - writer.WriteLine("pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,"); - writer.WriteLine(" new pbd::FileDescriptor[] {"); - foreach (FileDescriptor dependency in Descriptor.Dependencies) - { - writer.WriteLine(" {0}.Descriptor, ", DescriptorUtil.GetFullUmbrellaClassName(dependency)); - } - writer.WriteLine(" }, assigner);"); - writer.Outdent(); - writer.WriteLine("}"); - writer.WriteLine("#endregion"); - writer.WriteLine(); - } - - private void WriteLiteExtensions(TextGenerator writer) - { - writer.WriteLine("#region Extensions"); - writer.WriteLine("internal static readonly object Descriptor;"); - writer.WriteLine("static {0}() {{", Descriptor.CSharpOptions.UmbrellaClassname); - writer.Indent(); - writer.WriteLine("Descriptor = null;"); - - foreach (MessageDescriptor message in Descriptor.MessageTypes) - { - new MessageGenerator(message).GenerateStaticVariableInitializers(writer); - } - foreach (FieldDescriptor extension in Descriptor.Extensions) - { - new ExtensionGenerator(extension).GenerateStaticVariableInitializers(writer); - } - writer.Outdent(); - writer.WriteLine("}"); - writer.WriteLine("#endregion"); - writer.WriteLine(); - } - } -} \ No newline at end of file diff --git a/src/ProtoGen/app.config b/src/ProtoGen/app.config deleted file mode 100644 index 89b324b..0000000 --- a/src/ProtoGen/app.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/ProtoGen/protoc-gen-cs.csproj b/src/ProtoGen/protoc-gen-cs.csproj deleted file mode 100644 index fdc88cc..0000000 --- a/src/ProtoGen/protoc-gen-cs.csproj +++ /dev/null @@ -1,101 +0,0 @@ - - - - CLIENTPROFILE - NET35 - Debug - AnyCPU - 9.0.30729 - 2.0 - {250ADE34-82FD-4BAE-86D5-985FBE589C4B} - Exe - Properties - Google.ProtocolBuffers.ProtoGen - protoc-gen-cs - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - Google.ProtocolBuffers.ProtoGen.ProtocGenCs - - - true - full - false - bin\NET35\Debug - obj\NET35\Debug\ - DEBUG;TRACE - prompt - 4 - true - true - Off - - - pdbonly - true - bin\NET35\Release - obj\NET35\Release\ - TRACE - prompt - 4 - true - true - Off - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {231391af-449c-4a39-986c-ad7f270f4750} - ProtocolBuffers.Serialization - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - - - - \ No newline at end of file diff --git a/src/ProtoMunge/Program.cs b/src/ProtoMunge/Program.cs deleted file mode 100644 index 53dc350..0000000 --- a/src/ProtoMunge/Program.cs +++ /dev/null @@ -1,305 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.ProtoMunge -{ - /// - /// Utility console application which takes a message descriptor and a corresponding message, - /// and produces a new message with similar but random data. The data is the same length - /// as the original, but with random values within appropriate bands. (For instance, a compressed - /// integer in the range 0-127 will end up as another integer in the same range, to keep the length - /// the same.) - /// TODO(jonskeet): Potentially refactor to use an instance instead, making it simpler to - /// be thread-safe for external use. - /// - public sealed class Program - { - private static readonly Random rng = new Random(); - - private static int Main(string[] args) - { - if (args.Length != 3) - { - Console.Error.WriteLine("Usage: ProtoMunge "); - Console.Error.WriteLine( - "The descriptor type name is the fully-qualified message name, including assembly."); - Console.Error.WriteLine( - "(At a future date it may be possible to do this without building the .NET assembly at all.)"); - return 1; - } - IMessage defaultMessage; - try - { - defaultMessage = MessageUtil.GetDefaultMessage(args[0]); - } - catch (ArgumentException e) - { - Console.Error.WriteLine(e.Message); - return 1; - } - try - { - IBuilder builder = defaultMessage.WeakCreateBuilderForType(); - byte[] inputData = File.ReadAllBytes(args[1]); - builder.WeakMergeFrom(ByteString.CopyFrom(inputData)); - IMessage original = builder.WeakBuild(); - IMessage munged = Munge(original); - if (original.SerializedSize != munged.SerializedSize) - { - throw new Exception("Serialized sizes don't match"); - } - File.WriteAllBytes(args[2], munged.ToByteArray()); - return 0; - } - catch (Exception e) - { - Console.Error.WriteLine("Error: {0}", e.Message); - Console.Error.WriteLine(); - Console.Error.WriteLine("Detailed exception information: {0}", e); - return 1; - } - } - - /// - /// Munges a message recursively. - /// - /// A new message of the same type as the original message, - /// but munged so that all the data is desensitised. - private static IMessage Munge(IMessage message) - { - IBuilder builder = message.WeakCreateBuilderForType(); - foreach (var pair in message.AllFields) - { - if (pair.Key.IsRepeated) - { - foreach (object singleValue in (IEnumerable) pair.Value) - { - builder.WeakAddRepeatedField(pair.Key, CheckedMungeValue(pair.Key, singleValue)); - } - } - else - { - builder[pair.Key] = CheckedMungeValue(pair.Key, pair.Value); - } - } - IMessage munged = builder.WeakBuild(); - if (message.SerializedSize != munged.SerializedSize) - { - Console.WriteLine("Sub message sizes: {0}/{1}", message.SerializedSize, munged.SerializedSize); - } - return munged; - } - - /// - /// Munges a single value and checks that the length ends up the same as it was before. - /// - private static object CheckedMungeValue(FieldDescriptor fieldDescriptor, object value) - { - int currentSize = CodedOutputStream.ComputeFieldSize(fieldDescriptor.FieldType, fieldDescriptor.FieldNumber, - value); - object mungedValue = MungeValue(fieldDescriptor, value); - int mungedSize = CodedOutputStream.ComputeFieldSize(fieldDescriptor.FieldType, fieldDescriptor.FieldNumber, - mungedValue); - // Exceptions log more easily than assertions - if (currentSize != mungedSize) - { - throw new Exception("Munged value had wrong size. Field type: " + fieldDescriptor.FieldType - + "; old value: " + value + "; new value: " + mungedValue); - } - return mungedValue; - } - - /// - /// Munges a single value of the specified field descriptor. (i.e. if the field is - /// actually a repeated int, this method receives a single int value to munge, and - /// is called multiple times). - /// - private static object MungeValue(FieldDescriptor fieldDescriptor, object value) - { - switch (fieldDescriptor.FieldType) - { - case FieldType.SInt64: - case FieldType.Int64: - return (long) MungeVarint64((ulong) (long) value); - case FieldType.UInt64: - return MungeVarint64((ulong) value); - case FieldType.SInt32: - return (int) MungeVarint32((uint) (int) value); - case FieldType.Int32: - return MungeInt32((int) value); - case FieldType.UInt32: - return MungeVarint32((uint) value); - case FieldType.Double: - return rng.NextDouble(); - case FieldType.Float: - return (float) rng.NextDouble(); - case FieldType.Fixed64: - { - byte[] data = new byte[8]; - rng.NextBytes(data); - return BitConverter.ToUInt64(data, 0); - } - case FieldType.Fixed32: - { - byte[] data = new byte[4]; - rng.NextBytes(data); - return BitConverter.ToUInt32(data, 0); - } - case FieldType.Bool: - return rng.Next(2) == 1; - case FieldType.String: - return MungeString((string) value); - case FieldType.Group: - case FieldType.Message: - return Munge((IMessage) value); - case FieldType.Bytes: - return MungeByteString((ByteString) value); - case FieldType.SFixed64: - { - byte[] data = new byte[8]; - rng.NextBytes(data); - return BitConverter.ToInt64(data, 0); - } - case FieldType.SFixed32: - { - byte[] data = new byte[4]; - rng.NextBytes(data); - return BitConverter.ToInt32(data, 0); - } - case FieldType.Enum: - return MungeEnum(fieldDescriptor, (EnumValueDescriptor) value); - default: - // TODO(jonskeet): Different exception? - throw new ArgumentException("Invalid field descriptor"); - } - } - - private static object MungeString(string original) - { - foreach (char c in original) - { - if (c > 127) - { - throw new ArgumentException("Can't handle non-ascii yet"); - } - } - char[] chars = new char[original.Length]; - // Convert to pure ASCII - no control characters. - for (int i = 0; i < chars.Length; i++) - { - chars[i] = (char) rng.Next(32, 127); - } - return new string(chars); - } - - /// - /// Int32 fields are slightly strange - we need to keep the sign the same way it is: - /// negative numbers can munge to any other negative number (it'll always take - /// 10 bytes) but positive numbers have to stay positive, so we can't use the - /// full range of 32 bits. - /// - private static int MungeInt32(int value) - { - if (value < 0) - { - return rng.Next(int.MinValue, 0); - } - int length = CodedOutputStream.ComputeRawVarint32Size((uint) value); - uint min = length == 1 ? 0 : 1U << ((length - 1)*7); - uint max = length == 5 ? int.MaxValue : (1U << (length*7)) - 1; - return (int) NextRandomUInt64(min, max); - } - - private static uint MungeVarint32(uint original) - { - int length = CodedOutputStream.ComputeRawVarint32Size(original); - uint min = length == 1 ? 0 : 1U << ((length - 1)*7); - uint max = length == 5 ? uint.MaxValue : (1U << (length*7)) - 1; - return (uint) NextRandomUInt64(min, max); - } - - private static ulong MungeVarint64(ulong original) - { - int length = CodedOutputStream.ComputeRawVarint64Size(original); - ulong min = length == 1 ? 0 : 1UL << ((length - 1)*7); - ulong max = length == 10 ? ulong.MaxValue : (1UL << (length*7)) - 1; - return NextRandomUInt64(min, max); - } - - /// - /// Returns a random number in the range [min, max] (both inclusive). - /// - private static ulong NextRandomUInt64(ulong min, ulong max) - { - if (min > max) - { - throw new ArgumentException("min must be <= max; min=" + min + "; max = " + max); - } - ulong range = max - min; - // This isn't actually terribly good at very large ranges - but it doesn't really matter for the sake - // of this program. - return min + (ulong) (range*rng.NextDouble()); - } - - private static object MungeEnum(FieldDescriptor fieldDescriptor, EnumValueDescriptor original) - { - // Find all the values which get encoded to the same size as the current value, and pick one at random - int originalSize = CodedOutputStream.ComputeRawVarint32Size((uint) original.Number); - List sameSizeValues = new List(); - foreach (EnumValueDescriptor candidate in fieldDescriptor.EnumType.Values) - { - if (CodedOutputStream.ComputeRawVarint32Size((uint) candidate.Number) == originalSize) - { - sameSizeValues.Add(candidate); - } - } - return sameSizeValues[rng.Next(sameSizeValues.Count)]; - } - - private static object MungeByteString(ByteString byteString) - { - byte[] data = new byte[byteString.Length]; - rng.NextBytes(data); - return ByteString.CopyFrom(data); - } - } -} \ No newline at end of file diff --git a/src/ProtoMunge/Properties/AssemblyInfo.cs b/src/ProtoMunge/Properties/AssemblyInfo.cs deleted file mode 100644 index b78271b..0000000 --- a/src/ProtoMunge/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. - -[assembly: AssemblyTitle("ProtoMunge")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ProtoMunge")] -[assembly: AssemblyCopyright("Copyright © 2008")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("2.4.1.555")] - -[assembly: AssemblyVersion("2.4.1.555")] -[assembly: AssemblyFileVersion("2.4.1.555")] \ No newline at end of file diff --git a/src/ProtoMunge/ProtoMunge.csproj b/src/ProtoMunge/ProtoMunge.csproj deleted file mode 100644 index dae1a9a..0000000 --- a/src/ProtoMunge/ProtoMunge.csproj +++ /dev/null @@ -1,65 +0,0 @@ - - - - CLIENTPROFILE - NET35 - Debug - AnyCPU - 9.0.30729 - 2.0 - {8F09AF72-3327-4FA7-BC09-070B80221AB9} - Exe - Properties - Google.ProtocolBuffers.ProtoMunge - ProtoMunge - v3.5 - 512 - - - true - full - false - bin\NET35\Debug - obj\NET35\Debug\ - DEBUG;TRACE - prompt - 4 - true - true - Off - - - pdbonly - true - bin\NET35\Release - obj\NET35\Release\ - TRACE - prompt - 4 - true - true - Off - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/AbstractReader.cs b/src/ProtocolBuffers.Serialization/AbstractReader.cs deleted file mode 100644 index e198d0b..0000000 --- a/src/ProtocolBuffers.Serialization/AbstractReader.cs +++ /dev/null @@ -1,688 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using Google.ProtocolBuffers.Descriptors; - -//Disable CS3011: only CLS-compliant members can be abstract -#pragma warning disable 3011 - -namespace Google.ProtocolBuffers.Serialization -{ - /// - /// Provides a base-class that provides some basic functionality for handling type dispatching - /// - public abstract class AbstractReader : ICodedInputStream - { - private const int DefaultMaxDepth = 64; - private int _depth; - - /// Constructs a new reader - protected AbstractReader() { MaxDepth = DefaultMaxDepth; } - - /// Gets or sets the maximum recursion depth allowed - public int MaxDepth { get; set; } - - /// - /// Merges the contents of stream into the provided message builder - /// - public TBuilder Merge(TBuilder builder) where TBuilder : IBuilderLite - { - return Merge(builder, ExtensionRegistry.Empty); - } - - /// - /// Merges the contents of stream into the provided message builder - /// - public abstract TBuilder Merge(TBuilder builder, ExtensionRegistry registry) - where TBuilder : IBuilderLite; - - /// - /// Peeks at the next field in the input stream and returns what information is available. - /// - /// - /// This may be called multiple times without actually reading the field. Only after the field - /// is either read, or skipped, should PeekNext return a different value. - /// - protected abstract bool PeekNext(out string field); - - /// - /// Causes the reader to skip past this field - /// - protected abstract void Skip(); - - /// - /// Returns true if it was able to read a Boolean from the input - /// - protected abstract bool Read(ref bool value); - - /// - /// Returns true if it was able to read a Int32 from the input - /// - protected abstract bool Read(ref int value); - - /// - /// Returns true if it was able to read a UInt32 from the input - /// - [CLSCompliant(false)] - protected abstract bool Read(ref uint value); - - /// - /// Returns true if it was able to read a Int64 from the input - /// - protected abstract bool Read(ref long value); - - /// - /// Returns true if it was able to read a UInt64 from the input - /// - [CLSCompliant(false)] - protected abstract bool Read(ref ulong value); - - /// - /// Returns true if it was able to read a Single from the input - /// - protected abstract bool Read(ref float value); - - /// - /// Returns true if it was able to read a Double from the input - /// - protected abstract bool Read(ref double value); - - /// - /// Returns true if it was able to read a String from the input - /// - protected abstract bool Read(ref string value); - - /// - /// Returns true if it was able to read a ByteString from the input - /// - protected abstract bool Read(ref ByteString value); - - /// - /// returns true if it was able to read a single value into the value reference. The value - /// stored may be of type System.String, System.Int32, or an IEnumLite from the IEnumLiteMap. - /// - protected abstract bool ReadEnum(ref object value); - - /// - /// Merges the input stream into the provided IBuilderLite - /// - protected abstract bool ReadMessage(IBuilderLite builder, ExtensionRegistry registry); - - /// - /// Reads the root-message preamble specific to this formatter - /// - public abstract void ReadMessageStart(); - - /// - /// Reads the root-message close specific to this formatter - /// - public abstract void ReadMessageEnd(); - - /// - /// Merges the input stream into the provided IBuilderLite - /// - public virtual bool ReadGroup(IBuilderLite value, ExtensionRegistry registry) - { - return ReadMessage(value, registry); - } - - /// - /// Cursors through the array elements and stops at the end of the array - /// - protected virtual IEnumerable ForeachArrayItem(string field) - { - string next = field; - while (true) - { - yield return next; - - if (!PeekNext(out next) || next != field) - { - break; - } - } - } - - /// - /// Reads an array of T messages - /// - public virtual bool ReadMessageArray(string field, ICollection items, IMessageLite messageType, - ExtensionRegistry registry) - { - bool success = false; - foreach (string next in ForeachArrayItem(field)) - { - IBuilderLite builder = messageType.WeakCreateBuilderForType(); - if (ReadMessage(builder, registry)) - { - items.Add((T) builder.WeakBuild()); - success |= true; - } - } - return success; - } - - /// - /// Reads an array of T messages as a proto-buffer group - /// - public virtual bool ReadGroupArray(string field, ICollection items, IMessageLite messageType, - ExtensionRegistry registry) - { - bool success = false; - foreach (string next in ForeachArrayItem(field)) - { - IBuilderLite builder = messageType.WeakCreateBuilderForType(); - if (ReadGroup(builder, registry)) - { - items.Add((T) builder.WeakBuild()); - success |= true; - } - } - return success; - } - - /// - /// Reads an array of System.Enum type T and adds them to the collection - /// - public virtual bool ReadEnumArray(string field, ICollection items) - { - bool success = false; - foreach (string next in ForeachArrayItem(field)) - { - object temp = null; - if (ReadEnum(ref temp)) - { - items.Add(temp); - success |= true; - } - } - return success; - } - - /// - /// Reads an array of T, where T is a primitive type defined by FieldType - /// - public virtual bool ReadArray(FieldType type, string field, ICollection items) - { - bool success = false; - foreach (string next in ForeachArrayItem(field)) - { - object temp = null; - if (ReadField(type, ref temp)) - { - items.Add((T) temp); - success |= true; - } - } - return success; - } - - /// - /// returns true if it was able to read a single primitive value of FieldType into the value reference - /// - public virtual bool ReadField(FieldType type, ref object value) - { - switch (type) - { - case FieldType.Bool: - { - bool temp = false; - if (Read(ref temp)) - { - value = temp; - } - else - { - return false; - } - break; - } - case FieldType.Int64: - case FieldType.SInt64: - case FieldType.SFixed64: - { - long temp = 0; - if (Read(ref temp)) - { - value = temp; - } - else - { - return false; - } - break; - } - case FieldType.UInt64: - case FieldType.Fixed64: - { - ulong temp = 0; - if (Read(ref temp)) - { - value = temp; - } - else - { - return false; - } - break; - } - case FieldType.Int32: - case FieldType.SInt32: - case FieldType.SFixed32: - { - int temp = 0; - if (Read(ref temp)) - { - value = temp; - } - else - { - return false; - } - break; - } - case FieldType.UInt32: - case FieldType.Fixed32: - { - uint temp = 0; - if (Read(ref temp)) - { - value = temp; - } - else - { - return false; - } - break; - } - case FieldType.Float: - { - float temp = float.NaN; - if (Read(ref temp)) - { - value = temp; - } - else - { - return false; - } - break; - } - case FieldType.Double: - { - double temp = float.NaN; - if (Read(ref temp)) - { - value = temp; - } - else - { - return false; - } - break; - } - case FieldType.String: - { - string temp = null; - if (Read(ref temp)) - { - value = temp; - } - else - { - return false; - } - break; - } - case FieldType.Bytes: - { - ByteString temp = null; - if (Read(ref temp)) - { - value = temp; - } - else - { - return false; - } - break; - } - default: - throw InvalidProtocolBufferException.InvalidTag(); - } - return true; - } - - #region ICodedInputStream Members - - bool ICodedInputStream.ReadTag(out uint fieldTag, out string fieldName) - { - fieldTag = 0; - if (PeekNext(out fieldName)) - { - return true; - } - return false; - } - - bool ICodedInputStream.ReadDouble(ref double value) - { - return Read(ref value); - } - - bool ICodedInputStream.ReadFloat(ref float value) - { - return Read(ref value); - } - - bool ICodedInputStream.ReadUInt64(ref ulong value) - { - return Read(ref value); - } - - bool ICodedInputStream.ReadInt64(ref long value) - { - return Read(ref value); - } - - bool ICodedInputStream.ReadInt32(ref int value) - { - return Read(ref value); - } - - bool ICodedInputStream.ReadFixed64(ref ulong value) - { - return Read(ref value); - } - - bool ICodedInputStream.ReadFixed32(ref uint value) - { - return Read(ref value); - } - - bool ICodedInputStream.ReadBool(ref bool value) - { - return Read(ref value); - } - - bool ICodedInputStream.ReadString(ref string value) - { - return Read(ref value); - } - - void ICodedInputStream.ReadGroup(int fieldNumber, IBuilderLite builder, ExtensionRegistry extensionRegistry) - { - if (_depth++ > MaxDepth) - { - throw new RecursionLimitExceededException(); - } - ReadGroup(builder, extensionRegistry); - _depth--; - } - - void ICodedInputStream.ReadUnknownGroup(int fieldNumber, IBuilderLite builder) - { - throw new NotSupportedException(); - } - - void ICodedInputStream.ReadMessage(IBuilderLite builder, ExtensionRegistry extensionRegistry) - { - if (_depth++ > MaxDepth) - { - throw new RecursionLimitExceededException(); - } - ReadMessage(builder, extensionRegistry); - _depth--; - } - - bool ICodedInputStream.ReadBytes(ref ByteString value) - { - return Read(ref value); - } - - bool ICodedInputStream.ReadUInt32(ref uint value) - { - return Read(ref value); - } - - bool ICodedInputStream.ReadEnum(ref IEnumLite value, out object unknown, IEnumLiteMap mapping) - { - value = null; - unknown = null; - if (ReadEnum(ref unknown)) - { - if (unknown is int) - { - value = mapping.FindValueByNumber((int) unknown); - } - else if (unknown is string) - { - value = mapping.FindValueByName((string) unknown); - } - return value != null; - } - return false; - } - - bool ICodedInputStream.ReadEnum(ref T value, out object rawValue) - { - rawValue = null; - if (ReadEnum(ref rawValue)) - { - if (!EnumParser.TryConvert(rawValue, ref value)) - { - value = default(T); - return false; - } - return true; - } - return false; - } - - bool ICodedInputStream.ReadSFixed32(ref int value) - { - return Read(ref value); - } - - bool ICodedInputStream.ReadSFixed64(ref long value) - { - return Read(ref value); - } - - bool ICodedInputStream.ReadSInt32(ref int value) - { - return Read(ref value); - } - - bool ICodedInputStream.ReadSInt64(ref long value) - { - return Read(ref value); - } - - void ICodedInputStream.ReadPrimitiveArray(FieldType fieldType, uint fieldTag, string fieldName, - ICollection list) - { - ReadArray(fieldType, fieldName, list); - } - - void ICodedInputStream.ReadEnumArray(uint fieldTag, string fieldName, ICollection list, - out ICollection unknown, IEnumLiteMap mapping) - { - unknown = null; - List array = new List(); - if (ReadEnumArray(fieldName, array)) - { - foreach (object rawValue in array) - { - IEnumLite item = null; - if (rawValue is int) - { - item = mapping.FindValueByNumber((int) rawValue); - } - else if (rawValue is string) - { - item = mapping.FindValueByName((string) rawValue); - } - - if (item != null) - { - list.Add(item); - } - else - { - if (unknown == null) - { - unknown = new List(); - } - unknown.Add(rawValue); - } - } - } - } - - void ICodedInputStream.ReadEnumArray(uint fieldTag, string fieldName, ICollection list, - out ICollection unknown) - { - unknown = null; - List array = new List(); - if (ReadEnumArray(fieldName, array)) - { - foreach (object rawValue in array) - { - T val = default(T); - if (EnumParser.TryConvert(rawValue, ref val)) - { - list.Add(val); - } - else - { - if (unknown == null) - { - unknown = new List(); - } - unknown.Add(rawValue); - } - } - } - } - - void ICodedInputStream.ReadMessageArray(uint fieldTag, string fieldName, ICollection list, T messageType, - ExtensionRegistry registry) - { - if (_depth++ > MaxDepth) - { - throw new RecursionLimitExceededException(); - } - ReadMessageArray(fieldName, list, messageType, registry); - _depth--; - } - - void ICodedInputStream.ReadGroupArray(uint fieldTag, string fieldName, ICollection list, T messageType, - ExtensionRegistry registry) - { - if (_depth++ > MaxDepth) - { - throw new RecursionLimitExceededException(); - } - ReadGroupArray(fieldName, list, messageType, registry); - _depth--; - } - - bool ICodedInputStream.ReadPrimitiveField(FieldType fieldType, ref object value) - { - return ReadField(fieldType, ref value); - } - - bool ICodedInputStream.IsAtEnd - { - get - { - string next; - return PeekNext(out next) == false; - } - } - - bool ICodedInputStream.SkipField() - { - Skip(); - return true; - } - - void ICodedInputStream.ReadStringArray(uint fieldTag, string fieldName, ICollection list) - { - ReadArray(FieldType.String, fieldName, list); - } - - void ICodedInputStream.ReadBytesArray(uint fieldTag, string fieldName, ICollection list) - { - ReadArray(FieldType.Bytes, fieldName, list); - } - - void ICodedInputStream.ReadBoolArray(uint fieldTag, string fieldName, ICollection list) - { - ReadArray(FieldType.Bool, fieldName, list); - } - - void ICodedInputStream.ReadInt32Array(uint fieldTag, string fieldName, ICollection list) - { - ReadArray(FieldType.Int32, fieldName, list); - } - - void ICodedInputStream.ReadSInt32Array(uint fieldTag, string fieldName, ICollection list) - { - ReadArray(FieldType.SInt32, fieldName, list); - } - - void ICodedInputStream.ReadUInt32Array(uint fieldTag, string fieldName, ICollection list) - { - ReadArray(FieldType.UInt32, fieldName, list); - } - - void ICodedInputStream.ReadFixed32Array(uint fieldTag, string fieldName, ICollection list) - { - ReadArray(FieldType.Fixed32, fieldName, list); - } - - void ICodedInputStream.ReadSFixed32Array(uint fieldTag, string fieldName, ICollection list) - { - ReadArray(FieldType.SFixed32, fieldName, list); - } - - void ICodedInputStream.ReadInt64Array(uint fieldTag, string fieldName, ICollection list) - { - ReadArray(FieldType.Int64, fieldName, list); - } - - void ICodedInputStream.ReadSInt64Array(uint fieldTag, string fieldName, ICollection list) - { - ReadArray(FieldType.SInt64, fieldName, list); - } - - void ICodedInputStream.ReadUInt64Array(uint fieldTag, string fieldName, ICollection list) - { - ReadArray(FieldType.UInt64, fieldName, list); - } - - void ICodedInputStream.ReadFixed64Array(uint fieldTag, string fieldName, ICollection list) - { - ReadArray(FieldType.Fixed64, fieldName, list); - } - - void ICodedInputStream.ReadSFixed64Array(uint fieldTag, string fieldName, ICollection list) - { - ReadArray(FieldType.SFixed64, fieldName, list); - } - - void ICodedInputStream.ReadDoubleArray(uint fieldTag, string fieldName, ICollection list) - { - ReadArray(FieldType.Double, fieldName, list); - } - - void ICodedInputStream.ReadFloatArray(uint fieldTag, string fieldName, ICollection list) - { - ReadArray(FieldType.Float, fieldName, list); - } - - #endregion - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/AbstractTextReader.cs b/src/ProtocolBuffers.Serialization/AbstractTextReader.cs deleted file mode 100644 index b40a560..0000000 --- a/src/ProtocolBuffers.Serialization/AbstractTextReader.cs +++ /dev/null @@ -1,177 +0,0 @@ -using System; -using System.Globalization; -using System.Xml; - -namespace Google.ProtocolBuffers.Serialization -{ - /// - /// Provides a base class for text-parsing readers - /// - public abstract class AbstractTextReader : AbstractReader - { - /// Constructs a new reader - protected AbstractTextReader() { } - - /// - /// Reads a typed field as a string - /// - protected abstract bool ReadAsText(ref string textValue, Type type); - - /// - /// Returns true if it was able to read a String from the input - /// - protected override bool Read(ref string value) - { - string text = null; - if (ReadAsText(ref text, typeof(string))) - { - value = text; - return true; - } - return false; - } - - /// - /// Returns true if it was able to read a Boolean from the input - /// - protected override bool Read(ref bool value) - { - string text = null; - if (ReadAsText(ref text, typeof(bool))) - { - value = XmlConvert.ToBoolean(text); - return true; - } - return false; - } - - /// - /// Returns true if it was able to read a Int32 from the input - /// - protected override bool Read(ref int value) - { - string text = null; - if (ReadAsText(ref text, typeof(int))) - { - value = XmlConvert.ToInt32(text); - return true; - } - return false; - } - - /// - /// Returns true if it was able to read a UInt32 from the input - /// - [CLSCompliant(false)] - protected override bool Read(ref uint value) - { - string text = null; - if (ReadAsText(ref text, typeof(uint))) - { - value = XmlConvert.ToUInt32(text); - return true; - } - return false; - } - - /// - /// Returns true if it was able to read a Int64 from the input - /// - protected override bool Read(ref long value) - { - string text = null; - if (ReadAsText(ref text, typeof(long))) - { - value = XmlConvert.ToInt64(text); - return true; - } - return false; - } - - /// - /// Returns true if it was able to read a UInt64 from the input - /// - [CLSCompliant(false)] - protected override bool Read(ref ulong value) - { - string text = null; - if (ReadAsText(ref text, typeof(ulong))) - { - value = XmlConvert.ToUInt64(text); - return true; - } - return false; - } - - /// - /// Returns true if it was able to read a Single from the input - /// - protected override bool Read(ref float value) - { - string text = null; - if (ReadAsText(ref text, typeof(float))) - { - value = XmlConvert.ToSingle(text); - return true; - } - return false; - } - - /// - /// Returns true if it was able to read a Double from the input - /// - protected override bool Read(ref double value) - { - string text = null; - if (ReadAsText(ref text, typeof(double))) - { - value = XmlConvert.ToDouble(text); - return true; - } - return false; - } - - /// - /// Provides decoding of bytes read from the input stream - /// - protected virtual ByteString DecodeBytes(string bytes) - { - return ByteString.FromBase64(bytes); - } - - /// - /// Returns true if it was able to read a ByteString from the input - /// - protected override bool Read(ref ByteString value) - { - string text = null; - if (ReadAsText(ref text, typeof(ByteString))) - { - value = DecodeBytes(text); - return true; - } - return false; - } - - /// - /// returns true if it was able to read a single value into the value reference. The value - /// stored may be of type System.String, System.Int32, or an IEnumLite from the IEnumLiteMap. - /// - protected override bool ReadEnum(ref object value) - { - string text = null; - if (ReadAsText(ref text, typeof(Enum))) - { - int number; - if (FrameworkPortability.TryParseInt32(text, NumberStyles.Integer, FrameworkPortability.InvariantCulture, out number)) - { - value = number; - return true; - } - value = text; - return true; - } - return false; - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/AbstractTextWriter.cs b/src/ProtocolBuffers.Serialization/AbstractTextWriter.cs deleted file mode 100644 index 2c778df..0000000 --- a/src/ProtocolBuffers.Serialization/AbstractTextWriter.cs +++ /dev/null @@ -1,106 +0,0 @@ -using System; -using System.Xml; - -namespace Google.ProtocolBuffers.Serialization -{ - /// - /// Provides a base class for text writers - /// - public abstract class AbstractTextWriter : AbstractWriter - { - /// - /// Encodes raw bytes to be written to the stream - /// - protected virtual string EncodeBytes(ByteString bytes) - { - return bytes.ToBase64(); - } - - /// - /// Writes a typed field as a text value - /// - protected abstract void WriteAsText(string field, string textValue, object typedValue); - - /// - /// Writes a String value - /// - protected override void Write(string field, string value) - { - WriteAsText(field, value, value); - } - - /// - /// Writes a Boolean value - /// - protected override void Write(string field, bool value) - { - WriteAsText(field, XmlConvert.ToString(value), value); - } - - /// - /// Writes a Int32 value - /// - protected override void Write(string field, int value) - { - WriteAsText(field, XmlConvert.ToString(value), value); - } - - /// - /// Writes a UInt32 value - /// - [CLSCompliant(false)] - protected override void Write(string field, uint value) - { - WriteAsText(field, XmlConvert.ToString(value), value); - } - - /// - /// Writes a Int64 value - /// - protected override void Write(string field, long value) - { - WriteAsText(field, XmlConvert.ToString(value), value); - } - - /// - /// Writes a UInt64 value - /// - [CLSCompliant(false)] - protected override void Write(string field, ulong value) - { - WriteAsText(field, XmlConvert.ToString(value), value); - } - - /// - /// Writes a Single value - /// - protected override void Write(string field, float value) - { - WriteAsText(field, XmlConvert.ToString(value), value); - } - - /// - /// Writes a Double value - /// - protected override void Write(string field, double value) - { - WriteAsText(field, XmlConvert.ToString(value), value); - } - - /// - /// Writes a set of bytes - /// - protected override void Write(string field, ByteString value) - { - WriteAsText(field, EncodeBytes(value), value); - } - - /// - /// Writes a System.Enum by the numeric and textual value - /// - protected override void WriteEnum(string field, int number, string name) - { - WriteAsText(field, name, number); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/AbstractWriter.cs b/src/ProtocolBuffers.Serialization/AbstractWriter.cs deleted file mode 100644 index 2dc6b88..0000000 --- a/src/ProtocolBuffers.Serialization/AbstractWriter.cs +++ /dev/null @@ -1,507 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using Google.ProtocolBuffers.Descriptors; - -//Disable CS3011: only CLS-compliant members can be abstract -#pragma warning disable 3011 - -namespace Google.ProtocolBuffers.Serialization -{ - /// - /// Provides a base class for writers that performs some basic type dispatching - /// - public abstract class AbstractWriter : ICodedOutputStream - { - /// - /// Completes any pending write operations - /// - public virtual void Flush() - { - } - - /// - /// Writes the message to the the formatted stream. - /// - public abstract void WriteMessage(IMessageLite message); - - /// - /// Used to write any nessary root-message preamble. After this call you can call - /// IMessageLite.MergeTo(...) and complete the message with a call to WriteMessageEnd(). - /// These three calls are identical to just calling WriteMessage(message); - /// - /// - /// AbstractWriter writer; - /// writer.WriteMessageStart(); - /// message.WriteTo(writer); - /// writer.WriteMessageEnd(); - /// // ... or, but not both ... - /// writer.WriteMessage(message); - /// - public abstract void WriteMessageStart(); - - /// - /// Used to complete a root-message previously started with a call to WriteMessageStart() - /// - public abstract void WriteMessageEnd(); - - /// - /// Writes a Boolean value - /// - protected abstract void Write(string field, Boolean value); - - /// - /// Writes a Int32 value - /// - protected abstract void Write(string field, Int32 value); - - /// - /// Writes a UInt32 value - /// - [CLSCompliant(false)] - protected abstract void Write(string field, UInt32 value); - - /// - /// Writes a Int64 value - /// - protected abstract void Write(string field, Int64 value); - - /// - /// Writes a UInt64 value - /// - [CLSCompliant(false)] - protected abstract void Write(string field, UInt64 value); - - /// - /// Writes a Single value - /// - protected abstract void Write(string field, Single value); - - /// - /// Writes a Double value - /// - protected abstract void Write(string field, Double value); - - /// - /// Writes a String value - /// - protected abstract void Write(string field, String value); - - /// - /// Writes a set of bytes - /// - protected abstract void Write(string field, ByteString value); - - /// - /// Writes a message or group as a field - /// - protected abstract void WriteMessageOrGroup(string field, IMessageLite message); - - /// - /// Writes a System.Enum by the numeric and textual value - /// - protected abstract void WriteEnum(string field, int number, string name); - - /// - /// Writes a field of the type determined by field.FieldType - /// - protected virtual void WriteField(FieldType fieldType, string field, object value) - { - switch (fieldType) - { - case FieldType.Bool: - Write(field, (bool) value); - break; - case FieldType.Int64: - case FieldType.SInt64: - case FieldType.SFixed64: - Write(field, (long) value); - break; - case FieldType.UInt64: - case FieldType.Fixed64: - Write(field, (ulong) value); - break; - case FieldType.Int32: - case FieldType.SInt32: - case FieldType.SFixed32: - Write(field, (int) value); - break; - case FieldType.UInt32: - case FieldType.Fixed32: - Write(field, (uint) value); - break; - case FieldType.Float: - Write(field, (float) value); - break; - case FieldType.Double: - Write(field, (double) value); - break; - case FieldType.String: - Write(field, (string) value); - break; - case FieldType.Bytes: - Write(field, (ByteString) value); - break; - case FieldType.Group: - WriteMessageOrGroup(field, (IMessageLite) value); - break; - case FieldType.Message: - WriteMessageOrGroup(field, (IMessageLite) value); - break; - case FieldType.Enum: - { - if (value is IEnumLite) - { - WriteEnum(field, ((IEnumLite) value).Number, ((IEnumLite) value).Name); - } - else if (value is IConvertible) - { - WriteEnum(field, ((IConvertible)value).ToInt32(FrameworkPortability.InvariantCulture), - ((IConvertible)value).ToString(FrameworkPortability.InvariantCulture)); - } - else - { - throw new ArgumentException("Expected an Enum type for field " + field); - } - break; - } - default: - throw InvalidProtocolBufferException.InvalidTag(); - } - } - - /// - /// Writes an array of field values - /// - protected virtual void WriteArray(FieldType fieldType, string field, IEnumerable items) - { - foreach (object obj in items) - { - WriteField(fieldType, field, obj); - } - } - - /// - /// Writes a numeric unknown field of wire type: Fixed32, Fixed64, or Variant - /// - [CLSCompliant(false)] - protected virtual void WriteUnknown(WireFormat.WireType wireType, int fieldNumber, ulong value) - { - } - - /// - /// Writes an unknown field, Expect WireType of GroupStart or LengthPrefix - /// - [CLSCompliant(false)] - protected virtual void WriteUnknown(WireFormat.WireType wireType, int fieldNumber, ByteString value) - { - } - - #region ICodedOutputStream Members - - void ICodedOutputStream.WriteUnknownGroup(int fieldNumber, IMessageLite value) - { - } - - void ICodedOutputStream.WriteUnknownBytes(int fieldNumber, ByteString value) - { - } - - void ICodedOutputStream.WriteUnknownField(int fieldNumber, WireFormat.WireType type, ulong value) - { - } - - void ICodedOutputStream.WriteMessageSetExtension(int fieldNumber, string fieldName, IMessageLite value) - { - } - - void ICodedOutputStream.WriteMessageSetExtension(int fieldNumber, string fieldName, ByteString value) - { - } - - void ICodedOutputStream.WriteField(FieldType fieldType, int fieldNumber, string fieldName, object value) - { - WriteField(fieldType, fieldName, value); - } - - void ICodedOutputStream.WriteDouble(int fieldNumber, string fieldName, double value) - { - Write(fieldName, value); - } - - void ICodedOutputStream.WriteFloat(int fieldNumber, string fieldName, float value) - { - Write(fieldName, value); - } - - void ICodedOutputStream.WriteUInt64(int fieldNumber, string fieldName, ulong value) - { - Write(fieldName, value); - } - - void ICodedOutputStream.WriteInt64(int fieldNumber, string fieldName, long value) - { - Write(fieldName, value); - } - - void ICodedOutputStream.WriteInt32(int fieldNumber, string fieldName, int value) - { - Write(fieldName, value); - } - - void ICodedOutputStream.WriteFixed64(int fieldNumber, string fieldName, ulong value) - { - Write(fieldName, value); - } - - void ICodedOutputStream.WriteFixed32(int fieldNumber, string fieldName, uint value) - { - Write(fieldName, value); - } - - void ICodedOutputStream.WriteBool(int fieldNumber, string fieldName, bool value) - { - Write(fieldName, value); - } - - void ICodedOutputStream.WriteString(int fieldNumber, string fieldName, string value) - { - Write(fieldName, value); - } - - void ICodedOutputStream.WriteGroup(int fieldNumber, string fieldName, IMessageLite value) - { - WriteMessageOrGroup(fieldName, value); - } - - void ICodedOutputStream.WriteMessage(int fieldNumber, string fieldName, IMessageLite value) - { - WriteMessageOrGroup(fieldName, value); - } - - void ICodedOutputStream.WriteBytes(int fieldNumber, string fieldName, ByteString value) - { - Write(fieldName, value); - } - - void ICodedOutputStream.WriteUInt32(int fieldNumber, string fieldName, uint value) - { - Write(fieldName, value); - } - - void ICodedOutputStream.WriteEnum(int fieldNumber, string fieldName, int value, object rawValue) - { - WriteEnum(fieldName, value, rawValue.ToString()); - } - - void ICodedOutputStream.WriteSFixed32(int fieldNumber, string fieldName, int value) - { - Write(fieldName, value); - } - - void ICodedOutputStream.WriteSFixed64(int fieldNumber, string fieldName, long value) - { - Write(fieldName, value); - } - - void ICodedOutputStream.WriteSInt32(int fieldNumber, string fieldName, int value) - { - Write(fieldName, value); - } - - void ICodedOutputStream.WriteSInt64(int fieldNumber, string fieldName, long value) - { - Write(fieldName, value); - } - - - void ICodedOutputStream.WriteArray(FieldType fieldType, int fieldNumber, string fieldName, IEnumerable list) - { - WriteArray(fieldType, fieldName, list); - } - - void ICodedOutputStream.WriteGroupArray(int fieldNumber, string fieldName, IEnumerable list) - { - WriteArray(FieldType.Group, fieldName, list); - } - - void ICodedOutputStream.WriteMessageArray(int fieldNumber, string fieldName, IEnumerable list) - { - WriteArray(FieldType.Message, fieldName, list); - } - - void ICodedOutputStream.WriteStringArray(int fieldNumber, string fieldName, IEnumerable list) - { - WriteArray(FieldType.String, fieldName, list); - } - - void ICodedOutputStream.WriteBytesArray(int fieldNumber, string fieldName, IEnumerable list) - { - WriteArray(FieldType.Bytes, fieldName, list); - } - - void ICodedOutputStream.WriteBoolArray(int fieldNumber, string fieldName, IEnumerable list) - { - WriteArray(FieldType.Bool, fieldName, list); - } - - void ICodedOutputStream.WriteInt32Array(int fieldNumber, string fieldName, IEnumerable list) - { - WriteArray(FieldType.Int32, fieldName, list); - } - - void ICodedOutputStream.WriteSInt32Array(int fieldNumber, string fieldName, IEnumerable list) - { - WriteArray(FieldType.SInt32, fieldName, list); - } - - void ICodedOutputStream.WriteUInt32Array(int fieldNumber, string fieldName, IEnumerable list) - { - WriteArray(FieldType.UInt32, fieldName, list); - } - - void ICodedOutputStream.WriteFixed32Array(int fieldNumber, string fieldName, IEnumerable list) - { - WriteArray(FieldType.Fixed32, fieldName, list); - } - - void ICodedOutputStream.WriteSFixed32Array(int fieldNumber, string fieldName, IEnumerable list) - { - WriteArray(FieldType.SFixed32, fieldName, list); - } - - void ICodedOutputStream.WriteInt64Array(int fieldNumber, string fieldName, IEnumerable list) - { - WriteArray(FieldType.Int64, fieldName, list); - } - - void ICodedOutputStream.WriteSInt64Array(int fieldNumber, string fieldName, IEnumerable list) - { - WriteArray(FieldType.SInt64, fieldName, list); - } - - void ICodedOutputStream.WriteUInt64Array(int fieldNumber, string fieldName, IEnumerable list) - { - WriteArray(FieldType.UInt64, fieldName, list); - } - - void ICodedOutputStream.WriteFixed64Array(int fieldNumber, string fieldName, IEnumerable list) - { - WriteArray(FieldType.Fixed64, fieldName, list); - } - - void ICodedOutputStream.WriteSFixed64Array(int fieldNumber, string fieldName, IEnumerable list) - { - WriteArray(FieldType.SFixed64, fieldName, list); - } - - void ICodedOutputStream.WriteDoubleArray(int fieldNumber, string fieldName, IEnumerable list) - { - WriteArray(FieldType.Double, fieldName, list); - } - - void ICodedOutputStream.WriteFloatArray(int fieldNumber, string fieldName, IEnumerable list) - { - WriteArray(FieldType.Float, fieldName, list); - } - - void ICodedOutputStream.WriteEnumArray(int fieldNumber, string fieldName, IEnumerable list) - { - WriteArray(FieldType.Enum, fieldName, list); - } - - void ICodedOutputStream.WritePackedArray(FieldType fieldType, int fieldNumber, string fieldName, - IEnumerable list) - { - WriteArray(fieldType, fieldName, list); - } - - - void ICodedOutputStream.WritePackedBoolArray(int fieldNumber, string fieldName, int computedSize, - IEnumerable list) - { - WriteArray(FieldType.Bool, fieldName, list); - } - - void ICodedOutputStream.WritePackedInt32Array(int fieldNumber, string fieldName, int computedSize, - IEnumerable list) - { - WriteArray(FieldType.Int32, fieldName, list); - } - - void ICodedOutputStream.WritePackedSInt32Array(int fieldNumber, string fieldName, int computedSize, - IEnumerable list) - { - WriteArray(FieldType.SInt32, fieldName, list); - } - - void ICodedOutputStream.WritePackedUInt32Array(int fieldNumber, string fieldName, int computedSize, - IEnumerable list) - { - WriteArray(FieldType.UInt32, fieldName, list); - } - - void ICodedOutputStream.WritePackedFixed32Array(int fieldNumber, string fieldName, int computedSize, - IEnumerable list) - { - WriteArray(FieldType.Fixed32, fieldName, list); - } - - void ICodedOutputStream.WritePackedSFixed32Array(int fieldNumber, string fieldName, int computedSize, - IEnumerable list) - { - WriteArray(FieldType.SFixed32, fieldName, list); - } - - void ICodedOutputStream.WritePackedInt64Array(int fieldNumber, string fieldName, int computedSize, - IEnumerable list) - { - WriteArray(FieldType.Int64, fieldName, list); - } - - void ICodedOutputStream.WritePackedSInt64Array(int fieldNumber, string fieldName, int computedSize, - IEnumerable list) - { - WriteArray(FieldType.SInt64, fieldName, list); - } - - void ICodedOutputStream.WritePackedUInt64Array(int fieldNumber, string fieldName, int computedSize, - IEnumerable list) - { - WriteArray(FieldType.UInt64, fieldName, list); - } - - void ICodedOutputStream.WritePackedFixed64Array(int fieldNumber, string fieldName, int computedSize, - IEnumerable list) - { - WriteArray(FieldType.Fixed64, fieldName, list); - } - - void ICodedOutputStream.WritePackedSFixed64Array(int fieldNumber, string fieldName, int computedSize, - IEnumerable list) - { - WriteArray(FieldType.SFixed64, fieldName, list); - } - - void ICodedOutputStream.WritePackedDoubleArray(int fieldNumber, string fieldName, int computedSize, - IEnumerable list) - { - WriteArray(FieldType.Double, fieldName, list); - } - - void ICodedOutputStream.WritePackedFloatArray(int fieldNumber, string fieldName, int computedSize, - IEnumerable list) - { - WriteArray(FieldType.Float, fieldName, list); - } - - void ICodedOutputStream.WritePackedEnumArray(int fieldNumber, string fieldName, int computedSize, - IEnumerable list) - { - WriteArray(FieldType.Enum, fieldName, list); - } - - #endregion - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/DictionaryReader.cs b/src/ProtocolBuffers.Serialization/DictionaryReader.cs deleted file mode 100644 index c460523..0000000 --- a/src/ProtocolBuffers.Serialization/DictionaryReader.cs +++ /dev/null @@ -1,267 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.Serialization -{ - /// - /// Allows reading messages from a name/value dictionary - /// - public class DictionaryReader : AbstractReader - { - private readonly IEnumerator> _input; - private bool _ready; - - /// - /// Creates a dictionary reader from an enumeration of KeyValuePair data, like an IDictionary - /// - public DictionaryReader(IEnumerable> input) - { - _input = input.GetEnumerator(); - _ready = _input.MoveNext(); - } - - /// - /// No-op - /// - public override void ReadMessageStart() - { } - - /// - /// No-op - /// - public override void ReadMessageEnd() - { } - - /// - /// Merges the contents of stream into the provided message builder - /// - public override TBuilder Merge(TBuilder builder, ExtensionRegistry registry) - { - builder.WeakMergeFrom(this, registry); - return builder; - } - - /// - /// Peeks at the next field in the input stream and returns what information is available. - /// - /// - /// This may be called multiple times without actually reading the field. Only after the field - /// is either read, or skipped, should PeekNext return a different value. - /// - protected override bool PeekNext(out string field) - { - field = _ready ? _input.Current.Key : null; - return _ready; - } - - /// - /// Causes the reader to skip past this field - /// - protected override void Skip() - { - _ready = _input.MoveNext(); - } - - private bool GetValue(ref T value) - { - if (!_ready) - { - return false; - } - - object obj = _input.Current.Value; - if (obj is T) - { - value = (T) obj; - } - else - { - try - { - if (obj is IConvertible) - { - value = (T)Convert.ChangeType(obj, typeof(T), FrameworkPortability.InvariantCulture); - } - else - { - value = (T) obj; - } - } - catch - { - _ready = _input.MoveNext(); - return false; - } - } - _ready = _input.MoveNext(); - return true; - } - - /// - /// Returns true if it was able to read a Boolean from the input - /// - protected override bool Read(ref bool value) - { - return GetValue(ref value); - } - - /// - /// Returns true if it was able to read a Int32 from the input - /// - protected override bool Read(ref int value) - { - return GetValue(ref value); - } - - /// - /// Returns true if it was able to read a UInt32 from the input - /// - [CLSCompliant(false)] - protected override bool Read(ref uint value) - { - return GetValue(ref value); - } - - /// - /// Returns true if it was able to read a Int64 from the input - /// - protected override bool Read(ref long value) - { - return GetValue(ref value); - } - - /// - /// Returns true if it was able to read a UInt64 from the input - /// - [CLSCompliant(false)] - protected override bool Read(ref ulong value) - { - return GetValue(ref value); - } - - /// - /// Returns true if it was able to read a Single from the input - /// - protected override bool Read(ref float value) - { - return GetValue(ref value); - } - - /// - /// Returns true if it was able to read a Double from the input - /// - protected override bool Read(ref double value) - { - return GetValue(ref value); - } - - /// - /// Returns true if it was able to read a String from the input - /// - protected override bool Read(ref string value) - { - return GetValue(ref value); - } - - /// - /// Returns true if it was able to read a ByteString from the input - /// - protected override bool Read(ref ByteString value) - { - byte[] rawbytes = null; - if (GetValue(ref rawbytes)) - { - value = ByteString.CopyFrom(rawbytes); - return true; - } - return false; - } - - /// - /// returns true if it was able to read a single value into the value reference. The value - /// stored may be of type System.String, System.Int32, or an IEnumLite from the IEnumLiteMap. - /// - protected override bool ReadEnum(ref object value) - { - return GetValue(ref value); - } - - /// - /// Merges the input stream into the provided IBuilderLite - /// - protected override bool ReadMessage(IBuilderLite builder, ExtensionRegistry registry) - { - IDictionary values = null; - if (GetValue(ref values)) - { - new DictionaryReader(values).Merge(builder, registry); - return true; - } - return false; - } - - public override bool ReadArray(FieldType type, string field, ICollection items) - { - object[] array = null; - if (GetValue(ref array)) - { - if (typeof(T) == typeof(ByteString)) - { - ICollection output = (ICollection) items; - foreach (byte[] item in array) - { - output.Add(ByteString.CopyFrom(item)); - } - } - else - { - foreach (T item in array) - { - items.Add(item); - } - } - return true; - } - return false; - } - - public override bool ReadEnumArray(string field, ICollection items) - { - object[] array = null; - if (GetValue(ref array)) - { - foreach (object item in array) - { - items.Add(item); - } - return true; - } - return false; - } - - public override bool ReadMessageArray(string field, ICollection items, IMessageLite messageType, - ExtensionRegistry registry) - { - object[] array = null; - if (GetValue(ref array)) - { - foreach (IDictionary item in array) - { - IBuilderLite builder = messageType.WeakCreateBuilderForType(); - new DictionaryReader(item).Merge(builder); - items.Add((T) builder.WeakBuild()); - } - return true; - } - return false; - } - - public override bool ReadGroupArray(string field, ICollection items, IMessageLite messageType, - ExtensionRegistry registry) - { - return ReadMessageArray(field, items, messageType, registry); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/DictionaryWriter.cs b/src/ProtocolBuffers.Serialization/DictionaryWriter.cs deleted file mode 100644 index 6d82330..0000000 --- a/src/ProtocolBuffers.Serialization/DictionaryWriter.cs +++ /dev/null @@ -1,202 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.Serialization -{ - /// - /// Allows writing messages to a name/value dictionary - /// - public class DictionaryWriter : AbstractWriter - { - private readonly IDictionary _output; - - /// - /// Constructs a writer using a new dictionary - /// - public DictionaryWriter() - : this(new Dictionary(StringComparer.Ordinal)) - { - } - - /// - /// Constructs a writer using an existing dictionary - /// - public DictionaryWriter(IDictionary output) - { - ThrowHelper.ThrowIfNull(output, "output"); - _output = output; - } - - /// - /// Creates the dictionary instance for a child message. - /// - protected virtual DictionaryWriter Create() - { - return new DictionaryWriter(); - } - - /// - /// Accesses the dictionary that is backing this writer - /// - public IDictionary ToDictionary() - { - return _output; - } - - /// - /// Writes the message to the the formatted stream. - /// - public override void WriteMessage(IMessageLite message) - { - message.WriteTo(this); - } - - - /// - /// No-op - /// - public override void WriteMessageStart() - { } - - /// - /// No-op - /// - public override void WriteMessageEnd() - { } - - /// - /// Writes a Boolean value - /// - protected override void Write(string field, bool value) - { - _output[field] = value; - } - - /// - /// Writes a Int32 value - /// - protected override void Write(string field, int value) - { - _output[field] = value; - } - - /// - /// Writes a UInt32 value - /// - [CLSCompliant(false)] - protected override void Write(string field, uint value) - { - _output[field] = value; - } - - /// - /// Writes a Int64 value - /// - protected override void Write(string field, long value) - { - _output[field] = value; - } - - /// - /// Writes a UInt64 value - /// - [CLSCompliant(false)] - protected override void Write(string field, ulong value) - { - _output[field] = value; - } - - /// - /// Writes a Single value - /// - protected override void Write(string field, float value) - { - _output[field] = value; - } - - /// - /// Writes a Double value - /// - protected override void Write(string field, double value) - { - _output[field] = value; - } - - /// - /// Writes a String value - /// - protected override void Write(string field, string value) - { - _output[field] = value; - } - - /// - /// Writes a set of bytes - /// - protected override void Write(string field, ByteString value) - { - _output[field] = value.ToByteArray(); - } - - /// - /// Writes a message or group as a field - /// - protected override void WriteMessageOrGroup(string field, IMessageLite message) - { - DictionaryWriter writer = Create(); - writer.WriteMessage(message); - - _output[field] = writer.ToDictionary(); - } - - /// - /// Writes a System.Enum by the numeric and textual value - /// - protected override void WriteEnum(string field, int number, string name) - { - _output[field] = number; - } - - /// - /// Writes an array of field values - /// - protected override void WriteArray(FieldType fieldType, string field, IEnumerable items) - { - List objects = new List(); - foreach (object o in items) - { - switch (fieldType) - { - case FieldType.Group: - case FieldType.Message: - { - DictionaryWriter writer = Create(); - writer.WriteMessage((IMessageLite) o); - objects.Add(writer.ToDictionary()); - } - break; - case FieldType.Bytes: - objects.Add(((ByteString) o).ToByteArray()); - break; - case FieldType.Enum: - if (o is IEnumLite) - { - objects.Add(((IEnumLite) o).Number); - } - else - { - objects.Add((int) o); - } - break; - default: - objects.Add(o); - break; - } - } - - _output[field] = objects.ToArray(); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/Extensions.cs b/src/ProtocolBuffers.Serialization/Extensions.cs deleted file mode 100644 index 8aef0a9..0000000 --- a/src/ProtocolBuffers.Serialization/Extensions.cs +++ /dev/null @@ -1,213 +0,0 @@ -using System; -using System.Text; -using System.IO; -using System.Xml; -using Google.ProtocolBuffers.Serialization; -using Google.ProtocolBuffers.Serialization.Http; - -namespace Google.ProtocolBuffers -{ - /// - /// Extension methods for using serializers on instances of IMessageLite/IBuilderLite - /// - public static class Extensions - { - #region IMessageLite Extension - /// - /// Serializes the message to JSON text. This is a trivial wrapper - /// around Serialization.JsonFormatWriter.WriteMessage. - /// - public static string ToJson( -#if !NOEXTENSIONS - this -#endif - IMessageLite message) - { - JsonFormatWriter w = JsonFormatWriter.CreateInstance(); - w.WriteMessage(message); - return w.ToString(); - } - /// - /// Serializes the message to XML text. This is a trivial wrapper - /// around Serialization.XmlFormatWriter.WriteMessage. - /// - public static string ToXml( -#if !NOEXTENSIONS - this -#endif - IMessageLite message) - { - StringWriter w = new StringWriter(new StringBuilder(4096)); - XmlFormatWriter.CreateInstance(w).WriteMessage(message); - return w.ToString(); - } - /// - /// Serializes the message to XML text using the element name provided. - /// This is a trivial wrapper around Serialization.XmlFormatWriter.WriteMessage. - /// - public static string ToXml( -#if !NOEXTENSIONS - this -#endif - IMessageLite message, string rootElementName) - { - StringWriter w = new StringWriter(new StringBuilder(4096)); - XmlFormatWriter.CreateInstance(w).WriteMessage(rootElementName, message); - return w.ToString(); - } - - /// - /// Writes the message instance to the stream using the content type provided - /// - /// An instance of a message - /// Options specific to writing this message and/or content type - /// The mime type of the content to be written - /// The stream to write the message to - public static void WriteTo( -#if !NOEXTENSIONS - this -#endif - IMessageLite message, MessageFormatOptions options, string contentType, Stream output) - { - ICodedOutputStream codedOutput = MessageFormatFactory.CreateOutputStream(options, contentType, output); - - // Output the appropriate message preamble - codedOutput.WriteMessageStart(); - - // Write the message content to the output - message.WriteTo(codedOutput); - - // Write the closing message fragment - codedOutput.WriteMessageEnd(); - codedOutput.Flush(); - } - - #endregion - #region IBuilderLite Extensions - /// - /// Merges a JSON object into this builder and returns - /// - public static TBuilder MergeFromJson( -#if !NOEXTENSIONS - this -#endif - TBuilder builder, string jsonText) where TBuilder : IBuilderLite - { - return JsonFormatReader.CreateInstance(jsonText) - .Merge(builder); - } - /// - /// Merges a JSON object into this builder and returns - /// - public static TBuilder MergeFromJson( -#if !NOEXTENSIONS - this -#endif - TBuilder builder, TextReader reader) where TBuilder : IBuilderLite - { - return MergeFromJson(builder, reader, ExtensionRegistry.Empty); - } - /// - /// Merges a JSON object into this builder using the extensions provided and returns - /// - public static TBuilder MergeFromJson( -#if !NOEXTENSIONS - this -#endif - TBuilder builder, TextReader reader, ExtensionRegistry extensionRegistry) where TBuilder : IBuilderLite - { - return JsonFormatReader.CreateInstance(reader) - .Merge(builder, extensionRegistry); - } - - /// - /// Merges an XML object into this builder and returns - /// - public static TBuilder MergeFromXml( -#if !NOEXTENSIONS - this -#endif - TBuilder builder, XmlReader reader) where TBuilder : IBuilderLite - { - return MergeFromXml(builder, XmlFormatReader.DefaultRootElementName, reader, ExtensionRegistry.Empty); - } - - /// - /// Merges an XML object into this builder and returns - /// - public static TBuilder MergeFromXml( -#if !NOEXTENSIONS - this -#endif - TBuilder builder, string rootElementName, XmlReader reader) where TBuilder : IBuilderLite - { - return MergeFromXml(builder, rootElementName, reader, ExtensionRegistry.Empty); - } - - /// - /// Merges an XML object into this builder using the extensions provided and returns - /// - public static TBuilder MergeFromXml( -#if !NOEXTENSIONS - this -#endif - TBuilder builder, string rootElementName, XmlReader reader, - ExtensionRegistry extensionRegistry) where TBuilder : IBuilderLite - { - return XmlFormatReader.CreateInstance(reader) - .Merge(rootElementName, builder, extensionRegistry); - } - - /// - /// Merges the message from the input stream based on the contentType provided - /// - /// A type derived from IBuilderLite - /// An instance of a message builder - /// Options specific to reading this message and/or content type - /// The mime type of the input stream content - /// The stream to read the message from - /// The same builder instance that was supplied in the builder parameter - public static TBuilder MergeFrom( -#if !NOEXTENSIONS - this -#endif - TBuilder builder, MessageFormatOptions options, string contentType, Stream input) where TBuilder : IBuilderLite - { - ICodedInputStream codedInput = MessageFormatFactory.CreateInputStream(options, contentType, input); - codedInput.ReadMessageStart(); - builder.WeakMergeFrom(codedInput, options.ExtensionRegistry); - codedInput.ReadMessageEnd(); - return builder; - } - - #endregion - #region IRpcServerStub Extensions - - /// - /// Used to implement a service endpoint on an HTTP server. This works with services generated with the - /// service_generator_type option set to IRPCDISPATCH. - /// - /// The service execution stub - /// The name of the method being invoked - /// optional arguments for the format reader/writer - /// The mime type for the input stream - /// The input stream - /// The mime type for the output stream - /// The output stream - public static void HttpCallMethod( -#if !NOEXTENSIONS - this -#endif - IRpcServerStub stub, string methodName, MessageFormatOptions options, - string contentType, Stream input, string responseType, Stream output) - { - ICodedInputStream codedInput = MessageFormatFactory.CreateInputStream(options, contentType, input); - codedInput.ReadMessageStart(); - IMessageLite response = stub.CallMethod(methodName, codedInput, options.ExtensionRegistry); - codedInput.ReadMessageEnd(); - WriteTo(response, options, responseType, output); - } - - #endregion - } -} diff --git a/src/ProtocolBuffers.Serialization/Http/FormUrlEncodedReader.cs b/src/ProtocolBuffers.Serialization/Http/FormUrlEncodedReader.cs deleted file mode 100644 index 508d76a..0000000 --- a/src/ProtocolBuffers.Serialization/Http/FormUrlEncodedReader.cs +++ /dev/null @@ -1,162 +0,0 @@ -using System; -using System.IO; -using System.Text; - -namespace Google.ProtocolBuffers.Serialization.Http -{ - /// - /// Allows reading messages from a name/value dictionary - /// - public class FormUrlEncodedReader : AbstractTextReader - { - private readonly TextReader _input; - private string _fieldName, _fieldValue; - private bool _ready; - - /// - /// Creates a dictionary reader from an enumeration of KeyValuePair data, like an IDictionary - /// - FormUrlEncodedReader(TextReader input) - { - _input = input; - int ch = input.Peek(); - if (ch == '?') - { - input.Read(); - } - _ready = ReadNext(); - } - - #region CreateInstance overloads - /// - /// Constructs a FormUrlEncodedReader to parse form data, or url query text into a message. - /// - public static FormUrlEncodedReader CreateInstance(Stream stream) - { - return new FormUrlEncodedReader(new StreamReader(stream, Encoding.UTF8, false)); - } - - /// - /// Constructs a FormUrlEncodedReader to parse form data, or url query text into a message. - /// - public static FormUrlEncodedReader CreateInstance(byte[] bytes) - { - return new FormUrlEncodedReader(new StreamReader(new MemoryStream(bytes, false), Encoding.UTF8, false)); - } - - /// - /// Constructs a FormUrlEncodedReader to parse form data, or url query text into a message. - /// - public static FormUrlEncodedReader CreateInstance(string text) - { - return new FormUrlEncodedReader(new StringReader(text)); - } - - /// - /// Constructs a FormUrlEncodedReader to parse form data, or url query text into a message. - /// - public static FormUrlEncodedReader CreateInstance(TextReader input) - { - return new FormUrlEncodedReader(input); - } - #endregion - - private bool ReadNext() - { - StringBuilder field = new StringBuilder(32); - StringBuilder value = new StringBuilder(64); - int ch; - while (-1 != (ch = _input.Read()) && ch != '=' && ch != '&') - { - field.Append((char)ch); - } - - if (ch != -1 && ch != '&') - { - while (-1 != (ch = _input.Read()) && ch != '&') - { - value.Append((char)ch); - } - } - - _fieldName = field.ToString(); - _fieldValue = Uri.UnescapeDataString(value.Replace('+', ' ').ToString()); - - return !String.IsNullOrEmpty(_fieldName); - } - - /// - /// No-op - /// - public override void ReadMessageStart() - { } - - /// - /// No-op - /// - public override void ReadMessageEnd() - { } - - /// - /// Merges the contents of stream into the provided message builder - /// - public override TBuilder Merge(TBuilder builder, ExtensionRegistry registry) - { - builder.WeakMergeFrom(this, registry); - return builder; - } - - /// - /// Causes the reader to skip past this field - /// - protected override void Skip() - { - _ready = ReadNext(); - } - - /// - /// Peeks at the next field in the input stream and returns what information is available. - /// - /// - /// This may be called multiple times without actually reading the field. Only after the field - /// is either read, or skipped, should PeekNext return a different value. - /// - protected override bool PeekNext(out string field) - { - field = _ready ? _fieldName : null; - return field != null; - } - - /// - /// Returns true if it was able to read a String from the input - /// - protected override bool ReadAsText(ref string value, Type typeInfo) - { - if (_ready) - { - value = _fieldValue; - _ready = ReadNext(); - return true; - } - return false; - } - - /// - /// It's unlikely this will work for anything but text data as bytes UTF8 are transformed to text and back to bytes - /// - protected override ByteString DecodeBytes(string bytes) - { return ByteString.CopyFromUtf8(bytes); } - - /// - /// Not Supported - /// - public override bool ReadGroup(IBuilderLite value, ExtensionRegistry registry) - { throw new NotSupportedException(); } - - /// - /// Not Supported - /// - protected override bool ReadMessage(IBuilderLite builder, ExtensionRegistry registry) - { throw new NotSupportedException(); } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/Http/MessageFormatFactory.cs b/src/ProtocolBuffers.Serialization/Http/MessageFormatFactory.cs deleted file mode 100644 index 270af64..0000000 --- a/src/ProtocolBuffers.Serialization/Http/MessageFormatFactory.cs +++ /dev/null @@ -1,112 +0,0 @@ -using System; -using System.IO; -using System.Xml; -using System.Text; - -namespace Google.ProtocolBuffers.Serialization.Http -{ - /// - /// Extensions and helpers to abstract the reading/writing of messages by a client-specified content type. - /// - public static class MessageFormatFactory - { - /// - /// Constructs an ICodedInputStream from the input stream based on the contentType provided - /// - /// Options specific to reading this message and/or content type - /// The mime type of the input stream content - /// The stream to read the message from - /// The ICodedInputStream that can be given to the IBuilder.MergeFrom(...) method - public static ICodedInputStream CreateInputStream(MessageFormatOptions options, string contentType, Stream input) - { - ICodedInputStream codedInput = ContentTypeToInputStream(contentType, options, input); - - if (codedInput is XmlFormatReader) - { - XmlFormatReader reader = (XmlFormatReader)codedInput; - reader.RootElementName = options.XmlReaderRootElementName; - reader.Options = options.XmlReaderOptions; - } - - return codedInput; - } - - /// - /// Writes the message instance to the stream using the content type provided - /// - /// Options specific to writing this message and/or content type - /// The mime type of the content to be written - /// The stream to write the message to - /// If you do not dispose of ICodedOutputStream some formats may yield incomplete output - public static ICodedOutputStream CreateOutputStream(MessageFormatOptions options, string contentType, Stream output) - { - ICodedOutputStream codedOutput = ContentTypeToOutputStream(contentType, options, output); - - if (codedOutput is JsonFormatWriter) - { - JsonFormatWriter writer = (JsonFormatWriter)codedOutput; - if (options.FormattedOutput) - { - writer.Formatted(); - } - } - else if (codedOutput is XmlFormatWriter) - { - XmlFormatWriter writer = (XmlFormatWriter)codedOutput; - if (options.FormattedOutput) - { - XmlWriterSettings settings = new XmlWriterSettings() - { - CheckCharacters = false, - NewLineHandling = NewLineHandling.Entitize, - OmitXmlDeclaration = true, - Encoding = new UTF8Encoding(false), - Indent = true, - IndentChars = " ", - }; - // Don't know how else to change xml writer options? - codedOutput = writer = XmlFormatWriter.CreateInstance(XmlWriter.Create(output, settings)); - } - writer.RootElementName = options.XmlWriterRootElementName; - writer.Options = options.XmlWriterOptions; - } - - return codedOutput; - } - - private static ICodedInputStream ContentTypeToInputStream(string contentType, MessageFormatOptions options, Stream input) - { - contentType = (contentType ?? String.Empty).Split(';')[0].Trim(); - - CodedInputBuilder factory; - if(!options.MimeInputTypesReadOnly.TryGetValue(contentType, out factory) || factory == null) - { - if(String.IsNullOrEmpty(options.DefaultContentType) || - !options.MimeInputTypesReadOnly.TryGetValue(options.DefaultContentType, out factory) || factory == null) - { - throw new ArgumentOutOfRangeException("contentType"); - } - } - - return factory(input); - } - - private static ICodedOutputStream ContentTypeToOutputStream(string contentType, MessageFormatOptions options, Stream output) - { - contentType = (contentType ?? String.Empty).Split(';')[0].Trim(); - - CodedOutputBuilder factory; - if (!options.MimeOutputTypesReadOnly.TryGetValue(contentType, out factory) || factory == null) - { - if (String.IsNullOrEmpty(options.DefaultContentType) || - !options.MimeOutputTypesReadOnly.TryGetValue(options.DefaultContentType, out factory) || factory == null) - { - throw new ArgumentOutOfRangeException("contentType"); - } - } - - return factory(output); - } - - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/Http/MessageFormatOptions.cs b/src/ProtocolBuffers.Serialization/Http/MessageFormatOptions.cs deleted file mode 100644 index 1480e50..0000000 --- a/src/ProtocolBuffers.Serialization/Http/MessageFormatOptions.cs +++ /dev/null @@ -1,176 +0,0 @@ -using System; -using System.IO; -using System.Collections.Generic; -using Google.ProtocolBuffers.Collections; - -namespace Google.ProtocolBuffers.Serialization.Http -{ - /// - /// A delegate used to specify a method that constructs an ICodedInputStream from a .NET Stream. - /// - public delegate ICodedInputStream CodedInputBuilder(Stream stream); - /// - /// A delegate used to specify a method that constructs an ICodedOutputStream from a .NET Stream. - /// - public delegate ICodedOutputStream CodedOutputBuilder(Stream stream); - - /// - /// Defines control information for the various formatting used with HTTP services - /// - public class MessageFormatOptions - { - /// The mime type for xml content - /// Other valid xml mime types include: application/binary, application/x-protobuf - public const string ContentTypeProtoBuffer = "application/vnd.google.protobuf"; - - /// The mime type for xml content - /// Other valid xml mime types include: text/xml - public const string ContentTypeXml = "application/xml"; - - /// The mime type for json content - /// - /// Other valid json mime types include: application/json, application/x-json, - /// application/x-javascript, text/javascript, text/x-javascript, text/x-json, text/json - /// - public const string ContentTypeJson = "application/json"; - - /// The mime type for query strings and x-www-form-urlencoded content - /// This mime type is input-only - public const string ContentFormUrlEncoded = "application/x-www-form-urlencoded"; - - /// - /// Default mime-type handling for input - /// - private static readonly IDictionary MimeInputDefaults = - new ReadOnlyDictionary( - new Dictionary(StringComparer.OrdinalIgnoreCase) - { - {"application/json", JsonFormatReader.CreateInstance}, - {"application/x-json", JsonFormatReader.CreateInstance}, - {"application/x-javascript", JsonFormatReader.CreateInstance}, - {"text/javascript", JsonFormatReader.CreateInstance}, - {"text/x-javascript", JsonFormatReader.CreateInstance}, - {"text/x-json", JsonFormatReader.CreateInstance}, - {"text/json", JsonFormatReader.CreateInstance}, - {"text/xml", XmlFormatReader.CreateInstance}, - {"application/xml", XmlFormatReader.CreateInstance}, - {"application/binary", CodedInputStream.CreateInstance}, - {"application/x-protobuf", CodedInputStream.CreateInstance}, - {"application/vnd.google.protobuf", CodedInputStream.CreateInstance}, - {"application/x-www-form-urlencoded", FormUrlEncodedReader.CreateInstance}, - } - ); - - /// - /// Default mime-type handling for output - /// - private static readonly IDictionary MimeOutputDefaults = - new ReadOnlyDictionary( - new Dictionary(StringComparer.OrdinalIgnoreCase) - { - {"application/json", JsonFormatWriter.CreateInstance}, - {"application/x-json", JsonFormatWriter.CreateInstance}, - {"application/x-javascript", JsonFormatWriter.CreateInstance}, - {"text/javascript", JsonFormatWriter.CreateInstance}, - {"text/x-javascript", JsonFormatWriter.CreateInstance}, - {"text/x-json", JsonFormatWriter.CreateInstance}, - {"text/json", JsonFormatWriter.CreateInstance}, - {"text/xml", XmlFormatWriter.CreateInstance}, - {"application/xml", XmlFormatWriter.CreateInstance}, - {"application/binary", CodedOutputStream.CreateInstance}, - {"application/x-protobuf", CodedOutputStream.CreateInstance}, - {"application/vnd.google.protobuf", CodedOutputStream.CreateInstance}, - } - ); - - - - - private string _defaultContentType; - private string _xmlReaderRootElementName; - private string _xmlWriterRootElementName; - private ExtensionRegistry _extensionRegistry; - private Dictionary _mimeInputTypes; - private Dictionary _mimeOutputTypes; - - /// Provides access to modify the mime-type input stream construction - public IDictionary MimeInputTypes - { - get - { - return _mimeInputTypes ?? - (_mimeInputTypes = new Dictionary( - MimeInputDefaults, StringComparer.OrdinalIgnoreCase)); - } - } - - /// Provides access to modify the mime-type input stream construction - public IDictionary MimeOutputTypes - { - get - { - return _mimeOutputTypes ?? - (_mimeOutputTypes = new Dictionary( - MimeOutputDefaults, StringComparer.OrdinalIgnoreCase)); - } - } - - internal IDictionary MimeInputTypesReadOnly - { get { return _mimeInputTypes ?? MimeInputDefaults; } } - - internal IDictionary MimeOutputTypesReadOnly - { get { return _mimeOutputTypes ?? MimeOutputDefaults; } } - - /// - /// The default content type to use if the input type is null or empty. If this - /// value is not supplied an ArgumentOutOfRangeException exception will be raised. - /// - public string DefaultContentType - { - get { return _defaultContentType ?? String.Empty; } - set { _defaultContentType = value; } - } - - /// - /// The extension registry to use when reading messages - /// - public ExtensionRegistry ExtensionRegistry - { - get { return _extensionRegistry ?? ExtensionRegistry.Empty; } - set { _extensionRegistry = value; } - } - - /// - /// The name of the xml root element when reading messages - /// - public string XmlReaderRootElementName - { - get { return _xmlReaderRootElementName ?? XmlFormatReader.DefaultRootElementName; } - set { _xmlReaderRootElementName = value; } - } - - /// - /// Xml reader options - /// - public XmlReaderOptions XmlReaderOptions { get; set; } - - /// - /// True to use formatted output including new-lines and default indentation - /// - public bool FormattedOutput { get; set; } - - /// - /// The name of the xml root element when writing messages - /// - public string XmlWriterRootElementName - { - get { return _xmlWriterRootElementName ?? XmlFormatWriter.DefaultRootElementName; } - set { _xmlWriterRootElementName = value; } - } - - /// - /// Xml writer options - /// - public XmlWriterOptions XmlWriterOptions { get; set; } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/JsonFormatReader.cs b/src/ProtocolBuffers.Serialization/JsonFormatReader.cs deleted file mode 100644 index 423196d..0000000 --- a/src/ProtocolBuffers.Serialization/JsonFormatReader.cs +++ /dev/null @@ -1,262 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Xml; - -namespace Google.ProtocolBuffers.Serialization -{ - /// - /// JsonFormatReader is used to parse Json into a message or an array of messages - /// - public class JsonFormatReader : AbstractTextReader - { - private readonly JsonCursor _input; - // The expected token that ends the current item, either ']' or '}' - private readonly Stack _stopChar; - - private enum ReaderState - { - Start, - BeginValue, - EndValue, - BeginObject, - BeginArray - } - - private string _current; - private ReaderState _state; - - /// - /// Constructs a JsonFormatReader to parse Json into a message, this method does not use text encoding, all bytes MUST - /// represent ASCII character values. - /// - public static JsonFormatReader CreateInstance(Stream stream) - { - return new JsonFormatReader(JsonCursor.CreateInstance(stream)); - } - - /// - /// Constructs a JsonFormatReader to parse Json into a message, this method does not use text encoding, all bytes MUST - /// represent ASCII character values. - /// - public static JsonFormatReader CreateInstance(byte[] bytes) - { - return new JsonFormatReader(JsonCursor.CreateInstance(bytes)); - } - - /// - /// Constructs a JsonFormatReader to parse Json into a message - /// - public static JsonFormatReader CreateInstance(string jsonText) - { - return new JsonFormatReader(JsonCursor.CreateInstance(jsonText)); - } - - /// - /// Constructs a JsonFormatReader to parse Json into a message - /// - public static JsonFormatReader CreateInstance(TextReader input) - { - return new JsonFormatReader(JsonCursor.CreateInstance(input)); - } - - /// - /// Constructs a JsonFormatReader to parse Json into a message - /// - internal JsonFormatReader(JsonCursor input) - { - _input = input; - _stopChar = new Stack(); - _stopChar.Push(-1); - _state = ReaderState.Start; - } - - /// - /// Constructs a JsonFormatReader to parse Json into a message - /// - protected JsonFormatReader(TextReader input) - : this(JsonCursor.CreateInstance(input)) - { - } - - /// - /// Returns true if the reader is currently on an array element - /// - public bool IsArrayMessage - { - get { return _input.NextChar == '['; } - } - - /// - /// Returns an enumerator that is used to cursor over an array of messages - /// - /// - /// This is generally used when receiving an array of messages rather than a single root message - /// - public IEnumerable EnumerateArray() - { - foreach (string ignored in ForeachArrayItem(_current)) - { - yield return this; - } - } - - /// - /// Reads the root-message preamble specific to this formatter - /// - public override void ReadMessageStart() - { - _input.Consume('{'); - _stopChar.Push('}'); - - _state = ReaderState.BeginObject; - } - - /// - /// Reads the root-message close specific to this formatter - /// - public override void ReadMessageEnd() - { - _input.Consume((char)_stopChar.Pop()); - _state = ReaderState.EndValue; - } - - /// - /// Merges the contents of stream into the provided message builder - /// - public override TBuilder Merge(TBuilder builder, ExtensionRegistry registry) - { - ReadMessageStart(); - builder.WeakMergeFrom(this, registry); - ReadMessageEnd(); - return builder; - } - - /// - /// Causes the reader to skip past this field - /// - protected override void Skip() - { - object temp; - _input.ReadVariant(out temp); - _state = ReaderState.EndValue; - } - - /// - /// Peeks at the next field in the input stream and returns what information is available. - /// - /// - /// This may be called multiple times without actually reading the field. Only after the field - /// is either read, or skipped, should PeekNext return a different value. - /// - protected override bool PeekNext(out string field) - { - field = _current; - if (_state == ReaderState.BeginValue) - { - return true; - } - - int next = _input.NextChar; - if (next == _stopChar.Peek()) - { - return false; - } - - _input.Assert(next != -1, "Unexpected end of file."); - - //not sure about this yet, it will allow {, "a":true } - if (_state == ReaderState.EndValue && !_input.TryConsume(',')) - { - return false; - } - - field = _current = _input.ReadString(); - _input.Consume(':'); - _state = ReaderState.BeginValue; - return true; - } - - /// - /// Returns true if it was able to read a String from the input - /// - protected override bool ReadAsText(ref string value, Type typeInfo) - { - object temp; - JsonCursor.JsType type = _input.ReadVariant(out temp); - _state = ReaderState.EndValue; - - _input.Assert(type != JsonCursor.JsType.Array && type != JsonCursor.JsType.Object, - "Encountered {0} while expecting {1}", type, typeInfo); - if (type == JsonCursor.JsType.Null) - { - return false; - } - if (type == JsonCursor.JsType.True) - { - value = "1"; - } - else if (type == JsonCursor.JsType.False) - { - value = "0"; - } - else - { - value = temp as string; - } - - //exponent representation of integer number: - if (value != null && type == JsonCursor.JsType.Number && - (typeInfo != typeof(double) && typeInfo != typeof(float)) && - value.IndexOf("e", StringComparison.OrdinalIgnoreCase) > 0) - { - value = XmlConvert.ToString((long) Math.Round(XmlConvert.ToDouble(value), 0)); - } - return value != null; - } - - /// - /// Returns true if it was able to read a ByteString from the input - /// - protected override bool Read(ref ByteString value) - { - string bytes = null; - if (Read(ref bytes)) - { - value = ByteString.FromBase64(bytes); - return true; - } - return false; - } - - /// - /// Cursors through the array elements and stops at the end of the array - /// - protected override IEnumerable ForeachArrayItem(string field) - { - _input.Consume('['); - _stopChar.Push(']'); - _state = ReaderState.BeginArray; - while (_input.NextChar != ']') - { - _current = field; - yield return field; - if (!_input.TryConsume(',')) - { - break; - } - } - _input.Consume((char) _stopChar.Pop()); - _state = ReaderState.EndValue; - } - - /// - /// Merges the input stream into the provided IBuilderLite - /// - protected override bool ReadMessage(IBuilderLite builder, ExtensionRegistry registry) - { - Merge(builder, registry); - return true; - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/JsonFormatWriter.cs b/src/ProtocolBuffers.Serialization/JsonFormatWriter.cs deleted file mode 100644 index 15e0424..0000000 --- a/src/ProtocolBuffers.Serialization/JsonFormatWriter.cs +++ /dev/null @@ -1,541 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Text; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.Serialization -{ - /// - /// JsonFormatWriter is a .NET 2.0 friendly json formatter for proto buffer messages. For .NET 3.5 - /// you may also use the XmlFormatWriter with an XmlWriter created by the - /// JsonReaderWriterFactory. - /// - public abstract class JsonFormatWriter : AbstractTextWriter - { - #region buffering implementations - - private class JsonTextWriter : JsonFormatWriter - { - private readonly char[] _buffer; - private TextWriter _output; - private int _bufferPos; - - public JsonTextWriter(TextWriter output) - { - _buffer = new char[4096]; - _bufferPos = 0; - _output = output; - _counter.Add(0); - } - - /// - /// Returns the output of TextWriter.ToString() where TextWriter is the ctor argument. - /// - public override string ToString() - { - Flush(); - - if (_output != null) - { - return _output.ToString(); - } - - return new String(_buffer, 0, _bufferPos); - } - - protected override void WriteToOutput(char[] chars, int offset, int len) - { - if (_bufferPos + len >= _buffer.Length) - { - if (_output == null) - { - _output = new StringWriter(new StringBuilder(_buffer.Length*2 + len)); - } - Flush(); - } - - if (len < _buffer.Length) - { - if (len <= 12) - { - int stop = offset + len; - for (int i = offset; i < stop; i++) - { - _buffer[_bufferPos++] = chars[i]; - } - } - else - { - Buffer.BlockCopy(chars, offset << 1, _buffer, _bufferPos << 1, len << 1); - _bufferPos += len; - } - } - else - { - _output.Write(chars, offset, len); - } - } - - protected override void WriteToOutput(char ch) - { - if (_bufferPos >= _buffer.Length) - { - if (_output == null) - { - _output = new StringWriter(new StringBuilder(_buffer.Length * 2)); - } - Flush(); - } - _buffer[_bufferPos++] = ch; - } - - public override void Flush() - { - if (_bufferPos > 0 && _output != null) - { - _output.Write(_buffer, 0, _bufferPos); - _bufferPos = 0; - } - base.Flush(); - } - } - - private class JsonStreamWriter : JsonFormatWriter - { - static readonly Encoding Encoding = new UTF8Encoding(false); - private readonly byte[] _buffer; - private Stream _output; - private int _bufferPos; - - public JsonStreamWriter(Stream output) - { - _buffer = new byte[8192]; - _bufferPos = 0; - _output = output; - _counter.Add(0); - } - - protected override void WriteToOutput(char[] chars, int offset, int len) - { - if (_bufferPos + len >= _buffer.Length) - { - Flush(); - } - - if (len < _buffer.Length) - { - if (len <= 12) - { - int stop = offset + len; - for (int i = offset; i < stop; i++) - { - _buffer[_bufferPos++] = (byte) chars[i]; - } - } - else - { - _bufferPos += Encoding.GetBytes(chars, offset, len, _buffer, _bufferPos); - } - } - else - { - byte[] temp = Encoding.GetBytes(chars, offset, len); - _output.Write(temp, 0, temp.Length); - } - } - - protected override void WriteToOutput(char ch) - { - if (_bufferPos >= _buffer.Length) - { - Flush(); - } - _buffer[_bufferPos++] = (byte) ch; - } - - public override void Flush() - { - if (_bufferPos > 0 && _output != null) - { - _output.Write(_buffer, 0, _bufferPos); - _bufferPos = 0; - } - base.Flush(); - } - } - - #endregion - - //Tracks the writer depth and the array element count at that depth. - private readonly List _counter; - //True if the top-level of the writer is an array as opposed to a single message. - private bool _isArray; - - /// - /// Constructs a JsonFormatWriter, use the ToString() member to extract the final Json on completion. - /// - protected JsonFormatWriter() - { - _counter = new List(); - } - - /// - /// Constructs a JsonFormatWriter, use ToString() to extract the final output - /// - public static JsonFormatWriter CreateInstance() - { - return new JsonTextWriter(null); - } - - /// - /// Constructs a JsonFormatWriter to output to the given text writer - /// - public static JsonFormatWriter CreateInstance(TextWriter output) - { - return new JsonTextWriter(output); - } - - /// - /// Constructs a JsonFormatWriter to output to the given stream - /// - public static JsonFormatWriter CreateInstance(Stream output) - { - return new JsonStreamWriter(output); - } - - /// Write to the output stream - protected void WriteToOutput(string format, params object[] args) - { - WriteToOutput(String.Format(format, args)); - } - - /// Write to the output stream - protected void WriteToOutput(string text) - { - WriteToOutput(text.ToCharArray(), 0, text.Length); - } - - /// Write to the output stream - protected abstract void WriteToOutput(char ch); - - /// Write to the output stream - protected abstract void WriteToOutput(char[] chars, int offset, int len); - - /// Sets the output formatting to use Environment.NewLine with 4-character indentions - public JsonFormatWriter Formatted() - { - NewLine = FrameworkPortability.NewLine; - Indent = " "; - Whitespace = " "; - return this; - } - - /// Gets or sets the characters to use for the new-line, default = empty - public string NewLine { get; set; } - - /// Gets or sets the text to use for indenting, default = empty - public string Indent { get; set; } - - /// Gets or sets the whitespace to use to separate the text, default = empty - public string Whitespace { get; set; } - - private void Seperator() - { - if (_counter.Count == 0) - { - throw new InvalidOperationException("Mismatched open/close in Json writer."); - } - - int index = _counter.Count - 1; - if (_counter[index] > 0) - { - WriteToOutput(','); - } - - WriteLine(String.Empty); - _counter[index] = _counter[index] + 1; - } - - private void WriteLine(string content) - { - if (!String.IsNullOrEmpty(NewLine)) - { - WriteToOutput(NewLine); - for (int i = 1; i < _counter.Count; i++) - { - WriteToOutput(Indent); - } - } - else if (!String.IsNullOrEmpty(Whitespace)) - { - WriteToOutput(Whitespace); - } - - WriteToOutput(content); - } - - private void WriteName(string field) - { - Seperator(); - if (!String.IsNullOrEmpty(field)) - { - WriteToOutput('"'); - WriteToOutput(field); - WriteToOutput('"'); - WriteToOutput(':'); - if (!String.IsNullOrEmpty(Whitespace)) - { - WriteToOutput(Whitespace); - } - } - } - - private void EncodeText(string value) - { - char[] text = value.ToCharArray(); - int len = text.Length; - int pos = 0; - - while (pos < len) - { - int next = pos; - while (next < len && text[next] >= 32 && text[next] < 127 && text[next] != '\\' && text[next] != '/' && - text[next] != '"') - { - next++; - } - WriteToOutput(text, pos, next - pos); - if (next < len) - { - switch (text[next]) - { - case '"': - WriteToOutput(@"\"""); - break; - case '\\': - WriteToOutput(@"\\"); - break; - //odd at best to escape '/', most Json implementations don't, but it is defined in the rfc-4627 - case '/': - WriteToOutput(@"\/"); - break; - case '\b': - WriteToOutput(@"\b"); - break; - case '\f': - WriteToOutput(@"\f"); - break; - case '\n': - WriteToOutput(@"\n"); - break; - case '\r': - WriteToOutput(@"\r"); - break; - case '\t': - WriteToOutput(@"\t"); - break; - default: - WriteToOutput(@"\u{0:x4}", (int) text[next]); - break; - } - next++; - } - pos = next; - } - } - - /// - /// Writes a String value - /// - protected override void WriteAsText(string field, string textValue, object typedValue) - { - WriteName(field); - if (typedValue is bool || typedValue is int || typedValue is uint || typedValue is long || - typedValue is ulong || typedValue is double || typedValue is float) - { - WriteToOutput(textValue); - } - else - { - WriteToOutput('"'); - if (typedValue is string) - { - EncodeText(textValue); - } - else - { - WriteToOutput(textValue); - } - WriteToOutput('"'); - } - } - - /// - /// Writes a Double value - /// - protected override void Write(string field, double value) - { - if (double.IsNaN(value) || double.IsNegativeInfinity(value) || double.IsPositiveInfinity(value)) - { - throw new InvalidOperationException("This format does not support NaN, Infinity, or -Infinity"); - } - base.Write(field, value); - } - - /// - /// Writes a Single value - /// - protected override void Write(string field, float value) - { - if (float.IsNaN(value) || float.IsNegativeInfinity(value) || float.IsPositiveInfinity(value)) - { - throw new InvalidOperationException("This format does not support NaN, Infinity, or -Infinity"); - } - base.Write(field, value); - } - - // Treat enum as string - protected override void WriteEnum(string field, int number, string name) - { - Write(field, name); - } - - /// - /// Writes an array of field values - /// - protected override void WriteArray(FieldType type, string field, IEnumerable items) - { - IEnumerator enumerator = items.GetEnumerator(); - try - { - if (!enumerator.MoveNext()) - { - return; - } - } - finally - { - if (enumerator is IDisposable) - { - ((IDisposable) enumerator).Dispose(); - } - } - - WriteName(field); - WriteToOutput("["); - _counter.Add(0); - - base.WriteArray(type, String.Empty, items); - - _counter.RemoveAt(_counter.Count - 1); - WriteLine("]"); - } - - /// - /// Writes a message - /// - protected override void WriteMessageOrGroup(string field, IMessageLite message) - { - WriteName(field); - WriteMessage(message); - } - - /// - /// Writes the message to the the formatted stream. - /// - public override void WriteMessage(IMessageLite message) - { - WriteMessageStart(); - message.WriteTo(this); - WriteMessageEnd(); - } - - /// - /// Used to write the root-message preamble, in json this is the left-curly brace '{'. - /// After this call you can call IMessageLite.MergeTo(...) and complete the message with - /// a call to WriteMessageEnd(). - /// - public override void WriteMessageStart() - { - if (_isArray) - { - Seperator(); - } - WriteToOutput("{"); - _counter.Add(0); - } - - /// - /// Used to complete a root-message previously started with a call to WriteMessageStart() - /// - public override void WriteMessageEnd() - { - _counter.RemoveAt(_counter.Count - 1); - WriteLine("}"); - Flush(); - } - - /// - /// Used in streaming arrays of objects to the writer - /// - /// - /// - /// using(writer.StartArray()) - /// foreach(IMessageLite m in messages) - /// writer.WriteMessage(m); - /// - /// - public sealed class JsonArray : IDisposable - { - private JsonFormatWriter _writer; - - internal JsonArray(JsonFormatWriter writer) - { - _writer = writer; - _writer.WriteToOutput("["); - _writer._counter.Add(0); - } - - /// - /// Causes the end of the array character to be written. - /// - private void EndArray() - { - if (_writer != null) - { - _writer._counter.RemoveAt(_writer._counter.Count - 1); - _writer.WriteLine("]"); - _writer.Flush(); - } - _writer = null; - } - - void IDisposable.Dispose() - { - EndArray(); - } - } - - /// - /// Used to write an array of messages as the output rather than a single message. - /// - /// - /// - /// using(writer.StartArray()) - /// foreach(IMessageLite m in messages) - /// writer.WriteMessage(m); - /// - /// - public JsonArray StartArray() - { - if (_isArray) - { - Seperator(); - } - _isArray = true; - return new JsonArray(this); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/JsonTextCursor.cs b/src/ProtocolBuffers.Serialization/JsonTextCursor.cs deleted file mode 100644 index 19c45af..0000000 --- a/src/ProtocolBuffers.Serialization/JsonTextCursor.cs +++ /dev/null @@ -1,442 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Globalization; -using System.IO; - -namespace Google.ProtocolBuffers.Serialization -{ - /// - /// JSon Tokenizer used by JsonFormatReader - /// - internal abstract class JsonCursor - { - public enum JsType - { - String, - Number, - Object, - Array, - True, - False, - Null - } - - #region Buffering implementations - - private class JsonStreamCursor : JsonCursor - { - private readonly byte[] _buffer; - private int _bufferPos; - private readonly Stream _input; - - public JsonStreamCursor(Stream input) - { - _input = input; - _next = _input.ReadByte(); - } - - public JsonStreamCursor(byte[] input) - { - _input = null; - _buffer = input; - _next = _buffer[_bufferPos]; - } - - protected override int Peek() - { - if (_input != null) - { - return _next; - } - else if (_bufferPos < _buffer.Length) - { - return _buffer[_bufferPos]; - } - else - { - return -1; - } - } - - protected override int Read() - { - if (_input != null) - { - int result = _next; - _next = _input.ReadByte(); - return result; - } - else if (_bufferPos < _buffer.Length) - { - return _buffer[_bufferPos++]; - } - else - { - return -1; - } - } - } - - private class JsonTextCursor : JsonCursor - { - private readonly char[] _buffer; - private int _bufferPos; - private readonly TextReader _input; - - public JsonTextCursor(char[] input) - { - _input = null; - _buffer = input; - _bufferPos = 0; - _next = Peek(); - } - - public JsonTextCursor(TextReader input) - { - _input = input; - _next = Peek(); - } - - protected override int Peek() - { - if (_input != null) - { - return _input.Peek(); - } - else if (_bufferPos < _buffer.Length) - { - return _buffer[_bufferPos]; - } - else - { - return -1; - } - } - - protected override int Read() - { - if (_input != null) - { - return _input.Read(); - } - else if (_bufferPos < _buffer.Length) - { - return _buffer[_bufferPos++]; - } - else - { - return -1; - } - } - } - - #endregion - - protected int _next; - private int _lineNo, _linePos; - - public static JsonCursor CreateInstance(byte[] input) - { - return new JsonStreamCursor(input); - } - - public static JsonCursor CreateInstance(Stream input) - { - return new JsonStreamCursor(input); - } - - public static JsonCursor CreateInstance(string input) - { - return new JsonTextCursor(input.ToCharArray()); - } - - public static JsonCursor CreateInstance(TextReader input) - { - return new JsonTextCursor(input); - } - - protected JsonCursor() - { - _lineNo = 1; - _linePos = 0; - } - - /// Returns the next character without actually 'reading' it - protected abstract int Peek(); - - /// Reads the next character in the input - protected abstract int Read(); - - public Char NextChar - { - get - { - SkipWhitespace(); - return (char) _next; - } - } - - #region Assert(...) - - [DebuggerNonUserCode] - private string CharDisplay(int ch) - { - return ch == -1 - ? "EOF" - : (ch > 32 && ch < 127) - ? String.Format("'{0}'", (char) ch) - : String.Format("'\\u{0:x4}'", ch); - } - - [DebuggerNonUserCode] - private void Assert(bool cond, char expected) - { - if (!cond) - { - throw new FormatException( - String.Format(FrameworkPortability.InvariantCulture, - "({0}:{1}) error: Unexpected token {2}, expected: {3}.", - _lineNo, _linePos, - CharDisplay(_next), - CharDisplay(expected) - )); - } - } - - [DebuggerNonUserCode] - public void Assert(bool cond, string message) - { - if (!cond) - { - throw new FormatException( - String.Format(FrameworkPortability.InvariantCulture, - "({0},{1}) error: {2}", _lineNo, _linePos, message)); - } - } - - [DebuggerNonUserCode] - public void Assert(bool cond, string format, params object[] args) - { - if (!cond) - { - if (args != null && args.Length > 0) - { - format = String.Format(format, args); - } - throw new FormatException( - String.Format(FrameworkPortability.InvariantCulture, - "({0},{1}) error: {2}", _lineNo, _linePos, format)); - } - } - - #endregion - - private char ReadChar() - { - int ch = Read(); - Assert(ch != -1, "Unexpected end of file."); - if (ch == '\n') - { - _lineNo++; - _linePos = 0; - } - else if (ch != '\r') - { - _linePos++; - } - _next = Peek(); - return (char) ch; - } - - public void Consume(char ch) - { - Assert(TryConsume(ch), ch); - } - - public bool TryConsume(char ch) - { - SkipWhitespace(); - if (_next == ch) - { - ReadChar(); - return true; - } - return false; - } - - public void Consume(string sequence) - { - SkipWhitespace(); - - foreach (char ch in sequence) - { - Assert(ch == ReadChar(), "Expected token '{0}'.", sequence); - } - } - - public void SkipWhitespace() - { - int chnext = _next; - while (chnext != -1) - { - if (!Char.IsWhiteSpace((char) chnext)) - { - break; - } - ReadChar(); - chnext = _next; - } - } - - public string ReadString() - { - SkipWhitespace(); - Consume('"'); - List sb = new List(100); - while (_next != '"') - { - if (_next == '\\') - { - Consume('\\'); //skip the escape - char ch = ReadChar(); - switch (ch) - { - case 'b': - sb.Add('\b'); - break; - case 'f': - sb.Add('\f'); - break; - case 'n': - sb.Add('\n'); - break; - case 'r': - sb.Add('\r'); - break; - case 't': - sb.Add('\t'); - break; - case 'u': - { - string hex = new string(new char[] {ReadChar(), ReadChar(), ReadChar(), ReadChar()}); - int result; - Assert( - FrameworkPortability.TryParseInt32(hex, NumberStyles.AllowHexSpecifier, FrameworkPortability.InvariantCulture, - out result), - "Expected a 4-character hex specifier."); - sb.Add((char) result); - break; - } - default: - sb.Add(ch); - break; - } - } - else - { - Assert(_next != '\n' && _next != '\r' && _next != '\f' && _next != -1, '"'); - sb.Add(ReadChar()); - } - } - Consume('"'); - return new String(sb.ToArray()); - } - - public string ReadNumber() - { - SkipWhitespace(); - List sb = new List(24); - if (_next == '-') - { - sb.Add(ReadChar()); - } - Assert(_next >= '0' && _next <= '9', "Expected a numeric type."); - while ((_next >= '0' && _next <= '9') || _next == '.') - { - sb.Add(ReadChar()); - } - if (_next == 'e' || _next == 'E') - { - sb.Add(ReadChar()); - if (_next == '-' || _next == '+') - { - sb.Add(ReadChar()); - } - Assert(_next >= '0' && _next <= '9', "Expected a numeric type."); - while (_next >= '0' && _next <= '9') - { - sb.Add(ReadChar()); - } - } - return new String(sb.ToArray()); - } - - public JsType ReadVariant(out object value) - { - SkipWhitespace(); - switch (_next) - { - case 'n': - Consume("null"); - value = null; - return JsType.Null; - case 't': - Consume("true"); - value = true; - return JsType.True; - case 'f': - Consume("false"); - value = false; - return JsType.False; - case '"': - value = ReadString(); - return JsType.String; - case '{': - { - Consume('{'); - while (NextChar != '}') - { - ReadString(); - Consume(':'); - object tmp; - ReadVariant(out tmp); - if (!TryConsume(',')) - { - break; - } - } - Consume('}'); - value = null; - return JsType.Object; - } - case '[': - { - Consume('['); - List values = new List(); - while (NextChar != ']') - { - object tmp; - ReadVariant(out tmp); - values.Add(tmp); - if (!TryConsume(',')) - { - break; - } - } - Consume(']'); - value = values.ToArray(); - return JsType.Array; - } - default: - if ((_next >= '0' && _next <= '9') || _next == '-') - { - value = ReadNumber(); - return JsType.Number; - } - Assert(false, "Expected a value."); - throw new FormatException(); - } - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/Properties/AssemblyInfo.cs b/src/ProtocolBuffers.Serialization/Properties/AssemblyInfo.cs deleted file mode 100644 index c6420b5..0000000 --- a/src/ProtocolBuffers.Serialization/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -using System; -using System.Reflection; -using System.Runtime.InteropServices; -using System.Runtime.CompilerServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. - -[assembly: AssemblyTitle("ProtocolBuffers")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ProtocolBuffers")] -[assembly: AssemblyCopyright("Copyright © 2008")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("2.4.1.555")] - -[assembly: AssemblyVersion("2.4.1.555")] - -#if !NOFILEVERSION -[assembly: AssemblyFileVersion("2.4.1.555")] -#endif - -[assembly: CLSCompliant(true)] \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.CF20.csproj b/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.CF20.csproj deleted file mode 100644 index 0639ec6..0000000 --- a/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.CF20.csproj +++ /dev/null @@ -1,104 +0,0 @@ - - - COMPACT_FRAMEWORK - CF20 - Debug - AnyCPU - 9.0.30729 - 2.0 - {231391AF-449C-4A39-986C-AD7F270F4750} - Library - Properties - Google.ProtocolBuffers.Serialization - Google.ProtocolBuffers.Serialization - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Smartphone - f27da329-3269-4191-98e0-c87d3d7f1db9 - - - true - full - false - bin\CF20\Debug - obj\CF20\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION;NOEXTENSIONS - prompt - 4 - true - Off - true - - - pdbonly - true - bin\CF20\Release - obj\CF20\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION;NOEXTENSIONS - prompt - 4 - true - Off - true - - - - - - - - - - FrameworkPortability.cs - - - - - - - - - - - - - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - False - - - - - - - - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.CF35.csproj b/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.CF35.csproj deleted file mode 100644 index 22f381f..0000000 --- a/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.CF35.csproj +++ /dev/null @@ -1,104 +0,0 @@ - - - COMPACT_FRAMEWORK - CF35 - Debug - AnyCPU - 9.0.30729 - 2.0 - {231391AF-449C-4A39-986C-AD7F270F4750} - Library - Properties - Google.ProtocolBuffers.Serialization - Google.ProtocolBuffers.Serialization - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Smartphone - f27da329-3269-4191-98e0-c87d3d7f1db9 - - - true - full - false - bin\CF35\Debug - obj\CF35\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION - prompt - 4 - true - Off - true - - - pdbonly - true - bin\CF35\Release - obj\CF35\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION - prompt - 4 - true - Off - true - - - - - - - - - - FrameworkPortability.cs - - - - - - - - - - - - - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - False - - - - - - - - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.NET20.csproj b/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.NET20.csproj deleted file mode 100644 index dfeab79..0000000 --- a/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.NET20.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - CLIENTPROFILE - NET20 - Debug - AnyCPU - 9.0.30729 - 2.0 - {231391AF-449C-4A39-986C-AD7F270F4750} - Library - Properties - Google.ProtocolBuffers.Serialization - Google.ProtocolBuffers.Serialization - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET20\Debug - obj\NET20\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOEXTENSIONS - prompt - 4 - true - Off - - - pdbonly - true - bin\NET20\Release - obj\NET20\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOEXTENSIONS - prompt - 4 - true - Off - - - - - - - - - - FrameworkPortability.cs - - - - - - - - - - - - - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - False - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.NET35.csproj b/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.NET35.csproj deleted file mode 100644 index 4bed60d..0000000 --- a/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.NET35.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - CLIENTPROFILE - NET35 - Debug - AnyCPU - 9.0.30729 - 2.0 - {231391AF-449C-4A39-986C-AD7F270F4750} - Library - Properties - Google.ProtocolBuffers.Serialization - Google.ProtocolBuffers.Serialization - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET35\Debug - obj\NET35\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - pdbonly - true - bin\NET35\Release - obj\NET35\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - - - - - - - - FrameworkPortability.cs - - - - - - - - - - - - - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - False - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.NET40.csproj b/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.NET40.csproj deleted file mode 100644 index 80b76a0..0000000 --- a/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.NET40.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - CLIENTPROFILE - NET40 - Debug - AnyCPU - 9.0.30729 - 2.0 - {231391AF-449C-4A39-986C-AD7F270F4750} - Library - Properties - Google.ProtocolBuffers.Serialization - Google.ProtocolBuffers.Serialization - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET40\Debug - obj\NET40\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - pdbonly - true - bin\NET40\Release - obj\NET40\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - - - - - - - - FrameworkPortability.cs - - - - - - - - - - - - - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - False - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.PL40.csproj b/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.PL40.csproj deleted file mode 100644 index 60f8774..0000000 --- a/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.PL40.csproj +++ /dev/null @@ -1,95 +0,0 @@ - - - PORTABLE_LIBRARY - PL40 - Debug - AnyCPU - 9.0.30729 - 2.0 - {231391AF-449C-4A39-986C-AD7F270F4750} - Library - Properties - Google.ProtocolBuffers.Serialization - Google.ProtocolBuffers.Serialization - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - 10.0 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Profile1 - - - true - full - false - bin\PL40\Debug - obj\PL40\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - - - pdbonly - true - bin\PL40\Release - obj\PL40\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - - - - - - - - - - FrameworkPortability.cs - - - - - - - - - - - - - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - False - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.SL20.csproj b/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.SL20.csproj deleted file mode 100644 index f8c4c09..0000000 --- a/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.SL20.csproj +++ /dev/null @@ -1,107 +0,0 @@ - - - SILVERLIGHT - SL20 - Debug - AnyCPU - 9.0.30729 - 2.0 - {231391AF-449C-4A39-986C-AD7F270F4750} - Library - Properties - Google.ProtocolBuffers.Serialization - Google.ProtocolBuffers.Serialization - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - false - false - false - - - true - full - false - bin\SL20\Debug - obj\SL20\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST;NOEXTENSIONS - prompt - 4 - true - Off - true - - - pdbonly - true - bin\SL20\Release - obj\SL20\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST;NOEXTENSIONS - prompt - 4 - true - Off - true - - - - - - - - - - FrameworkPortability.cs - - - - - - - - - - - - - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - False - - - - - - - - OfflineApplication - - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.SL30.csproj b/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.SL30.csproj deleted file mode 100644 index 376c493..0000000 --- a/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.SL30.csproj +++ /dev/null @@ -1,107 +0,0 @@ - - - SILVERLIGHT - SL30 - Debug - AnyCPU - 9.0.30729 - 2.0 - {231391AF-449C-4A39-986C-AD7F270F4750} - Library - Properties - Google.ProtocolBuffers.Serialization - Google.ProtocolBuffers.Serialization - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - false - false - false - - - true - full - false - bin\SL30\Debug - obj\SL30\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - true - - - pdbonly - true - bin\SL30\Release - obj\SL30\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - true - - - - - - - - - - FrameworkPortability.cs - - - - - - - - - - - - - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - False - - - - - - - - OfflineApplication - - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.SL40.csproj b/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.SL40.csproj deleted file mode 100644 index dc675c4..0000000 --- a/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.SL40.csproj +++ /dev/null @@ -1,108 +0,0 @@ - - - SILVERLIGHT - SL40 - Debug - AnyCPU - 9.0.30729 - 2.0 - {231391AF-449C-4A39-986C-AD7F270F4750} - Library - Properties - Google.ProtocolBuffers.Serialization - Google.ProtocolBuffers.Serialization - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - false - false - false - v4.0 - - - true - full - false - bin\SL40\Debug - obj\SL40\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - true - - - pdbonly - true - bin\SL40\Release - obj\SL40\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - true - - - - - - - - - - FrameworkPortability.cs - - - - - - - - - - - - - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - False - - - - - - - - OfflineApplication - - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.csproj b/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.csproj deleted file mode 100644 index b9f728b..0000000 --- a/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.csproj +++ /dev/null @@ -1,93 +0,0 @@ - - - - CLIENTPROFILE - NET35 - Debug - AnyCPU - 9.0.30729 - 2.0 - {231391AF-449C-4A39-986C-AD7F270F4750} - Library - Properties - Google.ProtocolBuffers.Serialization - Google.ProtocolBuffers.Serialization - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET35\Debug - obj\NET35\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - pdbonly - true - bin\NET35\Release - obj\NET35\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - - - - - - - - FrameworkPortability.cs - - - - - - - - - - - - - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - False - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.CF20.csproj b/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.CF20.csproj deleted file mode 100644 index b382dc3..0000000 --- a/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.CF20.csproj +++ /dev/null @@ -1,104 +0,0 @@ - - - COMPACT_FRAMEWORK - CF20 - Debug - AnyCPU - 9.0.30729 - 2.0 - {E067A59D-9D0A-4A1F-92B1-38E4457241D1} - Library - Properties - Google.ProtocolBuffers.Serialization - Google.ProtocolBuffersLite.Serialization - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Smartphone - f27da329-3269-4191-98e0-c87d3d7f1db9 - - - true - full - false - bin\CF20\Debug - obj\CF20\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION;NOEXTENSIONS - prompt - 4 - true - Off - true - - - pdbonly - true - bin\CF20\Release - obj\CF20\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION;NOEXTENSIONS - prompt - 4 - true - Off - true - - - - - - - - - - FrameworkPortability.cs - - - - - - - - - - - - - - - - - - - - - - - - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffersLite - False - - - - - - - - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.CF35.csproj b/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.CF35.csproj deleted file mode 100644 index 558931d..0000000 --- a/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.CF35.csproj +++ /dev/null @@ -1,104 +0,0 @@ - - - COMPACT_FRAMEWORK - CF35 - Debug - AnyCPU - 9.0.30729 - 2.0 - {E067A59D-9D0A-4A1F-92B1-38E4457241D1} - Library - Properties - Google.ProtocolBuffers.Serialization - Google.ProtocolBuffersLite.Serialization - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Smartphone - f27da329-3269-4191-98e0-c87d3d7f1db9 - - - true - full - false - bin\CF35\Debug - obj\CF35\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION - prompt - 4 - true - Off - true - - - pdbonly - true - bin\CF35\Release - obj\CF35\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION - prompt - 4 - true - Off - true - - - - - - - - - - FrameworkPortability.cs - - - - - - - - - - - - - - - - - - - - - - - - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffersLite - False - - - - - - - - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.NET20.csproj b/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.NET20.csproj deleted file mode 100644 index 1e145ab..0000000 --- a/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.NET20.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - CLIENTPROFILE - NET20 - Debug - AnyCPU - 9.0.30729 - 2.0 - {E067A59D-9D0A-4A1F-92B1-38E4457241D1} - Library - Properties - Google.ProtocolBuffers.Serialization - Google.ProtocolBuffersLite.Serialization - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET20\Debug - obj\NET20\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOEXTENSIONS - prompt - 4 - true - Off - - - pdbonly - true - bin\NET20\Release - obj\NET20\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOEXTENSIONS - prompt - 4 - true - Off - - - - - - - - - - FrameworkPortability.cs - - - - - - - - - - - - - - - - - - - - - - - - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffersLite - False - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.NET35.csproj b/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.NET35.csproj deleted file mode 100644 index 9fd744c..0000000 --- a/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.NET35.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - CLIENTPROFILE - NET35 - Debug - AnyCPU - 9.0.30729 - 2.0 - {E067A59D-9D0A-4A1F-92B1-38E4457241D1} - Library - Properties - Google.ProtocolBuffers.Serialization - Google.ProtocolBuffersLite.Serialization - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET35\Debug - obj\NET35\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - pdbonly - true - bin\NET35\Release - obj\NET35\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - - - - - - - - FrameworkPortability.cs - - - - - - - - - - - - - - - - - - - - - - - - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffersLite - False - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.NET40.csproj b/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.NET40.csproj deleted file mode 100644 index 1254fdf..0000000 --- a/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.NET40.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - CLIENTPROFILE - NET40 - Debug - AnyCPU - 9.0.30729 - 2.0 - {E067A59D-9D0A-4A1F-92B1-38E4457241D1} - Library - Properties - Google.ProtocolBuffers.Serialization - Google.ProtocolBuffersLite.Serialization - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET40\Debug - obj\NET40\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - pdbonly - true - bin\NET40\Release - obj\NET40\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - - - - - - - - FrameworkPortability.cs - - - - - - - - - - - - - - - - - - - - - - - - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffersLite - False - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.PL40.csproj b/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.PL40.csproj deleted file mode 100644 index c6fbb6a..0000000 --- a/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.PL40.csproj +++ /dev/null @@ -1,95 +0,0 @@ - - - PORTABLE_LIBRARY - PL40 - Debug - AnyCPU - 9.0.30729 - 2.0 - {E067A59D-9D0A-4A1F-92B1-38E4457241D1} - Library - Properties - Google.ProtocolBuffers.Serialization - Google.ProtocolBuffersLite.Serialization - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - 10.0 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Profile1 - - - true - full - false - bin\PL40\Debug - obj\PL40\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - - - pdbonly - true - bin\PL40\Release - obj\PL40\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - - - - - - - - - - FrameworkPortability.cs - - - - - - - - - - - - - - - - - - - - - - - - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffersLite - False - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.SL20.csproj b/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.SL20.csproj deleted file mode 100644 index 9e89107..0000000 --- a/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.SL20.csproj +++ /dev/null @@ -1,107 +0,0 @@ - - - SILVERLIGHT - SL20 - Debug - AnyCPU - 9.0.30729 - 2.0 - {E067A59D-9D0A-4A1F-92B1-38E4457241D1} - Library - Properties - Google.ProtocolBuffers.Serialization - Google.ProtocolBuffersLite.Serialization - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - false - false - false - - - true - full - false - bin\SL20\Debug - obj\SL20\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST;NOEXTENSIONS - prompt - 4 - true - Off - true - - - pdbonly - true - bin\SL20\Release - obj\SL20\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST;NOEXTENSIONS - prompt - 4 - true - Off - true - - - - - - - - - - FrameworkPortability.cs - - - - - - - - - - - - - - - - - - - - - - - - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffersLite - False - - - - - - - - OfflineApplication - - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.SL30.csproj b/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.SL30.csproj deleted file mode 100644 index 6d3ac12..0000000 --- a/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.SL30.csproj +++ /dev/null @@ -1,107 +0,0 @@ - - - SILVERLIGHT - SL30 - Debug - AnyCPU - 9.0.30729 - 2.0 - {E067A59D-9D0A-4A1F-92B1-38E4457241D1} - Library - Properties - Google.ProtocolBuffers.Serialization - Google.ProtocolBuffersLite.Serialization - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - false - false - false - - - true - full - false - bin\SL30\Debug - obj\SL30\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - true - - - pdbonly - true - bin\SL30\Release - obj\SL30\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - true - - - - - - - - - - FrameworkPortability.cs - - - - - - - - - - - - - - - - - - - - - - - - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffersLite - False - - - - - - - - OfflineApplication - - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.SL40.csproj b/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.SL40.csproj deleted file mode 100644 index 9b34163..0000000 --- a/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.SL40.csproj +++ /dev/null @@ -1,108 +0,0 @@ - - - SILVERLIGHT - SL40 - Debug - AnyCPU - 9.0.30729 - 2.0 - {E067A59D-9D0A-4A1F-92B1-38E4457241D1} - Library - Properties - Google.ProtocolBuffers.Serialization - Google.ProtocolBuffersLite.Serialization - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - false - false - false - v4.0 - - - true - full - false - bin\SL40\Debug - obj\SL40\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - true - - - pdbonly - true - bin\SL40\Release - obj\SL40\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - true - - - - - - - - - - FrameworkPortability.cs - - - - - - - - - - - - - - - - - - - - - - - - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffersLite - False - - - - - - - - OfflineApplication - - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.csproj b/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.csproj deleted file mode 100644 index c1754cf..0000000 --- a/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.csproj +++ /dev/null @@ -1,93 +0,0 @@ - - - - CLIENTPROFILE - NET35 - Debug - AnyCPU - 9.0.30729 - 2.0 - {E067A59D-9D0A-4A1F-92B1-38E4457241D1} - Library - Properties - Google.ProtocolBuffers.Serialization - Google.ProtocolBuffersLite.Serialization - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET35\Debug - obj\NET35\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - pdbonly - true - bin\NET35\Release - obj\NET35\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - - - - - - - - FrameworkPortability.cs - - - - - - - - - - - - - - - - - - - - - - - - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffersLite - False - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/RecursionLimitExceeded.cs b/src/ProtocolBuffers.Serialization/RecursionLimitExceeded.cs deleted file mode 100644 index 14e72ba..0000000 --- a/src/ProtocolBuffers.Serialization/RecursionLimitExceeded.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Google.ProtocolBuffers.Serialization -{ - /// - /// The exception raised when a recursion limit is reached while parsing input. - /// - public sealed class RecursionLimitExceededException : FormatException - { - const string message = "Possible malicious message had too many levels of nesting."; - - internal RecursionLimitExceededException() : base(message) - { - } - } -} diff --git a/src/ProtocolBuffers.Serialization/XmlFormatReader.cs b/src/ProtocolBuffers.Serialization/XmlFormatReader.cs deleted file mode 100644 index a4f111d..0000000 --- a/src/ProtocolBuffers.Serialization/XmlFormatReader.cs +++ /dev/null @@ -1,338 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Xml; -using System.Diagnostics; - -namespace Google.ProtocolBuffers.Serialization -{ - /// - /// Parses a proto buffer from an XML document or fragment. .NET 3.5 users may also - /// use this class to process Json by setting the options to support Json and providing - /// an XmlReader obtained from . - /// - public class XmlFormatReader : AbstractTextReader - { - public const string DefaultRootElementName = XmlFormatWriter.DefaultRootElementName; - private readonly XmlReader _input; - // Tracks the message element for each nested message read - private readonly Stack _elements; - // The default element name for ReadMessageStart - private string _rootElementName; - - private struct ElementStackEntry - { - public readonly string LocalName; - public readonly int Depth; - public readonly bool IsEmpty; - - public ElementStackEntry(string localName, int depth, bool isEmpty) : this() - { - LocalName = localName; - IsEmpty = isEmpty; - Depth = depth; - } - } - - private static XmlReaderSettings DefaultSettings - { - get - { - return new XmlReaderSettings() - {CheckCharacters = false, IgnoreComments = true, IgnoreProcessingInstructions = true}; - } - } - - /// - /// Constructs the XmlFormatReader using the stream provided as the xml - /// - public static XmlFormatReader CreateInstance(byte[] input) - { - return new XmlFormatReader(XmlReader.Create(new MemoryStream(input, false), DefaultSettings)); - } - - /// - /// Constructs the XmlFormatReader using the stream provided as the xml - /// - public static XmlFormatReader CreateInstance(Stream input) - { - return new XmlFormatReader(XmlReader.Create(input, DefaultSettings)); - } - - /// - /// Constructs the XmlFormatReader using the string provided as the xml to be read - /// - public static XmlFormatReader CreateInstance(String input) - { - return new XmlFormatReader(XmlReader.Create(new StringReader(input), DefaultSettings)); - } - - /// - /// Constructs the XmlFormatReader using the xml in the TextReader - /// - public static XmlFormatReader CreateInstance(TextReader input) - { - return new XmlFormatReader(XmlReader.Create(input, DefaultSettings)); - } - - /// - /// Constructs the XmlFormatReader with the XmlReader - /// - public static XmlFormatReader CreateInstance(XmlReader input) - { - return new XmlFormatReader(input); - } - - /// - /// Constructs the XmlFormatReader with the XmlReader and options - /// - protected XmlFormatReader(XmlReader input) - { - _input = input; - _rootElementName = DefaultRootElementName; - _elements = new Stack(); - Options = XmlReaderOptions.None; - } - - /// - /// Gets or sets the options to use when reading the xml - /// - public XmlReaderOptions Options { get; set; } - - /// - /// Sets the options to use while generating the XML - /// - public XmlFormatReader SetOptions(XmlReaderOptions options) - { - Options = options; - return this; - } - - /// - /// Gets or sets the default element name to use when using the Merge<TBuilder>() - /// - public string RootElementName - { - get { return _rootElementName; } - set - { - ThrowHelper.ThrowIfNull(value, "RootElementName"); - _rootElementName = value; - } - } - - [DebuggerNonUserCode] - private static void Assert(bool cond) - { - if (!cond) - { - throw new FormatException(); - } - } - - /// - /// Reads the root-message preamble specific to this formatter - /// - public override void ReadMessageStart() - { - ReadMessageStart(_rootElementName); - } - - /// - /// Reads the root-message preamble specific to this formatter - /// - public void ReadMessageStart(string element) - { - while (!_input.IsStartElement() && _input.Read()) - { - continue; - } - Assert(_input.IsStartElement() && _input.LocalName == element); - _elements.Push(new ElementStackEntry(element, _input.Depth, _input.IsEmptyElement)); - _input.Read(); - } - - /// - /// Reads the root-message close specific to this formatter, MUST be called - /// on the reader obtained from ReadMessageStart(string element). - /// - public override void ReadMessageEnd() - { - Assert(_elements.Count > 0); - - ElementStackEntry stop = _elements.Peek(); - while (_input.NodeType != XmlNodeType.EndElement && _input.NodeType != XmlNodeType.Element - && _input.Depth > stop.Depth && _input.Read()) - { - continue; - } - - if (!stop.IsEmpty) - { - Assert(_input.NodeType == XmlNodeType.EndElement - && _input.LocalName == stop.LocalName - && _input.Depth == stop.Depth); - - _input.Read(); - } - _elements.Pop(); - } - - /// - /// Merge the provided builder as an element named in the current context - /// - public override TBuilder Merge(TBuilder builder, ExtensionRegistry registry) - { - return Merge(_rootElementName, builder, registry); - } - - /// - /// Merge the provided builder as an element of the current context - /// - public TBuilder Merge(string element, TBuilder builder) where TBuilder : IBuilderLite - { - return Merge(element, builder, ExtensionRegistry.Empty); - } - - /// - /// Merge the provided builder as an element of the current context - /// - public TBuilder Merge(string element, TBuilder builder, ExtensionRegistry registry) - where TBuilder : IBuilderLite - { - ReadMessageStart(element); - builder.WeakMergeFrom(this, registry); - ReadMessageEnd(); - return builder; - } - - /// - /// Peeks at the next field in the input stream and returns what information is available. - /// - /// - /// This may be called multiple times without actually reading the field. Only after the field - /// is either read, or skipped, should PeekNext return a different value. - /// - protected override bool PeekNext(out string field) - { - ElementStackEntry stopNode; - if (_elements.Count == 0) - { - stopNode = new ElementStackEntry(null, _input.Depth - 1, false); - } - else - { - stopNode = _elements.Peek(); - } - - if (!stopNode.IsEmpty) - { - while (!_input.IsStartElement() && _input.Depth > stopNode.Depth && _input.Read()) - { - continue; - } - - if (_input.IsStartElement() && _input.Depth > stopNode.Depth) - { - field = _input.LocalName; - return true; - } - } - field = null; - return false; - } - - /// - /// Causes the reader to skip past this field - /// - protected override void Skip() - { - if (_input.IsStartElement()) - { - if (!_input.IsEmptyElement) - { - int depth = _input.Depth; - while (_input.Depth >= depth && _input.NodeType != XmlNodeType.EndElement) - { - Assert(_input.Read()); - } - } - _input.Read(); - } - } - - /// - /// returns true if it was able to read a single value into the value reference. The value - /// stored may be of type System.String, System.Int32, or an IEnumLite from the IEnumLiteMap. - /// - protected override bool ReadEnum(ref object value) - { - int number; - string temp; - if (null != (temp = _input.GetAttribute("value")) && FrameworkPortability.TryParseInt32(temp, out number)) - { - Skip(); - value = number; - return true; - } - return base.ReadEnum(ref value); - } - - /// - /// Returns true if it was able to read a String from the input - /// - protected override bool ReadAsText(ref string value, Type type) - { - Assert(_input.NodeType == XmlNodeType.Element); - value = _input.ReadElementContentAsString(); - - return true; - } - - /// - /// Merges the input stream into the provided IBuilderLite - /// - protected override bool ReadMessage(IBuilderLite builder, ExtensionRegistry registry) - { - Assert(_input.IsStartElement()); - ReadMessageStart(_input.LocalName); - builder.WeakMergeFrom(this, registry); - ReadMessageEnd(); - return true; - } - - private IEnumerable NonNestedArrayItems(string field) - { - return base.ForeachArrayItem(field); - } - - /// - /// Cursors through the array elements and stops at the end of the array - /// - protected override IEnumerable ForeachArrayItem(string field) - { - bool isNested = (Options & XmlReaderOptions.ReadNestedArrays) != 0; - - if (!isNested) - { - foreach (string item in NonNestedArrayItems(field)) - { - yield return item; - } - } - else - { - string found; - ReadMessageStart(field); - if (PeekNext(out found) && found == "item") - { - foreach (string item in NonNestedArrayItems("item")) - { - yield return item; - } - } - ReadMessageEnd(); - } - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/XmlFormatWriter.cs b/src/ProtocolBuffers.Serialization/XmlFormatWriter.cs deleted file mode 100644 index 4bd2756..0000000 --- a/src/ProtocolBuffers.Serialization/XmlFormatWriter.cs +++ /dev/null @@ -1,280 +0,0 @@ -using System; -using System.Collections; -using System.IO; -using System.Text; -using System.Xml; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.Serialization -{ - /// - /// Writes a proto buffer to an XML document or fragment. .NET 3.5 users may also - /// use this class to produce Json by setting the options to support Json and providing - /// an XmlWriter obtained from . - /// - public class XmlFormatWriter : AbstractTextWriter - { - private static readonly Encoding DefaultEncoding = new UTF8Encoding(false); - public const string DefaultRootElementName = "root"; - - private readonly XmlWriter _output; - // The default element name used for WriteMessageStart - private string _rootElementName; - // Used to assert matching WriteMessageStart/WriteMessageEnd calls - private int _messageOpenCount; - - private static XmlWriterSettings DefaultSettings(Encoding encoding) - { - return new XmlWriterSettings() - { - CheckCharacters = false, - NewLineHandling = NewLineHandling.Entitize, - OmitXmlDeclaration = true, - Encoding = encoding, - }; - } - - /// - /// Constructs the XmlFormatWriter to write to the given TextWriter - /// - public static XmlFormatWriter CreateInstance(TextWriter output) - { - return new XmlFormatWriter(XmlWriter.Create(output, DefaultSettings(output.Encoding))); - } - - /// - /// Constructs the XmlFormatWriter to write to the given stream - /// - public static XmlFormatWriter CreateInstance(Stream output) - { - return new XmlFormatWriter(XmlWriter.Create(output, DefaultSettings(DefaultEncoding))); - } - - /// - /// Constructs the XmlFormatWriter to write to the given stream - /// - public static XmlFormatWriter CreateInstance(Stream output, Encoding encoding) - { - return new XmlFormatWriter(XmlWriter.Create(output, DefaultSettings(encoding))); - } - - /// - /// Constructs the XmlFormatWriter to write to the given XmlWriter - /// - public static XmlFormatWriter CreateInstance(XmlWriter output) - { - return new XmlFormatWriter(output); - } - - protected XmlFormatWriter(XmlWriter output) - { - _output = output; - _messageOpenCount = 0; - _rootElementName = DefaultRootElementName; - } - - /// - /// Gets or sets the default element name to use when using the Merge<TBuilder>() - /// - public string RootElementName - { - get { return _rootElementName; } - set - { - ThrowHelper.ThrowIfNull(value, "RootElementName"); - _rootElementName = value; - } - } - - /// - /// Gets or sets the options to use while generating the XML - /// - public XmlWriterOptions Options { get; set; } - - /// - /// Sets the options to use while generating the XML - /// - public XmlFormatWriter SetOptions(XmlWriterOptions options) - { - Options = options; - return this; - } - - private bool TestOption(XmlWriterOptions option) - { - return (Options & option) != 0; - } - - /// - /// Completes any pending write operations - /// - public override void Flush() - { - _output.Flush(); - base.Flush(); - } - - /// - /// Used to write the root-message preamble, in xml this is open element for RootElementName, - /// by default "<root>". After this call you can call IMessageLite.MergeTo(...) and - /// complete the message with a call to WriteMessageEnd(). - /// - public override void WriteMessageStart() - { - WriteMessageStart(_rootElementName); - } - - /// - /// Used to write the root-message preamble, in xml this is open element for elementName. - /// After this call you can call IMessageLite.MergeTo(...) and complete the message with - /// a call to WriteMessageEnd(). - /// - public void WriteMessageStart(string elementName) - { - if (TestOption(XmlWriterOptions.OutputJsonTypes)) - { - _output.WriteStartElement("root"); // json requires this is the root-element - _output.WriteAttributeString("type", "object"); - } - else - { - _output.WriteStartElement(elementName); - } - _messageOpenCount++; - } - - /// - /// Used to complete a root-message previously started with a call to WriteMessageStart() - /// - public override void WriteMessageEnd() - { - if (_messageOpenCount <= 0) - { - throw new InvalidOperationException(); - } - - _output.WriteEndElement(); - _output.Flush(); - _messageOpenCount--; - } - - /// - /// Writes a message as an element using the name defined in - /// - public override void WriteMessage(IMessageLite message) - { - WriteMessage(_rootElementName, message); - } - - /// - /// Writes a message as an element with the given name - /// - public void WriteMessage(string elementName, IMessageLite message) - { - WriteMessageStart(elementName); - message.WriteTo(this); - WriteMessageEnd(); - } - - /// - /// Writes a message - /// - protected override void WriteMessageOrGroup(string field, IMessageLite message) - { - _output.WriteStartElement(field); - - if (TestOption(XmlWriterOptions.OutputJsonTypes)) - { - _output.WriteAttributeString("type", "object"); - } - - message.WriteTo(this); - _output.WriteEndElement(); - } - - /// - /// Writes a String value - /// - protected override void WriteAsText(string field, string textValue, object typedValue) - { - _output.WriteStartElement(field); - - if (TestOption(XmlWriterOptions.OutputJsonTypes)) - { - if (typedValue is int || typedValue is uint || typedValue is long || typedValue is ulong || - typedValue is double || typedValue is float) - { - _output.WriteAttributeString("type", "number"); - } - else if (typedValue is bool) - { - _output.WriteAttributeString("type", "boolean"); - } - } - _output.WriteString(textValue); - - //Empty strings should not be written as empty elements '', rather as '' - if (_output.WriteState == WriteState.Element) - { - _output.WriteRaw(""); - } - - _output.WriteEndElement(); - } - - /// - /// Writes an array of field values - /// - protected override void WriteArray(FieldType fieldType, string field, IEnumerable items) - { - //see if it's empty - IEnumerator eitems = items.GetEnumerator(); - try - { - if (!eitems.MoveNext()) - { - return; - } - } - finally - { - if (eitems is IDisposable) - { - ((IDisposable) eitems).Dispose(); - } - } - - if (TestOption(XmlWriterOptions.OutputNestedArrays | XmlWriterOptions.OutputJsonTypes)) - { - _output.WriteStartElement(field); - if (TestOption(XmlWriterOptions.OutputJsonTypes)) - { - _output.WriteAttributeString("type", "array"); - } - - base.WriteArray(fieldType, "item", items); - _output.WriteEndElement(); - } - else - { - base.WriteArray(fieldType, field, items); - } - } - - /// - /// Writes a System.Enum by the numeric and textual value - /// - protected override void WriteEnum(string field, int number, string name) - { - _output.WriteStartElement(field); - - if (!TestOption(XmlWriterOptions.OutputJsonTypes) && TestOption(XmlWriterOptions.OutputEnumValues)) - { - _output.WriteAttributeString("value", XmlConvert.ToString(number)); - } - - _output.WriteString(name); - _output.WriteEndElement(); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/XmlReaderOptions.cs b/src/ProtocolBuffers.Serialization/XmlReaderOptions.cs deleted file mode 100644 index f7eca1d..0000000 --- a/src/ProtocolBuffers.Serialization/XmlReaderOptions.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; - -namespace Google.ProtocolBuffers.Serialization -{ - /// - /// Options available for the xml reader output - /// - [Flags] - public enum XmlReaderOptions - { - /// Simple xml formatting with no attributes - None, - - /// Requires that arrays items are nested in an <item> element - ReadNestedArrays = 1, - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/XmlWriterOptions.cs b/src/ProtocolBuffers.Serialization/XmlWriterOptions.cs deleted file mode 100644 index 7d740ee..0000000 --- a/src/ProtocolBuffers.Serialization/XmlWriterOptions.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; - -namespace Google.ProtocolBuffers.Serialization -{ - /// - /// Options available for the xml writer output - /// - [Flags] - public enum XmlWriterOptions - { - /// Simple xml formatting with no attributes - None, - - /// Writes the 'value' attribute on all enumerations with the numeric identifier - OutputEnumValues = 0x1, - - /// Embeds array items into child <item> elements - OutputNestedArrays = 0x4, - - /// Outputs the 'type' attribute for compatibility with the JsonReaderWriterFactory - /// This option must, by nessessity, also enable NestedArrayItems - OutputJsonTypes = 0x8, - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/AbstractMessageTest.cs b/src/ProtocolBuffers.Test/AbstractMessageTest.cs deleted file mode 100644 index 02793ae..0000000 --- a/src/ProtocolBuffers.Test/AbstractMessageTest.cs +++ /dev/null @@ -1,521 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using System.IO; -using Google.ProtocolBuffers.Descriptors; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Google.ProtocolBuffers.TestProtos; - -namespace Google.ProtocolBuffers -{ - [TestClass] - public class AbstractMessageTest - { - [TestMethod] - public void Clear() - { - AbstractMessageWrapper message = - new AbstractMessageWrapper.Builder(TestAllTypes.CreateBuilder(TestUtil.GetAllSet())).Clear().Build(); - TestUtil.AssertClear((TestAllTypes) message.WrappedMessage); - } - - [TestMethod] - public void Copy() - { - AbstractMessageWrapper message = - new AbstractMessageWrapper.Builder(TestAllTypes.CreateBuilder()).MergeFrom(TestUtil.GetAllSet()).Build(); - TestUtil.AssertAllFieldsSet((TestAllTypes) message.WrappedMessage); - } - - [TestMethod] - public void CreateAndBuild() - { - TestAllTypes.CreateBuilder() - .Build(); - } - - [TestMethod] - public void SerializedSize() - { - TestAllTypes message = TestUtil.GetAllSet(); - IMessage abstractMessage = new AbstractMessageWrapper(TestUtil.GetAllSet()); - - Assert.AreEqual(message.SerializedSize, abstractMessage.SerializedSize); - } - - [TestMethod] - public void Serialization() - { - IMessage abstractMessage = new AbstractMessageWrapper(TestUtil.GetAllSet()); - TestUtil.AssertAllFieldsSet(TestAllTypes.ParseFrom(abstractMessage.ToByteString())); - Assert.AreEqual(TestUtil.GetAllSet().ToByteString(), abstractMessage.ToByteString()); - } - - [TestMethod] - public void Parsing() - { - IBuilder builder = new AbstractMessageWrapper.Builder(TestAllTypes.CreateBuilder()); - AbstractMessageWrapper message = - (AbstractMessageWrapper) builder.WeakMergeFrom(TestUtil.GetAllSet().ToByteString()).WeakBuild(); - TestUtil.AssertAllFieldsSet((TestAllTypes) message.WrappedMessage); - } - - [TestMethod] - public void PackedSerialization() - { - IMessage abstractMessage = new AbstractMessageWrapper(TestUtil.GetPackedSet()); - TestUtil.AssertPackedFieldsSet(TestPackedTypes.ParseFrom(abstractMessage.ToByteString())); - Assert.AreEqual(TestUtil.GetPackedSet().ToByteString(), abstractMessage.ToByteString()); - } - - [TestMethod] - public void PackedParsing() - { - AbstractMessageWrapper.Builder builder = new AbstractMessageWrapper.Builder(TestPackedTypes.CreateBuilder()); - AbstractMessageWrapper message = builder.MergeFrom(TestUtil.GetPackedSet().ToByteString()).Build(); - TestUtil.AssertPackedFieldsSet((TestPackedTypes)message.WrappedMessage); - } - - [TestMethod] - public void UnpackedParsingOfPackedInput() - { - byte[] bytes = TestUtil.GetPackedSet().ToByteArray(); - TestUnpackedTypes message = TestUnpackedTypes.ParseFrom(bytes); - TestUtil.AssertUnpackedFieldsSet(message); - } - - [TestMethod] - public void PackedParsingOfUnpackedInput() - { - byte[] bytes = TestUnpackedTypes.ParseFrom(TestUtil.GetPackedSet().ToByteArray()).ToByteArray(); - TestPackedTypes message = TestPackedTypes.ParseFrom(bytes); - TestUtil.AssertPackedFieldsSet(message); - } - - [TestMethod] - public void UnpackedParsingOfPackedInputExtensions() - { - byte[] bytes = TestUtil.GetPackedSet().ToByteArray(); - ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); - UnitTestProtoFile.RegisterAllExtensions(registry); - UnitTestExtrasProtoFile.RegisterAllExtensions(registry); - TestUnpackedExtensions message = TestUnpackedExtensions.ParseFrom(bytes, registry); - TestUtil.AssertUnpackedExtensionsSet(message); - } - - [TestMethod] - public void PackedParsingOfUnpackedInputExtensions() - { - byte[] bytes = TestUnpackedTypes.ParseFrom(TestUtil.GetPackedSet().ToByteArray()).ToByteArray(); - ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); - UnitTestProtoFile.RegisterAllExtensions(registry); - TestPackedExtensions message = TestPackedExtensions.ParseFrom(bytes, registry); - TestUtil.AssertPackedExtensionsSet(message); - } - - [TestMethod] - public void OptimizedForSize() - { - // We're mostly only Checking that this class was compiled successfully. - TestOptimizedForSize message = TestOptimizedForSize.CreateBuilder().SetI(1).Build(); - message = TestOptimizedForSize.ParseFrom(message.ToByteString()); - Assert.AreEqual(2, message.SerializedSize); - } - - // ----------------------------------------------------------------- - // Tests for isInitialized(). - - private static readonly TestRequired TestRequiredUninitialized = TestRequired.DefaultInstance; - - private static readonly TestRequired TestRequiredInitialized = - TestRequired.CreateBuilder().SetA(1).SetB(2).SetC(3).Build(); - - [TestMethod] - public void IsInitialized() - { - TestRequired.Builder builder = TestRequired.CreateBuilder(); - AbstractMessageWrapper.Builder abstractBuilder = new AbstractMessageWrapper.Builder(builder); - - Assert.IsFalse(abstractBuilder.IsInitialized); - builder.A = 1; - Assert.IsFalse(abstractBuilder.IsInitialized); - builder.B = 1; - Assert.IsFalse(abstractBuilder.IsInitialized); - builder.C = 1; - Assert.IsTrue(abstractBuilder.IsInitialized); - } - - [TestMethod] - public void ForeignIsInitialized() - { - TestRequiredForeign.Builder builder = TestRequiredForeign.CreateBuilder(); - AbstractMessageWrapper.Builder abstractBuilder = new AbstractMessageWrapper.Builder(builder); - - Assert.IsTrue(abstractBuilder.IsInitialized); - - builder.SetOptionalMessage(TestRequiredUninitialized); - Assert.IsFalse(abstractBuilder.IsInitialized); - - builder.SetOptionalMessage(TestRequiredInitialized); - Assert.IsTrue(abstractBuilder.IsInitialized); - - builder.AddRepeatedMessage(TestRequiredUninitialized); - Assert.IsFalse(abstractBuilder.IsInitialized); - - builder.SetRepeatedMessage(0, TestRequiredInitialized); - Assert.IsTrue(abstractBuilder.IsInitialized); - } - - // ----------------------------------------------------------------- - // Tests for mergeFrom - - private static readonly TestAllTypes MergeSource = TestAllTypes.CreateBuilder() - .SetOptionalInt32(1) - .SetOptionalString("foo") - .SetOptionalForeignMessage(ForeignMessage.DefaultInstance) - .AddRepeatedString("bar") - .Build(); - - private static readonly TestAllTypes MergeDest = TestAllTypes.CreateBuilder() - .SetOptionalInt64(2) - .SetOptionalString("baz") - .SetOptionalForeignMessage(ForeignMessage.CreateBuilder().SetC(3).Build()) - .AddRepeatedString("qux") - .Build(); - - private const string MergeResultText = "optional_int32: 1\n" + - "optional_int64: 2\n" + - "optional_string: \"foo\"\n" + - "optional_foreign_message {\n" + - " c: 3\n" + - "}\n" + - "repeated_string: \"qux\"\n" + - "repeated_string: \"bar\"\n"; - - [TestMethod] - public void MergeFrom() - { - AbstractMessageWrapper result = (AbstractMessageWrapper) - new AbstractMessageWrapper.Builder(TestAllTypes.CreateBuilder(MergeDest)) - .MergeFrom(MergeSource) - .Build(); - - Assert.AreEqual(MergeResultText, result.ToString()); - } - - // ----------------------------------------------------------------- - // Tests for equals and hashCode - - [TestMethod] - public void EqualsAndHashCode() - { - TestAllTypes a = TestUtil.GetAllSet(); - TestAllTypes b = TestAllTypes.CreateBuilder().Build(); - TestAllTypes c = TestAllTypes.CreateBuilder(b).AddRepeatedString("x").Build(); - TestAllTypes d = TestAllTypes.CreateBuilder(c).AddRepeatedString("y").Build(); - TestAllExtensions e = TestUtil.GetAllExtensionsSet(); - TestAllExtensions f = TestAllExtensions.CreateBuilder(e) - .AddExtension(UnitTestProtoFile.RepeatedInt32Extension, 999).Build(); - - CheckEqualsIsConsistent(a); - CheckEqualsIsConsistent(b); - CheckEqualsIsConsistent(c); - CheckEqualsIsConsistent(d); - CheckEqualsIsConsistent(e); - CheckEqualsIsConsistent(f); - - CheckNotEqual(a, b); - CheckNotEqual(a, c); - CheckNotEqual(a, d); - CheckNotEqual(a, e); - CheckNotEqual(a, f); - - CheckNotEqual(b, c); - CheckNotEqual(b, d); - CheckNotEqual(b, e); - CheckNotEqual(b, f); - - CheckNotEqual(c, d); - CheckNotEqual(c, e); - CheckNotEqual(c, f); - - CheckNotEqual(d, e); - CheckNotEqual(d, f); - - CheckNotEqual(e, f); - - // Deserializing into the TestEmptyMessage such that every field is an UnknownFieldSet.Field - TestEmptyMessage eUnknownFields = TestEmptyMessage.ParseFrom(e.ToByteArray()); - TestEmptyMessage fUnknownFields = TestEmptyMessage.ParseFrom(f.ToByteArray()); - CheckNotEqual(eUnknownFields, fUnknownFields); - CheckEqualsIsConsistent(eUnknownFields); - CheckEqualsIsConsistent(fUnknownFields); - - // Subseqent reconstitutions should be identical - TestEmptyMessage eUnknownFields2 = TestEmptyMessage.ParseFrom(e.ToByteArray()); - CheckEqualsIsConsistent(eUnknownFields, eUnknownFields2); - } - - /// - /// Asserts that the given protos are equal and have the same hash code. - /// - private static void CheckEqualsIsConsistent(IMessage message) - { - // Object should be equal to itself. - Assert.AreEqual(message, message); - - // Object should be equal to a dynamic copy of itself. - DynamicMessage dynamic = DynamicMessage.CreateBuilder(message).Build(); - CheckEqualsIsConsistent(message, dynamic); - } - - /// - /// Asserts that the given protos are equal and have the same hash code. - /// - private static void CheckEqualsIsConsistent(IMessage message1, IMessage message2) - { - Assert.AreEqual(message1, message2); - Assert.AreEqual(message2, message1); - Assert.AreEqual(message2.GetHashCode(), message1.GetHashCode()); - } - - /// - /// Asserts that the given protos are not equal and have different hash codes. - /// - /// - /// It's valid for non-equal objects to have the same hash code, so - /// this test is stricter than it needs to be. However, this should happen - /// relatively rarely. (If this test fails, it's probably still due to a bug.) - /// - private static void CheckNotEqual(IMessage m1, IMessage m2) - { - String equalsError = string.Format("{0} should not be equal to {1}", m1, m2); - Assert.IsFalse(m1.Equals(m2), equalsError); - Assert.IsFalse(m2.Equals(m1), equalsError); - - Assert.IsFalse(m1.GetHashCode() == m2.GetHashCode(), - string.Format("{0} should have a different hash code from {1}", m1, m2)); - } - - /// - /// Extends AbstractMessage and wraps some other message object. The methods - /// of the Message interface which aren't explicitly implemented by - /// AbstractMessage are forwarded to the wrapped object. This allows us to - /// test that AbstractMessage's implementations work even if the wrapped - /// object does not use them. - /// - private class AbstractMessageWrapper : AbstractMessage - { - private readonly IMessage wrappedMessage; - - public IMessage WrappedMessage - { - get { return wrappedMessage; } - } - - public AbstractMessageWrapper(IMessage wrappedMessage) - { - this.wrappedMessage = wrappedMessage; - } - - public override MessageDescriptor DescriptorForType - { - get { return wrappedMessage.DescriptorForType; } - } - - public override AbstractMessageWrapper DefaultInstanceForType - { - get { return new AbstractMessageWrapper(wrappedMessage.WeakDefaultInstanceForType); } - } - - public override IDictionary AllFields - { - get { return wrappedMessage.AllFields; } - } - - public override bool HasField(FieldDescriptor field) - { - return wrappedMessage.HasField(field); - } - - public override object this[FieldDescriptor field] - { - get { return wrappedMessage[field]; } - } - - public override object this[FieldDescriptor field, int index] - { - get { return wrappedMessage[field, index]; } - } - - public override int GetRepeatedFieldCount(FieldDescriptor field) - { - return wrappedMessage.GetRepeatedFieldCount(field); - } - - public override UnknownFieldSet UnknownFields - { - get { return wrappedMessage.UnknownFields; } - } - - public override Builder CreateBuilderForType() - { - return new Builder(wrappedMessage.WeakCreateBuilderForType()); - } - - public override Builder ToBuilder() - { - return new Builder(wrappedMessage.WeakToBuilder()); - } - - internal class Builder : AbstractBuilder - { - private readonly IBuilder wrappedBuilder; - - protected override Builder ThisBuilder - { - get { return this; } - } - - internal Builder(IBuilder wrappedBuilder) - { - this.wrappedBuilder = wrappedBuilder; - } - - public override Builder MergeFrom(AbstractMessageWrapper other) - { - wrappedBuilder.WeakMergeFrom(other.wrappedMessage); - return this; - } - - public override bool IsInitialized - { - get { return wrappedBuilder.IsInitialized; } - } - - public override IDictionary AllFields - { - get { return wrappedBuilder.AllFields; } - } - - public override object this[FieldDescriptor field] - { - get { return wrappedBuilder[field]; } - set { wrappedBuilder[field] = value; } - } - - public override MessageDescriptor DescriptorForType - { - get { return wrappedBuilder.DescriptorForType; } - } - - public override int GetRepeatedFieldCount(FieldDescriptor field) - { - return wrappedBuilder.GetRepeatedFieldCount(field); - } - - public override object this[FieldDescriptor field, int index] - { - get { return wrappedBuilder[field, index]; } - set { wrappedBuilder[field, index] = value; } - } - - public override bool HasField(FieldDescriptor field) - { - return wrappedBuilder.HasField(field); - } - - public override UnknownFieldSet UnknownFields - { - get { return wrappedBuilder.UnknownFields; } - set { wrappedBuilder.UnknownFields = value; } - } - - public override AbstractMessageWrapper Build() - { - return new AbstractMessageWrapper(wrappedBuilder.WeakBuild()); - } - - public override AbstractMessageWrapper BuildPartial() - { - return new AbstractMessageWrapper(wrappedBuilder.WeakBuildPartial()); - } - - public override Builder Clone() - { - return new Builder(wrappedBuilder.WeakClone()); - } - - public override AbstractMessageWrapper DefaultInstanceForType - { - get { return new AbstractMessageWrapper(wrappedBuilder.WeakDefaultInstanceForType); } - } - - public override Builder ClearField(FieldDescriptor field) - { - wrappedBuilder.WeakClearField(field); - return this; - } - - public override Builder AddRepeatedField(FieldDescriptor field, object value) - { - wrappedBuilder.WeakAddRepeatedField(field, value); - return this; - } - - public override IBuilder CreateBuilderForField(FieldDescriptor field) - { - wrappedBuilder.CreateBuilderForField(field); - return this; - } - - public override Builder MergeFrom(IMessage other) - { - wrappedBuilder.WeakMergeFrom(other); - return this; - } - - public override Builder MergeFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry) - { - wrappedBuilder.WeakMergeFrom(input, extensionRegistry); - return this; - } - } - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/App.xaml b/src/ProtocolBuffers.Test/App.xaml deleted file mode 100644 index d4f1f2e..0000000 --- a/src/ProtocolBuffers.Test/App.xaml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - diff --git a/src/ProtocolBuffers.Test/App.xaml.cs b/src/ProtocolBuffers.Test/App.xaml.cs deleted file mode 100644 index 0c9fd9e..0000000 --- a/src/ProtocolBuffers.Test/App.xaml.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using System.Windows; -using Microsoft.Silverlight.Testing; - -namespace Google.ProtocolBuffers -{ - public partial class App : Application - { - - public App() - { - this.Startup += this.Application_Startup; - this.Exit += this.Application_Exit; - this.UnhandledException += this.Application_UnhandledException; - - //InitializeComponent(); - } - - private void Application_Startup(object sender, StartupEventArgs e) - { - this.RootVisual = UnitTestSystem.CreateTestPage(); - } - - private void Application_Exit(object sender, EventArgs e) - { - - } - private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) - { - // If the app is running outside of the debugger then report the exception using - // the browser's exception mechanism. On IE this will display it a yellow alert - // icon in the status bar and Firefox will display a script error. - if (!System.Diagnostics.Debugger.IsAttached) - { - - // NOTE: This will allow the application to continue running after an exception has been thrown - // but not handled. - // For production applications this error handling should be replaced with something that will - // report the error to the website and stop the application. - e.Handled = true; - Deployment.Current.Dispatcher.BeginInvoke( - new EventHandler(ReportErrorToDOM), - new object[] { sender, e } ); - } - } - private void ReportErrorToDOM(object sender, ApplicationUnhandledExceptionEventArgs e) - { - try - { - string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace; - errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n"); - - System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight 2 Application " + errorMsg + "\");"); - } - catch (Exception) - { - } - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/ByteStringTest.cs b/src/ProtocolBuffers.Test/ByteStringTest.cs deleted file mode 100644 index 003307a..0000000 --- a/src/ProtocolBuffers.Test/ByteStringTest.cs +++ /dev/null @@ -1,148 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Text; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers -{ - [TestClass] - public class ByteStringTest - { - [TestMethod] - public void EmptyByteStringHasZeroSize() - { - Assert.AreEqual(0, ByteString.Empty.Length); - } - - [TestMethod] - public void CopyFromStringWithExplicitEncoding() - { - ByteString bs = ByteString.CopyFrom("AB", Encoding.Unicode); - Assert.AreEqual(4, bs.Length); - Assert.AreEqual(65, bs[0]); - Assert.AreEqual(0, bs[1]); - Assert.AreEqual(66, bs[2]); - Assert.AreEqual(0, bs[3]); - } - - [TestMethod] - public void IsEmptyWhenEmpty() - { - Assert.IsTrue(ByteString.CopyFromUtf8("").IsEmpty); - } - - [TestMethod] - public void IsEmptyWhenNotEmpty() - { - Assert.IsFalse(ByteString.CopyFromUtf8("X").IsEmpty); - } - - [TestMethod] - public void CopyFromByteArrayCopiesContents() - { - byte[] data = new byte[1]; - data[0] = 10; - ByteString bs = ByteString.CopyFrom(data); - Assert.AreEqual(10, bs[0]); - data[0] = 5; - Assert.AreEqual(10, bs[0]); - } - - [TestMethod] - public void ToByteArrayCopiesContents() - { - ByteString bs = ByteString.CopyFromUtf8("Hello"); - byte[] data = bs.ToByteArray(); - Assert.AreEqual((byte)'H', data[0]); - Assert.AreEqual((byte)'H', bs[0]); - data[0] = 0; - Assert.AreEqual(0, data[0]); - Assert.AreEqual((byte)'H', bs[0]); - } - - [TestMethod] - public void CopyFromUtf8UsesUtf8() - { - ByteString bs = ByteString.CopyFromUtf8("\u20ac"); - Assert.AreEqual(3, bs.Length); - Assert.AreEqual(0xe2, bs[0]); - Assert.AreEqual(0x82, bs[1]); - Assert.AreEqual(0xac, bs[2]); - } - - [TestMethod] - public void CopyFromPortion() - { - byte[] data = new byte[] {0, 1, 2, 3, 4, 5, 6}; - ByteString bs = ByteString.CopyFrom(data, 2, 3); - Assert.AreEqual(3, bs.Length); - Assert.AreEqual(2, bs[0]); - Assert.AreEqual(3, bs[1]); - } - - [TestMethod] - public void ToStringUtf8() - { - ByteString bs = ByteString.CopyFromUtf8("\u20ac"); - Assert.AreEqual("\u20ac", bs.ToStringUtf8()); - } - - [TestMethod] - public void ToStringWithExplicitEncoding() - { - ByteString bs = ByteString.CopyFrom("\u20ac", Encoding.Unicode); - Assert.AreEqual("\u20ac", bs.ToString(Encoding.Unicode)); - } - - [TestMethod] - public void FromBase64_WithText() - { - byte[] data = new byte[] {0, 1, 2, 3, 4, 5, 6}; - string base64 = Convert.ToBase64String(data); - ByteString bs = ByteString.FromBase64(base64); - TestUtil.AssertBytesEqual(data, bs.ToByteArray()); - } - - [TestMethod] - public void FromBase64_Empty() - { - // Optimization which also fixes issue 61. - Assert.AreSame(ByteString.Empty, ByteString.FromBase64("")); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/CSharpOptionsTest.cs b/src/ProtocolBuffers.Test/CSharpOptionsTest.cs deleted file mode 100644 index 752d9a0..0000000 --- a/src/ProtocolBuffers.Test/CSharpOptionsTest.cs +++ /dev/null @@ -1,127 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using Google.ProtocolBuffers.DescriptorProtos; -using Google.ProtocolBuffers.Descriptors; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers -{ - [TestClass] - public class DescriptorUtilTest - { - [TestMethod] - public void ExplicitNamespace() - { - FileDescriptorProto proto = new FileDescriptorProto.Builder - { - Name = "x", - Package = "pack", - Options = - new FileOptions.Builder().SetExtension( - CSharpOptions.CSharpFileOptions, - new CSharpFileOptions.Builder {Namespace = "Foo.Bar"}.Build()). - Build() - }.Build(); - FileDescriptor descriptor = FileDescriptor.BuildFrom(proto, null); - Assert.AreEqual("Foo.Bar", descriptor.CSharpOptions.Namespace); - } - - [TestMethod] - public void NoNamespaceFallsBackToPackage() - { - FileDescriptorProto proto = new FileDescriptorProto.Builder {Name = "x", Package = "pack"}.Build(); - FileDescriptor descriptor = FileDescriptor.BuildFrom(proto, null); - Assert.AreEqual("pack", descriptor.CSharpOptions.Namespace); - } - - [TestMethod] - public void NoNamespaceOrPackageFallsBackToEmptyString() - { - FileDescriptorProto proto = new FileDescriptorProto.Builder {Name = "x"}.Build(); - FileDescriptor descriptor = FileDescriptor.BuildFrom(proto, null); - Assert.AreEqual("", descriptor.CSharpOptions.Namespace); - } - - [TestMethod] - public void ExplicitlyNamedFileClass() - { - FileDescriptorProto proto = new FileDescriptorProto.Builder - { - Name = "x", - Options = - new FileOptions.Builder().SetExtension( - CSharpOptions.CSharpFileOptions, - new CSharpFileOptions.Builder {UmbrellaClassname = "Foo"}.Build()) - .Build() - }.Build(); - FileDescriptor descriptor = FileDescriptor.BuildFrom(proto, null); - Assert.AreEqual("Foo", descriptor.CSharpOptions.UmbrellaClassname); - } - - [TestMethod] - public void ImplicitFileClassWithProtoSuffix() - { - FileDescriptorProto proto = new FileDescriptorProto.Builder {Name = "foo_bar.proto"}.Build(); - FileDescriptor descriptor = FileDescriptor.BuildFrom(proto, null); - Assert.AreEqual("FooBar", descriptor.CSharpOptions.UmbrellaClassname); - } - - [TestMethod] - public void ImplicitFileClassWithProtoDevelSuffix() - { - FileDescriptorProto proto = new FileDescriptorProto.Builder {Name = "foo_bar.protodevel"}.Build(); - FileDescriptor descriptor = FileDescriptor.BuildFrom(proto, null); - Assert.AreEqual("FooBar", descriptor.CSharpOptions.UmbrellaClassname); - } - - [TestMethod] - public void ImplicitFileClassWithNoSuffix() - { - FileDescriptorProto proto = new FileDescriptorProto.Builder {Name = "foo_bar"}.Build(); - FileDescriptor descriptor = FileDescriptor.BuildFrom(proto, null); - Assert.AreEqual("FooBar", descriptor.CSharpOptions.UmbrellaClassname); - } - - [TestMethod] - public void ImplicitFileClassWithDirectoryStructure() - { - FileDescriptorProto proto = new FileDescriptorProto.Builder {Name = "x/y/foo_bar"}.Build(); - FileDescriptor descriptor = FileDescriptor.BuildFrom(proto, null); - Assert.AreEqual("FooBar", descriptor.CSharpOptions.UmbrellaClassname); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/CodedInputStreamTest.cs b/src/ProtocolBuffers.Test/CodedInputStreamTest.cs deleted file mode 100644 index b09d334..0000000 --- a/src/ProtocolBuffers.Test/CodedInputStreamTest.cs +++ /dev/null @@ -1,639 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using System.IO; -using Google.ProtocolBuffers.Descriptors; -using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.Diagnostics; - -namespace Google.ProtocolBuffers -{ - [TestClass] - public class CodedInputStreamTest - { - /// - /// Helper to construct a byte array from a bunch of bytes. The inputs are - /// actually ints so that I can use hex notation and not get stupid errors - /// about precision. - /// - private static byte[] Bytes(params int[] bytesAsInts) - { - byte[] bytes = new byte[bytesAsInts.Length]; - for (int i = 0; i < bytesAsInts.Length; i++) - { - bytes[i] = (byte) bytesAsInts[i]; - } - return bytes; - } - - /// - /// Parses the given bytes using ReadRawVarint32() and ReadRawVarint64() and - /// - private static void AssertReadVarint(byte[] data, ulong value) - { - CodedInputStream input = CodedInputStream.CreateInstance(data); - Assert.AreEqual((uint) value, input.ReadRawVarint32()); - - input = CodedInputStream.CreateInstance(data); - Assert.AreEqual(value, input.ReadRawVarint64()); - Assert.IsTrue(input.IsAtEnd); - - // Try different block sizes. - for (int bufferSize = 1; bufferSize <= 16; bufferSize *= 2) - { - input = CodedInputStream.CreateInstance(new SmallBlockInputStream(data, bufferSize)); - Assert.AreEqual((uint) value, input.ReadRawVarint32()); - - input = CodedInputStream.CreateInstance(new SmallBlockInputStream(data, bufferSize)); - Assert.AreEqual(value, input.ReadRawVarint64()); - Assert.IsTrue(input.IsAtEnd); - } - - // Try reading directly from a MemoryStream. We want to verify that it - // doesn't read past the end of the input, so write an extra byte - this - // lets us test the position at the end. - MemoryStream memoryStream = new MemoryStream(); - memoryStream.Write(data, 0, data.Length); - memoryStream.WriteByte(0); - memoryStream.Position = 0; - Assert.AreEqual((uint) value, CodedInputStream.ReadRawVarint32(memoryStream)); - Assert.AreEqual(data.Length, memoryStream.Position); - } - - /// - /// Parses the given bytes using ReadRawVarint32() and ReadRawVarint64() and - /// expects them to fail with an InvalidProtocolBufferException whose - /// description matches the given one. - /// - private static void AssertReadVarintFailure(InvalidProtocolBufferException expected, byte[] data) - { - CodedInputStream input = CodedInputStream.CreateInstance(data); - try - { - input.ReadRawVarint32(); - Assert.Fail("Should have thrown an exception."); - } - catch (InvalidProtocolBufferException e) - { - Assert.AreEqual(expected.Message, e.Message); - } - - input = CodedInputStream.CreateInstance(data); - try - { - input.ReadRawVarint64(); - Assert.Fail("Should have thrown an exception."); - } - catch (InvalidProtocolBufferException e) - { - Assert.AreEqual(expected.Message, e.Message); - } - - // Make sure we get the same error when reading directly from a Stream. - try - { - CodedInputStream.ReadRawVarint32(new MemoryStream(data)); - Assert.Fail("Should have thrown an exception."); - } - catch (InvalidProtocolBufferException e) - { - Assert.AreEqual(expected.Message, e.Message); - } - } - - [TestMethod] - public void ReadVarint() - { - AssertReadVarint(Bytes(0x00), 0); - AssertReadVarint(Bytes(0x01), 1); - AssertReadVarint(Bytes(0x7f), 127); - // 14882 - AssertReadVarint(Bytes(0xa2, 0x74), (0x22 << 0) | (0x74 << 7)); - // 2961488830 - AssertReadVarint(Bytes(0xbe, 0xf7, 0x92, 0x84, 0x0b), - (0x3e << 0) | (0x77 << 7) | (0x12 << 14) | (0x04 << 21) | - (0x0bL << 28)); - - // 64-bit - // 7256456126 - AssertReadVarint(Bytes(0xbe, 0xf7, 0x92, 0x84, 0x1b), - (0x3e << 0) | (0x77 << 7) | (0x12 << 14) | (0x04 << 21) | - (0x1bL << 28)); - // 41256202580718336 - AssertReadVarint(Bytes(0x80, 0xe6, 0xeb, 0x9c, 0xc3, 0xc9, 0xa4, 0x49), - (0x00 << 0) | (0x66 << 7) | (0x6b << 14) | (0x1c << 21) | - (0x43L << 28) | (0x49L << 35) | (0x24L << 42) | (0x49L << 49)); - // 11964378330978735131 - AssertReadVarint(Bytes(0x9b, 0xa8, 0xf9, 0xc2, 0xbb, 0xd6, 0x80, 0x85, 0xa6, 0x01), - (0x1b << 0) | (0x28 << 7) | (0x79 << 14) | (0x42 << 21) | - (0x3bUL << 28) | (0x56UL << 35) | (0x00UL << 42) | - (0x05UL << 49) | (0x26UL << 56) | (0x01UL << 63)); - - // Failures - AssertReadVarintFailure( - InvalidProtocolBufferException.MalformedVarint(), - Bytes(0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x00)); - AssertReadVarintFailure( - InvalidProtocolBufferException.TruncatedMessage(), - Bytes(0x80)); - } - - /// - /// Parses the given bytes using ReadRawLittleEndian32() and checks - /// that the result matches the given value. - /// - private static void AssertReadLittleEndian32(byte[] data, uint value) - { - CodedInputStream input = CodedInputStream.CreateInstance(data); - Assert.AreEqual(value, input.ReadRawLittleEndian32()); - Assert.IsTrue(input.IsAtEnd); - - // Try different block sizes. - for (int blockSize = 1; blockSize <= 16; blockSize *= 2) - { - input = CodedInputStream.CreateInstance( - new SmallBlockInputStream(data, blockSize)); - Assert.AreEqual(value, input.ReadRawLittleEndian32()); - Assert.IsTrue(input.IsAtEnd); - } - } - - /// - /// Parses the given bytes using ReadRawLittleEndian64() and checks - /// that the result matches the given value. - /// - private static void AssertReadLittleEndian64(byte[] data, ulong value) - { - CodedInputStream input = CodedInputStream.CreateInstance(data); - Assert.AreEqual(value, input.ReadRawLittleEndian64()); - Assert.IsTrue(input.IsAtEnd); - - // Try different block sizes. - for (int blockSize = 1; blockSize <= 16; blockSize *= 2) - { - input = CodedInputStream.CreateInstance( - new SmallBlockInputStream(data, blockSize)); - Assert.AreEqual(value, input.ReadRawLittleEndian64()); - Assert.IsTrue(input.IsAtEnd); - } - } - - [TestMethod] - public void ReadLittleEndian() - { - AssertReadLittleEndian32(Bytes(0x78, 0x56, 0x34, 0x12), 0x12345678); - AssertReadLittleEndian32(Bytes(0xf0, 0xde, 0xbc, 0x9a), 0x9abcdef0); - - AssertReadLittleEndian64(Bytes(0xf0, 0xde, 0xbc, 0x9a, 0x78, 0x56, 0x34, 0x12), - 0x123456789abcdef0L); - AssertReadLittleEndian64( - Bytes(0x78, 0x56, 0x34, 0x12, 0xf0, 0xde, 0xbc, 0x9a), 0x9abcdef012345678UL); - } - - [TestMethod] - public void DecodeZigZag32() - { - Assert.AreEqual(0, CodedInputStream.DecodeZigZag32(0)); - Assert.AreEqual(-1, CodedInputStream.DecodeZigZag32(1)); - Assert.AreEqual(1, CodedInputStream.DecodeZigZag32(2)); - Assert.AreEqual(-2, CodedInputStream.DecodeZigZag32(3)); - Assert.AreEqual(0x3FFFFFFF, CodedInputStream.DecodeZigZag32(0x7FFFFFFE)); - Assert.AreEqual(unchecked((int) 0xC0000000), CodedInputStream.DecodeZigZag32(0x7FFFFFFF)); - Assert.AreEqual(0x7FFFFFFF, CodedInputStream.DecodeZigZag32(0xFFFFFFFE)); - Assert.AreEqual(unchecked((int) 0x80000000), CodedInputStream.DecodeZigZag32(0xFFFFFFFF)); - } - - [TestMethod] - public void DecodeZigZag64() - { - Assert.AreEqual(0, CodedInputStream.DecodeZigZag64(0)); - Assert.AreEqual(-1, CodedInputStream.DecodeZigZag64(1)); - Assert.AreEqual(1, CodedInputStream.DecodeZigZag64(2)); - Assert.AreEqual(-2, CodedInputStream.DecodeZigZag64(3)); - Assert.AreEqual(0x000000003FFFFFFFL, CodedInputStream.DecodeZigZag64(0x000000007FFFFFFEL)); - Assert.AreEqual(unchecked((long) 0xFFFFFFFFC0000000L), CodedInputStream.DecodeZigZag64(0x000000007FFFFFFFL)); - Assert.AreEqual(0x000000007FFFFFFFL, CodedInputStream.DecodeZigZag64(0x00000000FFFFFFFEL)); - Assert.AreEqual(unchecked((long) 0xFFFFFFFF80000000L), CodedInputStream.DecodeZigZag64(0x00000000FFFFFFFFL)); - Assert.AreEqual(0x7FFFFFFFFFFFFFFFL, CodedInputStream.DecodeZigZag64(0xFFFFFFFFFFFFFFFEL)); - Assert.AreEqual(unchecked((long) 0x8000000000000000L), CodedInputStream.DecodeZigZag64(0xFFFFFFFFFFFFFFFFL)); - } - - [TestMethod] - public void ReadWholeMessage() - { - TestAllTypes message = TestUtil.GetAllSet(); - - byte[] rawBytes = message.ToByteArray(); - Assert.AreEqual(rawBytes.Length, message.SerializedSize); - TestAllTypes message2 = TestAllTypes.ParseFrom(rawBytes); - TestUtil.AssertAllFieldsSet(message2); - - // Try different block sizes. - for (int blockSize = 1; blockSize < 256; blockSize *= 2) - { - message2 = TestAllTypes.ParseFrom(new SmallBlockInputStream(rawBytes, blockSize)); - TestUtil.AssertAllFieldsSet(message2); - } - } - - [TestMethod] - public void SkipWholeMessage() - { - TestAllTypes message = TestUtil.GetAllSet(); - byte[] rawBytes = message.ToByteArray(); - - // Create two parallel inputs. Parse one as unknown fields while using - // skipField() to skip each field on the other. Expect the same tags. - CodedInputStream input1 = CodedInputStream.CreateInstance(rawBytes); - CodedInputStream input2 = CodedInputStream.CreateInstance(rawBytes); - UnknownFieldSet.Builder unknownFields = UnknownFieldSet.CreateBuilder(); - - uint tag; - string name; - while (input1.ReadTag(out tag, out name)) - { - uint tag2; - Assert.IsTrue(input2.ReadTag(out tag2, out name)); - Assert.AreEqual(tag, tag2); - - unknownFields.MergeFieldFrom(tag, input1); - input2.SkipField(); - } - } - - /// - /// Test that a bug in SkipRawBytes has been fixed: if the skip - /// skips exactly up to a limit, this should bnot break things - /// - [TestMethod] - public void SkipRawBytesBug() - { - byte[] rawBytes = new byte[] {1, 2}; - CodedInputStream input = CodedInputStream.CreateInstance(rawBytes); - - int limit = input.PushLimit(1); - input.SkipRawBytes(1); - input.PopLimit(limit); - Assert.AreEqual(2, input.ReadRawByte()); - } - - public void ReadHugeBlob() - { - // Allocate and initialize a 1MB blob. - byte[] blob = new byte[1 << 20]; - for (int i = 0; i < blob.Length; i++) - { - blob[i] = (byte) i; - } - - // Make a message containing it. - TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); - TestUtil.SetAllFields(builder); - builder.SetOptionalBytes(ByteString.CopyFrom(blob)); - TestAllTypes message = builder.Build(); - - // Serialize and parse it. Make sure to parse from an InputStream, not - // directly from a ByteString, so that CodedInputStream uses buffered - // reading. - TestAllTypes message2 = TestAllTypes.ParseFrom(message.ToByteString().CreateCodedInput()); - - Assert.AreEqual(message.OptionalBytes, message2.OptionalBytes); - - // Make sure all the other fields were parsed correctly. - TestAllTypes message3 = TestAllTypes.CreateBuilder(message2) - .SetOptionalBytes(TestUtil.GetAllSet().OptionalBytes) - .Build(); - TestUtil.AssertAllFieldsSet(message3); - } - - [TestMethod] - public void ReadMaliciouslyLargeBlob() - { - MemoryStream ms = new MemoryStream(); - CodedOutputStream output = CodedOutputStream.CreateInstance(ms); - - uint tag = WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited); - output.WriteRawVarint32(tag); - output.WriteRawVarint32(0x7FFFFFFF); - output.WriteRawBytes(new byte[32]); // Pad with a few random bytes. - output.Flush(); - ms.Position = 0; - - CodedInputStream input = CodedInputStream.CreateInstance(ms); - uint testtag; - string ignore; - Assert.IsTrue(input.ReadTag(out testtag, out ignore)); - Assert.AreEqual(tag, testtag); - - try - { - ByteString bytes = null; - input.ReadBytes(ref bytes); - Assert.Fail("Should have thrown an exception!"); - } - catch (InvalidProtocolBufferException) - { - // success. - } - } - - private static TestRecursiveMessage MakeRecursiveMessage(int depth) - { - if (depth == 0) - { - return TestRecursiveMessage.CreateBuilder().SetI(5).Build(); - } - else - { - return TestRecursiveMessage.CreateBuilder() - .SetA(MakeRecursiveMessage(depth - 1)).Build(); - } - } - - private static void AssertMessageDepth(TestRecursiveMessage message, int depth) - { - if (depth == 0) - { - Assert.IsFalse(message.HasA); - Assert.AreEqual(5, message.I); - } - else - { - Assert.IsTrue(message.HasA); - AssertMessageDepth(message.A, depth - 1); - } - } - - [TestMethod] - public void MaliciousRecursion() - { - ByteString data64 = MakeRecursiveMessage(64).ToByteString(); - ByteString data65 = MakeRecursiveMessage(65).ToByteString(); - - AssertMessageDepth(TestRecursiveMessage.ParseFrom(data64), 64); - - try - { - TestRecursiveMessage.ParseFrom(data65); - Assert.Fail("Should have thrown an exception!"); - } - catch (InvalidProtocolBufferException) - { - // success. - } - - CodedInputStream input = data64.CreateCodedInput(); - input.SetRecursionLimit(8); - try - { - TestRecursiveMessage.ParseFrom(input); - Assert.Fail("Should have thrown an exception!"); - } - catch (InvalidProtocolBufferException) - { - // success. - } - } - - [TestMethod] - public void SizeLimit() - { - // Have to use a Stream rather than ByteString.CreateCodedInput as SizeLimit doesn't - // apply to the latter case. - MemoryStream ms = new MemoryStream(TestUtil.GetAllSet().ToByteString().ToByteArray()); - CodedInputStream input = CodedInputStream.CreateInstance(ms); - input.SetSizeLimit(16); - - try - { - TestAllTypes.ParseFrom(input); - Assert.Fail("Should have thrown an exception!"); - } - catch (InvalidProtocolBufferException) - { - // success. - } - } - - [TestMethod] - public void ResetSizeCounter() - { - CodedInputStream input = CodedInputStream.CreateInstance( - new SmallBlockInputStream(new byte[256], 8)); - input.SetSizeLimit(16); - input.ReadRawBytes(16); - - try - { - input.ReadRawByte(); - Assert.Fail("Should have thrown an exception!"); - } - catch (InvalidProtocolBufferException) - { - // Success. - } - - input.ResetSizeCounter(); - input.ReadRawByte(); // No exception thrown. - - try - { - input.ReadRawBytes(16); // Hits limit again. - Assert.Fail("Should have thrown an exception!"); - } - catch (InvalidProtocolBufferException) - { - // Success. - } - } - - /// - /// Tests that if we read an string that contains invalid UTF-8, no exception - /// is thrown. Instead, the invalid bytes are replaced with the Unicode - /// "replacement character" U+FFFD. - /// - [TestMethod] - public void ReadInvalidUtf8() - { - MemoryStream ms = new MemoryStream(); - CodedOutputStream output = CodedOutputStream.CreateInstance(ms); - - uint tag = WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited); - output.WriteRawVarint32(tag); - output.WriteRawVarint32(1); - output.WriteRawBytes(new byte[] {0x80}); - output.Flush(); - ms.Position = 0; - - CodedInputStream input = CodedInputStream.CreateInstance(ms); - - uint testtag; - string ignored; - - Assert.IsTrue(input.ReadTag(out testtag, out ignored)); - Assert.AreEqual(tag, testtag); - string text = null; - input.ReadString(ref text); - Assert.AreEqual('\ufffd', text[0]); - } - - /// - /// A stream which limits the number of bytes it reads at a time. - /// We use this to make sure that CodedInputStream doesn't screw up when - /// reading in small blocks. - /// - private sealed class SmallBlockInputStream : MemoryStream - { - private readonly int blockSize; - - public SmallBlockInputStream(byte[] data, int blockSize) - : base(data) - { - this.blockSize = blockSize; - } - - public override int Read(byte[] buffer, int offset, int count) - { - return base.Read(buffer, offset, Math.Min(count, blockSize)); - } - } - - enum TestNegEnum { None = 0, Value = -2 } - - [TestMethod] - public void TestNegativeEnum() - { - byte[] bytes = new byte[10] { 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01 }; - CodedInputStream input = CodedInputStream.CreateInstance(bytes); - object unk; - TestNegEnum val = TestNegEnum.None; - - Assert.IsTrue(input.ReadEnum(ref val, out unk)); - Assert.IsTrue(input.IsAtEnd); - Assert.AreEqual(TestNegEnum.Value, val); - } - - [TestMethod] - public void TestNegativeEnumPackedArray() - { - int arraySize = 1 + (10 * 5); - int msgSize = 1 + 1 + arraySize; - byte[] bytes = new byte[msgSize]; - CodedOutputStream output = CodedOutputStream.CreateInstance(bytes); - output.WritePackedInt32Array(8, "", arraySize, new int[] { 0, -1, -2, -3, -4, -5 }); - - Assert.AreEqual(0, output.SpaceLeft); - - CodedInputStream input = CodedInputStream.CreateInstance(bytes); - uint tag; - string name; - Assert.IsTrue(input.ReadTag(out tag, out name)); - - List values = new List(); - ICollection unk; - input.ReadEnumArray(tag, name, values, out unk); - - Assert.AreEqual(2, values.Count); - Assert.AreEqual(TestNegEnum.None, values[0]); - Assert.AreEqual(TestNegEnum.Value, values[1]); - - Assert.IsNotNull(unk); - Assert.AreEqual(4, unk.Count); - } - - [TestMethod] - public void TestNegativeEnumArray() - { - int arraySize = 1 + 1 + (11 * 5); - int msgSize = arraySize; - byte[] bytes = new byte[msgSize]; - CodedOutputStream output = CodedOutputStream.CreateInstance(bytes); - output.WriteInt32Array(8, "", new int[] { 0, -1, -2, -3, -4, -5 }); - - Assert.AreEqual(0, output.SpaceLeft); - - CodedInputStream input = CodedInputStream.CreateInstance(bytes); - uint tag; - string name; - Assert.IsTrue(input.ReadTag(out tag, out name)); - - List values = new List(); - ICollection unk; - input.ReadEnumArray(tag, name, values, out unk); - - Assert.AreEqual(2, values.Count); - Assert.AreEqual(TestNegEnum.None, values[0]); - Assert.AreEqual(TestNegEnum.Value, values[1]); - - Assert.IsNotNull(unk); - Assert.AreEqual(4, unk.Count); - } - - //Issue 71: CodedInputStream.ReadBytes go to slow path unnecessarily - [TestMethod] - public void TestSlowPathAvoidance() - { - using (var ms = new MemoryStream()) - { - CodedOutputStream output = CodedOutputStream.CreateInstance(ms); - output.WriteField(FieldType.Bytes, 1, "bytes", ByteString.CopyFrom(new byte[100])); - output.WriteField(FieldType.Bytes, 2, "bytes", ByteString.CopyFrom(new byte[100])); - output.Flush(); - - ms.Position = 0; - CodedInputStream input = CodedInputStream.CreateInstance(ms, new byte[ms.Length / 2]); - - uint tag; - string ignore; - ByteString value; - - Assert.IsTrue(input.ReadTag(out tag, out ignore)); - Assert.AreEqual(1, WireFormat.GetTagFieldNumber(tag)); - value = ByteString.Empty; - Assert.IsTrue(input.ReadBytes(ref value) && value.Length == 100); - - Assert.IsTrue(input.ReadTag(out tag, out ignore)); - Assert.AreEqual(2, WireFormat.GetTagFieldNumber(tag)); - value = ByteString.Empty; - Assert.IsTrue(input.ReadBytes(ref value) && value.Length == 100); - } - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/CodedOutputStreamTest.cs b/src/ProtocolBuffers.Test/CodedOutputStreamTest.cs deleted file mode 100644 index 8e4e909..0000000 --- a/src/ProtocolBuffers.Test/CodedOutputStreamTest.cs +++ /dev/null @@ -1,472 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using System.IO; -using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers -{ - [TestClass] - public class CodedOutputStreamTest - { - /// - /// Writes the given value using WriteRawVarint32() and WriteRawVarint64() and - /// checks that the result matches the given bytes - /// - private static void AssertWriteVarint(byte[] data, ulong value) - { - // Only do 32-bit write if the value fits in 32 bits. - if ((value >> 32) == 0) - { - MemoryStream rawOutput = new MemoryStream(); - CodedOutputStream output = CodedOutputStream.CreateInstance(rawOutput); - output.WriteRawVarint32((uint) value); - output.Flush(); - TestUtil.AssertBytesEqual(data, rawOutput.ToArray()); - // Also try computing size. - Assert.AreEqual(data.Length, CodedOutputStream.ComputeRawVarint32Size((uint) value)); - } - - { - MemoryStream rawOutput = new MemoryStream(); - CodedOutputStream output = CodedOutputStream.CreateInstance(rawOutput); - output.WriteRawVarint64(value); - output.Flush(); - TestUtil.AssertBytesEqual(data, rawOutput.ToArray()); - - // Also try computing size. - Assert.AreEqual(data.Length, CodedOutputStream.ComputeRawVarint64Size(value)); - } - - // Try different buffer sizes. - for (int bufferSize = 1; bufferSize <= 16; bufferSize *= 2) - { - // Only do 32-bit write if the value fits in 32 bits. - if ((value >> 32) == 0) - { - MemoryStream rawOutput = new MemoryStream(); - CodedOutputStream output = - CodedOutputStream.CreateInstance(rawOutput, bufferSize); - output.WriteRawVarint32((uint) value); - output.Flush(); - TestUtil.AssertBytesEqual(data, rawOutput.ToArray()); - } - - { - MemoryStream rawOutput = new MemoryStream(); - CodedOutputStream output = CodedOutputStream.CreateInstance(rawOutput, bufferSize); - output.WriteRawVarint64(value); - output.Flush(); - TestUtil.AssertBytesEqual(data, rawOutput.ToArray()); - } - } - } - - /// - /// Tests WriteRawVarint32() and WriteRawVarint64() - /// - [TestMethod] - public void WriteVarint() - { - AssertWriteVarint(new byte[] {0x00}, 0); - AssertWriteVarint(new byte[] {0x01}, 1); - AssertWriteVarint(new byte[] {0x7f}, 127); - // 14882 - AssertWriteVarint(new byte[] {0xa2, 0x74}, (0x22 << 0) | (0x74 << 7)); - // 2961488830 - AssertWriteVarint(new byte[] {0xbe, 0xf7, 0x92, 0x84, 0x0b}, - (0x3e << 0) | (0x77 << 7) | (0x12 << 14) | (0x04 << 21) | - (0x0bL << 28)); - - // 64-bit - // 7256456126 - AssertWriteVarint(new byte[] {0xbe, 0xf7, 0x92, 0x84, 0x1b}, - (0x3e << 0) | (0x77 << 7) | (0x12 << 14) | (0x04 << 21) | - (0x1bL << 28)); - // 41256202580718336 - AssertWriteVarint( - new byte[] {0x80, 0xe6, 0xeb, 0x9c, 0xc3, 0xc9, 0xa4, 0x49}, - (0x00 << 0) | (0x66 << 7) | (0x6b << 14) | (0x1c << 21) | - (0x43UL << 28) | (0x49L << 35) | (0x24UL << 42) | (0x49UL << 49)); - // 11964378330978735131 - AssertWriteVarint( - new byte[] {0x9b, 0xa8, 0xf9, 0xc2, 0xbb, 0xd6, 0x80, 0x85, 0xa6, 0x01}, - unchecked((ulong) - ((0x1b << 0) | (0x28 << 7) | (0x79 << 14) | (0x42 << 21) | - (0x3bL << 28) | (0x56L << 35) | (0x00L << 42) | - (0x05L << 49) | (0x26L << 56) | (0x01L << 63)))); - } - - /// - /// Parses the given bytes using WriteRawLittleEndian32() and checks - /// that the result matches the given value. - /// - private static void AssertWriteLittleEndian32(byte[] data, uint value) - { - MemoryStream rawOutput = new MemoryStream(); - CodedOutputStream output = CodedOutputStream.CreateInstance(rawOutput); - output.WriteRawLittleEndian32(value); - output.Flush(); - TestUtil.AssertBytesEqual(data, rawOutput.ToArray()); - - // Try different buffer sizes. - for (int bufferSize = 1; bufferSize <= 16; bufferSize *= 2) - { - rawOutput = new MemoryStream(); - output = CodedOutputStream.CreateInstance(rawOutput, bufferSize); - output.WriteRawLittleEndian32(value); - output.Flush(); - TestUtil.AssertBytesEqual(data, rawOutput.ToArray()); - } - } - - /// - /// Parses the given bytes using WriteRawLittleEndian64() and checks - /// that the result matches the given value. - /// - private static void AssertWriteLittleEndian64(byte[] data, ulong value) - { - MemoryStream rawOutput = new MemoryStream(); - CodedOutputStream output = CodedOutputStream.CreateInstance(rawOutput); - output.WriteRawLittleEndian64(value); - output.Flush(); - TestUtil.AssertBytesEqual(data, rawOutput.ToArray()); - - // Try different block sizes. - for (int blockSize = 1; blockSize <= 16; blockSize *= 2) - { - rawOutput = new MemoryStream(); - output = CodedOutputStream.CreateInstance(rawOutput, blockSize); - output.WriteRawLittleEndian64(value); - output.Flush(); - TestUtil.AssertBytesEqual(data, rawOutput.ToArray()); - } - } - - /// - /// Tests writeRawLittleEndian32() and writeRawLittleEndian64(). - /// - [TestMethod] - public void WriteLittleEndian() - { - AssertWriteLittleEndian32(new byte[] {0x78, 0x56, 0x34, 0x12}, 0x12345678); - AssertWriteLittleEndian32(new byte[] {0xf0, 0xde, 0xbc, 0x9a}, 0x9abcdef0); - - AssertWriteLittleEndian64( - new byte[] {0xf0, 0xde, 0xbc, 0x9a, 0x78, 0x56, 0x34, 0x12}, - 0x123456789abcdef0L); - AssertWriteLittleEndian64( - new byte[] {0x78, 0x56, 0x34, 0x12, 0xf0, 0xde, 0xbc, 0x9a}, - 0x9abcdef012345678UL); - } - - [TestMethod] - public void WriteWholeMessage() - { - TestAllTypes message = TestUtil.GetAllSet(); - - byte[] rawBytes = message.ToByteArray(); - TestUtil.AssertEqualBytes(TestUtil.GoldenMessage.ToByteArray(), rawBytes); - - // Try different block sizes. - for (int blockSize = 1; blockSize < 256; blockSize *= 2) - { - MemoryStream rawOutput = new MemoryStream(); - CodedOutputStream output = - CodedOutputStream.CreateInstance(rawOutput, blockSize); - message.WriteTo(output); - output.Flush(); - TestUtil.AssertEqualBytes(rawBytes, rawOutput.ToArray()); - } - } - - /// - /// Tests writing a whole message with every packed field type. Ensures the - /// wire format of packed fields is compatible with C++. - /// - [TestMethod] - public void WriteWholePackedFieldsMessage() - { - TestPackedTypes message = TestUtil.GetPackedSet(); - - byte[] rawBytes = message.ToByteArray(); - TestUtil.AssertEqualBytes(TestUtil.GetGoldenPackedFieldsMessage().ToByteArray(), - rawBytes); - } - - [TestMethod] - public void EncodeZigZag32() - { - Assert.AreEqual(0u, CodedOutputStream.EncodeZigZag32(0)); - Assert.AreEqual(1u, CodedOutputStream.EncodeZigZag32(-1)); - Assert.AreEqual(2u, CodedOutputStream.EncodeZigZag32(1)); - Assert.AreEqual(3u, CodedOutputStream.EncodeZigZag32(-2)); - Assert.AreEqual(0x7FFFFFFEu, CodedOutputStream.EncodeZigZag32(0x3FFFFFFF)); - Assert.AreEqual(0x7FFFFFFFu, CodedOutputStream.EncodeZigZag32(unchecked((int) 0xC0000000))); - Assert.AreEqual(0xFFFFFFFEu, CodedOutputStream.EncodeZigZag32(0x7FFFFFFF)); - Assert.AreEqual(0xFFFFFFFFu, CodedOutputStream.EncodeZigZag32(unchecked((int) 0x80000000))); - } - - [TestMethod] - public void EncodeZigZag64() - { - Assert.AreEqual(0u, CodedOutputStream.EncodeZigZag64(0)); - Assert.AreEqual(1u, CodedOutputStream.EncodeZigZag64(-1)); - Assert.AreEqual(2u, CodedOutputStream.EncodeZigZag64(1)); - Assert.AreEqual(3u, CodedOutputStream.EncodeZigZag64(-2)); - Assert.AreEqual(0x000000007FFFFFFEuL, - CodedOutputStream.EncodeZigZag64(unchecked((long) 0x000000003FFFFFFFUL))); - Assert.AreEqual(0x000000007FFFFFFFuL, - CodedOutputStream.EncodeZigZag64(unchecked((long) 0xFFFFFFFFC0000000UL))); - Assert.AreEqual(0x00000000FFFFFFFEuL, - CodedOutputStream.EncodeZigZag64(unchecked((long) 0x000000007FFFFFFFUL))); - Assert.AreEqual(0x00000000FFFFFFFFuL, - CodedOutputStream.EncodeZigZag64(unchecked((long) 0xFFFFFFFF80000000UL))); - Assert.AreEqual(0xFFFFFFFFFFFFFFFEL, - CodedOutputStream.EncodeZigZag64(unchecked((long) 0x7FFFFFFFFFFFFFFFUL))); - Assert.AreEqual(0xFFFFFFFFFFFFFFFFL, - CodedOutputStream.EncodeZigZag64(unchecked((long) 0x8000000000000000UL))); - } - - [TestMethod] - public void RoundTripZigZag32() - { - // Some easier-to-verify round-trip tests. The inputs (other than 0, 1, -1) - // were chosen semi-randomly via keyboard bashing. - Assert.AreEqual(0, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(0))); - Assert.AreEqual(1, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(1))); - Assert.AreEqual(-1, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(-1))); - Assert.AreEqual(14927, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(14927))); - Assert.AreEqual(-3612, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(-3612))); - } - - [TestMethod] - public void RoundTripZigZag64() - { - Assert.AreEqual(0, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(0))); - Assert.AreEqual(1, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(1))); - Assert.AreEqual(-1, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(-1))); - Assert.AreEqual(14927, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(14927))); - Assert.AreEqual(-3612, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(-3612))); - - Assert.AreEqual(856912304801416L, - CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(856912304801416L))); - Assert.AreEqual(-75123905439571256L, - CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(-75123905439571256L))); - } - - [TestMethod] - public void TestNegativeEnumNoTag() - { - Assert.AreEqual(10, CodedOutputStream.ComputeInt32SizeNoTag(-2)); - Assert.AreEqual(10, CodedOutputStream.ComputeEnumSizeNoTag(-2)); - - byte[] bytes = new byte[10]; - CodedOutputStream output = CodedOutputStream.CreateInstance(bytes); - output.WriteEnumNoTag(-2); - - Assert.AreEqual(0, output.SpaceLeft); - Assert.AreEqual("FE-FF-FF-FF-FF-FF-FF-FF-FF-01", BitConverter.ToString(bytes)); - } - - [TestMethod] - public void TestNegativeEnumWithTag() - { - Assert.AreEqual(11, CodedOutputStream.ComputeInt32Size(8, -2)); - Assert.AreEqual(11, CodedOutputStream.ComputeEnumSize(8, -2)); - - byte[] bytes = new byte[11]; - CodedOutputStream output = CodedOutputStream.CreateInstance(bytes); - output.WriteEnum(8, "", -2, -2); - - Assert.AreEqual(0, output.SpaceLeft); - //fyi, 0x40 == 0x08 << 3 + 0, field num + wire format shift - Assert.AreEqual("40-FE-FF-FF-FF-FF-FF-FF-FF-FF-01", BitConverter.ToString(bytes)); - } - - [TestMethod] - public void TestNegativeEnumArrayPacked() - { - int arraySize = 1 + (10 * 5); - int msgSize = 1 + 1 + arraySize; - byte[] bytes = new byte[msgSize]; - CodedOutputStream output = CodedOutputStream.CreateInstance(bytes); - output.WritePackedEnumArray(8, "", arraySize, new int[] { 0, -1, -2, -3, -4, -5 }); - - Assert.AreEqual(0, output.SpaceLeft); - - CodedInputStream input = CodedInputStream.CreateInstance(bytes); - uint tag; - string name; - Assert.IsTrue(input.ReadTag(out tag, out name)); - - List values = new List(); - input.ReadInt32Array(tag, name, values); - - Assert.AreEqual(6, values.Count); - for (int i = 0; i > -6; i--) - Assert.AreEqual(i, values[Math.Abs(i)]); - } - - [TestMethod] - public void TestNegativeEnumArray() - { - int arraySize = 1 + 1 + (11 * 5); - int msgSize = arraySize; - byte[] bytes = new byte[msgSize]; - CodedOutputStream output = CodedOutputStream.CreateInstance(bytes); - output.WriteEnumArray(8, "", new int[] { 0, -1, -2, -3, -4, -5 }); - - Assert.AreEqual(0, output.SpaceLeft); - - CodedInputStream input = CodedInputStream.CreateInstance(bytes); - uint tag; - string name; - Assert.IsTrue(input.ReadTag(out tag, out name)); - - List values = new List(); - input.ReadInt32Array(tag, name, values); - - Assert.AreEqual(6, values.Count); - for (int i = 0; i > -6; i--) - Assert.AreEqual(i, values[Math.Abs(i)]); - } - - [TestMethod] - public void TestCodedInputOutputPosition() - { - byte[] content = new byte[110]; - for (int i = 0; i < content.Length; i++) - content[i] = (byte)i; - - byte[] child = new byte[120]; - { - MemoryStream ms = new MemoryStream(child); - CodedOutputStream cout = CodedOutputStream.CreateInstance(ms, 20); - // Field 11: numeric value: 500 - cout.WriteTag(11, WireFormat.WireType.Varint); - Assert.AreEqual(1, cout.Position); - cout.WriteInt32NoTag(500); - Assert.AreEqual(3, cout.Position); - //Field 12: length delimited 120 bytes - cout.WriteTag(12, WireFormat.WireType.LengthDelimited); - Assert.AreEqual(4, cout.Position); - cout.WriteBytesNoTag(ByteString.CopyFrom(content)); - Assert.AreEqual(115, cout.Position); - // Field 13: fixed numeric value: 501 - cout.WriteTag(13, WireFormat.WireType.Fixed32); - Assert.AreEqual(116, cout.Position); - cout.WriteSFixed32NoTag(501); - Assert.AreEqual(120, cout.Position); - cout.Flush(); - } - - byte[] bytes = new byte[130]; - { - CodedOutputStream cout = CodedOutputStream.CreateInstance(bytes); - // Field 1: numeric value: 500 - cout.WriteTag(1, WireFormat.WireType.Varint); - Assert.AreEqual(1, cout.Position); - cout.WriteInt32NoTag(500); - Assert.AreEqual(3, cout.Position); - //Field 2: length delimited 120 bytes - cout.WriteTag(2, WireFormat.WireType.LengthDelimited); - Assert.AreEqual(4, cout.Position); - cout.WriteBytesNoTag(ByteString.CopyFrom(child)); - Assert.AreEqual(125, cout.Position); - // Field 3: fixed numeric value: 500 - cout.WriteTag(3, WireFormat.WireType.Fixed32); - Assert.AreEqual(126, cout.Position); - cout.WriteSFixed32NoTag(501); - Assert.AreEqual(130, cout.Position); - cout.Flush(); - } - //Now test Input stream: - { - CodedInputStream cin = CodedInputStream.CreateInstance(new MemoryStream(bytes), new byte[50]); - uint tag; - int intValue = 0; - string ignore; - Assert.AreEqual(0, cin.Position); - // Field 1: - Assert.IsTrue(cin.ReadTag(out tag, out ignore) && tag >> 3 == 1); - Assert.AreEqual(1, cin.Position); - Assert.IsTrue(cin.ReadInt32(ref intValue) && intValue == 500); - Assert.AreEqual(3, cin.Position); - //Field 2: - Assert.IsTrue(cin.ReadTag(out tag, out ignore) && tag >> 3 == 2); - Assert.AreEqual(4, cin.Position); - uint childlen = cin.ReadRawVarint32(); - Assert.AreEqual(120u, childlen); - Assert.AreEqual(5, cin.Position); - int oldlimit = cin.PushLimit((int)childlen); - Assert.AreEqual(5, cin.Position); - // Now we are reading child message - { - // Field 11: numeric value: 500 - Assert.IsTrue(cin.ReadTag(out tag, out ignore) && tag >> 3 == 11); - Assert.AreEqual(6, cin.Position); - Assert.IsTrue(cin.ReadInt32(ref intValue) && intValue == 500); - Assert.AreEqual(8, cin.Position); - //Field 12: length delimited 120 bytes - Assert.IsTrue(cin.ReadTag(out tag, out ignore) && tag >> 3 == 12); - Assert.AreEqual(9, cin.Position); - ByteString bstr = null; - Assert.IsTrue(cin.ReadBytes(ref bstr) && bstr.Length == 110 && bstr.ToByteArray()[109] == 109); - Assert.AreEqual(120, cin.Position); - // Field 13: fixed numeric value: 501 - Assert.IsTrue(cin.ReadTag(out tag, out ignore) && tag >> 3 == 13); - // ROK - Previously broken here, this returned 126 failing to account for bufferSizeAfterLimit - Assert.AreEqual(121, cin.Position); - Assert.IsTrue(cin.ReadSFixed32(ref intValue) && intValue == 501); - Assert.AreEqual(125, cin.Position); - Assert.IsTrue(cin.IsAtEnd); - } - cin.PopLimit(oldlimit); - Assert.AreEqual(125, cin.Position); - // Field 3: fixed numeric value: 501 - Assert.IsTrue(cin.ReadTag(out tag, out ignore) && tag >> 3 == 3); - Assert.AreEqual(126, cin.Position); - Assert.IsTrue(cin.ReadSFixed32(ref intValue) && intValue == 501); - Assert.AreEqual(130, cin.Position); - Assert.IsTrue(cin.IsAtEnd); - } - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/Collections/PopsicleListTest.cs b/src/ProtocolBuffers.Test/Collections/PopsicleListTest.cs deleted file mode 100644 index 0bce60d..0000000 --- a/src/ProtocolBuffers.Test/Collections/PopsicleListTest.cs +++ /dev/null @@ -1,153 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers.Collections -{ - [TestClass] - public class PopsicleListTest - { - [TestMethod] - public void MutatingOperationsOnFrozenList() - { - PopsicleList list = new PopsicleList(); - list.MakeReadOnly(); - TestUtil.AssertNotSupported(() => list.Add("")); - TestUtil.AssertNotSupported(() => list.Clear()); - TestUtil.AssertNotSupported(() => list.Insert(0, "")); - TestUtil.AssertNotSupported(() => list.Remove("")); - TestUtil.AssertNotSupported(() => list.RemoveAt(0)); - TestUtil.AssertNotSupported(() => list.Add(new[] { "", "" })); - } - - [TestMethod] - public void NonMutatingOperationsOnFrozenList() - { - PopsicleList list = new PopsicleList(); - list.MakeReadOnly(); - Assert.IsFalse(list.Contains("")); - Assert.AreEqual(0, list.Count); - list.CopyTo(new string[5], 0); - list.GetEnumerator(); - Assert.AreEqual(-1, list.IndexOf("")); - Assert.IsTrue(list.IsReadOnly); - } - - [TestMethod] - public void MutatingOperationsOnFluidList() - { - PopsicleList list = new PopsicleList(); - list.Add(""); - list.Clear(); - list.Insert(0, ""); - list.Remove(""); - list.Add("x"); // Just to make the next call valid - list.RemoveAt(0); - } - - [TestMethod] - public void NonMutatingOperationsOnFluidList() - { - PopsicleList list = new PopsicleList(); - Assert.IsFalse(list.Contains("")); - Assert.AreEqual(0, list.Count); - list.CopyTo(new string[5], 0); - list.GetEnumerator(); - Assert.AreEqual(-1, list.IndexOf("")); - Assert.IsFalse(list.IsReadOnly); - } - - [TestMethod] - public void DoesNotAddNullEnumerable() - { - PopsicleList list = new PopsicleList(); - try - { - list.Add((IEnumerable)null); - } - catch (ArgumentNullException) - { return; } - - Assert.Fail("List should not allow nulls."); - } - - [TestMethod] - public void DoesNotAddRangeWithNull() - { - PopsicleList list = new PopsicleList(); - try - { - list.Add(new[] { "a", "b", null }); - } - catch (ArgumentNullException) - { return; } - - Assert.Fail("List should not allow nulls."); - } - - [TestMethod] - public void DoesNotAddNull() - { - PopsicleList list = new PopsicleList(); - try - { - list.Add((string)null); - } - catch (ArgumentNullException) - { return; } - - Assert.Fail("List should not allow nulls."); - } - - [TestMethod] - public void DoesNotSetNull() - { - PopsicleList list = new PopsicleList(); - list.Add("a"); - try - { - list[0] = null; - } - catch (ArgumentNullException) - { return; } - - Assert.Fail("List should not allow nulls."); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/Compatibility/BinaryCompatibilityTests.cs b/src/ProtocolBuffers.Test/Compatibility/BinaryCompatibilityTests.cs deleted file mode 100644 index 9707f8e..0000000 --- a/src/ProtocolBuffers.Test/Compatibility/BinaryCompatibilityTests.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers.Compatibility -{ - [TestClass] - public class BinaryCompatibilityTests : CompatibilityTests - { - protected override object SerializeMessage(TMessage message) - { - byte[] bresult = message.ToByteArray(); - return Convert.ToBase64String(bresult); - } - - protected override TBuilder DeserializeMessage(object message, TBuilder builder, ExtensionRegistry registry) - { - return builder.MergeFrom((byte[])Convert.FromBase64String((string)message), registry); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/Compatibility/CompatibilityTests.cs b/src/ProtocolBuffers.Test/Compatibility/CompatibilityTests.cs deleted file mode 100644 index 2018961..0000000 --- a/src/ProtocolBuffers.Test/Compatibility/CompatibilityTests.cs +++ /dev/null @@ -1,227 +0,0 @@ -using System; -using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; - - -namespace Google.ProtocolBuffers.Compatibility -{ - /// - /// This abstract base implements several tests to ensure that well-known messages can be written - /// and read to/from various formats without loosing data. Implementations overload the two serailization - /// methods to provide the tests with the means to read and write for a given format. - /// - public abstract class CompatibilityTests - { - protected abstract object SerializeMessage(TMessage message) - where TMessage : IMessageLite - where TBuilder : IBuilderLite; - - protected abstract TBuilder DeserializeMessage(object message, TBuilder builder, ExtensionRegistry registry) - where TMessage : IMessageLite - where TBuilder : IBuilderLite; - - protected virtual void AssertOutputEquals(object lhs, object rhs) - { - Assert.AreEqual(lhs, rhs); - } - - [TestMethod] - public virtual void RoundTripWithEmptyChildMessageSize() - { - SizeMessage1 msg = SizeMessage1.CreateBuilder() - .SetField100(100) - .SetField15(SizeMessage1SubMessage.DefaultInstance) - .BuildPartial(); - byte[] contents = msg.ToByteArray(); - object content = SerializeMessage(msg); - - SizeMessage1 copy = DeserializeMessage(content, SizeMessage1.CreateBuilder(), ExtensionRegistry.Empty).BuildPartial(); - - Assert.AreEqual(msg, copy); - AssertOutputEquals(content, SerializeMessage(copy)); - Assert.AreEqual(Convert.ToBase64String(contents), Convert.ToBase64String(copy.ToByteArray())); - } - - [TestMethod] - public virtual void RoundTripWithEmptyChildMessageSpeed() - { - SpeedMessage1 msg = SpeedMessage1.CreateBuilder() - .SetField100(100) - .SetField15(SpeedMessage1SubMessage.DefaultInstance) - .BuildPartial(); - byte[] contents = msg.ToByteArray(); - object content = SerializeMessage(msg); - - SpeedMessage1 copy = DeserializeMessage(content, SpeedMessage1.CreateBuilder(), ExtensionRegistry.Empty).BuildPartial(); - - Assert.AreEqual(msg, copy); - AssertOutputEquals(content, SerializeMessage(copy)); - Assert.AreEqual(Convert.ToBase64String(contents), Convert.ToBase64String(copy.ToByteArray())); - } - - [TestMethod] - public virtual void RoundTripMessage1OptimizeSize() - { - SizeMessage1 msg = SizeMessage1.CreateBuilder().MergeFrom(TestResources.google_message1).Build(); - object content = SerializeMessage(msg); - - SizeMessage1 copy = DeserializeMessage(content, SizeMessage1.CreateBuilder(), ExtensionRegistry.Empty).Build(); - - Assert.AreEqual(msg, copy); - AssertOutputEquals(content, SerializeMessage(copy)); - Assert.AreEqual(Convert.ToBase64String(TestResources.google_message1), Convert.ToBase64String(copy.ToByteArray())); - } - - [TestMethod] - public virtual void RoundTripMessage2OptimizeSize() - { - SizeMessage2 msg = SizeMessage2.CreateBuilder().MergeFrom(TestResources.google_message2).Build(); - object content = SerializeMessage(msg); - - SizeMessage2 copy = DeserializeMessage(content, SizeMessage2.CreateBuilder(), ExtensionRegistry.Empty).Build(); - - Assert.AreEqual(msg, copy); - AssertOutputEquals(content, SerializeMessage(copy)); - Assert.AreEqual(Convert.ToBase64String(TestResources.google_message2), Convert.ToBase64String(copy.ToByteArray())); - } - - [TestMethod] - public virtual void RoundTripMessage1OptimizeSpeed() - { - SpeedMessage1 msg = SpeedMessage1.CreateBuilder().MergeFrom(TestResources.google_message1).Build(); - object content = SerializeMessage(msg); - - SpeedMessage1 copy = DeserializeMessage(content, SpeedMessage1.CreateBuilder(), ExtensionRegistry.Empty).Build(); - - Assert.AreEqual(msg, copy); - AssertOutputEquals(content, SerializeMessage(copy)); - Assert.AreEqual(Convert.ToBase64String(TestResources.google_message1), Convert.ToBase64String(copy.ToByteArray())); - } - - [TestMethod] - public virtual void RoundTripMessage2OptimizeSpeed() - { - SpeedMessage2 msg = SpeedMessage2.CreateBuilder().MergeFrom(TestResources.google_message2).Build(); - object content = SerializeMessage(msg); - - SpeedMessage2 copy = DeserializeMessage(content, SpeedMessage2.CreateBuilder(), ExtensionRegistry.Empty).Build(); - - Assert.AreEqual(msg, copy); - AssertOutputEquals(content, SerializeMessage(copy)); - Assert.AreEqual(Convert.ToBase64String(TestResources.google_message2), Convert.ToBase64String(copy.ToByteArray())); - } - - #region Test message builders - - protected static TestAllTypes.Builder AddAllTypes(TestAllTypes.Builder builder) - { - return builder.SetOptionalInt32(1001) - .SetOptionalInt64(1001) - .SetOptionalUint32(1001) - .SetOptionalUint64(1001) - .SetOptionalSint32(-1001) - .SetOptionalSint64(-1001) - .SetOptionalFixed32(1001) - .SetOptionalFixed64(1001) - .SetOptionalSfixed32(-1001) - .SetOptionalSfixed64(-1001) - .SetOptionalFloat(1001.1001f) - .SetOptionalDouble(1001.1001) - .SetOptionalBool(true) - .SetOptionalString("this is a string value") - .SetOptionalBytes(ByteString.CopyFromUtf8("this is an array of bytes")) - .SetOptionalGroup(new TestAllTypes.Types.OptionalGroup.Builder().SetA(1001)) - .SetOptionalNestedMessage(new TestAllTypes.Types.NestedMessage.Builder().SetBb(1001)) - .SetOptionalNestedEnum(TestAllTypes.Types.NestedEnum.FOO) - ; - } - - protected static TestAllTypes.Builder AddRepeatedTypes(TestAllTypes.Builder builder, int size) - { - //repeated values - for (int i = 0; i < size; i++) - builder.AddRepeatedInt32(1001 + i) - .AddRepeatedInt64(1001) - .AddRepeatedUint32(1001) - .AddRepeatedUint64(1001) - .AddRepeatedSint32(-1001) - .AddRepeatedSint64(-1001) - .AddRepeatedFixed32(1001) - .AddRepeatedFixed64(1001) - .AddRepeatedSfixed32(-1001) - .AddRepeatedSfixed64(-1001) - .AddRepeatedFloat(1001.1001f) - .AddRepeatedDouble(1001.1001) - .AddRepeatedBool(true) - .AddRepeatedString("this is a string value") - .AddRepeatedBytes(ByteString.CopyFromUtf8("this is an array of bytes")) - .AddRepeatedGroup(new TestAllTypes.Types.RepeatedGroup.Builder().SetA(1001)) - .AddRepeatedNestedMessage(new TestAllTypes.Types.NestedMessage.Builder().SetBb(1001)) - .AddRepeatedNestedEnum(TestAllTypes.Types.NestedEnum.FOO) - ; - return builder; - } - - protected static TestPackedTypes.Builder AddPackedTypes(TestPackedTypes.Builder builder, int size) - { - for(int i=0; i < size; i++ ) - builder.AddPackedInt32(1001) - .AddPackedInt64(1001) - .AddPackedUint32(1001) - .AddPackedUint64(1001) - .AddPackedSint32(-1001) - .AddPackedSint64(-1001) - .AddPackedFixed32(1001) - .AddPackedFixed64(1001) - .AddPackedSfixed32(-1001) - .AddPackedSfixed64(-1001) - .AddPackedFloat(1001.1001f) - .AddPackedDouble(1001.1001) - .AddPackedBool(true) - .AddPackedEnum(ForeignEnum.FOREIGN_FOO) - ; - return builder; - } - - #endregion - - [TestMethod] - public void TestRoundTripAllTypes() - { - TestAllTypes msg = AddAllTypes(new TestAllTypes.Builder()).Build(); - object content = SerializeMessage(msg); - - TestAllTypes copy = DeserializeMessage(content, TestAllTypes.CreateBuilder(), ExtensionRegistry.Empty).Build(); - - Assert.AreEqual(msg, copy); - AssertOutputEquals(content, SerializeMessage(copy)); - Assert.AreEqual(Convert.ToBase64String(msg.ToByteArray()), Convert.ToBase64String(copy.ToByteArray())); - } - - [TestMethod] - public void TestRoundTripRepeatedTypes() - { - TestAllTypes msg = AddRepeatedTypes(new TestAllTypes.Builder(), 5).Build(); - object content = SerializeMessage(msg); - - TestAllTypes copy = DeserializeMessage(content, TestAllTypes.CreateBuilder(), ExtensionRegistry.Empty).Build(); - - Assert.AreEqual(msg, copy); - AssertOutputEquals(content, SerializeMessage(copy)); - Assert.AreEqual(Convert.ToBase64String(msg.ToByteArray()), Convert.ToBase64String(copy.ToByteArray())); - } - - [TestMethod] - public void TestRoundTripPackedTypes() - { - TestPackedTypes msg = AddPackedTypes(new TestPackedTypes.Builder(), 5).Build(); - object content = SerializeMessage(msg); - - TestPackedTypes copy = DeserializeMessage(content, TestPackedTypes.CreateBuilder(), ExtensionRegistry.Empty).Build(); - - Assert.AreEqual(msg, copy); - AssertOutputEquals(content, SerializeMessage(copy)); - Assert.AreEqual(Convert.ToBase64String(msg.ToByteArray()), Convert.ToBase64String(copy.ToByteArray())); - } - } -} diff --git a/src/ProtocolBuffers.Test/Compatibility/DictionaryCompatibilityTests.cs b/src/ProtocolBuffers.Test/Compatibility/DictionaryCompatibilityTests.cs deleted file mode 100644 index 73037cc..0000000 --- a/src/ProtocolBuffers.Test/Compatibility/DictionaryCompatibilityTests.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using Google.ProtocolBuffers.Serialization; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers.Compatibility -{ - [TestClass] - public class DictionaryCompatibilityTests : CompatibilityTests - { - protected override object SerializeMessage(TMessage message) - { - DictionaryWriter writer = new DictionaryWriter(); - writer.WriteMessage(message); - return writer.ToDictionary(); - } - - protected override TBuilder DeserializeMessage(object message, TBuilder builder, ExtensionRegistry registry) - { - new DictionaryReader((IDictionary)message).Merge(builder); - return builder; - } - - protected override void AssertOutputEquals(object lhs, object rhs) - { - IDictionary left = (IDictionary)lhs; - IDictionary right = (IDictionary)rhs; - - Assert.AreEqual( - String.Join(",", new List(left.Keys).ToArray()), - String.Join(",", new List(right.Keys).ToArray()) - ); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/Compatibility/JsonCompatibilityTests.cs b/src/ProtocolBuffers.Test/Compatibility/JsonCompatibilityTests.cs deleted file mode 100644 index 7460310..0000000 --- a/src/ProtocolBuffers.Test/Compatibility/JsonCompatibilityTests.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System.IO; -using System.Text; -using Google.ProtocolBuffers.Serialization; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers.Compatibility -{ - [TestClass] - public class JsonCompatibilityTests : CompatibilityTests - { - protected override object SerializeMessage(TMessage message) - { - StringWriter sw = new StringWriter(); - JsonFormatWriter.CreateInstance(sw) - .WriteMessage(message); - return sw.ToString(); - } - - protected override TBuilder DeserializeMessage(object message, TBuilder builder, ExtensionRegistry registry) - { - JsonFormatReader.CreateInstance((string)message).Merge(builder); - return builder; - } - } - - [TestClass] - public class JsonCompatibilityFormattedTests : CompatibilityTests - { - protected override object SerializeMessage(TMessage message) - { - StringWriter sw = new StringWriter(); - JsonFormatWriter.CreateInstance(sw) - .Formatted() - .WriteMessage(message); - return sw.ToString(); - } - - protected override TBuilder DeserializeMessage(object message, TBuilder builder, ExtensionRegistry registry) - { - JsonFormatReader.CreateInstance((string)message).Merge(builder); - return builder; - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/Compatibility/TestResources.cs b/src/ProtocolBuffers.Test/Compatibility/TestResources.cs deleted file mode 100644 index c3ce588..0000000 --- a/src/ProtocolBuffers.Test/Compatibility/TestResources.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers.Compatibility -{ - static class TestResources - { - public static byte[] google_message1 - { - get - { - Stream resource = typeof(TestResources).Assembly.GetManifestResourceStream( - typeof(TestResources).Namespace + ".google_message1.dat"); - - Assert.IsNotNull(resource, "Unable to the locate resource: google_message1"); - - byte[] bytes = new byte[resource.Length]; - int amtRead = resource.Read(bytes, 0, bytes.Length); - Assert.AreEqual(bytes.Length, amtRead); - return bytes; - } - } - public static byte[] google_message2 - { - get - { - Stream resource = typeof(TestResources).Assembly.GetManifestResourceStream( - typeof(TestResources).Namespace + ".google_message2.dat"); - - Assert.IsNotNull(resource, "Unable to the locate resource: google_message2"); - - byte[] bytes = new byte[resource.Length]; - int amtRead = resource.Read(bytes, 0, bytes.Length); - Assert.AreEqual(bytes.Length, amtRead); - return bytes; - } - } - } -} diff --git a/src/ProtocolBuffers.Test/Compatibility/TextCompatibilityTests.cs b/src/ProtocolBuffers.Test/Compatibility/TextCompatibilityTests.cs deleted file mode 100644 index c2eaadf..0000000 --- a/src/ProtocolBuffers.Test/Compatibility/TextCompatibilityTests.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.ComponentModel; -using System.IO; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers.Compatibility -{ - [TestClass] - public class TextCompatibilityTests : CompatibilityTests - { - protected override object SerializeMessage(TMessage message) - { - StringWriter text = new StringWriter(); - message.PrintTo(text); - return text.ToString(); - } - - protected override TBuilder DeserializeMessage(object message, TBuilder builder, ExtensionRegistry registry) - { - TextFormat.Merge(new StringReader((string)message), registry, (IBuilder)builder); - return builder; - } - //This test can take a very long time to run. - [TestMethod] - public override void RoundTripMessage2OptimizeSize() - { - //base.RoundTripMessage2OptimizeSize(); - } - - //This test can take a very long time to run. - [TestMethod] - public override void RoundTripMessage2OptimizeSpeed() - { - //base.RoundTripMessage2OptimizeSpeed(); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/Compatibility/XmlCompatibilityTests.cs b/src/ProtocolBuffers.Test/Compatibility/XmlCompatibilityTests.cs deleted file mode 100644 index 7061474..0000000 --- a/src/ProtocolBuffers.Test/Compatibility/XmlCompatibilityTests.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System.IO; -using System.Xml; -using Google.ProtocolBuffers.Serialization; -using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers.Compatibility -{ - [TestClass] - public class XmlCompatibilityTests : CompatibilityTests - { - protected override object SerializeMessage(TMessage message) - { - StringWriter text = new StringWriter(); - XmlFormatWriter writer = XmlFormatWriter.CreateInstance(text); - writer.WriteMessage("root", message); - return text.ToString(); - } - - protected override TBuilder DeserializeMessage(object message, TBuilder builder, ExtensionRegistry registry) - { - XmlFormatReader reader = XmlFormatReader.CreateInstance((string)message); - return reader.Merge("root", builder, registry); - } - } - - [TestClass] - public class XmlCompatibilityFormattedTests : CompatibilityTests - { - protected override object SerializeMessage(TMessage message) - { - StringWriter text = new StringWriter(); - XmlWriter xwtr = XmlWriter.Create(text, new XmlWriterSettings { Indent = true, IndentChars = " " }); - - XmlFormatWriter writer = XmlFormatWriter.CreateInstance(xwtr).SetOptions(XmlWriterOptions.OutputNestedArrays); - writer.WriteMessage("root", message); - return text.ToString(); - } - - protected override TBuilder DeserializeMessage(object message, TBuilder builder, ExtensionRegistry registry) - { - XmlFormatReader reader = XmlFormatReader.CreateInstance((string)message).SetOptions(XmlReaderOptions.ReadNestedArrays); - return reader.Merge("root", builder, registry); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/Compatibility/google_message1.dat b/src/ProtocolBuffers.Test/Compatibility/google_message1.dat deleted file mode 100644 index bc0f064..0000000 Binary files a/src/ProtocolBuffers.Test/Compatibility/google_message1.dat and /dev/null differ diff --git a/src/ProtocolBuffers.Test/Compatibility/google_message2.dat b/src/ProtocolBuffers.Test/Compatibility/google_message2.dat deleted file mode 100644 index 06c0944..0000000 Binary files a/src/ProtocolBuffers.Test/Compatibility/google_message2.dat and /dev/null differ diff --git a/src/ProtocolBuffers.Test/DeprecatedMemberTest.cs b/src/ProtocolBuffers.Test/DeprecatedMemberTest.cs deleted file mode 100644 index 0901f04..0000000 --- a/src/ProtocolBuffers.Test/DeprecatedMemberTest.cs +++ /dev/null @@ -1,102 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Reflection; -using System.Text; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using UnitTest.Issues.TestProtos; - -namespace Google.ProtocolBuffers -{ - [TestClass] - public class DeprecatedMemberTest - { - private static void AssertIsDeprecated(MemberInfo member) - { - Assert.IsNotNull(member); - Assert.IsTrue(member.IsDefined(typeof(ObsoleteAttribute), false), "Member not obsolete: " + member); - } - - [TestMethod] - public void TestDepreatedPrimitiveValue() - { - AssertIsDeprecated(typeof(DeprecatedFieldsMessage).GetProperty("HasPrimitiveValue")); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage).GetProperty("PrimitiveValue")); - - AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetProperty("HasPrimitiveValue")); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetProperty("PrimitiveValue")); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("ClearPrimitiveValue")); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("SetPrimitiveValue")); - } - [TestMethod] - public void TestDepreatedPrimitiveArray() - { - AssertIsDeprecated(typeof(DeprecatedFieldsMessage).GetProperty("PrimitiveArrayList")); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage).GetProperty("PrimitiveArrayCount")); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage).GetMethod("GetPrimitiveArray")); - - AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetProperty("PrimitiveArrayList")); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetProperty("PrimitiveArrayCount")); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("GetPrimitiveArray")); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("SetPrimitiveArray")); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("AddPrimitiveArray")); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("AddRangePrimitiveArray")); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("ClearPrimitiveArray")); - } - [TestMethod] - public void TestDepreatedMessageValue() - { - AssertIsDeprecated(typeof(DeprecatedFieldsMessage).GetProperty("HasMessageValue")); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage).GetProperty("MessageValue")); - - AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetProperty("HasMessageValue")); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetProperty("MessageValue")); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("MergeMessageValue")); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("ClearMessageValue")); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("SetMessageValue", new[] { typeof(DeprecatedChild) })); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("SetMessageValue", new[] { typeof(DeprecatedChild.Builder) })); - } - [TestMethod] - public void TestDepreatedMessageArray() - { - AssertIsDeprecated(typeof(DeprecatedFieldsMessage).GetProperty("MessageArrayList")); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage).GetProperty("MessageArrayCount")); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage).GetMethod("GetMessageArray")); - - AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetProperty("MessageArrayList")); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetProperty("MessageArrayCount")); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("GetMessageArray")); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("SetMessageArray", new[] { typeof(int), typeof(DeprecatedChild) })); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("SetMessageArray", new[] { typeof(int), typeof(DeprecatedChild.Builder) })); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("AddMessageArray", new[] { typeof(DeprecatedChild) })); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("AddMessageArray", new[] { typeof(DeprecatedChild.Builder) })); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("AddRangeMessageArray")); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("ClearMessageArray")); - } - [TestMethod] - public void TestDepreatedEnumValue() - { - AssertIsDeprecated(typeof(DeprecatedFieldsMessage).GetProperty("HasEnumValue")); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage).GetProperty("EnumValue")); - - AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetProperty("HasEnumValue")); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetProperty("EnumValue")); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("ClearEnumValue")); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("SetEnumValue")); - } - [TestMethod] - public void TestDepreatedEnumArray() - { - AssertIsDeprecated(typeof(DeprecatedFieldsMessage).GetProperty("EnumArrayList")); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage).GetProperty("EnumArrayCount")); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage).GetMethod("GetEnumArray")); - - AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetProperty("EnumArrayList")); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetProperty("EnumArrayCount")); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("GetEnumArray")); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("SetEnumArray")); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("AddEnumArray")); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("AddRangeEnumArray")); - AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("ClearEnumArray")); - } - } -} diff --git a/src/ProtocolBuffers.Test/Descriptors/MessageDescriptorTest.cs b/src/ProtocolBuffers.Test/Descriptors/MessageDescriptorTest.cs deleted file mode 100644 index 79033e6..0000000 --- a/src/ProtocolBuffers.Test/Descriptors/MessageDescriptorTest.cs +++ /dev/null @@ -1,72 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Google.ProtocolBuffers.TestProtos; - -namespace Google.ProtocolBuffers.Descriptors -{ - [TestClass] - public class MessageDescriptorTest - { - [TestMethod] - public void FindPropertyWithDefaultName() - { - Assert.AreSame(OptionsMessage.Descriptor.FindFieldByNumber(OptionsMessage.NormalFieldNumber), - OptionsMessage.Descriptor.FindFieldByPropertyName("Normal")); - } - - [TestMethod] - public void FindPropertyWithAutoModifiedName() - { - Assert.AreSame(OptionsMessage.Descriptor.FindFieldByNumber(OptionsMessage.OptionsMessage_FieldNumber), - OptionsMessage.Descriptor.FindFieldByPropertyName("OptionsMessage_")); - } - - [TestMethod] - public void FindPropertyWithCustomizedName() - { - Assert.AreSame(OptionsMessage.Descriptor.FindFieldByNumber(OptionsMessage.CustomNameFieldNumber), - OptionsMessage.Descriptor.FindFieldByPropertyName("CustomName")); - } - - [TestMethod] - public void FindPropertyWithInvalidName() - { - Assert.IsNull(OptionsMessage.Descriptor.FindFieldByPropertyName("Bogus")); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/DescriptorsTest.cs b/src/ProtocolBuffers.Test/DescriptorsTest.cs deleted file mode 100644 index ca10c62..0000000 --- a/src/ProtocolBuffers.Test/DescriptorsTest.cs +++ /dev/null @@ -1,350 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System.Text; -using Google.ProtocolBuffers.Descriptors; -using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers -{ - /// - /// Tests for descriptors. (Not in its own namespace or broken up into individual classes as the - /// size doesn't warrant it. On the other hand, this makes me feel a bit dirty...) - /// - [TestClass] - public class DescriptorsTest - { - [TestMethod] - public void FileDescriptor() - { - FileDescriptor file = UnitTestProtoFile.Descriptor; - - Assert.AreEqual("google/protobuf/unittest.proto", file.Name); - Assert.AreEqual("protobuf_unittest", file.Package); - - Assert.AreEqual("UnittestProto", file.Options.JavaOuterClassname); - Assert.AreEqual("google/protobuf/unittest.proto", file.Proto.Name); - -// TODO(jonskeet): Either change to expect 2 dependencies, or don't emit them. -// Assert.AreEqual(2, file.Dependencies.Count); - Assert.AreEqual(UnitTestImportProtoFile.Descriptor, file.Dependencies[1]); - - MessageDescriptor messageType = TestAllTypes.Descriptor; - Assert.AreEqual(messageType, file.MessageTypes[0]); - Assert.AreEqual(messageType, file.FindTypeByName("TestAllTypes")); - Assert.IsNull(file.FindTypeByName("NoSuchType")); - Assert.IsNull(file.FindTypeByName("protobuf_unittest.TestAllTypes")); - for (int i = 0; i < file.MessageTypes.Count; i++) - { - Assert.AreEqual(i, file.MessageTypes[i].Index); - } - - Assert.AreEqual(file.EnumTypes[0], file.FindTypeByName("ForeignEnum")); - Assert.IsNull(file.FindTypeByName("NoSuchType")); - Assert.IsNull(file.FindTypeByName("protobuf_unittest.ForeignEnum")); - Assert.AreEqual(1, UnitTestImportProtoFile.Descriptor.EnumTypes.Count); - Assert.AreEqual("ImportEnum", UnitTestImportProtoFile.Descriptor.EnumTypes[0].Name); - for (int i = 0; i < file.EnumTypes.Count; i++) - { - Assert.AreEqual(i, file.EnumTypes[i].Index); - } - - ServiceDescriptor service = TestGenericService.Descriptor; - Assert.AreEqual(service, UnitTestGenericServices.Descriptor.Services[0]); - Assert.AreEqual(service, - UnitTestGenericServices.Descriptor.FindTypeByName("TestGenericService")); - Assert.IsNull(UnitTestGenericServices.Descriptor.FindTypeByName("NoSuchType")); - Assert.IsNull( - UnitTestGenericServices.Descriptor.FindTypeByName( - "protobuf_unittest.TestGenericService")); - Assert.AreEqual(0, UnitTestImportProtoFile.Descriptor.Services.Count); - for (int i = 0; i < file.Services.Count; i++) - { - Assert.AreEqual(i, file.Services[i].Index); - } - - FieldDescriptor extension = UnitTestProtoFile.OptionalInt32Extension.Descriptor; - Assert.AreEqual(extension, file.Extensions[0]); - Assert.AreEqual(extension, file.FindTypeByName("optional_int32_extension")); - Assert.IsNull(file.FindTypeByName("no_such_ext")); - Assert.IsNull(file.FindTypeByName("protobuf_unittest.optional_int32_extension")); - Assert.AreEqual(0, UnitTestImportProtoFile.Descriptor.Extensions.Count); - for (int i = 0; i < file.Extensions.Count; i++) - { - Assert.AreEqual(i, file.Extensions[i].Index); - } - } - - [TestMethod] - public void MessageDescriptor() - { - MessageDescriptor messageType = TestAllTypes.Descriptor; - MessageDescriptor nestedType = TestAllTypes.Types.NestedMessage.Descriptor; - - Assert.AreEqual("TestAllTypes", messageType.Name); - Assert.AreEqual("protobuf_unittest.TestAllTypes", messageType.FullName); - Assert.AreEqual(UnitTestProtoFile.Descriptor, messageType.File); - Assert.IsNull(messageType.ContainingType); - Assert.AreEqual(DescriptorProtos.MessageOptions.DefaultInstance, messageType.Options); - Assert.AreEqual("TestAllTypes", messageType.Proto.Name); - - Assert.AreEqual("NestedMessage", nestedType.Name); - Assert.AreEqual("protobuf_unittest.TestAllTypes.NestedMessage", nestedType.FullName); - Assert.AreEqual(UnitTestProtoFile.Descriptor, nestedType.File); - Assert.AreEqual(messageType, nestedType.ContainingType); - - FieldDescriptor field = messageType.Fields[0]; - Assert.AreEqual("optional_int32", field.Name); - Assert.AreEqual(field, messageType.FindDescriptor("optional_int32")); - Assert.IsNull(messageType.FindDescriptor("no_such_field")); - Assert.AreEqual(field, messageType.FindFieldByNumber(1)); - Assert.IsNull(messageType.FindFieldByNumber(571283)); - for (int i = 0; i < messageType.Fields.Count; i++) - { - Assert.AreEqual(i, messageType.Fields[i].Index); - } - - Assert.AreEqual(nestedType, messageType.NestedTypes[0]); - Assert.AreEqual(nestedType, messageType.FindDescriptor("NestedMessage")); - Assert.IsNull(messageType.FindDescriptor("NoSuchType")); - for (int i = 0; i < messageType.NestedTypes.Count; i++) - { - Assert.AreEqual(i, messageType.NestedTypes[i].Index); - } - - Assert.AreEqual(messageType.EnumTypes[0], messageType.FindDescriptor("NestedEnum")); - Assert.IsNull(messageType.FindDescriptor("NoSuchType")); - for (int i = 0; i < messageType.EnumTypes.Count; i++) - { - Assert.AreEqual(i, messageType.EnumTypes[i].Index); - } - } - - [TestMethod] - public void FieldDescriptor() - { - MessageDescriptor messageType = TestAllTypes.Descriptor; - FieldDescriptor primitiveField = messageType.FindDescriptor("optional_int32"); - FieldDescriptor enumField = messageType.FindDescriptor("optional_nested_enum"); - FieldDescriptor messageField = messageType.FindDescriptor("optional_foreign_message"); - FieldDescriptor cordField = messageType.FindDescriptor("optional_cord"); - FieldDescriptor extension = UnitTestProtoFile.OptionalInt32Extension.Descriptor; - FieldDescriptor nestedExtension = TestRequired.Single.Descriptor; - - Assert.AreEqual("optional_int32", primitiveField.Name); - Assert.AreEqual("protobuf_unittest.TestAllTypes.optional_int32", - primitiveField.FullName); - Assert.AreEqual(1, primitiveField.FieldNumber); - Assert.AreEqual(messageType, primitiveField.ContainingType); - Assert.AreEqual(UnitTestProtoFile.Descriptor, primitiveField.File); - Assert.AreEqual(FieldType.Int32, primitiveField.FieldType); - Assert.AreEqual(MappedType.Int32, primitiveField.MappedType); - Assert.AreEqual(DescriptorProtos.FieldOptions.DefaultInstance, primitiveField.Options); - Assert.IsFalse(primitiveField.IsExtension); - Assert.AreEqual("optional_int32", primitiveField.Proto.Name); - - Assert.AreEqual("optional_nested_enum", enumField.Name); - Assert.AreEqual(FieldType.Enum, enumField.FieldType); - Assert.AreEqual(MappedType.Enum, enumField.MappedType); - // Assert.AreEqual(TestAllTypes.Types.NestedEnum.Descriptor, enumField.EnumType); - - Assert.AreEqual("optional_foreign_message", messageField.Name); - Assert.AreEqual(FieldType.Message, messageField.FieldType); - Assert.AreEqual(MappedType.Message, messageField.MappedType); - Assert.AreEqual(ForeignMessage.Descriptor, messageField.MessageType); - - Assert.AreEqual("optional_cord", cordField.Name); - Assert.AreEqual(FieldType.String, cordField.FieldType); - Assert.AreEqual(MappedType.String, cordField.MappedType); - Assert.AreEqual(DescriptorProtos.FieldOptions.Types.CType.CORD, cordField.Options.Ctype); - - Assert.AreEqual("optional_int32_extension", extension.Name); - Assert.AreEqual("protobuf_unittest.optional_int32_extension", extension.FullName); - Assert.AreEqual(1, extension.FieldNumber); - Assert.AreEqual(TestAllExtensions.Descriptor, extension.ContainingType); - Assert.AreEqual(UnitTestProtoFile.Descriptor, extension.File); - Assert.AreEqual(FieldType.Int32, extension.FieldType); - Assert.AreEqual(MappedType.Int32, extension.MappedType); - Assert.AreEqual(DescriptorProtos.FieldOptions.DefaultInstance, - extension.Options); - Assert.IsTrue(extension.IsExtension); - Assert.AreEqual(null, extension.ExtensionScope); - Assert.AreEqual("optional_int32_extension", extension.Proto.Name); - - Assert.AreEqual("single", nestedExtension.Name); - Assert.AreEqual("protobuf_unittest.TestRequired.single", - nestedExtension.FullName); - Assert.AreEqual(TestRequired.Descriptor, - nestedExtension.ExtensionScope); - } - - [TestMethod] - public void FieldDescriptorLabel() - { - FieldDescriptor requiredField = - TestRequired.Descriptor.FindDescriptor("a"); - FieldDescriptor optionalField = - TestAllTypes.Descriptor.FindDescriptor("optional_int32"); - FieldDescriptor repeatedField = - TestAllTypes.Descriptor.FindDescriptor("repeated_int32"); - - Assert.IsTrue(requiredField.IsRequired); - Assert.IsFalse(requiredField.IsRepeated); - Assert.IsFalse(optionalField.IsRequired); - Assert.IsFalse(optionalField.IsRepeated); - Assert.IsFalse(repeatedField.IsRequired); - Assert.IsTrue(repeatedField.IsRepeated); - } - [TestMethod] - public void FieldDescriptorDefault() - { - MessageDescriptor d = TestAllTypes.Descriptor; - Assert.IsFalse(d.FindDescriptor("optional_int32").HasDefaultValue); - Assert.AreEqual(0, d.FindDescriptor("optional_int32").DefaultValue); - Assert.IsTrue(d.FindDescriptor("default_int32").HasDefaultValue); - Assert.AreEqual(41, d.FindDescriptor("default_int32").DefaultValue); - - d = TestExtremeDefaultValues.Descriptor; - Assert.AreEqual(TestExtremeDefaultValues.DefaultInstance.EscapedBytes, - d.FindDescriptor("escaped_bytes").DefaultValue); - - Assert.AreEqual(uint.MaxValue, d.FindDescriptor("large_uint32").DefaultValue); - Assert.AreEqual(ulong.MaxValue, d.FindDescriptor("large_uint64").DefaultValue); - } - [TestMethod] - public void EnumDescriptor() - { - // Note: this test is a bit different to the Java version because there's no static way of getting to the descriptor - EnumDescriptor enumType = UnitTestProtoFile.Descriptor.FindTypeByName("ForeignEnum"); - EnumDescriptor nestedType = TestAllTypes.Descriptor.FindDescriptor("NestedEnum"); - - Assert.AreEqual("ForeignEnum", enumType.Name); - Assert.AreEqual("protobuf_unittest.ForeignEnum", enumType.FullName); - Assert.AreEqual(UnitTestProtoFile.Descriptor, enumType.File); - Assert.IsNull(enumType.ContainingType); - Assert.AreEqual(DescriptorProtos.EnumOptions.DefaultInstance, - enumType.Options); - - Assert.AreEqual("NestedEnum", nestedType.Name); - Assert.AreEqual("protobuf_unittest.TestAllTypes.NestedEnum", - nestedType.FullName); - Assert.AreEqual(UnitTestProtoFile.Descriptor, nestedType.File); - Assert.AreEqual(TestAllTypes.Descriptor, nestedType.ContainingType); - - EnumValueDescriptor value = enumType.FindValueByName("FOREIGN_FOO"); - Assert.AreEqual(value, enumType.Values[0]); - Assert.AreEqual("FOREIGN_FOO", value.Name); - Assert.AreEqual(4, value.Number); - Assert.AreEqual((int) ForeignEnum.FOREIGN_FOO, value.Number); - Assert.AreEqual(value, enumType.FindValueByNumber(4)); - Assert.IsNull(enumType.FindValueByName("NO_SUCH_VALUE")); - for (int i = 0; i < enumType.Values.Count; i++) - { - Assert.AreEqual(i, enumType.Values[i].Index); - } - } - - [TestMethod] - public void ServiceDescriptor() - { - ServiceDescriptor service = TestGenericService.Descriptor; - - Assert.AreEqual("TestGenericService", service.Name); - Assert.AreEqual("protobuf_unittest.TestGenericService", service.FullName); - Assert.AreEqual(UnitTestGenericServices.Descriptor, service.File); - - Assert.AreEqual(2, service.Methods.Count); - - MethodDescriptor fooMethod = service.Methods[0]; - Assert.AreEqual("Foo", fooMethod.Name); - Assert.AreEqual(FooRequest.Descriptor, fooMethod.InputType); - Assert.AreEqual(FooResponse.Descriptor, fooMethod.OutputType); - Assert.AreEqual(fooMethod, service.FindMethodByName("Foo")); - - MethodDescriptor barMethod = service.Methods[1]; - Assert.AreEqual("Bar", barMethod.Name); - Assert.AreEqual(BarRequest.Descriptor, barMethod.InputType); - Assert.AreEqual(BarResponse.Descriptor, barMethod.OutputType); - Assert.AreEqual(barMethod, service.FindMethodByName("Bar")); - - Assert.IsNull(service.FindMethodByName("NoSuchMethod")); - - for (int i = 0; i < service.Methods.Count; i++) - { - Assert.AreEqual(i, service.Methods[i].Index); - } - } - - [TestMethod] - public void CustomOptions() - { - MessageDescriptor descriptor = TestMessageWithCustomOptions.Descriptor; - Assert.IsTrue(descriptor.Options.HasExtension(UnitTestCustomOptionsProtoFile.MessageOpt1)); - Assert.AreEqual(-56, descriptor.Options.GetExtension(UnitTestCustomOptionsProtoFile.MessageOpt1)); - - - FieldDescriptor field = descriptor.FindFieldByName("field1"); - Assert.IsNotNull(field); - - Assert.IsTrue(field.Options.HasExtension(UnitTestCustomOptionsProtoFile.FieldOpt1)); - Assert.AreEqual(8765432109uL, field.Options.GetExtension(UnitTestCustomOptionsProtoFile.FieldOpt1)); - - // TODO: Write out enum descriptors - /* - EnumDescriptor enumType = TestMessageWithCustomOptions.Types. - UnittestCustomOptions.TestMessageWithCustomOptions.AnEnum.getDescriptor(); - - Assert.IsTrue( - enumType.getOptions().hasExtension(UnittestCustomOptions.enumOpt1)); - Assert.AreEqual(Integer.valueOf(-789), - enumType.getOptions().getExtension(UnittestCustomOptions.enumOpt1)); - */ - - ServiceDescriptor service = TestGenericServiceWithCustomOptions.Descriptor; - - Assert.IsTrue(service.Options.HasExtension(UnitTestCustomOptionsProtoFile.ServiceOpt1)); - Assert.AreEqual(-9876543210L, service.Options.GetExtension(UnitTestCustomOptionsProtoFile.ServiceOpt1)); - - MethodDescriptor method = service.FindMethodByName("Foo"); - Assert.IsNotNull(method); - - Assert.IsTrue(method.Options.HasExtension(UnitTestCustomOptionsProtoFile.MethodOpt1)); - Assert.AreEqual(MethodOpt1.METHODOPT1_VAL2, - method.Options.GetExtension(UnitTestCustomOptionsProtoFile.MethodOpt1)); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/DynamicMessageTest.cs b/src/ProtocolBuffers.Test/DynamicMessageTest.cs deleted file mode 100644 index 9251599..0000000 --- a/src/ProtocolBuffers.Test/DynamicMessageTest.cs +++ /dev/null @@ -1,237 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers -{ - [TestClass] - public class DynamicMessageTest - { - private ReflectionTester reflectionTester; - private ReflectionTester extensionsReflectionTester; - private ReflectionTester packedReflectionTester; - - [TestInitialize] - public void SetUp() - { - reflectionTester = ReflectionTester.CreateTestAllTypesInstance(); - extensionsReflectionTester = ReflectionTester.CreateTestAllExtensionsInstance(); - packedReflectionTester = ReflectionTester.CreateTestPackedTypesInstance(); - } - - [TestMethod] - public void DynamicMessageAccessors() - { - IBuilder builder = DynamicMessage.CreateBuilder(TestAllTypes.Descriptor); - reflectionTester.SetAllFieldsViaReflection(builder); - IMessage message = builder.WeakBuild(); - reflectionTester.AssertAllFieldsSetViaReflection(message); - } - - [TestMethod] - public void DoubleBuildError() - { - DynamicMessage.Builder builder = DynamicMessage.CreateBuilder(TestAllTypes.Descriptor); - builder.Build(); - try - { - builder.Build(); - Assert.Fail("Should have thrown exception."); - } - catch (InvalidOperationException) - { - // Success. - } - } - - [TestMethod] - public void DynamicMessageSettersRejectNull() - { - IBuilder builder = DynamicMessage.CreateBuilder(TestAllTypes.Descriptor); - reflectionTester.AssertReflectionSettersRejectNull(builder); - } - - [TestMethod] - public void DynamicMessageExtensionAccessors() - { - // We don't need to extensively test DynamicMessage's handling of - // extensions because, frankly, it doesn't do anything special with them. - // It treats them just like any other fields. - IBuilder builder = DynamicMessage.CreateBuilder(TestAllExtensions.Descriptor); - extensionsReflectionTester.SetAllFieldsViaReflection(builder); - IMessage message = builder.WeakBuild(); - extensionsReflectionTester.AssertAllFieldsSetViaReflection(message); - } - - [TestMethod] - public void DynamicMessageExtensionSettersRejectNull() - { - IBuilder builder = DynamicMessage.CreateBuilder(TestAllExtensions.Descriptor); - extensionsReflectionTester.AssertReflectionSettersRejectNull(builder); - } - - [TestMethod] - public void DynamicMessageRepeatedSetters() - { - IBuilder builder = DynamicMessage.CreateBuilder(TestAllTypes.Descriptor); - reflectionTester.SetAllFieldsViaReflection(builder); - reflectionTester.ModifyRepeatedFieldsViaReflection(builder); - IMessage message = builder.WeakBuild(); - reflectionTester.AssertRepeatedFieldsModifiedViaReflection(message); - } - - [TestMethod] - public void DynamicMessageRepeatedSettersRejectNull() - { - IBuilder builder = DynamicMessage.CreateBuilder(TestAllTypes.Descriptor); - reflectionTester.AssertReflectionRepeatedSettersRejectNull(builder); - } - - [TestMethod] - public void DynamicMessageDefaults() - { - reflectionTester.AssertClearViaReflection(DynamicMessage.GetDefaultInstance(TestAllTypes.Descriptor)); - reflectionTester.AssertClearViaReflection(DynamicMessage.CreateBuilder(TestAllTypes.Descriptor).Build()); - } - - [TestMethod] - public void DynamicMessageSerializedSize() - { - TestAllTypes message = TestUtil.GetAllSet(); - - IBuilder dynamicBuilder = DynamicMessage.CreateBuilder(TestAllTypes.Descriptor); - reflectionTester.SetAllFieldsViaReflection(dynamicBuilder); - IMessage dynamicMessage = dynamicBuilder.WeakBuild(); - - Assert.AreEqual(message.SerializedSize, dynamicMessage.SerializedSize); - } - - [TestMethod] - public void DynamicMessageSerialization() - { - IBuilder builder = DynamicMessage.CreateBuilder(TestAllTypes.Descriptor); - reflectionTester.SetAllFieldsViaReflection(builder); - IMessage message = builder.WeakBuild(); - - ByteString rawBytes = message.ToByteString(); - TestAllTypes message2 = TestAllTypes.ParseFrom(rawBytes); - - TestUtil.AssertAllFieldsSet(message2); - - // In fact, the serialized forms should be exactly the same, byte-for-byte. - Assert.AreEqual(TestUtil.GetAllSet().ToByteString(), rawBytes); - } - - [TestMethod] - public void DynamicMessageParsing() - { - TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); - TestUtil.SetAllFields(builder); - TestAllTypes message = builder.Build(); - - ByteString rawBytes = message.ToByteString(); - - IMessage message2 = DynamicMessage.ParseFrom(TestAllTypes.Descriptor, rawBytes); - reflectionTester.AssertAllFieldsSetViaReflection(message2); - } - - [TestMethod] - public void DynamicMessagePackedSerialization() - { - IBuilder builder = DynamicMessage.CreateBuilder(TestPackedTypes.Descriptor); - packedReflectionTester.SetPackedFieldsViaReflection(builder); - IMessage message = builder.WeakBuild(); - - ByteString rawBytes = message.ToByteString(); - TestPackedTypes message2 = TestPackedTypes.ParseFrom(rawBytes); - - TestUtil.AssertPackedFieldsSet(message2); - - // In fact, the serialized forms should be exactly the same, byte-for-byte. - Assert.AreEqual(TestUtil.GetPackedSet().ToByteString(), rawBytes); - } - - [TestMethod] - public void testDynamicMessagePackedParsing() - { - TestPackedTypes.Builder builder = TestPackedTypes.CreateBuilder(); - TestUtil.SetPackedFields(builder); - TestPackedTypes message = builder.Build(); - - ByteString rawBytes = message.ToByteString(); - - IMessage message2 = DynamicMessage.ParseFrom(TestPackedTypes.Descriptor, rawBytes); - packedReflectionTester.AssertPackedFieldsSetViaReflection(message2); - } - - [TestMethod] - public void DynamicMessageCopy() - { - TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); - TestUtil.SetAllFields(builder); - TestAllTypes message = builder.Build(); - - DynamicMessage copy = DynamicMessage.CreateBuilder(message).Build(); - reflectionTester.AssertAllFieldsSetViaReflection(copy); - } - - [TestMethod] - public void ToBuilder() - { - DynamicMessage.Builder builder = - DynamicMessage.CreateBuilder(TestAllTypes.Descriptor); - reflectionTester.SetAllFieldsViaReflection(builder); - int unknownFieldNum = 9; - ulong unknownFieldVal = 90; - builder.SetUnknownFields(UnknownFieldSet.CreateBuilder() - .AddField(unknownFieldNum, - UnknownField.CreateBuilder().AddVarint(unknownFieldVal).Build()) - .Build()); - DynamicMessage message = builder.Build(); - - DynamicMessage derived = message.ToBuilder().Build(); - reflectionTester.AssertAllFieldsSetViaReflection(derived); - - IList values = derived.UnknownFields.FieldDictionary[unknownFieldNum].VarintList; - Assert.AreEqual(1, values.Count); - Assert.AreEqual(unknownFieldVal, values[0]); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/ExtendableMessageTest.cs b/src/ProtocolBuffers.Test/ExtendableMessageTest.cs deleted file mode 100644 index 68f37c3..0000000 --- a/src/ProtocolBuffers.Test/ExtendableMessageTest.cs +++ /dev/null @@ -1,202 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using Google.ProtocolBuffers; -using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers -{ - [TestClass] - public class ExtendableMessageTest - { - [TestMethod, ExpectedException(typeof(ArgumentException))] - public void ExtensionWriterInvalidExtension() - { - TestPackedExtensions.CreateBuilder()[UnitTestProtoFile.OptionalForeignMessageExtension.Descriptor] = - ForeignMessage.DefaultInstance; - } - - [TestMethod] - public void ExtensionWriterTest() - { - TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder() - .SetExtension(UnitTestProtoFile.DefaultBoolExtension, true) - .SetExtension(UnitTestProtoFile.DefaultBytesExtension, ByteString.CopyFromUtf8("123")) - .SetExtension(UnitTestProtoFile.DefaultCordExtension, "123") - .SetExtension(UnitTestProtoFile.DefaultDoubleExtension, 123) - .SetExtension(UnitTestProtoFile.DefaultFixed32Extension, 123u) - .SetExtension(UnitTestProtoFile.DefaultFixed64Extension, 123u) - .SetExtension(UnitTestProtoFile.DefaultFloatExtension, 123) - .SetExtension(UnitTestProtoFile.DefaultForeignEnumExtension, ForeignEnum.FOREIGN_BAZ) - .SetExtension(UnitTestProtoFile.DefaultImportEnumExtension, ImportEnum.IMPORT_BAZ) - .SetExtension(UnitTestProtoFile.DefaultInt32Extension, 123) - .SetExtension(UnitTestProtoFile.DefaultInt64Extension, 123) - .SetExtension(UnitTestProtoFile.DefaultNestedEnumExtension, TestAllTypes.Types.NestedEnum.FOO) - .SetExtension(UnitTestProtoFile.DefaultSfixed32Extension, 123) - .SetExtension(UnitTestProtoFile.DefaultSfixed64Extension, 123) - .SetExtension(UnitTestProtoFile.DefaultSint32Extension, 123) - .SetExtension(UnitTestProtoFile.DefaultSint64Extension, 123) - .SetExtension(UnitTestProtoFile.DefaultStringExtension, "123") - .SetExtension(UnitTestProtoFile.DefaultStringPieceExtension, "123") - .SetExtension(UnitTestProtoFile.DefaultUint32Extension, 123u) - .SetExtension(UnitTestProtoFile.DefaultUint64Extension, 123u) - //Optional - .SetExtension(UnitTestProtoFile.OptionalBoolExtension, true) - .SetExtension(UnitTestProtoFile.OptionalBytesExtension, ByteString.CopyFromUtf8("123")) - .SetExtension(UnitTestProtoFile.OptionalCordExtension, "123") - .SetExtension(UnitTestProtoFile.OptionalDoubleExtension, 123) - .SetExtension(UnitTestProtoFile.OptionalFixed32Extension, 123u) - .SetExtension(UnitTestProtoFile.OptionalFixed64Extension, 123u) - .SetExtension(UnitTestProtoFile.OptionalFloatExtension, 123) - .SetExtension(UnitTestProtoFile.OptionalForeignEnumExtension, ForeignEnum.FOREIGN_BAZ) - .SetExtension(UnitTestProtoFile.OptionalImportEnumExtension, ImportEnum.IMPORT_BAZ) - .SetExtension(UnitTestProtoFile.OptionalInt32Extension, 123) - .SetExtension(UnitTestProtoFile.OptionalInt64Extension, 123) - .SetExtension(UnitTestProtoFile.OptionalNestedEnumExtension, TestAllTypes.Types.NestedEnum.FOO) - .SetExtension(UnitTestProtoFile.OptionalSfixed32Extension, 123) - .SetExtension(UnitTestProtoFile.OptionalSfixed64Extension, 123) - .SetExtension(UnitTestProtoFile.OptionalSint32Extension, 123) - .SetExtension(UnitTestProtoFile.OptionalSint64Extension, 123) - .SetExtension(UnitTestProtoFile.OptionalStringExtension, "123") - .SetExtension(UnitTestProtoFile.OptionalStringPieceExtension, "123") - .SetExtension(UnitTestProtoFile.OptionalUint32Extension, 123u) - .SetExtension(UnitTestProtoFile.OptionalUint64Extension, 123u) - //Repeated - .AddExtension(UnitTestProtoFile.RepeatedBoolExtension, true) - .AddExtension(UnitTestProtoFile.RepeatedBytesExtension, ByteString.CopyFromUtf8("123")) - .AddExtension(UnitTestProtoFile.RepeatedCordExtension, "123") - .AddExtension(UnitTestProtoFile.RepeatedDoubleExtension, 123) - .AddExtension(UnitTestProtoFile.RepeatedFixed32Extension, 123u) - .AddExtension(UnitTestProtoFile.RepeatedFixed64Extension, 123u) - .AddExtension(UnitTestProtoFile.RepeatedFloatExtension, 123) - .AddExtension(UnitTestProtoFile.RepeatedForeignEnumExtension, ForeignEnum.FOREIGN_BAZ) - .AddExtension(UnitTestProtoFile.RepeatedImportEnumExtension, ImportEnum.IMPORT_BAZ) - .AddExtension(UnitTestProtoFile.RepeatedInt32Extension, 123) - .AddExtension(UnitTestProtoFile.RepeatedInt64Extension, 123) - .AddExtension(UnitTestProtoFile.RepeatedNestedEnumExtension, TestAllTypes.Types.NestedEnum.FOO) - .AddExtension(UnitTestProtoFile.RepeatedSfixed32Extension, 123) - .AddExtension(UnitTestProtoFile.RepeatedSfixed64Extension, 123) - .AddExtension(UnitTestProtoFile.RepeatedSint32Extension, 123) - .AddExtension(UnitTestProtoFile.RepeatedSint64Extension, 123) - .AddExtension(UnitTestProtoFile.RepeatedStringExtension, "123") - .AddExtension(UnitTestProtoFile.RepeatedStringPieceExtension, "123") - .AddExtension(UnitTestProtoFile.RepeatedUint32Extension, 123u) - .AddExtension(UnitTestProtoFile.RepeatedUint64Extension, 123u) - ; - TestAllExtensions msg = builder.Build(); - - ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); - UnitTestProtoFile.RegisterAllExtensions(registry); - - TestAllExtensions.Builder copyBuilder = TestAllExtensions.CreateBuilder().MergeFrom(msg.ToByteArray(), - registry); - TestAllExtensions copy = copyBuilder.Build(); - - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); - - Assert.AreEqual(true, copy.GetExtension(UnitTestProtoFile.DefaultBoolExtension)); - Assert.AreEqual(ByteString.CopyFromUtf8("123"), copy.GetExtension(UnitTestProtoFile.DefaultBytesExtension)); - Assert.AreEqual("123", copy.GetExtension(UnitTestProtoFile.DefaultCordExtension)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.DefaultDoubleExtension)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestProtoFile.DefaultFixed32Extension)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestProtoFile.DefaultFixed64Extension)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.DefaultFloatExtension)); - Assert.AreEqual(ForeignEnum.FOREIGN_BAZ, copy.GetExtension(UnitTestProtoFile.DefaultForeignEnumExtension)); - Assert.AreEqual(ImportEnum.IMPORT_BAZ, copy.GetExtension(UnitTestProtoFile.DefaultImportEnumExtension)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.DefaultInt32Extension)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.DefaultInt64Extension)); - Assert.AreEqual(TestAllTypes.Types.NestedEnum.FOO, - copy.GetExtension(UnitTestProtoFile.DefaultNestedEnumExtension)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.DefaultSfixed32Extension)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.DefaultSfixed64Extension)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.DefaultSint32Extension)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.DefaultSint64Extension)); - Assert.AreEqual("123", copy.GetExtension(UnitTestProtoFile.DefaultStringExtension)); - Assert.AreEqual("123", copy.GetExtension(UnitTestProtoFile.DefaultStringPieceExtension)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestProtoFile.DefaultUint32Extension)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestProtoFile.DefaultUint64Extension)); - - Assert.AreEqual(true, copy.GetExtension(UnitTestProtoFile.OptionalBoolExtension)); - Assert.AreEqual(ByteString.CopyFromUtf8("123"), copy.GetExtension(UnitTestProtoFile.OptionalBytesExtension)); - Assert.AreEqual("123", copy.GetExtension(UnitTestProtoFile.OptionalCordExtension)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.OptionalDoubleExtension)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestProtoFile.OptionalFixed32Extension)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestProtoFile.OptionalFixed64Extension)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.OptionalFloatExtension)); - Assert.AreEqual(ForeignEnum.FOREIGN_BAZ, copy.GetExtension(UnitTestProtoFile.OptionalForeignEnumExtension)); - Assert.AreEqual(ImportEnum.IMPORT_BAZ, copy.GetExtension(UnitTestProtoFile.OptionalImportEnumExtension)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.OptionalInt32Extension)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.OptionalInt64Extension)); - Assert.AreEqual(TestAllTypes.Types.NestedEnum.FOO, - copy.GetExtension(UnitTestProtoFile.OptionalNestedEnumExtension)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.OptionalSfixed32Extension)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.OptionalSfixed64Extension)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.OptionalSint32Extension)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.OptionalSint64Extension)); - Assert.AreEqual("123", copy.GetExtension(UnitTestProtoFile.OptionalStringExtension)); - Assert.AreEqual("123", copy.GetExtension(UnitTestProtoFile.OptionalStringPieceExtension)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestProtoFile.OptionalUint32Extension)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestProtoFile.OptionalUint64Extension)); - - Assert.AreEqual(true, copy.GetExtension(UnitTestProtoFile.RepeatedBoolExtension, 0)); - Assert.AreEqual(ByteString.CopyFromUtf8("123"), - copy.GetExtension(UnitTestProtoFile.RepeatedBytesExtension, 0)); - Assert.AreEqual("123", copy.GetExtension(UnitTestProtoFile.RepeatedCordExtension, 0)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.RepeatedDoubleExtension, 0)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestProtoFile.RepeatedFixed32Extension, 0)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestProtoFile.RepeatedFixed64Extension, 0)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.RepeatedFloatExtension, 0)); - Assert.AreEqual(ForeignEnum.FOREIGN_BAZ, - copy.GetExtension(UnitTestProtoFile.RepeatedForeignEnumExtension, 0)); - Assert.AreEqual(ImportEnum.IMPORT_BAZ, copy.GetExtension(UnitTestProtoFile.RepeatedImportEnumExtension, 0)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.RepeatedInt32Extension, 0)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.RepeatedInt64Extension, 0)); - Assert.AreEqual(TestAllTypes.Types.NestedEnum.FOO, - copy.GetExtension(UnitTestProtoFile.RepeatedNestedEnumExtension, 0)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.RepeatedSfixed32Extension, 0)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.RepeatedSfixed64Extension, 0)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.RepeatedSint32Extension, 0)); - Assert.AreEqual(123, copy.GetExtension(UnitTestProtoFile.RepeatedSint64Extension, 0)); - Assert.AreEqual("123", copy.GetExtension(UnitTestProtoFile.RepeatedStringExtension, 0)); - Assert.AreEqual("123", copy.GetExtension(UnitTestProtoFile.RepeatedStringPieceExtension, 0)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestProtoFile.RepeatedUint32Extension, 0)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestProtoFile.RepeatedUint64Extension, 0)); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/GeneratedBuilderTest.cs b/src/ProtocolBuffers.Test/GeneratedBuilderTest.cs deleted file mode 100644 index 1dcb1c2..0000000 --- a/src/ProtocolBuffers.Test/GeneratedBuilderTest.cs +++ /dev/null @@ -1,125 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers -{ - [TestClass] - public class GeneratedBuilderTest - { - class OneTimeEnumerator : IEnumerable - { - readonly T _item; - bool _enumerated; - public OneTimeEnumerator(T item) - { - _item = item; - } - public IEnumerator GetEnumerator() - { - Assert.IsFalse(_enumerated, "The collection {0} has already been enumerated", GetType()); - _enumerated = true; - yield return _item; - } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() - { return GetEnumerator(); } - } - - [TestMethod] - public void DoesNotEnumerateTwiceForMessageList() - { - TestAllTypes.Builder b = new TestAllTypes.Builder(); - b.AddRangeRepeatedForeignMessage( - new OneTimeEnumerator( - ForeignMessage.DefaultInstance)); - } - [TestMethod] - public void DoesNotEnumerateTwiceForPrimitiveList() - { - TestAllTypes.Builder b = new TestAllTypes.Builder(); - b.AddRangeRepeatedInt32(new OneTimeEnumerator(1)); - } - [TestMethod] - public void DoesNotEnumerateTwiceForStringList() - { - TestAllTypes.Builder b = new TestAllTypes.Builder(); - b.AddRangeRepeatedString(new OneTimeEnumerator("test")); - } - [TestMethod] - public void DoesNotEnumerateTwiceForEnumList() - { - TestAllTypes.Builder b = new TestAllTypes.Builder(); - b.AddRangeRepeatedForeignEnum(new OneTimeEnumerator(ForeignEnum.FOREIGN_BAR)); - } - - private delegate void TestMethod(); - - private static void AssertThrows(TestMethod method) where T : Exception - { - try - { - method(); - } - catch (Exception error) - { - if (error is T) - return; - throw; - } - Assert.Fail("Expected exception of type " + typeof(T)); - } - - [TestMethod] - public void DoesNotAddNullToMessageListByAddRange() - { - TestAllTypes.Builder b = new TestAllTypes.Builder(); - AssertThrows( - () => b.AddRangeRepeatedForeignMessage(new ForeignMessage[] { null }) - ); - } - [TestMethod] - public void DoesNotAddNullToMessageListByAdd() - { - TestAllTypes.Builder b = new TestAllTypes.Builder(); - AssertThrows( - () => b.AddRepeatedForeignMessage((ForeignMessage)null) - ); - } - [TestMethod] - public void DoesNotAddNullToMessageListBySet() - { - TestAllTypes.Builder b = new TestAllTypes.Builder(); - b.AddRepeatedForeignMessage(ForeignMessage.DefaultInstance); - AssertThrows( - () => b.SetRepeatedForeignMessage(0, (ForeignMessage)null) - ); - } - [TestMethod] - public void DoesNotAddNullToStringListByAddRange() - { - TestAllTypes.Builder b = new TestAllTypes.Builder(); - AssertThrows( - () => b.AddRangeRepeatedString(new String[] { null }) - ); - } - [TestMethod] - public void DoesNotAddNullToStringListByAdd() - { - TestAllTypes.Builder b = new TestAllTypes.Builder(); - AssertThrows( - () => b.AddRepeatedString(null) - ); - } - [TestMethod] - public void DoesNotAddNullToStringListBySet() - { - TestAllTypes.Builder b = new TestAllTypes.Builder(); - b.AddRepeatedString("one"); - AssertThrows( - () => b.SetRepeatedString(0, null) - ); - } - } -} diff --git a/src/ProtocolBuffers.Test/GeneratedMessageTest.cs b/src/ProtocolBuffers.Test/GeneratedMessageTest.cs deleted file mode 100644 index b04fb39..0000000 --- a/src/ProtocolBuffers.Test/GeneratedMessageTest.cs +++ /dev/null @@ -1,532 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using Google.ProtocolBuffers.Collections; -using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers -{ - [TestClass] - public class GeneratedMessageTest - { - private ReflectionTester reflectionTester; - private ReflectionTester extensionsReflectionTester; - - [TestInitialize] - public void SetUp() - { - reflectionTester = ReflectionTester.CreateTestAllTypesInstance(); - extensionsReflectionTester = ReflectionTester.CreateTestAllExtensionsInstance(); - } - - [TestMethod] - public void RepeatedAddPrimitiveBeforeBuild() - { - TestAllTypes message = new TestAllTypes.Builder {RepeatedInt32List = {1, 2, 3}}.Build(); - TestUtil.AssertEqual(new int[] {1, 2, 3}, message.RepeatedInt32List); - } - - [TestMethod] - public void AddPrimitiveFailsAfterBuild() - { - TestAllTypes.Builder builder = new TestAllTypes.Builder(); - IList list = builder.RepeatedInt32List; - list.Add(1); // Fine - builder.Build(); - - try - { - list.Add(2); - Assert.Fail("List should be frozen"); - } - catch (NotSupportedException) - { - // Expected - } - } - - [TestMethod] - public void RepeatedAddMessageBeforeBuild() - { - TestAllTypes message = new TestAllTypes.Builder - { - RepeatedNestedMessageList = - {new TestAllTypes.Types.NestedMessage.Builder {Bb = 10}.Build()} - }.Build(); - Assert.AreEqual(1, message.RepeatedNestedMessageCount); - Assert.AreEqual(10, message.RepeatedNestedMessageList[0].Bb); - } - - [TestMethod] - public void AddMessageFailsAfterBuild() - { - TestAllTypes.Builder builder = new TestAllTypes.Builder(); - IList list = builder.RepeatedNestedMessageList; - builder.Build(); - - try - { - list.Add(new TestAllTypes.Types.NestedMessage.Builder {Bb = 10}.Build()); - Assert.Fail("List should be frozen"); - } - catch (NotSupportedException) - { - // Expected - } - } - - [TestMethod] - public void DefaultInstance() - { - Assert.AreSame(TestAllTypes.DefaultInstance, TestAllTypes.DefaultInstance.DefaultInstanceForType); - Assert.AreSame(TestAllTypes.DefaultInstance, TestAllTypes.CreateBuilder().DefaultInstanceForType); - } - - [TestMethod] - public void Accessors() - { - TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); - TestUtil.SetAllFields(builder); - TestAllTypes message = builder.Build(); - TestUtil.AssertAllFieldsSet(message); - } - - [TestMethod] - public void SettersRejectNull() - { - TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); - TestUtil.AssertArgumentNullException(() => builder.SetOptionalString(null)); - TestUtil.AssertArgumentNullException(() => builder.SetOptionalBytes(null)); - TestUtil.AssertArgumentNullException( - () => builder.SetOptionalNestedMessage((TestAllTypes.Types.NestedMessage) null)); - TestUtil.AssertArgumentNullException( - () => builder.SetOptionalNestedMessage((TestAllTypes.Types.NestedMessage.Builder) null)); - TestUtil.AssertArgumentNullException(() => builder.AddRepeatedString(null)); - TestUtil.AssertArgumentNullException(() => builder.AddRepeatedBytes(null)); - TestUtil.AssertArgumentNullException( - () => builder.AddRepeatedNestedMessage((TestAllTypes.Types.NestedMessage) null)); - TestUtil.AssertArgumentNullException( - () => builder.AddRepeatedNestedMessage((TestAllTypes.Types.NestedMessage.Builder) null)); - } - - [TestMethod] - public void RepeatedSetters() - { - TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); - TestUtil.SetAllFields(builder); - TestUtil.ModifyRepeatedFields(builder); - TestAllTypes message = builder.Build(); - TestUtil.AssertRepeatedFieldsModified(message); - } - - [TestMethod] - public void RepeatedAppend() - { - TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); - - builder.AddRangeRepeatedInt32(new int[] {1, 2, 3, 4}); - builder.AddRangeRepeatedForeignEnum((new ForeignEnum[] {ForeignEnum.FOREIGN_BAZ})); - - ForeignMessage foreignMessage = ForeignMessage.CreateBuilder().SetC(12).Build(); - builder.AddRangeRepeatedForeignMessage(new ForeignMessage[] {foreignMessage}); - - TestAllTypes message = builder.Build(); - TestUtil.AssertEqual(message.RepeatedInt32List, new int[] {1, 2, 3, 4}); - TestUtil.AssertEqual(message.RepeatedForeignEnumList, new ForeignEnum[] {ForeignEnum.FOREIGN_BAZ}); - Assert.AreEqual(1, message.RepeatedForeignMessageCount); - Assert.AreEqual(12, message.GetRepeatedForeignMessage(0).C); - } - - [TestMethod] - public void RepeatedAppendRejectsNull() - { - TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); - - ForeignMessage foreignMessage = ForeignMessage.CreateBuilder().SetC(12).Build(); - TestUtil.AssertArgumentNullException( - () => builder.AddRangeRepeatedForeignMessage(new[] {foreignMessage, null})); - TestUtil.AssertArgumentNullException(() => builder.AddRangeRepeatedForeignMessage(null)); - TestUtil.AssertArgumentNullException(() => builder.AddRangeRepeatedForeignEnum(null)); - TestUtil.AssertArgumentNullException(() => builder.AddRangeRepeatedString(new[] {"one", null})); - TestUtil.AssertArgumentNullException( - () => builder.AddRangeRepeatedBytes(new[] {TestUtil.ToBytes("one"), null})); - } - - [TestMethod] - public void SettingForeignMessageUsingBuilder() - { - TestAllTypes message = TestAllTypes.CreateBuilder() - // Pass builder for foreign message instance. - .SetOptionalForeignMessage(ForeignMessage.CreateBuilder().SetC(123)) - .Build(); - TestAllTypes expectedMessage = TestAllTypes.CreateBuilder() - // Create expected version passing foreign message instance explicitly. - .SetOptionalForeignMessage(ForeignMessage.CreateBuilder().SetC(123).Build()) - .Build(); - Assert.AreEqual(expectedMessage, message); - } - - [TestMethod] - public void SettingRepeatedForeignMessageUsingBuilder() - { - TestAllTypes message = TestAllTypes.CreateBuilder() - // Pass builder for foreign message instance. - .AddRepeatedForeignMessage(ForeignMessage.CreateBuilder().SetC(456)) - .Build(); - TestAllTypes expectedMessage = TestAllTypes.CreateBuilder() - // Create expected version passing foreign message instance explicitly. - .AddRepeatedForeignMessage(ForeignMessage.CreateBuilder().SetC(456).Build()) - .Build(); - Assert.AreEqual(expectedMessage, message); - } - - [TestMethod] - public void SettingRepeatedValuesUsingRangeInCollectionInitializer() - { - int[] values = {1, 2, 3}; - TestAllTypes message = new TestAllTypes.Builder - { - RepeatedSint32List = {values} - }.Build(); - Assert.IsTrue(Lists.Equals(values, message.RepeatedSint32List)); - } - - [TestMethod] - public void SettingRepeatedValuesUsingIndividualValuesInCollectionInitializer() - { - TestAllTypes message = new TestAllTypes.Builder - { - RepeatedSint32List = {6, 7} - }.Build(); - Assert.IsTrue(Lists.Equals(new int[] {6, 7}, message.RepeatedSint32List)); - } - - [TestMethod] - public void Defaults() - { - TestUtil.AssertClear(TestAllTypes.DefaultInstance); - TestUtil.AssertClear(TestAllTypes.CreateBuilder().Build()); - - Assert.AreEqual("\u1234", TestExtremeDefaultValues.DefaultInstance.Utf8String); - } - - [TestMethod] - public void ReflectionGetters() - { - TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); - TestUtil.SetAllFields(builder); - TestAllTypes message = builder.Build(); - reflectionTester.AssertAllFieldsSetViaReflection(message); - } - - [TestMethod] - public void ReflectionSetters() - { - TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); - reflectionTester.SetAllFieldsViaReflection(builder); - TestAllTypes message = builder.Build(); - TestUtil.AssertAllFieldsSet(message); - } - - [TestMethod] - public void ReflectionClear() - { - TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); - reflectionTester.SetAllFieldsViaReflection(builder); - reflectionTester.ClearAllFieldsViaReflection(builder); - TestAllTypes message = builder.Build(); - TestUtil.AssertClear(message); - } - - [TestMethod] - public void ReflectionSettersRejectNull() - { - TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); - reflectionTester.AssertReflectionSettersRejectNull(builder); - } - - [TestMethod] - public void ReflectionRepeatedSetters() - { - TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); - reflectionTester.SetAllFieldsViaReflection(builder); - reflectionTester.ModifyRepeatedFieldsViaReflection(builder); - TestAllTypes message = builder.Build(); - TestUtil.AssertRepeatedFieldsModified(message); - } - - [TestMethod] - public void TestReflectionRepeatedSettersRejectNull() - { - TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); - reflectionTester.AssertReflectionRepeatedSettersRejectNull(builder); - } - - [TestMethod] - public void ReflectionDefaults() - { - TestUtil.TestInMultipleCultures(() => - { - reflectionTester.AssertClearViaReflection( - TestAllTypes.DefaultInstance); - reflectionTester.AssertClearViaReflection( - TestAllTypes.CreateBuilder().Build()); - }); - } - - // ================================================================= - // Extensions. - - [TestMethod] - public void ExtensionAccessors() - { - TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder(); - TestUtil.SetAllExtensions(builder); - TestAllExtensions message = builder.Build(); - TestUtil.AssertAllExtensionsSet(message); - } - - [TestMethod] - public void ExtensionRepeatedSetters() - { - TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder(); - TestUtil.SetAllExtensions(builder); - TestUtil.ModifyRepeatedExtensions(builder); - TestAllExtensions message = builder.Build(); - TestUtil.AssertRepeatedExtensionsModified(message); - } - - [TestMethod] - public void ExtensionDefaults() - { - TestUtil.AssertExtensionsClear(TestAllExtensions.DefaultInstance); - TestUtil.AssertExtensionsClear(TestAllExtensions.CreateBuilder().Build()); - } - - [TestMethod] - public void ExtensionReflectionGetters() - { - TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder(); - TestUtil.SetAllExtensions(builder); - TestAllExtensions message = builder.Build(); - extensionsReflectionTester.AssertAllFieldsSetViaReflection(message); - } - - [TestMethod] - public void ExtensionReflectionSetters() - { - TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder(); - extensionsReflectionTester.SetAllFieldsViaReflection(builder); - TestAllExtensions message = builder.Build(); - TestUtil.AssertAllExtensionsSet(message); - } - - [TestMethod] - public void ExtensionReflectionSettersRejectNull() - { - TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder(); - extensionsReflectionTester.AssertReflectionSettersRejectNull(builder); - } - - [TestMethod] - public void ExtensionReflectionRepeatedSetters() - { - TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder(); - extensionsReflectionTester.SetAllFieldsViaReflection(builder); - extensionsReflectionTester.ModifyRepeatedFieldsViaReflection(builder); - TestAllExtensions message = builder.Build(); - TestUtil.AssertRepeatedExtensionsModified(message); - } - - [TestMethod] - public void ExtensionReflectionRepeatedSettersRejectNull() - { - TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder(); - extensionsReflectionTester.AssertReflectionRepeatedSettersRejectNull(builder); - } - - [TestMethod] - public void ExtensionReflectionDefaults() - { - TestUtil.TestInMultipleCultures(() => - { - extensionsReflectionTester.AssertClearViaReflection( - TestAllExtensions.DefaultInstance); - extensionsReflectionTester.AssertClearViaReflection( - TestAllExtensions.CreateBuilder().Build()); - }); - } - - [TestMethod] - public void ClearExtension() - { - // ClearExtension() is not actually used in TestUtil, so try it manually. - Assert.IsFalse(TestAllExtensions.CreateBuilder() - .SetExtension(UnitTestProtoFile.OptionalInt32Extension, 1) - .ClearExtension(UnitTestProtoFile.OptionalInt32Extension) - .HasExtension(UnitTestProtoFile.OptionalInt32Extension)); - Assert.AreEqual(0, TestAllExtensions.CreateBuilder() - .AddExtension(UnitTestProtoFile.RepeatedInt32Extension, 1) - .ClearExtension(UnitTestProtoFile.RepeatedInt32Extension) - .GetExtensionCount(UnitTestProtoFile.RepeatedInt32Extension)); - } - - [TestMethod] - public void ExtensionMergeFrom() - { - TestAllExtensions original = TestAllExtensions.CreateBuilder() - .SetExtension(UnitTestProtoFile.OptionalInt32Extension, 1).Build(); - TestAllExtensions merged = - TestAllExtensions.CreateBuilder().MergeFrom(original).Build(); - Assert.IsTrue((merged.HasExtension(UnitTestProtoFile.OptionalInt32Extension))); - Assert.AreEqual(1, (int) merged.GetExtension(UnitTestProtoFile.OptionalInt32Extension)); - } - - /* Removed multiple files option for the moment - [TestMethod] - public void MultipleFilesOption() { - // We mostly just want to check that things compile. - MessageWithNoOuter message = MessageWithNoOuter.CreateBuilder() - .SetNested(MessageWithNoOuter.Types.NestedMessage.CreateBuilder().SetI(1)) - .AddForeign(TestAllTypes.CreateBuilder().SetOptionalInt32(1)) - .SetNestedEnum(MessageWithNoOuter.Types.NestedEnum.BAZ) - .SetForeignEnum(EnumWithNoOuter.BAR) - .Build(); - Assert.AreEqual(message, MessageWithNoOuter.ParseFrom(message.ToByteString())); - - Assert.AreEqual(MultiFileProto.Descriptor, MessageWithNoOuter.Descriptor.File); - - FieldDescriptor field = MessageWithNoOuter.Descriptor.FindDescriptor("foreign_enum"); - Assert.AreEqual(MultiFileProto.Descriptor.FindTypeByName("EnumWithNoOuter") - .FindValueByNumber((int)EnumWithNoOuter.BAR), message[field]); - - Assert.AreEqual(MultiFileProto.Descriptor, ServiceWithNoOuter.Descriptor.File); - - Assert.IsFalse(TestAllExtensions.DefaultInstance.HasExtension(MultiFileProto.ExtensionWithOuter)); - }*/ - - [TestMethod] - public void OptionalFieldWithRequiredSubfieldsOptimizedForSize() - { - TestOptionalOptimizedForSize message = TestOptionalOptimizedForSize.DefaultInstance; - Assert.IsTrue(message.IsInitialized); - - message = TestOptionalOptimizedForSize.CreateBuilder().SetO( - TestRequiredOptimizedForSize.CreateBuilder().BuildPartial() - ).BuildPartial(); - Assert.IsFalse(message.IsInitialized); - - message = TestOptionalOptimizedForSize.CreateBuilder().SetO( - TestRequiredOptimizedForSize.CreateBuilder().SetX(5).BuildPartial() - ).BuildPartial(); - Assert.IsTrue(message.IsInitialized); - } - - [TestMethod] - public void OptimizedForSizeMergeUsesAllFieldsFromTarget() - { - TestOptimizedForSize withFieldSet = new TestOptimizedForSize.Builder {I = 10}.Build(); - TestOptimizedForSize.Builder builder = new TestOptimizedForSize.Builder(); - builder.MergeFrom(withFieldSet); - TestOptimizedForSize built = builder.Build(); - Assert.AreEqual(10, built.I); - } - - [TestMethod] - public void UninitializedExtensionInOptimizedForSizeMakesMessageUninitialized() - { - TestOptimizedForSize.Builder builder = new TestOptimizedForSize.Builder(); - builder.SetExtension(TestOptimizedForSize.TestExtension2, - new TestRequiredOptimizedForSize.Builder().BuildPartial()); - Assert.IsFalse(builder.IsInitialized); - Assert.IsFalse(builder.BuildPartial().IsInitialized); - - builder = new TestOptimizedForSize.Builder(); - builder.SetExtension(TestOptimizedForSize.TestExtension2, - new TestRequiredOptimizedForSize.Builder {X = 10}.BuildPartial()); - Assert.IsTrue(builder.IsInitialized); - Assert.IsTrue(builder.BuildPartial().IsInitialized); - } - - [TestMethod] - public void ToBuilder() - { - TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); - TestUtil.SetAllFields(builder); - TestAllTypes message = builder.Build(); - TestUtil.AssertAllFieldsSet(message.ToBuilder().Build()); - } - - [TestMethod] - public void FieldConstantValues() - { - Assert.AreEqual(TestAllTypes.Types.NestedMessage.BbFieldNumber, 1); - Assert.AreEqual(TestAllTypes.OptionalInt32FieldNumber, 1); - Assert.AreEqual(TestAllTypes.OptionalGroupFieldNumber, 16); - Assert.AreEqual(TestAllTypes.OptionalNestedMessageFieldNumber, 18); - Assert.AreEqual(TestAllTypes.OptionalNestedEnumFieldNumber, 21); - Assert.AreEqual(TestAllTypes.RepeatedInt32FieldNumber, 31); - Assert.AreEqual(TestAllTypes.RepeatedGroupFieldNumber, 46); - Assert.AreEqual(TestAllTypes.RepeatedNestedMessageFieldNumber, 48); - Assert.AreEqual(TestAllTypes.RepeatedNestedEnumFieldNumber, 51); - } - - [TestMethod] - public void ExtensionConstantValues() - { - Assert.AreEqual(TestRequired.SingleFieldNumber, 1000); - Assert.AreEqual(TestRequired.MultiFieldNumber, 1001); - Assert.AreEqual(UnitTestProtoFile.OptionalInt32ExtensionFieldNumber, 1); - Assert.AreEqual(UnitTestProtoFile.OptionalGroupExtensionFieldNumber, 16); - Assert.AreEqual(UnitTestProtoFile.OptionalNestedMessageExtensionFieldNumber, 18); - Assert.AreEqual(UnitTestProtoFile.OptionalNestedEnumExtensionFieldNumber, 21); - Assert.AreEqual(UnitTestProtoFile.RepeatedInt32ExtensionFieldNumber, 31); - Assert.AreEqual(UnitTestProtoFile.RepeatedGroupExtensionFieldNumber, 46); - Assert.AreEqual(UnitTestProtoFile.RepeatedNestedMessageExtensionFieldNumber, 48); - Assert.AreEqual(UnitTestProtoFile.RepeatedNestedEnumExtensionFieldNumber, 51); - } - - [TestMethod] - public void EmptyPackedValue() - { - TestPackedTypes empty = new TestPackedTypes.Builder().Build(); - Assert.AreEqual(0, empty.SerializedSize); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/IssuesTest.cs b/src/ProtocolBuffers.Test/IssuesTest.cs deleted file mode 100644 index a80021c..0000000 --- a/src/ProtocolBuffers.Test/IssuesTest.cs +++ /dev/null @@ -1,65 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - - -using System; -using System.Collections.Generic; -using Google.ProtocolBuffers.Collections; -using Google.ProtocolBuffers.Descriptors; -using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using UnitTest.Issues.TestProtos; - - -namespace Google.ProtocolBuffers -{ - /// - /// Tests for issues which aren't easily compartmentalized into other unit tests. - /// - [TestClass] - public class IssuesTest - { - // Issue 45 - [TestMethod] - public void FieldCalledItem() - { - ItemField message = new ItemField.Builder { Item = 3 }.Build(); - FieldDescriptor field = ItemField.Descriptor.FindFieldByName("item"); - Assert.IsNotNull(field); - Assert.AreEqual(3, (int)message[field]); - } - } -} diff --git a/src/ProtocolBuffers.Test/MessageStreamIteratorTest.cs b/src/ProtocolBuffers.Test/MessageStreamIteratorTest.cs deleted file mode 100644 index 78f059f..0000000 --- a/src/ProtocolBuffers.Test/MessageStreamIteratorTest.cs +++ /dev/null @@ -1,91 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System.Collections.Generic; -using System.IO; -using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using NestedMessage = Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage; - -namespace Google.ProtocolBuffers -{ - [TestClass] - public class MessageStreamIteratorTest - { - [TestMethod] - public void ThreeMessagesInMemory() - { - MemoryStream stream = new MemoryStream(MessageStreamWriterTest.ThreeMessageData); - IEnumerable iterator = MessageStreamIterator.FromStreamProvider(() => stream); - List messages = new List(iterator); - - Assert.AreEqual(3, messages.Count); - Assert.AreEqual(5, messages[0].Bb); - Assert.AreEqual(1500, messages[1].Bb); - Assert.IsFalse(messages[2].HasBb); - } - - [TestMethod] - public void ManyMessagesShouldNotTriggerSizeAlert() - { - int messageSize = TestUtil.GetAllSet().SerializedSize; - // Enough messages to trigger the alert unless we've reset the size - // Note that currently we need to make this big enough to copy two whole buffers, - // as otherwise when we refill the buffer the second type, the alert triggers instantly. - int correctCount = (CodedInputStream.BufferSize*2)/messageSize + 1; - using (MemoryStream stream = new MemoryStream()) - { - MessageStreamWriter writer = new MessageStreamWriter(stream); - for (int i = 0; i < correctCount; i++) - { - writer.Write(TestUtil.GetAllSet()); - } - writer.Flush(); - - stream.Position = 0; - - int count = 0; - foreach (var message in MessageStreamIterator.FromStreamProvider(() => stream) - .WithSizeLimit(CodedInputStream.BufferSize*2)) - { - count++; - TestUtil.AssertAllFieldsSet(message); - } - Assert.AreEqual(correctCount, count); - } - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/MessageStreamWriterTest.cs b/src/ProtocolBuffers.Test/MessageStreamWriterTest.cs deleted file mode 100644 index 5377252..0000000 --- a/src/ProtocolBuffers.Test/MessageStreamWriterTest.cs +++ /dev/null @@ -1,79 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System.IO; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using NestedMessage = Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage; - -namespace Google.ProtocolBuffers -{ - [TestClass] - public class MessageStreamWriterTest - { - internal static readonly byte[] ThreeMessageData = new byte[] - { - (1 << 3) | 2, 2, - // Field 1, 2 bytes long (first message) - (1 << 3) | 0, 5, // Field 1, value 5 - (1 << 3) | 2, 3, - // Field 1, 3 bytes long (second message) - (1 << 3) | 0, (1500 & 0x7f) | 0x80, 1500 >> 7, - // Field 1, value 1500 - (1 << 3) | 2, 0, // Field 1, no data (third message) - }; - - [TestMethod] - public void ThreeMessages() - { - NestedMessage message1 = new NestedMessage.Builder {Bb = 5}.Build(); - NestedMessage message2 = new NestedMessage.Builder {Bb = 1500}.Build(); - NestedMessage message3 = new NestedMessage.Builder().Build(); - - byte[] data; - using (MemoryStream stream = new MemoryStream()) - { - MessageStreamWriter writer = new MessageStreamWriter(stream); - writer.Write(message1); - writer.Write(message2); - writer.Write(message3); - writer.Flush(); - data = stream.ToArray(); - } - - TestUtil.AssertEqualBytes(ThreeMessageData, data); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/MessageTest.cs b/src/ProtocolBuffers.Test/MessageTest.cs deleted file mode 100644 index 8bb0fac..0000000 --- a/src/ProtocolBuffers.Test/MessageTest.cs +++ /dev/null @@ -1,387 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System.IO; -using Google.ProtocolBuffers.Descriptors; -using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers -{ - /// - /// Miscellaneous tests for message operations that apply to both - /// generated and dynamic messages. - /// - [TestClass] - public class MessageTest - { - // ================================================================= - // Message-merging tests. - - private static readonly TestAllTypes MergeSource = new TestAllTypes.Builder - { - OptionalInt32 = 1, - OptionalString = "foo", - OptionalForeignMessage = - ForeignMessage.DefaultInstance, - }.AddRepeatedString("bar").Build(); - - private static readonly TestAllTypes MergeDest = new TestAllTypes.Builder - { - OptionalInt64 = 2, - OptionalString = "baz", - OptionalForeignMessage = - new ForeignMessage.Builder {C = 3}.Build(), - }.AddRepeatedString("qux").Build(); - - private const string MergeResultText = - "optional_int32: 1\n" + - "optional_int64: 2\n" + - "optional_string: \"foo\"\n" + - "optional_foreign_message {\n" + - " c: 3\n" + - "}\n" + - "repeated_string: \"qux\"\n" + - "repeated_string: \"bar\"\n"; - - [TestMethod] - public void MergeFrom() - { - TestAllTypes result = TestAllTypes.CreateBuilder(MergeDest).MergeFrom(MergeSource).Build(); - - Assert.AreEqual(MergeResultText, result.ToString()); - } - - /// - /// Test merging a DynamicMessage into a GeneratedMessage. - /// As long as they have the same descriptor, this should work, but it is an - /// entirely different code path. - /// - [TestMethod] - public void MergeFromDynamic() - { - TestAllTypes result = (TestAllTypes) TestAllTypes.CreateBuilder(MergeDest) - .MergeFrom(DynamicMessage.CreateBuilder(MergeSource).Build()) - .Build(); - - Assert.AreEqual(MergeResultText, result.ToString()); - } - - /// - /// Test merging two DynamicMessages. - /// - [TestMethod] - public void DynamicMergeFrom() - { - DynamicMessage result = (DynamicMessage) DynamicMessage.CreateBuilder(MergeDest) - .MergeFrom( - (DynamicMessage) - DynamicMessage.CreateBuilder(MergeSource).Build()) - .Build(); - - Assert.AreEqual(MergeResultText, result.ToString()); - } - - // ================================================================= - // Required-field-related tests. - - private static readonly TestRequired TestRequiredUninitialized = TestRequired.DefaultInstance; - - private static readonly TestRequired TestRequiredInitialized = new TestRequired.Builder - { - A = 1, - B = 2, - C = 3 - }.Build(); - - [TestMethod] - public void Initialization() - { - TestRequired.Builder builder = TestRequired.CreateBuilder(); - - Assert.IsFalse(builder.IsInitialized); - builder.A = 1; - Assert.IsFalse(builder.IsInitialized); - builder.B = 1; - Assert.IsFalse(builder.IsInitialized); - builder.C = 1; - Assert.IsTrue(builder.IsInitialized); - } - - [TestMethod] - public void UninitializedBuilderToString() - { - TestRequired.Builder builder = TestRequired.CreateBuilder().SetA(1); - Assert.AreEqual("a: 1\n", builder.ToString()); - } - - [TestMethod] - public void RequiredForeign() - { - TestRequiredForeign.Builder builder = TestRequiredForeign.CreateBuilder(); - - Assert.IsTrue(builder.IsInitialized); - - builder.SetOptionalMessage(TestRequiredUninitialized); - Assert.IsFalse(builder.IsInitialized); - - builder.SetOptionalMessage(TestRequiredInitialized); - Assert.IsTrue(builder.IsInitialized); - - builder.AddRepeatedMessage(TestRequiredUninitialized); - Assert.IsFalse(builder.IsInitialized); - - builder.SetRepeatedMessage(0, TestRequiredInitialized); - Assert.IsTrue(builder.IsInitialized); - } - - [TestMethod] - public void RequiredExtension() - { - TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder(); - - Assert.IsTrue(builder.IsInitialized); - - builder.SetExtension(TestRequired.Single, TestRequiredUninitialized); - Assert.IsFalse(builder.IsInitialized); - - builder.SetExtension(TestRequired.Single, TestRequiredInitialized); - Assert.IsTrue(builder.IsInitialized); - - builder.AddExtension(TestRequired.Multi, TestRequiredUninitialized); - Assert.IsFalse(builder.IsInitialized); - - builder.SetExtension(TestRequired.Multi, 0, TestRequiredInitialized); - Assert.IsTrue(builder.IsInitialized); - } - - [TestMethod] - public void RequiredDynamic() - { - MessageDescriptor descriptor = TestRequired.Descriptor; - DynamicMessage.Builder builder = DynamicMessage.CreateBuilder(descriptor); - - Assert.IsFalse(builder.IsInitialized); - builder[descriptor.FindDescriptor("a")] = 1; - Assert.IsFalse(builder.IsInitialized); - builder[descriptor.FindDescriptor("b")] = 1; - Assert.IsFalse(builder.IsInitialized); - builder[descriptor.FindDescriptor("c")] = 1; - Assert.IsTrue(builder.IsInitialized); - } - - [TestMethod] - public void RequiredDynamicForeign() - { - MessageDescriptor descriptor = TestRequiredForeign.Descriptor; - DynamicMessage.Builder builder = DynamicMessage.CreateBuilder(descriptor); - - Assert.IsTrue(builder.IsInitialized); - - builder[descriptor.FindDescriptor("optional_message")] = TestRequiredUninitialized; - Assert.IsFalse(builder.IsInitialized); - - builder[descriptor.FindDescriptor("optional_message")] = TestRequiredInitialized; - Assert.IsTrue(builder.IsInitialized); - - builder.AddRepeatedField(descriptor.FindDescriptor("repeated_message"), - TestRequiredUninitialized); - Assert.IsFalse(builder.IsInitialized); - - builder.SetRepeatedField(descriptor.FindDescriptor("repeated_message"), 0, - TestRequiredInitialized); - Assert.IsTrue(builder.IsInitialized); - } - - [TestMethod] - public void UninitializedException() - { - try - { - TestRequired.CreateBuilder().Build(); - Assert.Fail("Should have thrown an exception."); - } - catch (UninitializedMessageException e) - { - Assert.AreEqual("Message missing required fields: a, b, c", e.Message); - } - } - - [TestMethod] - public void BuildPartial() - { - // We're mostly testing that no exception is thrown. - TestRequired message = TestRequired.CreateBuilder().BuildPartial(); - Assert.IsFalse(message.IsInitialized); - } - - [TestMethod] - public void NestedUninitializedException() - { - try - { - TestRequiredForeign.CreateBuilder() - .SetOptionalMessage(TestRequiredUninitialized) - .AddRepeatedMessage(TestRequiredUninitialized) - .AddRepeatedMessage(TestRequiredUninitialized) - .Build(); - Assert.Fail("Should have thrown an exception."); - } - catch (UninitializedMessageException e) - { - Assert.AreEqual( - "Message missing required fields: " + - "optional_message.a, " + - "optional_message.b, " + - "optional_message.c, " + - "repeated_message[0].a, " + - "repeated_message[0].b, " + - "repeated_message[0].c, " + - "repeated_message[1].a, " + - "repeated_message[1].b, " + - "repeated_message[1].c", - e.Message); - } - } - - [TestMethod] - public void BuildNestedPartial() - { - // We're mostly testing that no exception is thrown. - TestRequiredForeign message = - TestRequiredForeign.CreateBuilder() - .SetOptionalMessage(TestRequiredUninitialized) - .AddRepeatedMessage(TestRequiredUninitialized) - .AddRepeatedMessage(TestRequiredUninitialized) - .BuildPartial(); - Assert.IsFalse(message.IsInitialized); - } - - [TestMethod] - public void ParseUnititialized() - { - try - { - TestRequired.ParseFrom(ByteString.Empty); - Assert.Fail("Should have thrown an exception."); - } - catch (InvalidProtocolBufferException e) - { - Assert.AreEqual("Message missing required fields: a, b, c", e.Message); - } - } - - [TestMethod] - public void ParseNestedUnititialized() - { - ByteString data = - TestRequiredForeign.CreateBuilder() - .SetOptionalMessage(TestRequiredUninitialized) - .AddRepeatedMessage(TestRequiredUninitialized) - .AddRepeatedMessage(TestRequiredUninitialized) - .BuildPartial().ToByteString(); - - try - { - TestRequiredForeign.ParseFrom(data); - Assert.Fail("Should have thrown an exception."); - } - catch (InvalidProtocolBufferException e) - { - Assert.AreEqual( - "Message missing required fields: " + - "optional_message.a, " + - "optional_message.b, " + - "optional_message.c, " + - "repeated_message[0].a, " + - "repeated_message[0].b, " + - "repeated_message[0].c, " + - "repeated_message[1].a, " + - "repeated_message[1].b, " + - "repeated_message[1].c", - e.Message); - } - } - - [TestMethod] - public void DynamicUninitializedException() - { - try - { - DynamicMessage.CreateBuilder(TestRequired.Descriptor).Build(); - Assert.Fail("Should have thrown an exception."); - } - catch (UninitializedMessageException e) - { - Assert.AreEqual("Message missing required fields: a, b, c", e.Message); - } - } - - [TestMethod] - public void DynamicBuildPartial() - { - // We're mostly testing that no exception is thrown. - DynamicMessage message = DynamicMessage.CreateBuilder(TestRequired.Descriptor).BuildPartial(); - Assert.IsFalse(message.Initialized); - } - - [TestMethod] - public void DynamicParseUnititialized() - { - try - { - MessageDescriptor descriptor = TestRequired.Descriptor; - DynamicMessage.ParseFrom(descriptor, ByteString.Empty); - Assert.Fail("Should have thrown an exception."); - } - catch (InvalidProtocolBufferException e) - { - Assert.AreEqual("Message missing required fields: a, b, c", e.Message); - } - } - - [TestMethod] - public void PackedTypesWrittenDirectlyToStream() - { - TestPackedTypes message = new TestPackedTypes.Builder {PackedInt32List = {0, 1, 2}}.Build(); - MemoryStream stream = new MemoryStream(); - message.WriteTo(stream); - stream.Position = 0; - TestPackedTypes readMessage = TestPackedTypes.ParseFrom(stream); - Assert.AreEqual(message, readMessage); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/MessageUtilTest.cs b/src/ProtocolBuffers.Test/MessageUtilTest.cs deleted file mode 100644 index 4c33dbb..0000000 --- a/src/ProtocolBuffers.Test/MessageUtilTest.cs +++ /dev/null @@ -1,87 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers -{ - [TestClass] - public class MessageUtilTest - { - [TestMethod] - [ExpectedException(typeof(ArgumentNullException))] - public void NullTypeName() - { - MessageUtil.GetDefaultMessage((string) null); - } - - [TestMethod] - [ExpectedException(typeof(ArgumentException))] - public void InvalidTypeName() - { - MessageUtil.GetDefaultMessage("invalidtypename"); - } - - [TestMethod] - public void ValidTypeName() - { - Assert.AreSame(TestAllTypes.DefaultInstance, - MessageUtil.GetDefaultMessage(typeof(TestAllTypes).AssemblyQualifiedName)); - } - - [TestMethod] - [ExpectedException(typeof(ArgumentNullException))] - public void NullType() - { - MessageUtil.GetDefaultMessage((Type) null); - } - - [TestMethod] - [ExpectedException(typeof(ArgumentException))] - public void NonMessageType() - { - MessageUtil.GetDefaultMessage(typeof(string)); - } - - [TestMethod] - public void ValidType() - { - Assert.AreSame(TestAllTypes.DefaultInstance, MessageUtil.GetDefaultMessage(typeof(TestAllTypes))); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/NameHelpersTest.cs b/src/ProtocolBuffers.Test/NameHelpersTest.cs deleted file mode 100644 index 50ab373..0000000 --- a/src/ProtocolBuffers.Test/NameHelpersTest.cs +++ /dev/null @@ -1,82 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers -{ - [TestClass] - public class NameHelpersTest - { - [TestMethod] - public void UnderscoresToPascalCase() - { - Assert.AreEqual("FooBar", NameHelpers.UnderscoresToPascalCase("Foo_bar")); - Assert.AreEqual("FooBar", NameHelpers.UnderscoresToPascalCase("foo_bar")); - Assert.AreEqual("Foo0Bar", NameHelpers.UnderscoresToPascalCase("Foo0bar")); - Assert.AreEqual("FooBar", NameHelpers.UnderscoresToPascalCase("Foo_+_Bar")); - - Assert.AreEqual("Bar", NameHelpers.UnderscoresToPascalCase("__+bar")); - Assert.AreEqual("Bar", NameHelpers.UnderscoresToPascalCase("bar_")); - Assert.AreEqual("_0Bar", NameHelpers.UnderscoresToPascalCase("_0bar")); - Assert.AreEqual("_1Bar", NameHelpers.UnderscoresToPascalCase("_1_bar")); - } - - [TestMethod] - public void UnderscoresToCamelCase() - { - Assert.AreEqual("fooBar", NameHelpers.UnderscoresToCamelCase("Foo_bar")); - Assert.AreEqual("fooBar", NameHelpers.UnderscoresToCamelCase("foo_bar")); - Assert.AreEqual("foo0Bar", NameHelpers.UnderscoresToCamelCase("Foo0bar")); - Assert.AreEqual("fooBar", NameHelpers.UnderscoresToCamelCase("Foo_+_Bar")); - - Assert.AreEqual("bar", NameHelpers.UnderscoresToCamelCase("__+bar")); - Assert.AreEqual("bar", NameHelpers.UnderscoresToCamelCase("bar_")); - Assert.AreEqual("_0Bar", NameHelpers.UnderscoresToCamelCase("_0bar")); - Assert.AreEqual("_1Bar", NameHelpers.UnderscoresToCamelCase("_1_bar")); - } - - [TestMethod] - public void StripSuffix() - { - string text = "FooBar"; - Assert.IsFalse(NameHelpers.StripSuffix(ref text, "Foo")); - Assert.AreEqual("FooBar", text); - Assert.IsTrue(NameHelpers.StripSuffix(ref text, "Bar")); - Assert.AreEqual("Foo", text); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/Properties/AppManifest.xml b/src/ProtocolBuffers.Test/Properties/AppManifest.xml deleted file mode 100644 index a955232..0000000 --- a/src/ProtocolBuffers.Test/Properties/AppManifest.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - diff --git a/src/ProtocolBuffers.Test/Properties/AssemblyInfo.cs b/src/ProtocolBuffers.Test/Properties/AssemblyInfo.cs deleted file mode 100644 index cea5da5..0000000 --- a/src/ProtocolBuffers.Test/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. - -[assembly: AssemblyTitle("ProtocolBuffers.Test")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ProtocolBuffers.Test")] -[assembly: AssemblyCopyright("Copyright � 2008")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("2.4.1.555")] - -[assembly: AssemblyVersion("2.4.1.555")] - -// We don't really need CLSCompliance, but if the assembly builds with no warnings, -// that means the generator is okay. - -[assembly: CLSCompliant(true)] \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/Properties/OutOfBrowserSettings.xml b/src/ProtocolBuffers.Test/Properties/OutOfBrowserSettings.xml deleted file mode 100644 index 634f44b..0000000 --- a/src/ProtocolBuffers.Test/Properties/OutOfBrowserSettings.xml +++ /dev/null @@ -1,7 +0,0 @@ - - ProtocolBuffers.Test - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/ProtocolBuffers.Test.CF20.csproj b/src/ProtocolBuffers.Test/ProtocolBuffers.Test.CF20.csproj deleted file mode 100644 index 9ac3eaf..0000000 --- a/src/ProtocolBuffers.Test/ProtocolBuffers.Test.CF20.csproj +++ /dev/null @@ -1,190 +0,0 @@ - - - COMPACT_FRAMEWORK - CF20 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {DD01ED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffers.Test - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Smartphone - f27da329-3269-4191-98e0-c87d3d7f1db9 - - - true - full - false - bin\CF20\Debug - obj\CF20\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION;NOEXTENSIONS - prompt - 4 - true - true - Off - true - - - pdbonly - true - bin\CF20\Release - obj\CF20\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION;NOEXTENSIONS - prompt - 4 - true - true - Off - true - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {231391AF-449C-4a39-986C-AD7F270F4750} - ProtocolBuffers.Serialization - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - - - - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/ProtocolBuffers.Test.CF35.csproj b/src/ProtocolBuffers.Test/ProtocolBuffers.Test.CF35.csproj deleted file mode 100644 index 0c6344e..0000000 --- a/src/ProtocolBuffers.Test/ProtocolBuffers.Test.CF35.csproj +++ /dev/null @@ -1,191 +0,0 @@ - - - COMPACT_FRAMEWORK - CF35 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {DD01ED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffers.Test - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Smartphone - f27da329-3269-4191-98e0-c87d3d7f1db9 - - - true - full - false - bin\CF35\Debug - obj\CF35\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION - prompt - 4 - true - true - Off - true - - - pdbonly - true - bin\CF35\Release - obj\CF35\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION - prompt - 4 - true - true - Off - true - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {231391AF-449C-4a39-986C-AD7F270F4750} - ProtocolBuffers.Serialization - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - - - - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/ProtocolBuffers.Test.NET20.csproj b/src/ProtocolBuffers.Test/ProtocolBuffers.Test.NET20.csproj deleted file mode 100644 index f0453fa..0000000 --- a/src/ProtocolBuffers.Test/ProtocolBuffers.Test.NET20.csproj +++ /dev/null @@ -1,178 +0,0 @@ - - - CLIENTPROFILE - NET20 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {DD01ED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffers.Test - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET20\Debug - obj\NET20\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOEXTENSIONS - prompt - 4 - true - true - Off - - - pdbonly - true - bin\NET20\Release - obj\NET20\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOEXTENSIONS - prompt - 4 - true - true - Off - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {231391AF-449C-4a39-986C-AD7F270F4750} - ProtocolBuffers.Serialization - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/ProtocolBuffers.Test.NET35.csproj b/src/ProtocolBuffers.Test/ProtocolBuffers.Test.NET35.csproj deleted file mode 100644 index 33630b4..0000000 --- a/src/ProtocolBuffers.Test/ProtocolBuffers.Test.NET35.csproj +++ /dev/null @@ -1,179 +0,0 @@ - - - CLIENTPROFILE - NET35 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {DD01ED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffers.Test - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET35\Debug - obj\NET35\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - true - Off - - - pdbonly - true - bin\NET35\Release - obj\NET35\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - true - Off - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {231391AF-449C-4a39-986C-AD7F270F4750} - ProtocolBuffers.Serialization - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/ProtocolBuffers.Test.NET40.csproj b/src/ProtocolBuffers.Test/ProtocolBuffers.Test.NET40.csproj deleted file mode 100644 index 74ea721..0000000 --- a/src/ProtocolBuffers.Test/ProtocolBuffers.Test.NET40.csproj +++ /dev/null @@ -1,179 +0,0 @@ - - - CLIENTPROFILE - NET40 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {DD01ED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffers.Test - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET40\Debug - obj\NET40\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - true - Off - - - pdbonly - true - bin\NET40\Release - obj\NET40\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - true - Off - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {231391AF-449C-4a39-986C-AD7F270F4750} - ProtocolBuffers.Serialization - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/ProtocolBuffers.Test.PL40.csproj b/src/ProtocolBuffers.Test/ProtocolBuffers.Test.PL40.csproj deleted file mode 100644 index 018cf9d..0000000 --- a/src/ProtocolBuffers.Test/ProtocolBuffers.Test.PL40.csproj +++ /dev/null @@ -1,213 +0,0 @@ - - - PORTABLE_LIBRARY - PL40 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {DD01ED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffers.Test - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - 10.0 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - - false - false - true - true - true - Google.ProtocolBuffers.Test.xap - Properties\AppManifest.xml - Google.ProtocolBuffers.App - TestPage.html - true - v4.0 - Properties\OutOfBrowserSettings.xml - true - - - true - full - false - bin\PL40\Debug - obj\PL40\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - true - Off - - - pdbonly - true - bin\PL40\Release - obj\PL40\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - true - Off - - - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - App.xaml - - - - - MSBuild:Compile - Designer - - - - - {231391AF-449C-4a39-986C-AD7F270F4750} - ProtocolBuffers.Serialization - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - - - - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/ProtocolBuffers.Test.SL20.csproj b/src/ProtocolBuffers.Test/ProtocolBuffers.Test.SL20.csproj deleted file mode 100644 index e54fa25..0000000 --- a/src/ProtocolBuffers.Test/ProtocolBuffers.Test.SL20.csproj +++ /dev/null @@ -1,214 +0,0 @@ - - - SILVERLIGHT - SL20 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {DD01ED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffers.Test - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - true - false - false - true - true - Google.ProtocolBuffers.Test.xap - Properties\AppManifest.xml - Google.ProtocolBuffers.App - TestPage.html - true - v2.0 - Properties\OutOfBrowserSettings.xml - true - - - true - full - false - bin\SL20\Debug - obj\SL20\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST;NOEXTENSIONS - prompt - 4 - true - true - Off - true - - - pdbonly - true - bin\SL20\Release - obj\SL20\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST;NOEXTENSIONS - prompt - 4 - true - true - Off - true - - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - App.xaml - - - - - MSBuild:Compile - Designer - - - - - {231391AF-449C-4a39-986C-AD7F270F4750} - ProtocolBuffers.Serialization - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - - - - - OfflineApplication - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/ProtocolBuffers.Test.SL30.csproj b/src/ProtocolBuffers.Test/ProtocolBuffers.Test.SL30.csproj deleted file mode 100644 index 76f6b1a..0000000 --- a/src/ProtocolBuffers.Test/ProtocolBuffers.Test.SL30.csproj +++ /dev/null @@ -1,215 +0,0 @@ - - - SILVERLIGHT - SL30 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {DD01ED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffers.Test - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - true - false - false - true - true - Google.ProtocolBuffers.Test.xap - Properties\AppManifest.xml - Google.ProtocolBuffers.App - TestPage.html - true - v3.5 - Properties\OutOfBrowserSettings.xml - true - - - true - full - false - bin\SL30\Debug - obj\SL30\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - true - Off - true - - - pdbonly - true - bin\SL30\Release - obj\SL30\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - true - Off - true - - - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - App.xaml - - - - - MSBuild:Compile - Designer - - - - - {231391AF-449C-4a39-986C-AD7F270F4750} - ProtocolBuffers.Serialization - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - - - - - OfflineApplication - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/ProtocolBuffers.Test.SL40.csproj b/src/ProtocolBuffers.Test/ProtocolBuffers.Test.SL40.csproj deleted file mode 100644 index ade3dc3..0000000 --- a/src/ProtocolBuffers.Test/ProtocolBuffers.Test.SL40.csproj +++ /dev/null @@ -1,215 +0,0 @@ - - - SILVERLIGHT - SL40 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {DD01ED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffers.Test - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - true - false - false - v4.0 - true - true - Google.ProtocolBuffers.Test.xap - Properties\AppManifest.xml - Google.ProtocolBuffers.App - TestPage.html - true - Properties\OutOfBrowserSettings.xml - true - - - true - full - false - bin\SL40\Debug - obj\SL40\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - true - Off - true - - - pdbonly - true - bin\SL40\Release - obj\SL40\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - true - Off - true - - - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - App.xaml - - - - - MSBuild:Compile - Designer - - - - - {231391AF-449C-4a39-986C-AD7F270F4750} - ProtocolBuffers.Serialization - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - - - - - OfflineApplication - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj b/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj deleted file mode 100644 index 267fedc..0000000 --- a/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj +++ /dev/null @@ -1,179 +0,0 @@ - - - - CLIENTPROFILE - NET35 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {DD01ED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffers.Test - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET35\Debug - obj\NET35\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - true - Off - - - pdbonly - true - bin\NET35\Release - obj\NET35\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - true - Off - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {231391AF-449C-4a39-986C-AD7F270F4750} - ProtocolBuffers.Serialization - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/ReflectionTester.cs b/src/ProtocolBuffers.Test/ReflectionTester.cs deleted file mode 100644 index 2120ff8..0000000 --- a/src/ProtocolBuffers.Test/ReflectionTester.cs +++ /dev/null @@ -1,1006 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using Google.ProtocolBuffers.Descriptors; -using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -#pragma warning disable 618 // Disable warning about obsolete use miss-matched assert arguments - -namespace Google.ProtocolBuffers -{ - /// - /// Performs the same things that the methods of TestUtil do, but - /// via the reflection interface. This is its own class because it needs - /// to know what descriptor to use. - /// - internal class ReflectionTester - { - private readonly MessageDescriptor baseDescriptor; - private readonly ExtensionRegistry extensionRegistry; - - private readonly FileDescriptor file; - private readonly FileDescriptor importFile; - - private readonly MessageDescriptor optionalGroup; - private readonly MessageDescriptor repeatedGroup; - private readonly MessageDescriptor nestedMessage; - private readonly MessageDescriptor foreignMessage; - private readonly MessageDescriptor importMessage; - - private readonly FieldDescriptor groupA; - private readonly FieldDescriptor repeatedGroupA; - private readonly FieldDescriptor nestedB; - private readonly FieldDescriptor foreignC; - private readonly FieldDescriptor importD; - - private readonly EnumDescriptor nestedEnum; - private readonly EnumDescriptor foreignEnum; - private readonly EnumDescriptor importEnum; - - private readonly EnumValueDescriptor nestedFoo; - private readonly EnumValueDescriptor nestedBar; - private readonly EnumValueDescriptor nestedBaz; - private readonly EnumValueDescriptor foreignFoo; - private readonly EnumValueDescriptor foreignBar; - private readonly EnumValueDescriptor foreignBaz; - private readonly EnumValueDescriptor importFoo; - private readonly EnumValueDescriptor importBar; - private readonly EnumValueDescriptor importBaz; - - /// - /// Constructs an instance that will expect messages using the given - /// descriptor. Normally should be - /// a descriptor for TestAllTypes. However, if extensionRegistry is non-null, - /// then baseDescriptor should be for TestAllExtensions instead, and instead of - /// reading and writing normal fields, the tester will read and write extensions. - /// All of the TestAllExtensions extensions must be registered in the registry. - /// - private ReflectionTester(MessageDescriptor baseDescriptor, - ExtensionRegistry extensionRegistry) - { - this.baseDescriptor = baseDescriptor; - this.extensionRegistry = extensionRegistry; - - this.file = baseDescriptor.File; - // TODO(jonskeet): We've got 2 dependencies, not 1 - because of the C# options. Hmm. - // Assert.AreEqual(1, file.Dependencies.Count); - // TODO(jonskeet): Find dependency by name instead of number? - this.importFile = file.Dependencies[1]; - - MessageDescriptor testAllTypes; - if (baseDescriptor.Name == "TestAllTypes") - { - testAllTypes = baseDescriptor; - } - else - { - testAllTypes = file.FindTypeByName("TestAllTypes"); - Assert.IsNotNull(testAllTypes); - } - - if (extensionRegistry == null) - { - // Use testAllTypes, rather than baseDescriptor, to allow - // initialization using TestPackedTypes descriptors. These objects - // won't be used by the methods for packed fields. - this.optionalGroup = - testAllTypes.FindDescriptor("OptionalGroup"); - this.repeatedGroup = - testAllTypes.FindDescriptor("RepeatedGroup"); - } - else - { - this.optionalGroup = - file.FindTypeByName("OptionalGroup_extension"); - this.repeatedGroup = - file.FindTypeByName("RepeatedGroup_extension"); - } - this.nestedMessage = testAllTypes.FindDescriptor("NestedMessage"); - this.foreignMessage = file.FindTypeByName("ForeignMessage"); - this.importMessage = importFile.FindTypeByName("ImportMessage"); - - this.nestedEnum = testAllTypes.FindDescriptor("NestedEnum"); - this.foreignEnum = file.FindTypeByName("ForeignEnum"); - this.importEnum = importFile.FindTypeByName("ImportEnum"); - - Assert.IsNotNull(optionalGroup); - Assert.IsNotNull(repeatedGroup); - Assert.IsNotNull(nestedMessage); - Assert.IsNotNull(foreignMessage); - Assert.IsNotNull(importMessage); - Assert.IsNotNull(nestedEnum); - Assert.IsNotNull(foreignEnum); - Assert.IsNotNull(importEnum); - - this.nestedB = nestedMessage.FindDescriptor("bb"); - this.foreignC = foreignMessage.FindDescriptor("c"); - this.importD = importMessage.FindDescriptor("d"); - this.nestedFoo = nestedEnum.FindValueByName("FOO"); - this.nestedBar = nestedEnum.FindValueByName("BAR"); - this.nestedBaz = nestedEnum.FindValueByName("BAZ"); - this.foreignFoo = foreignEnum.FindValueByName("FOREIGN_FOO"); - this.foreignBar = foreignEnum.FindValueByName("FOREIGN_BAR"); - this.foreignBaz = foreignEnum.FindValueByName("FOREIGN_BAZ"); - this.importFoo = importEnum.FindValueByName("IMPORT_FOO"); - this.importBar = importEnum.FindValueByName("IMPORT_BAR"); - this.importBaz = importEnum.FindValueByName("IMPORT_BAZ"); - - this.groupA = optionalGroup.FindDescriptor("a"); - this.repeatedGroupA = repeatedGroup.FindDescriptor("a"); - - Assert.IsNotNull(groupA); - Assert.IsNotNull(repeatedGroupA); - Assert.IsNotNull(nestedB); - Assert.IsNotNull(foreignC); - Assert.IsNotNull(importD); - Assert.IsNotNull(nestedFoo); - Assert.IsNotNull(nestedBar); - Assert.IsNotNull(nestedBaz); - Assert.IsNotNull(foreignFoo); - Assert.IsNotNull(foreignBar); - Assert.IsNotNull(foreignBaz); - Assert.IsNotNull(importFoo); - Assert.IsNotNull(importBar); - Assert.IsNotNull(importBaz); - } - - /// - /// Creates an instance for the TestAllTypes message, with no extension registry. - /// - public static ReflectionTester CreateTestAllTypesInstance() - { - return new ReflectionTester(TestAllTypes.Descriptor, null); - } - - /// - /// Creates an instance for the TestAllExtensions message, with an - /// extension registry from TestUtil.CreateExtensionRegistry. - /// - public static ReflectionTester CreateTestAllExtensionsInstance() - { - return new ReflectionTester(TestAllExtensions.Descriptor, TestUtil.CreateExtensionRegistry()); - } - - /// - /// Creates an instance for the TestPackedTypes message, with no extensions. - /// - public static ReflectionTester CreateTestPackedTypesInstance() - { - return new ReflectionTester(TestPackedTypes.Descriptor, null); - } - - /// - /// Shorthand to get a FieldDescriptor for a field of unittest::TestAllTypes. - /// - private FieldDescriptor f(String name) - { - FieldDescriptor result; - if (extensionRegistry == null) - { - result = baseDescriptor.FindDescriptor(name); - } - else - { - result = file.FindTypeByName(name + "_extension"); - } - Assert.IsNotNull(result); - return result; - } - - /// - /// Calls parent.CreateBuilderForField() or uses the extension registry - /// to find an appropriate builder, depending on what type is being tested. - /// - private IBuilder CreateBuilderForField(IBuilder parent, FieldDescriptor field) - { - if (extensionRegistry == null) - { - return parent.CreateBuilderForField(field); - } - else - { - ExtensionInfo extension = extensionRegistry[field.ContainingType, field.FieldNumber]; - Assert.IsNotNull(extension); - Assert.IsNotNull(extension.DefaultInstance); - return (IBuilder) extension.DefaultInstance.WeakCreateBuilderForType(); - } - } - - /// - /// Sets every field of the message to the values expected by - /// AssertAllFieldsSet, using the reflection interface. - /// - /// - internal void SetAllFieldsViaReflection(IBuilder message) - { - message[f("optional_int32")] = 101; - message[f("optional_int64")] = 102L; - message[f("optional_uint32")] = 103U; - message[f("optional_uint64")] = 104UL; - message[f("optional_sint32")] = 105; - message[f("optional_sint64")] = 106L; - message[f("optional_fixed32")] = 107U; - message[f("optional_fixed64")] = 108UL; - message[f("optional_sfixed32")] = 109; - message[f("optional_sfixed64")] = 110L; - message[f("optional_float")] = 111F; - message[f("optional_double")] = 112D; - message[f("optional_bool")] = true; - message[f("optional_string")] = "115"; - message[f("optional_bytes")] = TestUtil.ToBytes("116"); - - message[f("optionalgroup")] = - CreateBuilderForField(message, f("optionalgroup")).SetField(groupA, 117).WeakBuild(); - message[f("optional_nested_message")] = - CreateBuilderForField(message, f("optional_nested_message")).SetField(nestedB, 118).WeakBuild(); - message[f("optional_foreign_message")] = - CreateBuilderForField(message, f("optional_foreign_message")).SetField(foreignC, 119).WeakBuild(); - message[f("optional_import_message")] = - CreateBuilderForField(message, f("optional_import_message")).SetField(importD, 120).WeakBuild(); - - message[f("optional_nested_enum")] = nestedBaz; - message[f("optional_foreign_enum")] = foreignBaz; - message[f("optional_import_enum")] = importBaz; - - message[f("optional_string_piece")] = "124"; - message[f("optional_cord")] = "125"; - - // ----------------------------------------------------------------- - - message.WeakAddRepeatedField(f("repeated_int32"), 201); - message.WeakAddRepeatedField(f("repeated_int64"), 202L); - message.WeakAddRepeatedField(f("repeated_uint32"), 203U); - message.WeakAddRepeatedField(f("repeated_uint64"), 204UL); - message.WeakAddRepeatedField(f("repeated_sint32"), 205); - message.WeakAddRepeatedField(f("repeated_sint64"), 206L); - message.WeakAddRepeatedField(f("repeated_fixed32"), 207U); - message.WeakAddRepeatedField(f("repeated_fixed64"), 208UL); - message.WeakAddRepeatedField(f("repeated_sfixed32"), 209); - message.WeakAddRepeatedField(f("repeated_sfixed64"), 210L); - message.WeakAddRepeatedField(f("repeated_float"), 211F); - message.WeakAddRepeatedField(f("repeated_double"), 212D); - message.WeakAddRepeatedField(f("repeated_bool"), true); - message.WeakAddRepeatedField(f("repeated_string"), "215"); - message.WeakAddRepeatedField(f("repeated_bytes"), TestUtil.ToBytes("216")); - - - message.WeakAddRepeatedField(f("repeatedgroup"), - CreateBuilderForField(message, f("repeatedgroup")).SetField(repeatedGroupA, 217) - .WeakBuild()); - message.WeakAddRepeatedField(f("repeated_nested_message"), - CreateBuilderForField(message, f("repeated_nested_message")).SetField(nestedB, - 218). - WeakBuild()); - message.WeakAddRepeatedField(f("repeated_foreign_message"), - CreateBuilderForField(message, f("repeated_foreign_message")).SetField( - foreignC, 219).WeakBuild()); - message.WeakAddRepeatedField(f("repeated_import_message"), - CreateBuilderForField(message, f("repeated_import_message")).SetField(importD, - 220). - WeakBuild()); - - message.WeakAddRepeatedField(f("repeated_nested_enum"), nestedBar); - message.WeakAddRepeatedField(f("repeated_foreign_enum"), foreignBar); - message.WeakAddRepeatedField(f("repeated_import_enum"), importBar); - - message.WeakAddRepeatedField(f("repeated_string_piece"), "224"); - message.WeakAddRepeatedField(f("repeated_cord"), "225"); - - // Add a second one of each field. - message.WeakAddRepeatedField(f("repeated_int32"), 301); - message.WeakAddRepeatedField(f("repeated_int64"), 302L); - message.WeakAddRepeatedField(f("repeated_uint32"), 303U); - message.WeakAddRepeatedField(f("repeated_uint64"), 304UL); - message.WeakAddRepeatedField(f("repeated_sint32"), 305); - message.WeakAddRepeatedField(f("repeated_sint64"), 306L); - message.WeakAddRepeatedField(f("repeated_fixed32"), 307U); - message.WeakAddRepeatedField(f("repeated_fixed64"), 308UL); - message.WeakAddRepeatedField(f("repeated_sfixed32"), 309); - message.WeakAddRepeatedField(f("repeated_sfixed64"), 310L); - message.WeakAddRepeatedField(f("repeated_float"), 311F); - message.WeakAddRepeatedField(f("repeated_double"), 312D); - message.WeakAddRepeatedField(f("repeated_bool"), false); - message.WeakAddRepeatedField(f("repeated_string"), "315"); - message.WeakAddRepeatedField(f("repeated_bytes"), TestUtil.ToBytes("316")); - - message.WeakAddRepeatedField(f("repeatedgroup"), - CreateBuilderForField(message, f("repeatedgroup")) - .SetField(repeatedGroupA, 317).WeakBuild()); - message.WeakAddRepeatedField(f("repeated_nested_message"), - CreateBuilderForField(message, f("repeated_nested_message")) - .SetField(nestedB, 318).WeakBuild()); - message.WeakAddRepeatedField(f("repeated_foreign_message"), - CreateBuilderForField(message, f("repeated_foreign_message")) - .SetField(foreignC, 319).WeakBuild()); - message.WeakAddRepeatedField(f("repeated_import_message"), - CreateBuilderForField(message, f("repeated_import_message")) - .SetField(importD, 320).WeakBuild()); - - message.WeakAddRepeatedField(f("repeated_nested_enum"), nestedBaz); - message.WeakAddRepeatedField(f("repeated_foreign_enum"), foreignBaz); - message.WeakAddRepeatedField(f("repeated_import_enum"), importBaz); - - message.WeakAddRepeatedField(f("repeated_string_piece"), "324"); - message.WeakAddRepeatedField(f("repeated_cord"), "325"); - - // ----------------------------------------------------------------- - - message[f("default_int32")] = 401; - message[f("default_int64")] = 402L; - message[f("default_uint32")] = 403U; - message[f("default_uint64")] = 404UL; - message[f("default_sint32")] = 405; - message[f("default_sint64")] = 406L; - message[f("default_fixed32")] = 407U; - message[f("default_fixed64")] = 408UL; - message[f("default_sfixed32")] = 409; - message[f("default_sfixed64")] = 410L; - message[f("default_float")] = 411F; - message[f("default_double")] = 412D; - message[f("default_bool")] = false; - message[f("default_string")] = "415"; - message[f("default_bytes")] = TestUtil.ToBytes("416"); - - message[f("default_nested_enum")] = nestedFoo; - message[f("default_foreign_enum")] = foreignFoo; - message[f("default_import_enum")] = importFoo; - - message[f("default_string_piece")] = "424"; - message[f("default_cord")] = "425"; - } - - /// - /// Clears every field of the message, using the reflection interface. - /// - /// - internal void ClearAllFieldsViaReflection(IBuilder message) - { - foreach (FieldDescriptor field in message.AllFields.Keys) - { - message.WeakClearField(field); - } - } - - // ------------------------------------------------------------------- - - /// - /// Modify the repeated fields of the specified message to contain the - /// values expected by AssertRepeatedFieldsModified, using the IBuilder - /// reflection interface. - /// - internal void ModifyRepeatedFieldsViaReflection(IBuilder message) - { - message[f("repeated_int32"), 1] = 501; - message[f("repeated_int64"), 1] = 502L; - message[f("repeated_uint32"), 1] = 503U; - message[f("repeated_uint64"), 1] = 504UL; - message[f("repeated_sint32"), 1] = 505; - message[f("repeated_sint64"), 1] = 506L; - message[f("repeated_fixed32"), 1] = 507U; - message[f("repeated_fixed64"), 1] = 508UL; - message[f("repeated_sfixed32"), 1] = 509; - message[f("repeated_sfixed64"), 1] = 510L; - message[f("repeated_float"), 1] = 511F; - message[f("repeated_double"), 1] = 512D; - message[f("repeated_bool"), 1] = true; - message[f("repeated_string"), 1] = "515"; - message.SetRepeatedField(f("repeated_bytes"), 1, TestUtil.ToBytes("516")); - - message.SetRepeatedField(f("repeatedgroup"), 1, - CreateBuilderForField(message, f("repeatedgroup")).SetField(repeatedGroupA, 517). - WeakBuild()); - message.SetRepeatedField(f("repeated_nested_message"), 1, - CreateBuilderForField(message, f("repeated_nested_message")).SetField(nestedB, 518) - .WeakBuild()); - message.SetRepeatedField(f("repeated_foreign_message"), 1, - CreateBuilderForField(message, f("repeated_foreign_message")).SetField(foreignC, - 519). - WeakBuild()); - message.SetRepeatedField(f("repeated_import_message"), 1, - CreateBuilderForField(message, f("repeated_import_message")).SetField(importD, 520) - .WeakBuild()); - - message[f("repeated_nested_enum"), 1] = nestedFoo; - message[f("repeated_foreign_enum"), 1] = foreignFoo; - message[f("repeated_import_enum"), 1] = importFoo; - - message[f("repeated_string_piece"), 1] = "524"; - message[f("repeated_cord"), 1] = "525"; - } - - // ------------------------------------------------------------------- - - /// - /// Asserts that all fields of the specified message are set to the values - /// assigned by SetAllFields, using the IMessage reflection interface. - /// - public void AssertAllFieldsSetViaReflection(IMessage message) - { - Assert.IsTrue(message.HasField(f("optional_int32"))); - Assert.IsTrue(message.HasField(f("optional_int64"))); - Assert.IsTrue(message.HasField(f("optional_uint32"))); - Assert.IsTrue(message.HasField(f("optional_uint64"))); - Assert.IsTrue(message.HasField(f("optional_sint32"))); - Assert.IsTrue(message.HasField(f("optional_sint64"))); - Assert.IsTrue(message.HasField(f("optional_fixed32"))); - Assert.IsTrue(message.HasField(f("optional_fixed64"))); - Assert.IsTrue(message.HasField(f("optional_sfixed32"))); - Assert.IsTrue(message.HasField(f("optional_sfixed64"))); - Assert.IsTrue(message.HasField(f("optional_float"))); - Assert.IsTrue(message.HasField(f("optional_double"))); - Assert.IsTrue(message.HasField(f("optional_bool"))); - Assert.IsTrue(message.HasField(f("optional_string"))); - Assert.IsTrue(message.HasField(f("optional_bytes"))); - - Assert.IsTrue(message.HasField(f("optionalgroup"))); - Assert.IsTrue(message.HasField(f("optional_nested_message"))); - Assert.IsTrue(message.HasField(f("optional_foreign_message"))); - Assert.IsTrue(message.HasField(f("optional_import_message"))); - - Assert.IsTrue(((IMessage) message[f("optionalgroup")]).HasField(groupA)); - Assert.IsTrue(((IMessage) message[f("optional_nested_message")]).HasField(nestedB)); - Assert.IsTrue(((IMessage) message[f("optional_foreign_message")]).HasField(foreignC)); - Assert.IsTrue(((IMessage) message[f("optional_import_message")]).HasField(importD)); - - Assert.IsTrue(message.HasField(f("optional_nested_enum"))); - Assert.IsTrue(message.HasField(f("optional_foreign_enum"))); - Assert.IsTrue(message.HasField(f("optional_import_enum"))); - - Assert.IsTrue(message.HasField(f("optional_string_piece"))); - Assert.IsTrue(message.HasField(f("optional_cord"))); - - Assert.AreEqual(101, message[f("optional_int32")]); - Assert.AreEqual(102L, message[f("optional_int64")]); - Assert.AreEqual(103u, message[f("optional_uint32")]); - Assert.AreEqual(104UL, message[f("optional_uint64")]); - Assert.AreEqual(105, message[f("optional_sint32")]); - Assert.AreEqual(106L, message[f("optional_sint64")]); - Assert.AreEqual(107U, message[f("optional_fixed32")]); - Assert.AreEqual(108UL, message[f("optional_fixed64")]); - Assert.AreEqual(109, message[f("optional_sfixed32")]); - Assert.AreEqual(110L, message[f("optional_sfixed64")]); - Assert.AreEqual(111F, message[f("optional_float")]); - Assert.AreEqual(112D, message[f("optional_double")]); - Assert.AreEqual(true, message[f("optional_bool")]); - Assert.AreEqual("115", message[f("optional_string")]); - Assert.AreEqual(TestUtil.ToBytes("116"), message[f("optional_bytes")]); - - Assert.AreEqual(117, ((IMessage) message[f("optionalgroup")])[groupA]); - Assert.AreEqual(118, ((IMessage) message[f("optional_nested_message")])[nestedB]); - Assert.AreEqual(119, ((IMessage) message[f("optional_foreign_message")])[foreignC]); - Assert.AreEqual(120, ((IMessage) message[f("optional_import_message")])[importD]); - - Assert.AreEqual(nestedBaz, message[f("optional_nested_enum")]); - Assert.AreEqual(foreignBaz, message[f("optional_foreign_enum")]); - Assert.AreEqual(importBaz, message[f("optional_import_enum")]); - - Assert.AreEqual("124", message[f("optional_string_piece")]); - Assert.AreEqual("125", message[f("optional_cord")]); - - // ----------------------------------------------------------------- - - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_int32"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_int64"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_uint32"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_uint64"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_sint32"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_sint64"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_fixed32"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_fixed64"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_sfixed32"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_sfixed64"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_float"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_double"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_bool"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_string"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_bytes"))); - - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeatedgroup"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_nested_message"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_foreign_message"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_import_message"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_nested_enum"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_foreign_enum"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_import_enum"))); - - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_string_piece"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_cord"))); - - Assert.AreEqual(201, message[f("repeated_int32"), 0]); - Assert.AreEqual(202L, message[f("repeated_int64"), 0]); - Assert.AreEqual(203U, message[f("repeated_uint32"), 0]); - Assert.AreEqual(204UL, message[f("repeated_uint64"), 0]); - Assert.AreEqual(205, message[f("repeated_sint32"), 0]); - Assert.AreEqual(206L, message[f("repeated_sint64"), 0]); - Assert.AreEqual(207U, message[f("repeated_fixed32"), 0]); - Assert.AreEqual(208UL, message[f("repeated_fixed64"), 0]); - Assert.AreEqual(209, message[f("repeated_sfixed32"), 0]); - Assert.AreEqual(210L, message[f("repeated_sfixed64"), 0]); - Assert.AreEqual(211F, message[f("repeated_float"), 0]); - Assert.AreEqual(212D, message[f("repeated_double"), 0]); - Assert.AreEqual(true, message[f("repeated_bool"), 0]); - Assert.AreEqual("215", message[f("repeated_string"), 0]); - Assert.AreEqual(TestUtil.ToBytes("216"), message[f("repeated_bytes"), 0]); - - Assert.AreEqual(217, ((IMessage) message[f("repeatedgroup"), 0])[repeatedGroupA]); - Assert.AreEqual(218, ((IMessage) message[f("repeated_nested_message"), 0])[nestedB]); - Assert.AreEqual(219, ((IMessage) message[f("repeated_foreign_message"), 0])[foreignC]); - Assert.AreEqual(220, ((IMessage) message[f("repeated_import_message"), 0])[importD]); - - Assert.AreEqual(nestedBar, message[f("repeated_nested_enum"), 0]); - Assert.AreEqual(foreignBar, message[f("repeated_foreign_enum"), 0]); - Assert.AreEqual(importBar, message[f("repeated_import_enum"), 0]); - - Assert.AreEqual("224", message[f("repeated_string_piece"), 0]); - Assert.AreEqual("225", message[f("repeated_cord"), 0]); - - Assert.AreEqual(301, message[f("repeated_int32"), 1]); - Assert.AreEqual(302L, message[f("repeated_int64"), 1]); - Assert.AreEqual(303U, message[f("repeated_uint32"), 1]); - Assert.AreEqual(304UL, message[f("repeated_uint64"), 1]); - Assert.AreEqual(305, message[f("repeated_sint32"), 1]); - Assert.AreEqual(306L, message[f("repeated_sint64"), 1]); - Assert.AreEqual(307U, message[f("repeated_fixed32"), 1]); - Assert.AreEqual(308UL, message[f("repeated_fixed64"), 1]); - Assert.AreEqual(309, message[f("repeated_sfixed32"), 1]); - Assert.AreEqual(310L, message[f("repeated_sfixed64"), 1]); - Assert.AreEqual(311F, message[f("repeated_float"), 1]); - Assert.AreEqual(312D, message[f("repeated_double"), 1]); - Assert.AreEqual(false, message[f("repeated_bool"), 1]); - Assert.AreEqual("315", message[f("repeated_string"), 1]); - Assert.AreEqual(TestUtil.ToBytes("316"), message[f("repeated_bytes"), 1]); - - Assert.AreEqual(317, ((IMessage) message[f("repeatedgroup"), 1])[repeatedGroupA]); - Assert.AreEqual(318, ((IMessage) message[f("repeated_nested_message"), 1])[nestedB]); - Assert.AreEqual(319, ((IMessage) message[f("repeated_foreign_message"), 1])[foreignC]); - Assert.AreEqual(320, ((IMessage) message[f("repeated_import_message"), 1])[importD]); - - Assert.AreEqual(nestedBaz, message[f("repeated_nested_enum"), 1]); - Assert.AreEqual(foreignBaz, message[f("repeated_foreign_enum"), 1]); - Assert.AreEqual(importBaz, message[f("repeated_import_enum"), 1]); - - Assert.AreEqual("324", message[f("repeated_string_piece"), 1]); - Assert.AreEqual("325", message[f("repeated_cord"), 1]); - - // ----------------------------------------------------------------- - - Assert.IsTrue(message.HasField(f("default_int32"))); - Assert.IsTrue(message.HasField(f("default_int64"))); - Assert.IsTrue(message.HasField(f("default_uint32"))); - Assert.IsTrue(message.HasField(f("default_uint64"))); - Assert.IsTrue(message.HasField(f("default_sint32"))); - Assert.IsTrue(message.HasField(f("default_sint64"))); - Assert.IsTrue(message.HasField(f("default_fixed32"))); - Assert.IsTrue(message.HasField(f("default_fixed64"))); - Assert.IsTrue(message.HasField(f("default_sfixed32"))); - Assert.IsTrue(message.HasField(f("default_sfixed64"))); - Assert.IsTrue(message.HasField(f("default_float"))); - Assert.IsTrue(message.HasField(f("default_double"))); - Assert.IsTrue(message.HasField(f("default_bool"))); - Assert.IsTrue(message.HasField(f("default_string"))); - Assert.IsTrue(message.HasField(f("default_bytes"))); - - Assert.IsTrue(message.HasField(f("default_nested_enum"))); - Assert.IsTrue(message.HasField(f("default_foreign_enum"))); - Assert.IsTrue(message.HasField(f("default_import_enum"))); - - Assert.IsTrue(message.HasField(f("default_string_piece"))); - Assert.IsTrue(message.HasField(f("default_cord"))); - - Assert.AreEqual(401, message[f("default_int32")]); - Assert.AreEqual(402L, message[f("default_int64")]); - Assert.AreEqual(403U, message[f("default_uint32")]); - Assert.AreEqual(404UL, message[f("default_uint64")]); - Assert.AreEqual(405, message[f("default_sint32")]); - Assert.AreEqual(406L, message[f("default_sint64")]); - Assert.AreEqual(407U, message[f("default_fixed32")]); - Assert.AreEqual(408UL, message[f("default_fixed64")]); - Assert.AreEqual(409, message[f("default_sfixed32")]); - Assert.AreEqual(410L, message[f("default_sfixed64")]); - Assert.AreEqual(411F, message[f("default_float")]); - Assert.AreEqual(412D, message[f("default_double")]); - Assert.AreEqual(false, message[f("default_bool")]); - Assert.AreEqual("415", message[f("default_string")]); - Assert.AreEqual(TestUtil.ToBytes("416"), message[f("default_bytes")]); - - Assert.AreEqual(nestedFoo, message[f("default_nested_enum")]); - Assert.AreEqual(foreignFoo, message[f("default_foreign_enum")]); - Assert.AreEqual(importFoo, message[f("default_import_enum")]); - - Assert.AreEqual("424", message[f("default_string_piece")]); - Assert.AreEqual("425", message[f("default_cord")]); - } - - /// - /// Assert that all fields of the message are cleared, and that - /// getting the fields returns their default values, using the reflection interface. - /// - public void AssertClearViaReflection(IMessage message) - { - // has_blah() should initially be false for all optional fields. - Assert.IsFalse(message.HasField(f("optional_int32"))); - Assert.IsFalse(message.HasField(f("optional_int64"))); - Assert.IsFalse(message.HasField(f("optional_uint32"))); - Assert.IsFalse(message.HasField(f("optional_uint64"))); - Assert.IsFalse(message.HasField(f("optional_sint32"))); - Assert.IsFalse(message.HasField(f("optional_sint64"))); - Assert.IsFalse(message.HasField(f("optional_fixed32"))); - Assert.IsFalse(message.HasField(f("optional_fixed64"))); - Assert.IsFalse(message.HasField(f("optional_sfixed32"))); - Assert.IsFalse(message.HasField(f("optional_sfixed64"))); - Assert.IsFalse(message.HasField(f("optional_float"))); - Assert.IsFalse(message.HasField(f("optional_double"))); - Assert.IsFalse(message.HasField(f("optional_bool"))); - Assert.IsFalse(message.HasField(f("optional_string"))); - Assert.IsFalse(message.HasField(f("optional_bytes"))); - - Assert.IsFalse(message.HasField(f("optionalgroup"))); - Assert.IsFalse(message.HasField(f("optional_nested_message"))); - Assert.IsFalse(message.HasField(f("optional_foreign_message"))); - Assert.IsFalse(message.HasField(f("optional_import_message"))); - - Assert.IsFalse(message.HasField(f("optional_nested_enum"))); - Assert.IsFalse(message.HasField(f("optional_foreign_enum"))); - Assert.IsFalse(message.HasField(f("optional_import_enum"))); - - Assert.IsFalse(message.HasField(f("optional_string_piece"))); - Assert.IsFalse(message.HasField(f("optional_cord"))); - - // Optional fields without defaults are set to zero or something like it. - Assert.AreEqual(0, message[f("optional_int32")]); - Assert.AreEqual(0L, message[f("optional_int64")]); - Assert.AreEqual(0U, message[f("optional_uint32")]); - Assert.AreEqual(0UL, message[f("optional_uint64")]); - Assert.AreEqual(0, message[f("optional_sint32")]); - Assert.AreEqual(0L, message[f("optional_sint64")]); - Assert.AreEqual(0U, message[f("optional_fixed32")]); - Assert.AreEqual(0UL, message[f("optional_fixed64")]); - Assert.AreEqual(0, message[f("optional_sfixed32")]); - Assert.AreEqual(0L, message[f("optional_sfixed64")]); - Assert.AreEqual(0F, message[f("optional_float")]); - Assert.AreEqual(0D, message[f("optional_double")]); - Assert.AreEqual(false, message[f("optional_bool")]); - Assert.AreEqual("", message[f("optional_string")]); - Assert.AreEqual(ByteString.Empty, message[f("optional_bytes")]); - - // Embedded messages should also be clear. - Assert.IsFalse(((IMessage) message[f("optionalgroup")]).HasField(groupA)); - Assert.IsFalse(((IMessage) message[f("optional_nested_message")]) - .HasField(nestedB)); - Assert.IsFalse(((IMessage) message[f("optional_foreign_message")]) - .HasField(foreignC)); - Assert.IsFalse(((IMessage) message[f("optional_import_message")]) - .HasField(importD)); - - Assert.AreEqual(0, ((IMessage) message[f("optionalgroup")])[groupA]); - Assert.AreEqual(0, ((IMessage) message[f("optional_nested_message")])[nestedB]); - Assert.AreEqual(0, ((IMessage) message[f("optional_foreign_message")])[foreignC]); - Assert.AreEqual(0, ((IMessage) message[f("optional_import_message")])[importD]); - - // Enums without defaults are set to the first value in the enum. - Assert.AreEqual(nestedFoo, message[f("optional_nested_enum")]); - Assert.AreEqual(foreignFoo, message[f("optional_foreign_enum")]); - Assert.AreEqual(importFoo, message[f("optional_import_enum")]); - - Assert.AreEqual("", message[f("optional_string_piece")]); - Assert.AreEqual("", message[f("optional_cord")]); - - // Repeated fields are empty. - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_int32"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_int64"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_uint32"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_uint64"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_sint32"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_sint64"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_fixed32"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_fixed64"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_sfixed32"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_sfixed64"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_float"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_double"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_bool"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_string"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_bytes"))); - - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeatedgroup"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_nested_message"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_foreign_message"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_import_message"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_nested_enum"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_foreign_enum"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_import_enum"))); - - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_string_piece"))); - Assert.AreEqual(0, message.GetRepeatedFieldCount(f("repeated_cord"))); - - // has_blah() should also be false for all default fields. - Assert.IsFalse(message.HasField(f("default_int32"))); - Assert.IsFalse(message.HasField(f("default_int64"))); - Assert.IsFalse(message.HasField(f("default_uint32"))); - Assert.IsFalse(message.HasField(f("default_uint64"))); - Assert.IsFalse(message.HasField(f("default_sint32"))); - Assert.IsFalse(message.HasField(f("default_sint64"))); - Assert.IsFalse(message.HasField(f("default_fixed32"))); - Assert.IsFalse(message.HasField(f("default_fixed64"))); - Assert.IsFalse(message.HasField(f("default_sfixed32"))); - Assert.IsFalse(message.HasField(f("default_sfixed64"))); - Assert.IsFalse(message.HasField(f("default_float"))); - Assert.IsFalse(message.HasField(f("default_double"))); - Assert.IsFalse(message.HasField(f("default_bool"))); - Assert.IsFalse(message.HasField(f("default_string"))); - Assert.IsFalse(message.HasField(f("default_bytes"))); - - Assert.IsFalse(message.HasField(f("default_nested_enum"))); - Assert.IsFalse(message.HasField(f("default_foreign_enum"))); - Assert.IsFalse(message.HasField(f("default_import_enum"))); - - Assert.IsFalse(message.HasField(f("default_string_piece"))); - Assert.IsFalse(message.HasField(f("default_cord"))); - - // Fields with defaults have their default values (duh). - Assert.AreEqual(41, message[f("default_int32")]); - Assert.AreEqual(42L, message[f("default_int64")]); - Assert.AreEqual(43U, message[f("default_uint32")]); - Assert.AreEqual(44UL, message[f("default_uint64")]); - Assert.AreEqual(-45, message[f("default_sint32")]); - Assert.AreEqual(46L, message[f("default_sint64")]); - Assert.AreEqual(47U, message[f("default_fixed32")]); - Assert.AreEqual(48UL, message[f("default_fixed64")]); - Assert.AreEqual(49, message[f("default_sfixed32")]); - Assert.AreEqual(-50L, message[f("default_sfixed64")]); - Assert.AreEqual(51.5F, message[f("default_float")]); - Assert.AreEqual(52e3D, message[f("default_double")]); - Assert.AreEqual(true, message[f("default_bool")]); - Assert.AreEqual("hello", message[f("default_string")]); - Assert.AreEqual(TestUtil.ToBytes("world"), message[f("default_bytes")]); - - Assert.AreEqual(nestedBar, message[f("default_nested_enum")]); - Assert.AreEqual(foreignBar, message[f("default_foreign_enum")]); - Assert.AreEqual(importBar, message[f("default_import_enum")]); - - Assert.AreEqual("abc", message[f("default_string_piece")]); - Assert.AreEqual("123", message[f("default_cord")]); - } - - // --------------------------------------------------------------- - - internal void AssertRepeatedFieldsModifiedViaReflection(IMessage message) - { - // ModifyRepeatedFields only sets the second repeated element of each - // field. In addition to verifying this, we also verify that the first - // element and size were *not* modified. - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_int32"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_int64"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_uint32"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_uint64"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_sint32"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_sint64"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_fixed32"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_fixed64"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_sfixed32"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_sfixed64"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_float"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_double"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_bool"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_string"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_bytes"))); - - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeatedgroup"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_nested_message"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_foreign_message"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_import_message"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_nested_enum"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_foreign_enum"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_import_enum"))); - - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_string_piece"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("repeated_cord"))); - - Assert.AreEqual(201, message[f("repeated_int32"), 0]); - Assert.AreEqual(202L, message[f("repeated_int64"), 0]); - Assert.AreEqual(203U, message[f("repeated_uint32"), 0]); - Assert.AreEqual(204UL, message[f("repeated_uint64"), 0]); - Assert.AreEqual(205, message[f("repeated_sint32"), 0]); - Assert.AreEqual(206L, message[f("repeated_sint64"), 0]); - Assert.AreEqual(207U, message[f("repeated_fixed32"), 0]); - Assert.AreEqual(208UL, message[f("repeated_fixed64"), 0]); - Assert.AreEqual(209, message[f("repeated_sfixed32"), 0]); - Assert.AreEqual(210L, message[f("repeated_sfixed64"), 0]); - Assert.AreEqual(211F, message[f("repeated_float"), 0]); - Assert.AreEqual(212D, message[f("repeated_double"), 0]); - Assert.AreEqual(true, message[f("repeated_bool"), 0]); - Assert.AreEqual("215", message[f("repeated_string"), 0]); - Assert.AreEqual(TestUtil.ToBytes("216"), message[f("repeated_bytes"), 0]); - - Assert.AreEqual(217, ((IMessage) message[f("repeatedgroup"), 0])[repeatedGroupA]); - Assert.AreEqual(218, ((IMessage) message[f("repeated_nested_message"), 0])[nestedB]); - Assert.AreEqual(219, ((IMessage) message[f("repeated_foreign_message"), 0])[foreignC]); - Assert.AreEqual(220, ((IMessage) message[f("repeated_import_message"), 0])[importD]); - - Assert.AreEqual(nestedBar, message[f("repeated_nested_enum"), 0]); - Assert.AreEqual(foreignBar, message[f("repeated_foreign_enum"), 0]); - Assert.AreEqual(importBar, message[f("repeated_import_enum"), 0]); - - Assert.AreEqual("224", message[f("repeated_string_piece"), 0]); - Assert.AreEqual("225", message[f("repeated_cord"), 0]); - - Assert.AreEqual(501, message[f("repeated_int32"), 1]); - Assert.AreEqual(502L, message[f("repeated_int64"), 1]); - Assert.AreEqual(503U, message[f("repeated_uint32"), 1]); - Assert.AreEqual(504UL, message[f("repeated_uint64"), 1]); - Assert.AreEqual(505, message[f("repeated_sint32"), 1]); - Assert.AreEqual(506L, message[f("repeated_sint64"), 1]); - Assert.AreEqual(507U, message[f("repeated_fixed32"), 1]); - Assert.AreEqual(508UL, message[f("repeated_fixed64"), 1]); - Assert.AreEqual(509, message[f("repeated_sfixed32"), 1]); - Assert.AreEqual(510L, message[f("repeated_sfixed64"), 1]); - Assert.AreEqual(511F, message[f("repeated_float"), 1]); - Assert.AreEqual(512D, message[f("repeated_double"), 1]); - Assert.AreEqual(true, message[f("repeated_bool"), 1]); - Assert.AreEqual("515", message[f("repeated_string"), 1]); - Assert.AreEqual(TestUtil.ToBytes("516"), message[f("repeated_bytes"), 1]); - - Assert.AreEqual(517, ((IMessage) message[f("repeatedgroup"), 1])[repeatedGroupA]); - Assert.AreEqual(518, ((IMessage) message[f("repeated_nested_message"), 1])[nestedB]); - Assert.AreEqual(519, ((IMessage) message[f("repeated_foreign_message"), 1])[foreignC]); - Assert.AreEqual(520, ((IMessage) message[f("repeated_import_message"), 1])[importD]); - - Assert.AreEqual(nestedFoo, message[f("repeated_nested_enum"), 1]); - Assert.AreEqual(foreignFoo, message[f("repeated_foreign_enum"), 1]); - Assert.AreEqual(importFoo, message[f("repeated_import_enum"), 1]); - - Assert.AreEqual("524", message[f("repeated_string_piece"), 1]); - Assert.AreEqual("525", message[f("repeated_cord"), 1]); - } - - /// - /// Verifies that the reflection setters for the given Builder object throw an - /// ArgumentNullException if they are passed a null value. - /// - public void AssertReflectionSettersRejectNull(IBuilder builder) - { - TestUtil.AssertArgumentNullException(() => builder[f("optional_string")] = null); - TestUtil.AssertArgumentNullException(() => builder[f("optional_bytes")] = null); - TestUtil.AssertArgumentNullException(() => builder[f("optional_nested_enum")] = null); - TestUtil.AssertArgumentNullException(() => builder[f("optional_nested_message")] = null); - TestUtil.AssertArgumentNullException(() => builder[f("optional_nested_message")] = null); - TestUtil.AssertArgumentNullException(() => builder.WeakAddRepeatedField(f("repeated_string"), null)); - TestUtil.AssertArgumentNullException(() => builder.WeakAddRepeatedField(f("repeated_bytes"), null)); - TestUtil.AssertArgumentNullException(() => builder.WeakAddRepeatedField(f("repeated_nested_enum"), null)); - TestUtil.AssertArgumentNullException(() => builder.WeakAddRepeatedField(f("repeated_nested_message"), null)); - } - - /// - /// Verifies that the reflection repeated setters for the given Builder object throw an - /// ArgumentNullException if they are passed a null value. - /// - public void AssertReflectionRepeatedSettersRejectNull(IBuilder builder) - { - builder.WeakAddRepeatedField(f("repeated_string"), "one"); - TestUtil.AssertArgumentNullException(() => builder.SetRepeatedField(f("repeated_string"), 0, null)); - builder.WeakAddRepeatedField(f("repeated_bytes"), TestUtil.ToBytes("one")); - TestUtil.AssertArgumentNullException(() => builder.SetRepeatedField(f("repeated_bytes"), 0, null)); - builder.WeakAddRepeatedField(f("repeated_nested_enum"), nestedBaz); - TestUtil.AssertArgumentNullException(() => builder.SetRepeatedField(f("repeated_nested_enum"), 0, null)); - builder.WeakAddRepeatedField(f("repeated_nested_message"), - new TestAllTypes.Types.NestedMessage.Builder {Bb = 218}.Build()); - TestUtil.AssertArgumentNullException(() => builder.SetRepeatedField(f("repeated_nested_message"), 0, null)); - } - - public void SetPackedFieldsViaReflection(IBuilder message) - { - message.WeakAddRepeatedField(f("packed_int32"), 601); - message.WeakAddRepeatedField(f("packed_int64"), 602L); - message.WeakAddRepeatedField(f("packed_uint32"), 603U); - message.WeakAddRepeatedField(f("packed_uint64"), 604UL); - message.WeakAddRepeatedField(f("packed_sint32"), 605); - message.WeakAddRepeatedField(f("packed_sint64"), 606L); - message.WeakAddRepeatedField(f("packed_fixed32"), 607U); - message.WeakAddRepeatedField(f("packed_fixed64"), 608UL); - message.WeakAddRepeatedField(f("packed_sfixed32"), 609); - message.WeakAddRepeatedField(f("packed_sfixed64"), 610L); - message.WeakAddRepeatedField(f("packed_float"), 611F); - message.WeakAddRepeatedField(f("packed_double"), 612D); - message.WeakAddRepeatedField(f("packed_bool"), true); - message.WeakAddRepeatedField(f("packed_enum"), foreignBar); - // Add a second one of each field. - message.WeakAddRepeatedField(f("packed_int32"), 701); - message.WeakAddRepeatedField(f("packed_int64"), 702L); - message.WeakAddRepeatedField(f("packed_uint32"), 703U); - message.WeakAddRepeatedField(f("packed_uint64"), 704UL); - message.WeakAddRepeatedField(f("packed_sint32"), 705); - message.WeakAddRepeatedField(f("packed_sint64"), 706L); - message.WeakAddRepeatedField(f("packed_fixed32"), 707U); - message.WeakAddRepeatedField(f("packed_fixed64"), 708UL); - message.WeakAddRepeatedField(f("packed_sfixed32"), 709); - message.WeakAddRepeatedField(f("packed_sfixed64"), 710L); - message.WeakAddRepeatedField(f("packed_float"), 711F); - message.WeakAddRepeatedField(f("packed_double"), 712D); - message.WeakAddRepeatedField(f("packed_bool"), false); - message.WeakAddRepeatedField(f("packed_enum"), foreignBaz); - } - - public void AssertPackedFieldsSetViaReflection(IMessage message) - { - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_int32"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_int64"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_uint32"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_uint64"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_sint32"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_sint64"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_fixed32"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_fixed64"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_sfixed32"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_sfixed64"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_float"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_double"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_bool"))); - Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_enum"))); - - Assert.AreEqual(601, message[f("packed_int32"), 0]); - Assert.AreEqual(602L, message[f("packed_int64"), 0]); - Assert.AreEqual(603u, message[f("packed_uint32"), 0]); - Assert.AreEqual(604uL, message[f("packed_uint64"), 0]); - Assert.AreEqual(605, message[f("packed_sint32"), 0]); - Assert.AreEqual(606L, message[f("packed_sint64"), 0]); - Assert.AreEqual(607u, message[f("packed_fixed32"), 0]); - Assert.AreEqual(608uL, message[f("packed_fixed64"), 0]); - Assert.AreEqual(609, message[f("packed_sfixed32"), 0]); - Assert.AreEqual(610L, message[f("packed_sfixed64"), 0]); - Assert.AreEqual(611F, message[f("packed_float"), 0]); - Assert.AreEqual(612D, message[f("packed_double"), 0]); - Assert.AreEqual(true, message[f("packed_bool"), 0]); - Assert.AreEqual(foreignBar, message[f("packed_enum"), 0]); - - Assert.AreEqual(701, message[f("packed_int32"), 1]); - Assert.AreEqual(702L, message[f("packed_int64"), 1]); - Assert.AreEqual(703u, message[f("packed_uint32"), 1]); - Assert.AreEqual(704uL, message[f("packed_uint64"), 1]); - Assert.AreEqual(705, message[f("packed_sint32"), 1]); - Assert.AreEqual(706L, message[f("packed_sint64"), 1]); - Assert.AreEqual(707u, message[f("packed_fixed32"), 1]); - Assert.AreEqual(708uL, message[f("packed_fixed64"), 1]); - Assert.AreEqual(709, message[f("packed_sfixed32"), 1]); - Assert.AreEqual(710L, message[f("packed_sfixed64"), 1]); - Assert.AreEqual(711F, message[f("packed_float"), 1]); - Assert.AreEqual(712D, message[f("packed_double"), 1]); - Assert.AreEqual(false, message[f("packed_bool"), 1]); - Assert.AreEqual(foreignBaz, message[f("packed_enum"), 1]); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/ReusableBuilderTest.cs b/src/ProtocolBuffers.Test/ReusableBuilderTest.cs deleted file mode 100644 index a63f657..0000000 --- a/src/ProtocolBuffers.Test/ReusableBuilderTest.cs +++ /dev/null @@ -1,171 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Text; -using Google.ProtocolBuffers.Collections; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Google.ProtocolBuffers.TestProtos; -using Google.ProtocolBuffers.Serialization; -using UnitTest.Issues.TestProtos; - -namespace Google.ProtocolBuffers -{ - [TestClass] - public class ReusableBuilderTest - { - //Issue 28: Circular message dependencies result in null defaults for DefaultInstance - [TestMethod] - public void EnsureStaticCicularReference() - { - MyMessageAReferenceB ab = MyMessageAReferenceB.DefaultInstance; - Assert.IsNotNull(ab); - Assert.IsNotNull(ab.Value); - MyMessageBReferenceA ba = MyMessageBReferenceA.DefaultInstance; - Assert.IsNotNull(ba); - Assert.IsNotNull(ba.Value); - } - - [TestMethod] - public void TestModifyDefaultInstance() - { - //verify that the default instance has correctly been marked as read-only - Assert.AreEqual(typeof(PopsicleList), TestAllTypes.DefaultInstance.RepeatedBoolList.GetType()); - PopsicleList list = (PopsicleList)TestAllTypes.DefaultInstance.RepeatedBoolList; - Assert.IsTrue(list.IsReadOnly); - } - - [TestMethod] - public void TestUnmodifiedDefaultInstance() - { - //Simply calling ToBuilder().Build() no longer creates a copy of the message - TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); - Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); - } - - [TestMethod] - public void BuildMultipleWithoutChange() - { - //Calling Build() or BuildPartial() does not require a copy of the message - TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); - builder.SetDefaultBool(true); - - TestAllTypes first = builder.BuildPartial(); - //Still the same instance? - Assert.IsTrue(ReferenceEquals(first, builder.Build())); - //Still the same instance? - Assert.IsTrue(ReferenceEquals(first, builder.BuildPartial().ToBuilder().Build())); - } - - [TestMethod] - public void MergeFromDefaultInstance() - { - TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); - Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); - builder.MergeFrom(TestAllTypes.DefaultInstance); - Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); - } - - [TestMethod] - public void BuildNewBuilderIsDefaultInstance() - { - Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, new TestAllTypes.Builder().Build())); - Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, TestAllTypes.CreateBuilder().Build())); - //last test, if you clear a builder it reverts to default instance - Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, - TestAllTypes.CreateBuilder().SetOptionalBool(true).Build().ToBuilder().Clear().Build())); - } - - [TestMethod] - public void BuildModifyAndRebuild() - { - TestAllTypes.Builder b1 = new TestAllTypes.Builder(); - b1.SetDefaultInt32(1); - b1.AddRepeatedInt32(2); - b1.SetOptionalForeignMessage(ForeignMessage.DefaultInstance); - - TestAllTypes m1 = b1.Build(); - - b1.SetDefaultInt32(5); - b1.AddRepeatedInt32(6); - b1.SetOptionalForeignMessage(b1.OptionalForeignMessage.ToBuilder().SetC(7)); - - TestAllTypes m2 = b1.Build(); - - Assert.AreEqual("{\"optional_foreign_message\":{},\"repeated_int32\":[2],\"default_int32\":1}", Extensions.ToJson(m1)); - Assert.AreEqual("{\"optional_foreign_message\":{\"c\":7},\"repeated_int32\":[2,6],\"default_int32\":5}", Extensions.ToJson(m2)); - } - - [TestMethod] - public void CloneOnChangePrimitive() - { - TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); - Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); - builder.SetDefaultBool(true); - Assert.IsFalse(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); - } - - [TestMethod] - public void CloneOnAddRepeatedBool() - { - TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); - Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); - builder.AddRepeatedBool(true); - Assert.IsFalse(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); - } - - [TestMethod] - public void CloneOnGetRepeatedBoolList() - { - TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); - Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); - GC.KeepAlive(builder.RepeatedBoolList); - Assert.IsFalse(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); - } - - [TestMethod] - public void CloneOnChangeMessage() - { - TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); - Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); - builder.SetOptionalForeignMessage(new ForeignMessage.Builder()); - Assert.IsFalse(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); - } - - [TestMethod] - public void CloneOnClearMessage() - { - TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); - Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); - builder.ClearOptionalForeignMessage(); - Assert.IsFalse(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); - } - - [TestMethod] - public void CloneOnGetRepeatedForeignMessageList() - { - TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); - Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); - GC.KeepAlive(builder.RepeatedForeignMessageList); - Assert.IsFalse(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); - } - - [TestMethod] - public void CloneOnChangeEnumValue() - { - TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); - Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); - builder.SetOptionalForeignEnum(ForeignEnum.FOREIGN_BAR); - Assert.IsFalse(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); - } - - [TestMethod] - public void CloneOnGetRepeatedForeignEnumList() - { - TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); - Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); - GC.KeepAlive(builder.RepeatedForeignEnumList); - Assert.IsFalse(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); - } - - } -} diff --git a/src/ProtocolBuffers.Test/SerializableAttribute.cs b/src/ProtocolBuffers.Test/SerializableAttribute.cs deleted file mode 100644 index 0553762..0000000 --- a/src/ProtocolBuffers.Test/SerializableAttribute.cs +++ /dev/null @@ -1,12 +0,0 @@ -#if NOSERIALIZABLE && !COMPACT_FRAMEWORK - -namespace System -{ - [AttributeUsage(AttributeTargets.Class)] - public class SerializableAttribute : Attribute - { - public SerializableAttribute () : base() { } - } -} - -#endif diff --git a/src/ProtocolBuffers.Test/SerializableTest.cs b/src/ProtocolBuffers.Test/SerializableTest.cs deleted file mode 100644 index 9040614..0000000 --- a/src/ProtocolBuffers.Test/SerializableTest.cs +++ /dev/null @@ -1,179 +0,0 @@ -#if !NOSERIALIZABLE -using System; -using System.Collections.Generic; -using System.IO; -using System.Runtime.Serialization; -using System.Runtime.Serialization.Formatters.Binary; -using System.Text; -using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers -{ - [TestClass] - public class SerializableTest - { - /// - /// Just keep it from even compiling if we these objects don't implement the expected interface. - /// - public static readonly ISerializable CompileTimeCheckSerializableMessage = TestXmlMessage.DefaultInstance; - public static readonly ISerializable CompileTimeCheckSerializableBuilder = new TestXmlMessage.Builder(); - - [TestMethod] - public void TestPlainMessage() - { - TestXmlMessage message = TestXmlMessage.CreateBuilder() - .SetValid(true) - .SetText("text") - .AddTextlines("a") - .AddTextlines("b") - .AddTextlines("c") - .SetNumber(0x1010101010) - .AddNumbers(1) - .AddNumbers(2) - .AddNumbers(3) - .SetChild(TestXmlChild.CreateBuilder() - .AddOptions(EnumOptions.ONE) - .SetBinary(ByteString.CopyFrom(new byte[1]))) - .AddChildren(TestXmlMessage.Types.Children.CreateBuilder() - .AddOptions(EnumOptions.TWO) - .SetBinary(ByteString.CopyFrom(new byte[2]))) - .AddChildren(TestXmlMessage.Types.Children.CreateBuilder() - .AddOptions(EnumOptions.THREE) - .SetBinary(ByteString.CopyFrom(new byte[3]))) - .Build(); - - MemoryStream ms = new MemoryStream(); - new BinaryFormatter().Serialize(ms, message); - - ms.Position = 0; - TestXmlMessage copy = (TestXmlMessage)new BinaryFormatter().Deserialize(ms); - - Assert.AreEqual(message, copy); - } - - [TestMethod] - public void TestMessageWithExtensions() - { - TestXmlMessage message = TestXmlMessage.CreateBuilder() - .SetValid(true) - .SetText("text") - .AddTextlines("a") - .AddTextlines("b") - .AddTextlines("c") - .SetNumber(0x1010101010) - .AddNumbers(1) - .AddNumbers(2) - .AddNumbers(3) - .SetChild(TestXmlChild.CreateBuilder() - .AddOptions(EnumOptions.ONE) - .SetBinary(ByteString.CopyFrom(new byte[1]))) - .AddChildren(TestXmlMessage.Types.Children.CreateBuilder() - .AddOptions(EnumOptions.TWO) - .SetBinary(ByteString.CopyFrom(new byte[2]))) - .AddChildren(TestXmlMessage.Types.Children.CreateBuilder() - .AddOptions(EnumOptions.THREE) - .SetBinary(ByteString.CopyFrom(new byte[3]))) - .SetExtension(UnitTestXmlSerializerTestProtoFile.ExtensionText, " extension text value ! ") - .SetExtension(UnitTestXmlSerializerTestProtoFile.ExtensionMessage, new TestXmlExtension.Builder().SetNumber(42).Build()) - .AddExtension(UnitTestXmlSerializerTestProtoFile.ExtensionNumber, 100) - .AddExtension(UnitTestXmlSerializerTestProtoFile.ExtensionNumber, 101) - .AddExtension(UnitTestXmlSerializerTestProtoFile.ExtensionNumber, 102) - .SetExtension(UnitTestXmlSerializerTestProtoFile.ExtensionEnum, EnumOptions.ONE) - .Build(); - - ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); - UnitTestXmlSerializerTestProtoFile.RegisterAllExtensions(registry); - - MemoryStream ms = new MemoryStream(); - new BinaryFormatter().Serialize(ms, message); - - ms.Position = 0; - //you need to provide the extension registry as context to the serializer - BinaryFormatter bff = new BinaryFormatter(null, new StreamingContext(StreamingContextStates.All, registry)); - TestXmlMessage copy = (TestXmlMessage)bff.Deserialize(ms); - - // And all extensions will be defined. - Assert.AreEqual(message, copy); - } - - [TestMethod] - public void TestPlainBuilder() - { - TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder() - .SetValid(true) - .SetText("text") - .AddTextlines("a") - .AddTextlines("b") - .AddTextlines("c") - .SetNumber(0x1010101010) - .AddNumbers(1) - .AddNumbers(2) - .AddNumbers(3) - .SetChild(TestXmlChild.CreateBuilder() - .AddOptions(EnumOptions.ONE) - .SetBinary(ByteString.CopyFrom(new byte[1]))) - .AddChildren(TestXmlMessage.Types.Children.CreateBuilder() - .AddOptions(EnumOptions.TWO) - .SetBinary(ByteString.CopyFrom(new byte[2]))) - .AddChildren(TestXmlMessage.Types.Children.CreateBuilder() - .AddOptions(EnumOptions.THREE) - .SetBinary(ByteString.CopyFrom(new byte[3]))) - ; - - MemoryStream ms = new MemoryStream(); - new BinaryFormatter().Serialize(ms, builder); - - ms.Position = 0; - TestXmlMessage.Builder copy = (TestXmlMessage.Builder)new BinaryFormatter().Deserialize(ms); - - Assert.AreEqual(builder.Build(), copy.Build()); - } - - [TestMethod] - public void TestBuilderWithExtensions() - { - TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder() - .SetValid(true) - .SetText("text") - .AddTextlines("a") - .AddTextlines("b") - .AddTextlines("c") - .SetNumber(0x1010101010) - .AddNumbers(1) - .AddNumbers(2) - .AddNumbers(3) - .SetChild(TestXmlChild.CreateBuilder() - .AddOptions(EnumOptions.ONE) - .SetBinary(ByteString.CopyFrom(new byte[1]))) - .AddChildren(TestXmlMessage.Types.Children.CreateBuilder() - .AddOptions(EnumOptions.TWO) - .SetBinary(ByteString.CopyFrom(new byte[2]))) - .AddChildren(TestXmlMessage.Types.Children.CreateBuilder() - .AddOptions(EnumOptions.THREE) - .SetBinary(ByteString.CopyFrom(new byte[3]))) - .SetExtension(UnitTestXmlSerializerTestProtoFile.ExtensionText, " extension text value ! ") - .SetExtension(UnitTestXmlSerializerTestProtoFile.ExtensionMessage, new TestXmlExtension.Builder().SetNumber(42).Build()) - .AddExtension(UnitTestXmlSerializerTestProtoFile.ExtensionNumber, 100) - .AddExtension(UnitTestXmlSerializerTestProtoFile.ExtensionNumber, 101) - .AddExtension(UnitTestXmlSerializerTestProtoFile.ExtensionNumber, 102) - .SetExtension(UnitTestXmlSerializerTestProtoFile.ExtensionEnum, EnumOptions.ONE) - ; - - ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); - UnitTestXmlSerializerTestProtoFile.RegisterAllExtensions(registry); - - MemoryStream ms = new MemoryStream(); - new BinaryFormatter().Serialize(ms, builder); - - ms.Position = 0; - //you need to provide the extension registry as context to the serializer - BinaryFormatter bff = new BinaryFormatter(null, new StreamingContext(StreamingContextStates.All, registry)); - TestXmlMessage.Builder copy = (TestXmlMessage.Builder)bff.Deserialize(ms); - - // And all extensions will be defined. - Assert.AreEqual(builder.Build(), copy.Build()); - } - } -} -#endif \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/ServiceTest.cs b/src/ProtocolBuffers.Test/ServiceTest.cs deleted file mode 100644 index ee28ca1..0000000 --- a/src/ProtocolBuffers.Test/ServiceTest.cs +++ /dev/null @@ -1,262 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using Google.ProtocolBuffers.Descriptors; -using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers -{ - /// - /// Tests for generated service classes. - /// TODO(jonskeet): Convert the mocking tests using Rhino.Mocks. - /// - [TestClass] - public class ServiceTest - { - private delegate void Action(T1 t1, T2 t2); - - private static readonly MethodDescriptor FooDescriptor = TestGenericService.Descriptor.Methods[0]; - private static readonly MethodDescriptor BarDescriptor = TestGenericService.Descriptor.Methods[1]; - - [TestMethod] - public void GetRequestPrototype() - { - TestGenericService service = new TestServiceImpl(); - - Assert.AreSame(service.GetRequestPrototype(FooDescriptor), FooRequest.DefaultInstance); - Assert.AreSame(service.GetRequestPrototype(BarDescriptor), BarRequest.DefaultInstance); - } - - [TestMethod] - public void GetResponsePrototype() - { - TestGenericService service = new TestServiceImpl(); - - Assert.AreSame(service.GetResponsePrototype(FooDescriptor), FooResponse.DefaultInstance); - Assert.AreSame(service.GetResponsePrototype(BarDescriptor), BarResponse.DefaultInstance); - } - - [TestMethod] - public void CallMethodFoo() - { - FooRequest fooRequest = FooRequest.CreateBuilder().Build(); - FooResponse fooResponse = FooResponse.CreateBuilder().Build(); - IRpcController controller = new RpcTestController(); - - bool fooCalled = false; - - TestGenericService service = new TestServiceImpl((request, responseAction) => - { - Assert.AreSame(fooRequest, request); - fooCalled = true; - responseAction(fooResponse); - }, null, controller); - - bool doneHandlerCalled = false; - Action doneHandler = (response => - { - Assert.AreSame(fooResponse, response); - doneHandlerCalled = true; - }); - - service.CallMethod(FooDescriptor, controller, fooRequest, doneHandler); - - Assert.IsTrue(doneHandlerCalled); - Assert.IsTrue(fooCalled); - } - - [TestMethod] - public void CallMethodBar() - { - BarRequest barRequest = BarRequest.CreateBuilder().Build(); - BarResponse barResponse = BarResponse.CreateBuilder().Build(); - IRpcController controller = new RpcTestController(); - - bool barCalled = false; - - TestGenericService service = new TestServiceImpl(null, (request, responseAction) => - { - Assert.AreSame(barRequest, request); - barCalled = true; - responseAction(barResponse); - }, controller); - - bool doneHandlerCalled = false; - Action doneHandler = (response => - { - Assert.AreSame(barResponse, response); - doneHandlerCalled = true; - }); - - service.CallMethod(BarDescriptor, controller, barRequest, doneHandler); - - Assert.IsTrue(doneHandlerCalled); - Assert.IsTrue(barCalled); - } - - [TestMethod] - public void GeneratedStubFooCall() - { - IRpcChannel channel = new RpcTestChannel(); - IRpcController controller = new RpcTestController(); - TestGenericService service = TestGenericService.CreateStub(channel); - FooResponse fooResponse = null; - Action doneHandler = r => fooResponse = r; - - service.Foo(controller, FooRequest.DefaultInstance, doneHandler); - - Assert.IsNotNull(fooResponse); - Assert.IsFalse(controller.Failed); - } - - [TestMethod] - public void GeneratedStubBarCallFails() - { - IRpcChannel channel = new RpcTestChannel(); - IRpcController controller = new RpcTestController(); - TestGenericService service = TestGenericService.CreateStub(channel); - BarResponse barResponse = null; - Action doneHandler = r => barResponse = r; - - service.Bar(controller, BarRequest.DefaultInstance, doneHandler); - - Assert.IsNull(barResponse); - Assert.IsTrue(controller.Failed); - } - - #region RpcTestController - private class RpcTestController : IRpcController - { - public string TestFailedReason { get; set; } - public bool TestCancelled { get; set; } - public Action TestCancelledCallback { get; set; } - - void IRpcController.Reset() - { - TestFailedReason = null; - TestCancelled = false; - TestCancelledCallback = null; - } - - bool IRpcController.Failed - { - get { return TestFailedReason != null; } - } - - string IRpcController.ErrorText - { - get { return TestFailedReason; } - } - - void IRpcController.StartCancel() - { - TestCancelled = true; - if (TestCancelledCallback != null) - TestCancelledCallback(this); - } - - void IRpcController.SetFailed(string reason) - { - TestFailedReason = reason; - } - - bool IRpcController.IsCanceled() - { - return TestCancelled; - } - - void IRpcController.NotifyOnCancel(Action callback) - { - TestCancelledCallback = callback; - } - } - #endregion - #region RpcTestChannel - private class RpcTestChannel : IRpcChannel - { - public MethodDescriptor TestMethodCalled { get; set; } - - void IRpcChannel.CallMethod(MethodDescriptor method, IRpcController controller, IMessage request, IMessage responsePrototype, Action done) - { - TestMethodCalled = method; - try - { - done(FooResponse.DefaultInstance); - } - catch (Exception e) - { - controller.SetFailed(e.Message); - } - } - } - #endregion - #region TestServiceImpl - private class TestServiceImpl : TestGenericService - { - private readonly Action> fooHandler; - private readonly Action> barHandler; - private readonly IRpcController expectedController; - - internal TestServiceImpl() - { - } - - internal TestServiceImpl(Action> fooHandler, - Action> barHandler, - IRpcController expectedController) - { - this.fooHandler = fooHandler; - this.barHandler = barHandler; - this.expectedController = expectedController; - } - - public override void Foo(IRpcController controller, FooRequest request, Action done) - { - Assert.AreSame(expectedController, controller); - fooHandler(request, done); - } - - public override void Bar(IRpcController controller, BarRequest request, Action done) - { - Assert.AreSame(expectedController, controller); - barHandler(request, done); - } - } - #endregion - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/TestCornerCases.cs b/src/ProtocolBuffers.Test/TestCornerCases.cs deleted file mode 100644 index 0be4e1d..0000000 --- a/src/ProtocolBuffers.Test/TestCornerCases.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using UnitTest.Issues.TestProtos; - -namespace Google.ProtocolBuffers -{ - [TestClass] - public class TestCornerCases - { - [TestMethod] - public void TestRoundTripNegativeEnums() - { - NegativeEnumMessage msg = NegativeEnumMessage.CreateBuilder() - .SetValue(NegativeEnum.MinusOne) //11 - .AddValues(NegativeEnum.Zero) //2 - .AddValues(NegativeEnum.MinusOne) //11 - .AddValues(NegativeEnum.FiveBelow) //11 - //2 - .AddPackedValues(NegativeEnum.Zero) //1 - .AddPackedValues(NegativeEnum.MinusOne) //10 - .AddPackedValues(NegativeEnum.FiveBelow) //10 - .Build(); - - Assert.AreEqual(58, msg.SerializedSize); - - byte[] bytes = new byte[58]; - CodedOutputStream output = CodedOutputStream.CreateInstance(bytes); - - msg.WriteTo(output); - Assert.AreEqual(0, output.SpaceLeft); - - NegativeEnumMessage copy = NegativeEnumMessage.ParseFrom(bytes); - Assert.AreEqual(msg, copy); - } - } -} diff --git a/src/ProtocolBuffers.Test/TestMimeMessageFormats.cs b/src/ProtocolBuffers.Test/TestMimeMessageFormats.cs deleted file mode 100644 index c16f567..0000000 --- a/src/ProtocolBuffers.Test/TestMimeMessageFormats.cs +++ /dev/null @@ -1,264 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using Google.ProtocolBuffers.Serialization; -using Google.ProtocolBuffers.Serialization.Http; -using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers -{ - [TestClass] - public class TestMimeMessageFormats - { - // There is a whole host of various json mime types in use around the net, this is the set we accept... - readonly IEnumerable JsonTypes = new string[] { "application/json", "application/x-json", "application/x-javascript", "text/javascript", "text/x-javascript", "text/x-json", "text/json" }; - readonly IEnumerable XmlTypes = new string[] { "text/xml", "application/xml" }; - readonly IEnumerable ProtobufTypes = new string[] { "application/binary", "application/x-protobuf", "application/vnd.google.protobuf" }; - - [TestMethod] - public void TestReadJsonMimeTypes() - { - foreach (string type in JsonTypes) - { - Assert.IsTrue( - MessageFormatFactory.CreateInputStream(new MessageFormatOptions(), type, Stream.Null) - is JsonFormatReader); - } - Assert.IsTrue( - MessageFormatFactory.CreateInputStream(new MessageFormatOptions() { DefaultContentType = "application/json" }, null, Stream.Null) - is JsonFormatReader); - } - [TestMethod] - public void TestWriteJsonMimeTypes() - { - foreach (string type in JsonTypes) - { - Assert.IsTrue( - MessageFormatFactory.CreateOutputStream(new MessageFormatOptions(), type, Stream.Null) - is JsonFormatWriter); - } - Assert.IsTrue( - MessageFormatFactory.CreateOutputStream(new MessageFormatOptions() { DefaultContentType = "application/json" }, null, Stream.Null) - is JsonFormatWriter); - } - [TestMethod] - public void TestReadXmlMimeTypes() - { - foreach (string type in XmlTypes) - { - Assert.IsTrue( - MessageFormatFactory.CreateInputStream(new MessageFormatOptions(), type, Stream.Null) - is XmlFormatReader); - } - Assert.IsTrue( - MessageFormatFactory.CreateInputStream(new MessageFormatOptions() { DefaultContentType = "application/xml" }, null, Stream.Null) - is XmlFormatReader); - } - [TestMethod] - public void TestWriteXmlMimeTypes() - { - foreach (string type in XmlTypes) - { - Assert.IsTrue( - MessageFormatFactory.CreateOutputStream(new MessageFormatOptions(), type, Stream.Null) - is XmlFormatWriter); - } - Assert.IsTrue( - MessageFormatFactory.CreateOutputStream(new MessageFormatOptions() { DefaultContentType = "application/xml" }, null, Stream.Null) - is XmlFormatWriter); - } - [TestMethod] - public void TestReadProtoMimeTypes() - { - foreach (string type in ProtobufTypes) - { - Assert.IsTrue( - MessageFormatFactory.CreateInputStream(new MessageFormatOptions(), type, Stream.Null) - is CodedInputStream); - } - Assert.IsTrue( - MessageFormatFactory.CreateInputStream(new MessageFormatOptions() { DefaultContentType = "application/vnd.google.protobuf" }, null, Stream.Null) - is CodedInputStream); - } - [TestMethod] - public void TestWriteProtoMimeTypes() - { - foreach (string type in ProtobufTypes) - { - Assert.IsTrue( - MessageFormatFactory.CreateOutputStream(new MessageFormatOptions(), type, Stream.Null) - is CodedOutputStream); - } - Assert.IsTrue( - MessageFormatFactory.CreateOutputStream(new MessageFormatOptions() { DefaultContentType = "application/vnd.google.protobuf" }, null, Stream.Null) - is CodedOutputStream); - } - [TestMethod] - public void TestMergeFromJsonType() - { - TestXmlMessage msg = Extensions.MergeFrom(new TestXmlMessage.Builder(), - new MessageFormatOptions(), "application/json", new MemoryStream(Encoding.UTF8.GetBytes( - Extensions.ToJson(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build()) - ))) - .Build(); - Assert.AreEqual("a", msg.Text); - Assert.AreEqual(1, msg.Number); - } - [TestMethod] - public void TestMergeFromXmlType() - { - TestXmlMessage msg = Extensions.MergeFrom(new TestXmlMessage.Builder(), - new MessageFormatOptions(), "application/xml", new MemoryStream(Encoding.UTF8.GetBytes( - Extensions.ToXml(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build()) - ))) - .Build(); - Assert.AreEqual("a", msg.Text); - Assert.AreEqual(1, msg.Number); - } - [TestMethod] - public void TestMergeFromProtoType() - { - TestXmlMessage msg = Extensions.MergeFrom(new TestXmlMessage.Builder(), - new MessageFormatOptions(), "application/vnd.google.protobuf", new MemoryStream( - TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build().ToByteArray() - )) - .Build(); - Assert.AreEqual("a", msg.Text); - Assert.AreEqual(1, msg.Number); - } - [TestMethod] - public void TestWriteToJsonType() - { - MemoryStream ms = new MemoryStream(); - Extensions.WriteTo(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build(), - new MessageFormatOptions(), "application/json", ms); - - Assert.AreEqual(@"{""text"":""a"",""number"":1}", Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length)); - } - [TestMethod] - public void TestWriteToXmlType() - { - MemoryStream ms = new MemoryStream(); - Extensions.WriteTo(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build(), - new MessageFormatOptions(), "application/xml", ms); - - Assert.AreEqual("a1", Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length)); - } - [TestMethod] - public void TestWriteToProtoType() - { - MemoryStream ms = new MemoryStream(); - Extensions.WriteTo(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build(), - new MessageFormatOptions(), "application/vnd.google.protobuf", ms); - - byte[] bytes = TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build().ToByteArray(); - TestUtil.AssertBytesEqual(bytes, ms.ToArray()); - } - [TestMethod] - public void TestXmlReaderOptions() - { - MemoryStream ms = new MemoryStream(); - XmlFormatWriter.CreateInstance(ms) - .SetOptions(XmlWriterOptions.OutputNestedArrays) - .WriteMessage("my-root-node", TestXmlMessage.CreateBuilder().SetText("a").AddNumbers(1).AddNumbers(2).Build()); - ms.Position = 0; - - MessageFormatOptions options = new MessageFormatOptions() - { - XmlReaderOptions = XmlReaderOptions.ReadNestedArrays, - XmlReaderRootElementName = "my-root-node" - }; - - TestXmlMessage msg = Extensions.MergeFrom(new TestXmlMessage.Builder(), - options, "application/xml", ms) - .Build(); - - Assert.AreEqual("a", msg.Text); - Assert.AreEqual(1, msg.NumbersList[0]); - Assert.AreEqual(2, msg.NumbersList[1]); - - } - [TestMethod] - public void TestXmlWriterOptions() - { - TestXmlMessage message = TestXmlMessage.CreateBuilder().SetText("a").AddNumbers(1).AddNumbers(2).Build(); - MessageFormatOptions options = new MessageFormatOptions() - { - XmlWriterOptions = XmlWriterOptions.OutputNestedArrays, - XmlWriterRootElementName = "root-node" - }; - - MemoryStream ms = new MemoryStream(); - Extensions.WriteTo(message, options, "application/xml", ms); - ms.Position = 0; - - TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); - XmlFormatReader.CreateInstance(ms) - .SetOptions(XmlReaderOptions.ReadNestedArrays) - .Merge("root-node", builder); - - Assert.AreEqual("a", builder.Text); - Assert.AreEqual(1, builder.NumbersList[0]); - Assert.AreEqual(2, builder.NumbersList[1]); - } - [TestMethod] - public void TestJsonFormatted() - { - MemoryStream ms = new MemoryStream(); - Extensions.WriteTo(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build(), - new MessageFormatOptions() { FormattedOutput = true }, "application/json", ms); - - Assert.AreEqual("{\r\n \"text\": \"a\",\r\n \"number\": 1\r\n}", Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length)); - } - [TestMethod] - public void TestXmlFormatted() - { - MemoryStream ms = new MemoryStream(); - Extensions.WriteTo(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build(), - new MessageFormatOptions() { FormattedOutput = true }, "application/xml", ms); - - Assert.AreEqual("\r\n a\r\n 1\r\n", Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length)); - } - - [TestMethod] - public void TestReadCustomMimeTypes() - { - var options = new MessageFormatOptions(); - //Remove existing mime-type mappings - options.MimeInputTypes.Clear(); - //Add our own - options.MimeInputTypes.Add("-custom-XML-mime-type-", XmlFormatReader.CreateInstance); - Assert.AreEqual(1, options.MimeInputTypes.Count); - - Stream xmlStream = new MemoryStream(Encoding.UTF8.GetBytes( - Extensions.ToXml(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build()) - )); - - TestXmlMessage msg = Extensions.MergeFrom(new TestXmlMessage.Builder(), - options, "-custom-XML-mime-type-", xmlStream) - .Build(); - Assert.AreEqual("a", msg.Text); - Assert.AreEqual(1, msg.Number); - } - - [TestMethod] - public void TestWriteToCustomType() - { - var options = new MessageFormatOptions(); - //Remove existing mime-type mappings - options.MimeOutputTypes.Clear(); - //Add our own - options.MimeOutputTypes.Add("-custom-XML-mime-type-", XmlFormatWriter.CreateInstance); - - Assert.AreEqual(1, options.MimeOutputTypes.Count); - - MemoryStream ms = new MemoryStream(); - Extensions.WriteTo(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build(), - options, "-custom-XML-mime-type-", ms); - - Assert.AreEqual("a1", Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length)); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestCSharpOptionsProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestCSharpOptionsProtoFile.cs deleted file mode 100644 index 8c81980..0000000 --- a/src/ProtocolBuffers.Test/TestProtos/UnitTestCSharpOptionsProtoFile.cs +++ /dev/null @@ -1,426 +0,0 @@ -// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.TestProtos { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class UnitTestCSharpOptionsProtoFile { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_OptionsMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_OptionsMessage__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static UnitTestCSharpOptionsProtoFile() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "Ci1nb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfY3NoYXJwX29wdGlvbnMucHJv", - "dG8SEXByb3RvYnVmX3VuaXR0ZXN0GiRnb29nbGUvcHJvdG9idWYvY3NoYXJw", - "X29wdGlvbnMucHJvdG8iXgoOT3B0aW9uc01lc3NhZ2USDgoGbm9ybWFsGAEg", - "ASgJEhcKD29wdGlvbnNfbWVzc2FnZRgCIAEoCRIjCgpjdXN0b21pemVkGAMg", - "ASgJQg/CPgwKCkN1c3RvbU5hbWVCRsI+QwohR29vZ2xlLlByb3RvY29sQnVm", - "ZmVycy5UZXN0UHJvdG9zEh5Vbml0VGVzdENTaGFycE9wdGlvbnNQcm90b0Zp", - "bGU=")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_protobuf_unittest_OptionsMessage__Descriptor = Descriptor.MessageTypes[0]; - internal__static_protobuf_unittest_OptionsMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_OptionsMessage__Descriptor, - new string[] { "Normal", "OptionsMessage_", "CustomName", }); - pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); - RegisterAllExtensions(registry); - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.RegisterAllExtensions(registry); - return registry; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, - }, assigner); - } - #endregion - - } - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class OptionsMessage : pb::GeneratedMessage { - private OptionsMessage() { } - private static readonly OptionsMessage defaultInstance = new OptionsMessage().MakeReadOnly(); - private static readonly string[] _optionsMessageFieldNames = new string[] { "customized", "normal", "options_message" }; - private static readonly uint[] _optionsMessageFieldTags = new uint[] { 26, 10, 18 }; - public static OptionsMessage DefaultInstance { - get { return defaultInstance; } - } - - public override OptionsMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override OptionsMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCSharpOptionsProtoFile.internal__static_protobuf_unittest_OptionsMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCSharpOptionsProtoFile.internal__static_protobuf_unittest_OptionsMessage__FieldAccessorTable; } - } - - public const int NormalFieldNumber = 1; - private bool hasNormal; - private string normal_ = ""; - public bool HasNormal { - get { return hasNormal; } - } - public string Normal { - get { return normal_; } - } - - public const int OptionsMessage_FieldNumber = 2; - private bool hasOptionsMessage_; - private string optionsMessage_ = ""; - public bool HasOptionsMessage_ { - get { return hasOptionsMessage_; } - } - public string OptionsMessage_ { - get { return optionsMessage_; } - } - - public const int CustomNameFieldNumber = 3; - private bool hasCustomName; - private string customized_ = ""; - public bool HasCustomName { - get { return hasCustomName; } - } - public string CustomName { - get { return customized_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _optionsMessageFieldNames; - if (hasNormal) { - output.WriteString(1, field_names[1], Normal); - } - if (hasOptionsMessage_) { - output.WriteString(2, field_names[2], OptionsMessage_); - } - if (hasCustomName) { - output.WriteString(3, field_names[0], CustomName); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasNormal) { - size += pb::CodedOutputStream.ComputeStringSize(1, Normal); - } - if (hasOptionsMessage_) { - size += pb::CodedOutputStream.ComputeStringSize(2, OptionsMessage_); - } - if (hasCustomName) { - size += pb::CodedOutputStream.ComputeStringSize(3, CustomName); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static OptionsMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OptionsMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OptionsMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OptionsMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OptionsMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OptionsMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static OptionsMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static OptionsMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static OptionsMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OptionsMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private OptionsMessage MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(OptionsMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(OptionsMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private OptionsMessage result; - - private OptionsMessage PrepareBuilder() { - if (resultIsReadOnly) { - OptionsMessage original = result; - result = new OptionsMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override OptionsMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.OptionsMessage.Descriptor; } - } - - public override OptionsMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.OptionsMessage.DefaultInstance; } - } - - public override OptionsMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is OptionsMessage) { - return MergeFrom((OptionsMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(OptionsMessage other) { - if (other == global::Google.ProtocolBuffers.TestProtos.OptionsMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasNormal) { - Normal = other.Normal; - } - if (other.HasOptionsMessage_) { - OptionsMessage_ = other.OptionsMessage_; - } - if (other.HasCustomName) { - CustomName = other.CustomName; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_optionsMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _optionsMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasNormal = input.ReadString(ref result.normal_); - break; - } - case 18: { - result.hasOptionsMessage_ = input.ReadString(ref result.optionsMessage_); - break; - } - case 26: { - result.hasCustomName = input.ReadString(ref result.customized_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasNormal { - get { return result.hasNormal; } - } - public string Normal { - get { return result.Normal; } - set { SetNormal(value); } - } - public Builder SetNormal(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasNormal = true; - result.normal_ = value; - return this; - } - public Builder ClearNormal() { - PrepareBuilder(); - result.hasNormal = false; - result.normal_ = ""; - return this; - } - - public bool HasOptionsMessage_ { - get { return result.hasOptionsMessage_; } - } - public string OptionsMessage_ { - get { return result.OptionsMessage_; } - set { SetOptionsMessage_(value); } - } - public Builder SetOptionsMessage_(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionsMessage_ = true; - result.optionsMessage_ = value; - return this; - } - public Builder ClearOptionsMessage_() { - PrepareBuilder(); - result.hasOptionsMessage_ = false; - result.optionsMessage_ = ""; - return this; - } - - public bool HasCustomName { - get { return result.hasCustomName; } - } - public string CustomName { - get { return result.CustomName; } - set { SetCustomName(value); } - } - public Builder SetCustomName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasCustomName = true; - result.customized_ = value; - return this; - } - public Builder ClearCustomName() { - PrepareBuilder(); - result.hasCustomName = false; - result.customized_ = ""; - return this; - } - } - static OptionsMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestCSharpOptionsProtoFile.Descriptor, null); - } - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestCustomOptionsProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestCustomOptionsProtoFile.cs deleted file mode 100644 index b61cce7..0000000 --- a/src/ProtocolBuffers.Test/TestProtos/UnitTestCustomOptionsProtoFile.cs +++ /dev/null @@ -1,6411 +0,0 @@ -// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.TestProtos { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class UnitTestCustomOptionsProtoFile { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.FileOpt1); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.MessageOpt1); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.FieldOpt1); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.FieldOpt2); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.EnumOpt1); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.EnumValueOpt1); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.ServiceOpt1); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.MethodOpt1); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.BoolOpt); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Int32Opt); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Int64Opt); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Uint32Opt); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Uint64Opt); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Sint32Opt); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Sint64Opt); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Fixed32Opt); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Fixed64Opt); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Sfixed32Opt); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Sfixed64Opt); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.FloatOpt); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.DoubleOpt); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.StringOpt); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.BytesOpt); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.EnumOpt); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.MessageTypeOpt); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Quux); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Corge); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Grault); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Garply); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.ComplexOpt1); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.ComplexOpt2); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.ComplexOpt3); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.ComplexOpt6); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Fileopt); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Msgopt); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Fieldopt); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.EnumoptRenamed); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Enumvalopt); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Serviceopt); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Methodopt); - registry.Add(global::Google.ProtocolBuffers.TestProtos.ComplexOptionType2.Types.ComplexOptionType4.ComplexOpt4); - registry.Add(global::Google.ProtocolBuffers.TestProtos.AggregateMessageSetElement.MessageSetExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.Aggregate.Nested); - } - #endregion - #region Extensions - public const int FileOpt1FieldNumber = 7736974; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase FileOpt1; - public const int MessageOpt1FieldNumber = 7739036; - public static pb::GeneratedExtensionBase MessageOpt1; - public const int FieldOpt1FieldNumber = 7740936; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase FieldOpt1; - public const int FieldOpt2FieldNumber = 7753913; - public static pb::GeneratedExtensionBase FieldOpt2; - public const int EnumOpt1FieldNumber = 7753576; - public static pb::GeneratedExtensionBase EnumOpt1; - public const int EnumValueOpt1FieldNumber = 1560678; - public static pb::GeneratedExtensionBase EnumValueOpt1; - public const int ServiceOpt1FieldNumber = 7887650; - public static pb::GeneratedExtensionBase ServiceOpt1; - public const int MethodOpt1FieldNumber = 7890860; - public static pb::GeneratedExtensionBase MethodOpt1; - public const int BoolOptFieldNumber = 7706090; - public static pb::GeneratedExtensionBase BoolOpt; - public const int Int32OptFieldNumber = 7705709; - public static pb::GeneratedExtensionBase Int32Opt; - public const int Int64OptFieldNumber = 7705542; - public static pb::GeneratedExtensionBase Int64Opt; - public const int Uint32OptFieldNumber = 7704880; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase Uint32Opt; - public const int Uint64OptFieldNumber = 7702367; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase Uint64Opt; - public const int Sint32OptFieldNumber = 7701568; - public static pb::GeneratedExtensionBase Sint32Opt; - public const int Sint64OptFieldNumber = 7700863; - public static pb::GeneratedExtensionBase Sint64Opt; - public const int Fixed32OptFieldNumber = 7700307; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase Fixed32Opt; - public const int Fixed64OptFieldNumber = 7700194; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase Fixed64Opt; - public const int Sfixed32OptFieldNumber = 7698645; - public static pb::GeneratedExtensionBase Sfixed32Opt; - public const int Sfixed64OptFieldNumber = 7685475; - public static pb::GeneratedExtensionBase Sfixed64Opt; - public const int FloatOptFieldNumber = 7675390; - public static pb::GeneratedExtensionBase FloatOpt; - public const int DoubleOptFieldNumber = 7673293; - public static pb::GeneratedExtensionBase DoubleOpt; - public const int StringOptFieldNumber = 7673285; - public static pb::GeneratedExtensionBase StringOpt; - public const int BytesOptFieldNumber = 7673238; - public static pb::GeneratedExtensionBase BytesOpt; - public const int EnumOptFieldNumber = 7673233; - public static pb::GeneratedExtensionBase EnumOpt; - public const int MessageTypeOptFieldNumber = 7665967; - public static pb::GeneratedExtensionBase MessageTypeOpt; - public const int QuuxFieldNumber = 7663707; - public static pb::GeneratedExtensionBase Quux; - public const int CorgeFieldNumber = 7663442; - public static pb::GeneratedExtensionBase Corge; - public const int GraultFieldNumber = 7650927; - public static pb::GeneratedExtensionBase Grault; - public const int GarplyFieldNumber = 7649992; - public static pb::GeneratedExtensionBase Garply; - public const int ComplexOpt1FieldNumber = 7646756; - public static pb::GeneratedExtensionBase ComplexOpt1; - public const int ComplexOpt2FieldNumber = 7636949; - public static pb::GeneratedExtensionBase ComplexOpt2; - public const int ComplexOpt3FieldNumber = 7636463; - public static pb::GeneratedExtensionBase ComplexOpt3; - public const int ComplexOpt6FieldNumber = 7595468; - public static pb::GeneratedExtensionBase ComplexOpt6; - public const int FileoptFieldNumber = 15478479; - public static pb::GeneratedExtensionBase Fileopt; - public const int MsgoptFieldNumber = 15480088; - public static pb::GeneratedExtensionBase Msgopt; - public const int FieldoptFieldNumber = 15481374; - public static pb::GeneratedExtensionBase Fieldopt; - public const int EnumoptRenamedFieldNumber = 15483218; - public static pb::GeneratedExtensionBase EnumoptRenamed; - public const int EnumvaloptFieldNumber = 15486921; - public static pb::GeneratedExtensionBase Enumvalopt; - public const int ServiceoptFieldNumber = 15497145; - public static pb::GeneratedExtensionBase Serviceopt; - public const int MethodoptFieldNumber = 15512713; - public static pb::GeneratedExtensionBase Methodopt; - #endregion - - #region Static variables - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestMessageWithCustomOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMessageWithCustomOptions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_CustomOptionFooRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_CustomOptionFooRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_CustomOptionFooResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_CustomOptionFooResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_DummyMessageContainingEnum__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_DummyMessageContainingEnum__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_DummyMessageInvalidAsOptionType__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_DummyMessageInvalidAsOptionType__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_CustomOptionMinIntegerValues__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_CustomOptionMinIntegerValues__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_CustomOptionMaxIntegerValues__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_CustomOptionMaxIntegerValues__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_CustomOptionOtherValues__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_CustomOptionOtherValues__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_SettingRealsFromPositiveInts__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_SettingRealsFromPositiveInts__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_SettingRealsFromNegativeInts__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_SettingRealsFromNegativeInts__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_ComplexOptionType1__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_ComplexOptionType1__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_ComplexOptionType2__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_ComplexOptionType2__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_ComplexOptionType2_ComplexOptionType4__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_ComplexOptionType2_ComplexOptionType4__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_ComplexOptionType3__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_ComplexOptionType3__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_ComplexOptionType3_ComplexOptionType5__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_ComplexOptionType3_ComplexOptionType5__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_ComplexOpt6__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_ComplexOpt6__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_VariousComplexOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_VariousComplexOptions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_AggregateMessageSet__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_AggregateMessageSet__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_AggregateMessageSetElement__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_AggregateMessageSetElement__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_Aggregate__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_Aggregate__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_AggregateMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_AggregateMessage__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static UnitTestCustomOptionsProtoFile() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "Ci1nb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfY3VzdG9tX29wdGlvbnMucHJv", - "dG8SEXByb3RvYnVmX3VuaXR0ZXN0GiRnb29nbGUvcHJvdG9idWYvY3NoYXJw", - "X29wdGlvbnMucHJvdG8aIGdvb2dsZS9wcm90b2J1Zi9kZXNjcmlwdG9yLnBy", - "b3RvIo0BChxUZXN0TWVzc2FnZVdpdGhDdXN0b21PcHRpb25zEh4KBmZpZWxk", - "MRgBIAEoCUIOCAHB4MMdLeF1CgIAAAAiOwoGQW5FbnVtEg8KC0FORU5VTV9W", - "QUwxEAESFgoLQU5FTlVNX1ZBTDIQAhoFsIb6BXsaCMX2yR3r/P//OhAIAODp", - "wh3I//////////8BIhgKFkN1c3RvbU9wdGlvbkZvb1JlcXVlc3QiGQoXQ3Vz", - "dG9tT3B0aW9uRm9vUmVzcG9uc2UibQoaRHVtbXlNZXNzYWdlQ29udGFpbmlu", - "Z0VudW0iTwoMVGVzdEVudW1UeXBlEhoKFlRFU1RfT1BUSU9OX0VOVU1fVFlQ", - "RTEQFhIjChZURVNUX09QVElPTl9FTlVNX1RZUEUyEOn//////////wEiIQof", - "RHVtbXlNZXNzYWdlSW52YWxpZEFzT3B0aW9uVHlwZSKKAQocQ3VzdG9tT3B0", - "aW9uTWluSW50ZWdlclZhbHVlczpqmdaoHQAAAAAAAACArY2vHQAAAICR7q8d", - "AAAAAAAAAACd9a8dAAAAAPiXsB3///////////8BgMSwHf////8P+PWwHQCA", - "k7IdALC8sh2AgICAgICAgIAB6MayHYCAgID4/////wHQ3rIdACKRAQocQ3Vz", - "dG9tT3B0aW9uTWF4SW50ZWdlclZhbHVlczpxmdaoHf////////9/rY2vHf//", - "/3+R7q8d//////////+d9a8d//////iXsB3+//////////8BgMSwHf7///8P", - "+PWwHf///////////wGAk7Id/////w+wvLId//////////9/6MayHf////8H", - "0N6yHQEibgoXQ3VzdG9tT3B0aW9uT3RoZXJWYWx1ZXM6U4jZoh3p////////", - "//8BstmiHQtIZWxsbwBXb3JsZKrcoh0OSGVsbG8sICJXb3JsZCLp3KId+1mM", - "QsrA8z/136Md54dFQejGsh2c//////////8BIjQKHFNldHRpbmdSZWFsc0Zy", - "b21Qb3NpdGl2ZUludHM6FOncoh0AAAAAAEBjQPXfox0AAEBBIjQKHFNldHRp", - "bmdSZWFsc0Zyb21OZWdhdGl2ZUludHM6FOncoh0AAAAAAEBjwPXfox0AAEDB", - "IkcKEkNvbXBsZXhPcHRpb25UeXBlMRILCgNmb28YASABKAUSDAoEZm9vMhgC", - "IAEoBRIMCgRmb28zGAMgASgFKggIZBCAgICAAiLBAgoSQ29tcGxleE9wdGlv", - "blR5cGUyEjIKA2JhchgBIAEoCzIlLnByb3RvYnVmX3VuaXR0ZXN0LkNvbXBs", - "ZXhPcHRpb25UeXBlMRILCgNiYXoYAiABKAUSRgoEZnJlZBgDIAEoCzI4LnBy", - "b3RvYnVmX3VuaXR0ZXN0LkNvbXBsZXhPcHRpb25UeXBlMi5Db21wbGV4T3B0", - "aW9uVHlwZTQalwEKEkNvbXBsZXhPcHRpb25UeXBlNBINCgV3YWxkbxgBIAEo", - "BTJyCgxjb21wbGV4X29wdDQSHy5nb29nbGUucHJvdG9idWYuTWVzc2FnZU9w", - "dGlvbnMYivXRAyABKAsyOC5wcm90b2J1Zl91bml0dGVzdC5Db21wbGV4T3B0", - "aW9uVHlwZTIuQ29tcGxleE9wdGlvblR5cGU0KggIZBCAgICAAiKcAQoSQ29t", - "cGxleE9wdGlvblR5cGUzEgsKA3F1eBgBIAEoBRJUChJjb21wbGV4b3B0aW9u", - "dHlwZTUYAiABKAoyOC5wcm90b2J1Zl91bml0dGVzdC5Db21wbGV4T3B0aW9u", - "VHlwZTMuQ29tcGxleE9wdGlvblR5cGU1GiMKEkNvbXBsZXhPcHRpb25UeXBl", - "NRINCgVwbHVnaBgDIAEoBSIfCgtDb21wbGV4T3B0NhIQCgV4eXp6eRjfv88D", - "IAEoBSLQAQoVVmFyaW91c0NvbXBsZXhPcHRpb25zOrYB49z8HPj9+xwY5Nz8", - "HNKojx0DCLMP+t6QHQIICfrekB0EExgWFKr9kB0DENsHqv2QHQb45pcdjgWq", - "/ZAdBQoDCOcFqv2QHQgKBtiFnh3PD6r9kB0KCgiS9Z0dAwjYD6r9kB0IwqyX", - "HQMI5QWq/ZAdC8Kslx0G2IWeHc4Pqv2QHQ3CrJcdCJL1nR0DCMkQqv2QHQUa", - "AwjBAqLilR0CCCqi4pUdBtiFnh3EAqLilR0IkvWdHQMI7AYiIwoTQWdncmVn", - "YXRlTWVzc2FnZVNldCoICAQQgICAgAI6AggBIqABChpBZ2dyZWdhdGVNZXNz", - "YWdlU2V0RWxlbWVudBIJCgFzGAEgASgJMncKFW1lc3NhZ2Vfc2V0X2V4dGVu", - "c2lvbhImLnByb3RvYnVmX3VuaXR0ZXN0LkFnZ3JlZ2F0ZU1lc3NhZ2VTZXQY", - "9uuuByABKAsyLS5wcm90b2J1Zl91bml0dGVzdC5BZ2dyZWdhdGVNZXNzYWdl", - "U2V0RWxlbWVudCL9AQoJQWdncmVnYXRlEgkKAWkYASABKAUSCQoBcxgCIAEo", - "CRIpCgNzdWIYAyABKAsyHC5wcm90b2J1Zl91bml0dGVzdC5BZ2dyZWdhdGUS", - "KgoEZmlsZRgEIAEoCzIcLmdvb2dsZS5wcm90b2J1Zi5GaWxlT3B0aW9ucxI0", - "CgRtc2V0GAUgASgLMiYucHJvdG9idWZfdW5pdHRlc3QuQWdncmVnYXRlTWVz", - "c2FnZVNldDJNCgZuZXN0ZWQSHC5nb29nbGUucHJvdG9idWYuRmlsZU9wdGlv", - "bnMYp9GwByABKAsyHC5wcm90b2J1Zl91bml0dGVzdC5BZ2dyZWdhdGUiWQoQ", - "QWdncmVnYXRlTWVzc2FnZRIpCglmaWVsZG5hbWUYASABKAVCFvKhhzsREg9G", - "aWVsZEFubm90YXRpb246GsLRhjsVCGUSEU1lc3NhZ2VBbm5vdGF0aW9uKjYK", - "Ck1ldGhvZE9wdDESEwoPTUVUSE9ET1BUMV9WQUwxEAESEwoPTUVUSE9ET1BU", - "MV9WQUwyEAIqTQoNQWdncmVnYXRlRW51bRIlCgVWQUxVRRABGhrK/Ik7FRIT", - "RW51bVZhbHVlQW5ub3RhdGlvbhoVkpWIOxASDkVudW1Bbm5vdGF0aW9uMo4B", - "ChxUZXN0U2VydmljZVdpdGhDdXN0b21PcHRpb25zEmMKA0ZvbxIpLnByb3Rv", - "YnVmX3VuaXR0ZXN0LkN1c3RvbU9wdGlvbkZvb1JlcXVlc3QaKi5wcm90b2J1", - "Zl91bml0dGVzdC5DdXN0b21PcHRpb25Gb29SZXNwb25zZSIF4PqMHgIaCZCy", - "ix7T24DLSTKZAQoQQWdncmVnYXRlU2VydmljZRJrCgZNZXRob2QSIy5wcm90", - "b2J1Zl91bml0dGVzdC5BZ2dyZWdhdGVNZXNzYWdlGiMucHJvdG9idWZfdW5p", - "dHRlc3QuQWdncmVnYXRlTWVzc2FnZSIXysiWOxISEE1ldGhvZEFubm90YXRp", - "b24aGMr7jjsTEhFTZXJ2aWNlQW5ub3RhdGlvbjoyCglmaWxlX29wdDESHC5n", - "b29nbGUucHJvdG9idWYuRmlsZU9wdGlvbnMYjp3YAyABKAQ6OAoMbWVzc2Fn", - "ZV9vcHQxEh8uZ29vZ2xlLnByb3RvYnVmLk1lc3NhZ2VPcHRpb25zGJyt2AMg", - "ASgFOjQKCmZpZWxkX29wdDESHS5nb29nbGUucHJvdG9idWYuRmllbGRPcHRp", - "b25zGIi82AMgASgGOjgKCmZpZWxkX29wdDISHS5nb29nbGUucHJvdG9idWYu", - "RmllbGRPcHRpb25zGLmh2QMgASgFOgI0MjoyCgllbnVtX29wdDESHC5nb29n", - "bGUucHJvdG9idWYuRW51bU9wdGlvbnMY6J7ZAyABKA86PAoPZW51bV92YWx1", - "ZV9vcHQxEiEuZ29vZ2xlLnByb3RvYnVmLkVudW1WYWx1ZU9wdGlvbnMY5qBf", - "IAEoBTo4CgxzZXJ2aWNlX29wdDESHy5nb29nbGUucHJvdG9idWYuU2Vydmlj", - "ZU9wdGlvbnMYorbhAyABKBI6VQoLbWV0aG9kX29wdDESHi5nb29nbGUucHJv", - "dG9idWYuTWV0aG9kT3B0aW9ucxisz+EDIAEoDjIdLnByb3RvYnVmX3VuaXR0", - "ZXN0Lk1ldGhvZE9wdDE6NAoIYm9vbF9vcHQSHy5nb29nbGUucHJvdG9idWYu", - "TWVzc2FnZU9wdGlvbnMY6qvWAyABKAg6NQoJaW50MzJfb3B0Eh8uZ29vZ2xl", - "LnByb3RvYnVmLk1lc3NhZ2VPcHRpb25zGO2o1gMgASgFOjUKCWludDY0X29w", - "dBIfLmdvb2dsZS5wcm90b2J1Zi5NZXNzYWdlT3B0aW9ucxjGp9YDIAEoAzo2", - "Cgp1aW50MzJfb3B0Eh8uZ29vZ2xlLnByb3RvYnVmLk1lc3NhZ2VPcHRpb25z", - "GLCi1gMgASgNOjYKCnVpbnQ2NF9vcHQSHy5nb29nbGUucHJvdG9idWYuTWVz", - "c2FnZU9wdGlvbnMY347WAyABKAQ6NgoKc2ludDMyX29wdBIfLmdvb2dsZS5w", - "cm90b2J1Zi5NZXNzYWdlT3B0aW9ucxjAiNYDIAEoETo2CgpzaW50NjRfb3B0", - "Eh8uZ29vZ2xlLnByb3RvYnVmLk1lc3NhZ2VPcHRpb25zGP+C1gMgASgSOjcK", - "C2ZpeGVkMzJfb3B0Eh8uZ29vZ2xlLnByb3RvYnVmLk1lc3NhZ2VPcHRpb25z", - "GNP+1QMgASgHOjcKC2ZpeGVkNjRfb3B0Eh8uZ29vZ2xlLnByb3RvYnVmLk1l", - "c3NhZ2VPcHRpb25zGOL91QMgASgGOjgKDHNmaXhlZDMyX29wdBIfLmdvb2ds", - "ZS5wcm90b2J1Zi5NZXNzYWdlT3B0aW9ucxjV8dUDIAEoDzo4CgxzZml4ZWQ2", - "NF9vcHQSHy5nb29nbGUucHJvdG9idWYuTWVzc2FnZU9wdGlvbnMY44rVAyAB", - "KBA6NQoJZmxvYXRfb3B0Eh8uZ29vZ2xlLnByb3RvYnVmLk1lc3NhZ2VPcHRp", - "b25zGP671AMgASgCOjYKCmRvdWJsZV9vcHQSHy5nb29nbGUucHJvdG9idWYu", - "TWVzc2FnZU9wdGlvbnMYzavUAyABKAE6NgoKc3RyaW5nX29wdBIfLmdvb2ds", - "ZS5wcm90b2J1Zi5NZXNzYWdlT3B0aW9ucxjFq9QDIAEoCTo1CglieXRlc19v", - "cHQSHy5nb29nbGUucHJvdG9idWYuTWVzc2FnZU9wdGlvbnMYlqvUAyABKAw6", - "cAoIZW51bV9vcHQSHy5nb29nbGUucHJvdG9idWYuTWVzc2FnZU9wdGlvbnMY", - "kavUAyABKA4yOi5wcm90b2J1Zl91bml0dGVzdC5EdW1teU1lc3NhZ2VDb250", - "YWluaW5nRW51bS5UZXN0RW51bVR5cGU6cAoQbWVzc2FnZV90eXBlX29wdBIf", - "Lmdvb2dsZS5wcm90b2J1Zi5NZXNzYWdlT3B0aW9ucxiv8tMDIAEoCzIyLnBy", - "b3RvYnVmX3VuaXR0ZXN0LkR1bW15TWVzc2FnZUludmFsaWRBc09wdGlvblR5", - "cGU6NgoEcXV1eBIlLnByb3RvYnVmX3VuaXR0ZXN0LkNvbXBsZXhPcHRpb25U", - "eXBlMRjb4NMDIAEoBTpeCgVjb3JnZRIlLnByb3RvYnVmX3VuaXR0ZXN0LkNv", - "bXBsZXhPcHRpb25UeXBlMRjS3tMDIAEoCzIlLnByb3RvYnVmX3VuaXR0ZXN0", - "LkNvbXBsZXhPcHRpb25UeXBlMzo4CgZncmF1bHQSJS5wcm90b2J1Zl91bml0", - "dGVzdC5Db21wbGV4T3B0aW9uVHlwZTIY7/zSAyABKAU6XwoGZ2FycGx5EiUu", - "cHJvdG9idWZfdW5pdHRlc3QuQ29tcGxleE9wdGlvblR5cGUyGMj10gMgASgL", - "MiUucHJvdG9idWZfdW5pdHRlc3QuQ29tcGxleE9wdGlvblR5cGUxOl8KDGNv", - "bXBsZXhfb3B0MRIfLmdvb2dsZS5wcm90b2J1Zi5NZXNzYWdlT3B0aW9ucxik", - "3NIDIAEoCzIlLnByb3RvYnVmX3VuaXR0ZXN0LkNvbXBsZXhPcHRpb25UeXBl", - "MTpfCgxjb21wbGV4X29wdDISHy5nb29nbGUucHJvdG9idWYuTWVzc2FnZU9w", - "dGlvbnMY1Y/SAyABKAsyJS5wcm90b2J1Zl91bml0dGVzdC5Db21wbGV4T3B0", - "aW9uVHlwZTI6XwoMY29tcGxleF9vcHQzEh8uZ29vZ2xlLnByb3RvYnVmLk1l", - "c3NhZ2VPcHRpb25zGO+L0gMgASgLMiUucHJvdG9idWZfdW5pdHRlc3QuQ29t", - "cGxleE9wdGlvblR5cGUzOlcKC2NvbXBsZXhvcHQ2Eh8uZ29vZ2xlLnByb3Rv", - "YnVmLk1lc3NhZ2VPcHRpb25zGMzLzwMgASgKMh4ucHJvdG9idWZfdW5pdHRl", - "c3QuQ29tcGxleE9wdDY6TgoHZmlsZW9wdBIcLmdvb2dsZS5wcm90b2J1Zi5G", - "aWxlT3B0aW9ucxjP3bAHIAEoCzIcLnByb3RvYnVmX3VuaXR0ZXN0LkFnZ3Jl", - "Z2F0ZTpQCgZtc2dvcHQSHy5nb29nbGUucHJvdG9idWYuTWVzc2FnZU9wdGlv", - "bnMYmOqwByABKAsyHC5wcm90b2J1Zl91bml0dGVzdC5BZ2dyZWdhdGU6UAoI", - "ZmllbGRvcHQSHS5nb29nbGUucHJvdG9idWYuRmllbGRPcHRpb25zGJ70sAcg", - "ASgLMhwucHJvdG9idWZfdW5pdHRlc3QuQWdncmVnYXRlOlYKD2VudW1vcHRf", - "cmVuYW1lZBIcLmdvb2dsZS5wcm90b2J1Zi5FbnVtT3B0aW9ucxjSgrEHIAEo", - "CzIcLnByb3RvYnVmX3VuaXR0ZXN0LkFnZ3JlZ2F0ZTpWCgplbnVtdmFsb3B0", - "EiEuZ29vZ2xlLnByb3RvYnVmLkVudW1WYWx1ZU9wdGlvbnMYyZ+xByABKAsy", - "HC5wcm90b2J1Zl91bml0dGVzdC5BZ2dyZWdhdGU6VAoKc2VydmljZW9wdBIf", - "Lmdvb2dsZS5wcm90b2J1Zi5TZXJ2aWNlT3B0aW9ucxi577EHIAEoCzIcLnBy", - "b3RvYnVmX3VuaXR0ZXN0LkFnZ3JlZ2F0ZTpSCgltZXRob2RvcHQSHi5nb29n", - "bGUucHJvdG9idWYuTWV0aG9kT3B0aW9ucxiJ6bIHIAEoCzIcLnByb3RvYnVm", - "X3VuaXR0ZXN0LkFnZ3JlZ2F0ZULNAYABAYgBAZABAcI+QwohR29vZ2xlLlBy", - "b3RvY29sQnVmZmVycy5UZXN0UHJvdG9zEh5Vbml0VGVzdEN1c3RvbU9wdGlv", - "bnNQcm90b0ZpbGXw6MEd6q3A5ST67IU7cAhkEg5GaWxlQW5ub3RhdGlvbhoW", - "EhROZXN0ZWRGaWxlQW5ub3RhdGlvbiIe+uyFOxkSF0ZpbGVFeHRlbnNpb25B", - "bm5vdGF0aW9uKiQLEPbrrgcaGwoZRW1iZWRkZWRNZXNzYWdlU2V0RWxlbWVu", - "dAw=")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_protobuf_unittest_TestMessageWithCustomOptions__Descriptor = Descriptor.MessageTypes[0]; - internal__static_protobuf_unittest_TestMessageWithCustomOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestMessageWithCustomOptions__Descriptor, - new string[] { "Field1", }); - internal__static_protobuf_unittest_CustomOptionFooRequest__Descriptor = Descriptor.MessageTypes[1]; - internal__static_protobuf_unittest_CustomOptionFooRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_CustomOptionFooRequest__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_CustomOptionFooResponse__Descriptor = Descriptor.MessageTypes[2]; - internal__static_protobuf_unittest_CustomOptionFooResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_CustomOptionFooResponse__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_DummyMessageContainingEnum__Descriptor = Descriptor.MessageTypes[3]; - internal__static_protobuf_unittest_DummyMessageContainingEnum__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_DummyMessageContainingEnum__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_DummyMessageInvalidAsOptionType__Descriptor = Descriptor.MessageTypes[4]; - internal__static_protobuf_unittest_DummyMessageInvalidAsOptionType__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_DummyMessageInvalidAsOptionType__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_CustomOptionMinIntegerValues__Descriptor = Descriptor.MessageTypes[5]; - internal__static_protobuf_unittest_CustomOptionMinIntegerValues__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_CustomOptionMinIntegerValues__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_CustomOptionMaxIntegerValues__Descriptor = Descriptor.MessageTypes[6]; - internal__static_protobuf_unittest_CustomOptionMaxIntegerValues__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_CustomOptionMaxIntegerValues__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_CustomOptionOtherValues__Descriptor = Descriptor.MessageTypes[7]; - internal__static_protobuf_unittest_CustomOptionOtherValues__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_CustomOptionOtherValues__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_SettingRealsFromPositiveInts__Descriptor = Descriptor.MessageTypes[8]; - internal__static_protobuf_unittest_SettingRealsFromPositiveInts__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_SettingRealsFromPositiveInts__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_SettingRealsFromNegativeInts__Descriptor = Descriptor.MessageTypes[9]; - internal__static_protobuf_unittest_SettingRealsFromNegativeInts__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_SettingRealsFromNegativeInts__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_ComplexOptionType1__Descriptor = Descriptor.MessageTypes[10]; - internal__static_protobuf_unittest_ComplexOptionType1__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_ComplexOptionType1__Descriptor, - new string[] { "Foo", "Foo2", "Foo3", }); - internal__static_protobuf_unittest_ComplexOptionType2__Descriptor = Descriptor.MessageTypes[11]; - internal__static_protobuf_unittest_ComplexOptionType2__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_ComplexOptionType2__Descriptor, - new string[] { "Bar", "Baz", "Fred", }); - internal__static_protobuf_unittest_ComplexOptionType2_ComplexOptionType4__Descriptor = internal__static_protobuf_unittest_ComplexOptionType2__Descriptor.NestedTypes[0]; - internal__static_protobuf_unittest_ComplexOptionType2_ComplexOptionType4__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_ComplexOptionType2_ComplexOptionType4__Descriptor, - new string[] { "Waldo", }); - global::Google.ProtocolBuffers.TestProtos.ComplexOptionType2.Types.ComplexOptionType4.ComplexOpt4 = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.ComplexOptionType2.Types.ComplexOptionType4.Descriptor.Extensions[0]); - internal__static_protobuf_unittest_ComplexOptionType3__Descriptor = Descriptor.MessageTypes[12]; - internal__static_protobuf_unittest_ComplexOptionType3__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_ComplexOptionType3__Descriptor, - new string[] { "Qux", "ComplexOptionType5", }); - internal__static_protobuf_unittest_ComplexOptionType3_ComplexOptionType5__Descriptor = internal__static_protobuf_unittest_ComplexOptionType3__Descriptor.NestedTypes[0]; - internal__static_protobuf_unittest_ComplexOptionType3_ComplexOptionType5__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_ComplexOptionType3_ComplexOptionType5__Descriptor, - new string[] { "Plugh", }); - internal__static_protobuf_unittest_ComplexOpt6__Descriptor = Descriptor.MessageTypes[13]; - internal__static_protobuf_unittest_ComplexOpt6__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_ComplexOpt6__Descriptor, - new string[] { "Xyzzy", }); - internal__static_protobuf_unittest_VariousComplexOptions__Descriptor = Descriptor.MessageTypes[14]; - internal__static_protobuf_unittest_VariousComplexOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_VariousComplexOptions__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_AggregateMessageSet__Descriptor = Descriptor.MessageTypes[15]; - internal__static_protobuf_unittest_AggregateMessageSet__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_AggregateMessageSet__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_AggregateMessageSetElement__Descriptor = Descriptor.MessageTypes[16]; - internal__static_protobuf_unittest_AggregateMessageSetElement__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_AggregateMessageSetElement__Descriptor, - new string[] { "S", }); - global::Google.ProtocolBuffers.TestProtos.AggregateMessageSetElement.MessageSetExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.AggregateMessageSetElement.Descriptor.Extensions[0]); - internal__static_protobuf_unittest_Aggregate__Descriptor = Descriptor.MessageTypes[17]; - internal__static_protobuf_unittest_Aggregate__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_Aggregate__Descriptor, - new string[] { "I", "S", "Sub", "File", "Mset", }); - global::Google.ProtocolBuffers.TestProtos.Aggregate.Nested = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.Aggregate.Descriptor.Extensions[0]); - internal__static_protobuf_unittest_AggregateMessage__Descriptor = Descriptor.MessageTypes[18]; - internal__static_protobuf_unittest_AggregateMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_AggregateMessage__Descriptor, - new string[] { "Fieldname", }); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.FileOpt1 = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[0]); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.MessageOpt1 = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[1]); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.FieldOpt1 = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[2]); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.FieldOpt2 = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[3]); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.EnumOpt1 = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[4]); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.EnumValueOpt1 = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[5]); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.ServiceOpt1 = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[6]); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.MethodOpt1 = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[7]); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.BoolOpt = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[8]); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Int32Opt = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[9]); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Int64Opt = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[10]); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Uint32Opt = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[11]); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Uint64Opt = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[12]); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Sint32Opt = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[13]); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Sint64Opt = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[14]); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Fixed32Opt = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[15]); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Fixed64Opt = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[16]); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Sfixed32Opt = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[17]); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Sfixed64Opt = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[18]); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.FloatOpt = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[19]); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.DoubleOpt = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[20]); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.StringOpt = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[21]); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.BytesOpt = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[22]); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.EnumOpt = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[23]); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.MessageTypeOpt = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[24]); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Quux = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[25]); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Corge = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[26]); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Grault = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[27]); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Garply = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[28]); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.ComplexOpt1 = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[29]); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.ComplexOpt2 = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[30]); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.ComplexOpt3 = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[31]); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.ComplexOpt6 = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[32]); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Fileopt = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[33]); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Msgopt = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[34]); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Fieldopt = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[35]); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.EnumoptRenamed = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[36]); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Enumvalopt = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[37]); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Serviceopt = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[38]); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Methodopt = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor.Extensions[39]); - pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); - RegisterAllExtensions(registry); - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.RegisterAllExtensions(registry); - global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.RegisterAllExtensions(registry); - return registry; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, - global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, - }, assigner); - } - #endregion - - } - #region Enums - public enum MethodOpt1 { - METHODOPT1_VAL1 = 1, - METHODOPT1_VAL2 = 2, - } - - public enum AggregateEnum { - VALUE = 1, - } - - #endregion - - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestMessageWithCustomOptions : pb::GeneratedMessage { - private TestMessageWithCustomOptions() { } - private static readonly TestMessageWithCustomOptions defaultInstance = new TestMessageWithCustomOptions().MakeReadOnly(); - private static readonly string[] _testMessageWithCustomOptionsFieldNames = new string[] { "field1" }; - private static readonly uint[] _testMessageWithCustomOptionsFieldTags = new uint[] { 10 }; - public static TestMessageWithCustomOptions DefaultInstance { - get { return defaultInstance; } - } - - public override TestMessageWithCustomOptions DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestMessageWithCustomOptions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_TestMessageWithCustomOptions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_TestMessageWithCustomOptions__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - public enum AnEnum { - ANENUM_VAL1 = 1, - ANENUM_VAL2 = 2, - } - - } - #endregion - - public const int Field1FieldNumber = 1; - private bool hasField1; - private string field1_ = ""; - public bool HasField1 { - get { return hasField1; } - } - public string Field1 { - get { return field1_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testMessageWithCustomOptionsFieldNames; - if (hasField1) { - output.WriteString(1, field_names[0], Field1); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasField1) { - size += pb::CodedOutputStream.ComputeStringSize(1, Field1); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestMessageWithCustomOptions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestMessageWithCustomOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestMessageWithCustomOptions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestMessageWithCustomOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestMessageWithCustomOptions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestMessageWithCustomOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestMessageWithCustomOptions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestMessageWithCustomOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestMessageWithCustomOptions ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestMessageWithCustomOptions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestMessageWithCustomOptions MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestMessageWithCustomOptions prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestMessageWithCustomOptions cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestMessageWithCustomOptions result; - - private TestMessageWithCustomOptions PrepareBuilder() { - if (resultIsReadOnly) { - TestMessageWithCustomOptions original = result; - result = new TestMessageWithCustomOptions(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestMessageWithCustomOptions MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestMessageWithCustomOptions.Descriptor; } - } - - public override TestMessageWithCustomOptions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestMessageWithCustomOptions.DefaultInstance; } - } - - public override TestMessageWithCustomOptions BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestMessageWithCustomOptions) { - return MergeFrom((TestMessageWithCustomOptions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestMessageWithCustomOptions other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestMessageWithCustomOptions.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasField1) { - Field1 = other.Field1; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testMessageWithCustomOptionsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testMessageWithCustomOptionsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasField1 = input.ReadString(ref result.field1_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasField1 { - get { return result.hasField1; } - } - public string Field1 { - get { return result.Field1; } - set { SetField1(value); } - } - public Builder SetField1(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField1 = true; - result.field1_ = value; - return this; - } - public Builder ClearField1() { - PrepareBuilder(); - result.hasField1 = false; - result.field1_ = ""; - return this; - } - } - static TestMessageWithCustomOptions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class CustomOptionFooRequest : pb::GeneratedMessage { - private CustomOptionFooRequest() { } - private static readonly CustomOptionFooRequest defaultInstance = new CustomOptionFooRequest().MakeReadOnly(); - private static readonly string[] _customOptionFooRequestFieldNames = new string[] { }; - private static readonly uint[] _customOptionFooRequestFieldTags = new uint[] { }; - public static CustomOptionFooRequest DefaultInstance { - get { return defaultInstance; } - } - - public override CustomOptionFooRequest DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override CustomOptionFooRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_CustomOptionFooRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_CustomOptionFooRequest__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _customOptionFooRequestFieldNames; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static CustomOptionFooRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CustomOptionFooRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CustomOptionFooRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CustomOptionFooRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CustomOptionFooRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CustomOptionFooRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static CustomOptionFooRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static CustomOptionFooRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static CustomOptionFooRequest ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CustomOptionFooRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private CustomOptionFooRequest MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(CustomOptionFooRequest prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(CustomOptionFooRequest cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private CustomOptionFooRequest result; - - private CustomOptionFooRequest PrepareBuilder() { - if (resultIsReadOnly) { - CustomOptionFooRequest original = result; - result = new CustomOptionFooRequest(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override CustomOptionFooRequest MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.CustomOptionFooRequest.Descriptor; } - } - - public override CustomOptionFooRequest DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.CustomOptionFooRequest.DefaultInstance; } - } - - public override CustomOptionFooRequest BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is CustomOptionFooRequest) { - return MergeFrom((CustomOptionFooRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(CustomOptionFooRequest other) { - if (other == global::Google.ProtocolBuffers.TestProtos.CustomOptionFooRequest.DefaultInstance) return this; - PrepareBuilder(); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_customOptionFooRequestFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _customOptionFooRequestFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static CustomOptionFooRequest() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class CustomOptionFooResponse : pb::GeneratedMessage { - private CustomOptionFooResponse() { } - private static readonly CustomOptionFooResponse defaultInstance = new CustomOptionFooResponse().MakeReadOnly(); - private static readonly string[] _customOptionFooResponseFieldNames = new string[] { }; - private static readonly uint[] _customOptionFooResponseFieldTags = new uint[] { }; - public static CustomOptionFooResponse DefaultInstance { - get { return defaultInstance; } - } - - public override CustomOptionFooResponse DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override CustomOptionFooResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_CustomOptionFooResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_CustomOptionFooResponse__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _customOptionFooResponseFieldNames; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static CustomOptionFooResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CustomOptionFooResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CustomOptionFooResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CustomOptionFooResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CustomOptionFooResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CustomOptionFooResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static CustomOptionFooResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static CustomOptionFooResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static CustomOptionFooResponse ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CustomOptionFooResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private CustomOptionFooResponse MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(CustomOptionFooResponse prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(CustomOptionFooResponse cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private CustomOptionFooResponse result; - - private CustomOptionFooResponse PrepareBuilder() { - if (resultIsReadOnly) { - CustomOptionFooResponse original = result; - result = new CustomOptionFooResponse(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override CustomOptionFooResponse MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.CustomOptionFooResponse.Descriptor; } - } - - public override CustomOptionFooResponse DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.CustomOptionFooResponse.DefaultInstance; } - } - - public override CustomOptionFooResponse BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is CustomOptionFooResponse) { - return MergeFrom((CustomOptionFooResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(CustomOptionFooResponse other) { - if (other == global::Google.ProtocolBuffers.TestProtos.CustomOptionFooResponse.DefaultInstance) return this; - PrepareBuilder(); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_customOptionFooResponseFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _customOptionFooResponseFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static CustomOptionFooResponse() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class DummyMessageContainingEnum : pb::GeneratedMessage { - private DummyMessageContainingEnum() { } - private static readonly DummyMessageContainingEnum defaultInstance = new DummyMessageContainingEnum().MakeReadOnly(); - private static readonly string[] _dummyMessageContainingEnumFieldNames = new string[] { }; - private static readonly uint[] _dummyMessageContainingEnumFieldTags = new uint[] { }; - public static DummyMessageContainingEnum DefaultInstance { - get { return defaultInstance; } - } - - public override DummyMessageContainingEnum DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override DummyMessageContainingEnum ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_DummyMessageContainingEnum__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_DummyMessageContainingEnum__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - public enum TestEnumType { - TEST_OPTION_ENUM_TYPE1 = 22, - TEST_OPTION_ENUM_TYPE2 = -23, - } - - } - #endregion - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _dummyMessageContainingEnumFieldNames; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static DummyMessageContainingEnum ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static DummyMessageContainingEnum ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static DummyMessageContainingEnum ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static DummyMessageContainingEnum ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static DummyMessageContainingEnum ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static DummyMessageContainingEnum ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static DummyMessageContainingEnum ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static DummyMessageContainingEnum ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static DummyMessageContainingEnum ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static DummyMessageContainingEnum ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private DummyMessageContainingEnum MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(DummyMessageContainingEnum prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(DummyMessageContainingEnum cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private DummyMessageContainingEnum result; - - private DummyMessageContainingEnum PrepareBuilder() { - if (resultIsReadOnly) { - DummyMessageContainingEnum original = result; - result = new DummyMessageContainingEnum(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override DummyMessageContainingEnum MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.DummyMessageContainingEnum.Descriptor; } - } - - public override DummyMessageContainingEnum DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.DummyMessageContainingEnum.DefaultInstance; } - } - - public override DummyMessageContainingEnum BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is DummyMessageContainingEnum) { - return MergeFrom((DummyMessageContainingEnum) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(DummyMessageContainingEnum other) { - if (other == global::Google.ProtocolBuffers.TestProtos.DummyMessageContainingEnum.DefaultInstance) return this; - PrepareBuilder(); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_dummyMessageContainingEnumFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _dummyMessageContainingEnumFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static DummyMessageContainingEnum() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class DummyMessageInvalidAsOptionType : pb::GeneratedMessage { - private DummyMessageInvalidAsOptionType() { } - private static readonly DummyMessageInvalidAsOptionType defaultInstance = new DummyMessageInvalidAsOptionType().MakeReadOnly(); - private static readonly string[] _dummyMessageInvalidAsOptionTypeFieldNames = new string[] { }; - private static readonly uint[] _dummyMessageInvalidAsOptionTypeFieldTags = new uint[] { }; - public static DummyMessageInvalidAsOptionType DefaultInstance { - get { return defaultInstance; } - } - - public override DummyMessageInvalidAsOptionType DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override DummyMessageInvalidAsOptionType ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_DummyMessageInvalidAsOptionType__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_DummyMessageInvalidAsOptionType__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _dummyMessageInvalidAsOptionTypeFieldNames; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static DummyMessageInvalidAsOptionType ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static DummyMessageInvalidAsOptionType ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static DummyMessageInvalidAsOptionType ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static DummyMessageInvalidAsOptionType ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static DummyMessageInvalidAsOptionType ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static DummyMessageInvalidAsOptionType ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static DummyMessageInvalidAsOptionType ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static DummyMessageInvalidAsOptionType ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static DummyMessageInvalidAsOptionType ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static DummyMessageInvalidAsOptionType ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private DummyMessageInvalidAsOptionType MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(DummyMessageInvalidAsOptionType prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(DummyMessageInvalidAsOptionType cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private DummyMessageInvalidAsOptionType result; - - private DummyMessageInvalidAsOptionType PrepareBuilder() { - if (resultIsReadOnly) { - DummyMessageInvalidAsOptionType original = result; - result = new DummyMessageInvalidAsOptionType(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override DummyMessageInvalidAsOptionType MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.DummyMessageInvalidAsOptionType.Descriptor; } - } - - public override DummyMessageInvalidAsOptionType DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.DummyMessageInvalidAsOptionType.DefaultInstance; } - } - - public override DummyMessageInvalidAsOptionType BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is DummyMessageInvalidAsOptionType) { - return MergeFrom((DummyMessageInvalidAsOptionType) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(DummyMessageInvalidAsOptionType other) { - if (other == global::Google.ProtocolBuffers.TestProtos.DummyMessageInvalidAsOptionType.DefaultInstance) return this; - PrepareBuilder(); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_dummyMessageInvalidAsOptionTypeFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _dummyMessageInvalidAsOptionTypeFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static DummyMessageInvalidAsOptionType() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class CustomOptionMinIntegerValues : pb::GeneratedMessage { - private CustomOptionMinIntegerValues() { } - private static readonly CustomOptionMinIntegerValues defaultInstance = new CustomOptionMinIntegerValues().MakeReadOnly(); - private static readonly string[] _customOptionMinIntegerValuesFieldNames = new string[] { }; - private static readonly uint[] _customOptionMinIntegerValuesFieldTags = new uint[] { }; - public static CustomOptionMinIntegerValues DefaultInstance { - get { return defaultInstance; } - } - - public override CustomOptionMinIntegerValues DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override CustomOptionMinIntegerValues ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_CustomOptionMinIntegerValues__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_CustomOptionMinIntegerValues__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _customOptionMinIntegerValuesFieldNames; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static CustomOptionMinIntegerValues ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CustomOptionMinIntegerValues ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CustomOptionMinIntegerValues ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CustomOptionMinIntegerValues ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CustomOptionMinIntegerValues ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CustomOptionMinIntegerValues ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static CustomOptionMinIntegerValues ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static CustomOptionMinIntegerValues ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static CustomOptionMinIntegerValues ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CustomOptionMinIntegerValues ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private CustomOptionMinIntegerValues MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(CustomOptionMinIntegerValues prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(CustomOptionMinIntegerValues cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private CustomOptionMinIntegerValues result; - - private CustomOptionMinIntegerValues PrepareBuilder() { - if (resultIsReadOnly) { - CustomOptionMinIntegerValues original = result; - result = new CustomOptionMinIntegerValues(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override CustomOptionMinIntegerValues MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.CustomOptionMinIntegerValues.Descriptor; } - } - - public override CustomOptionMinIntegerValues DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.CustomOptionMinIntegerValues.DefaultInstance; } - } - - public override CustomOptionMinIntegerValues BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is CustomOptionMinIntegerValues) { - return MergeFrom((CustomOptionMinIntegerValues) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(CustomOptionMinIntegerValues other) { - if (other == global::Google.ProtocolBuffers.TestProtos.CustomOptionMinIntegerValues.DefaultInstance) return this; - PrepareBuilder(); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_customOptionMinIntegerValuesFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _customOptionMinIntegerValuesFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static CustomOptionMinIntegerValues() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class CustomOptionMaxIntegerValues : pb::GeneratedMessage { - private CustomOptionMaxIntegerValues() { } - private static readonly CustomOptionMaxIntegerValues defaultInstance = new CustomOptionMaxIntegerValues().MakeReadOnly(); - private static readonly string[] _customOptionMaxIntegerValuesFieldNames = new string[] { }; - private static readonly uint[] _customOptionMaxIntegerValuesFieldTags = new uint[] { }; - public static CustomOptionMaxIntegerValues DefaultInstance { - get { return defaultInstance; } - } - - public override CustomOptionMaxIntegerValues DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override CustomOptionMaxIntegerValues ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_CustomOptionMaxIntegerValues__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_CustomOptionMaxIntegerValues__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _customOptionMaxIntegerValuesFieldNames; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static CustomOptionMaxIntegerValues ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CustomOptionMaxIntegerValues ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CustomOptionMaxIntegerValues ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CustomOptionMaxIntegerValues ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CustomOptionMaxIntegerValues ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CustomOptionMaxIntegerValues ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static CustomOptionMaxIntegerValues ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static CustomOptionMaxIntegerValues ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static CustomOptionMaxIntegerValues ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CustomOptionMaxIntegerValues ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private CustomOptionMaxIntegerValues MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(CustomOptionMaxIntegerValues prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(CustomOptionMaxIntegerValues cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private CustomOptionMaxIntegerValues result; - - private CustomOptionMaxIntegerValues PrepareBuilder() { - if (resultIsReadOnly) { - CustomOptionMaxIntegerValues original = result; - result = new CustomOptionMaxIntegerValues(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override CustomOptionMaxIntegerValues MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.CustomOptionMaxIntegerValues.Descriptor; } - } - - public override CustomOptionMaxIntegerValues DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.CustomOptionMaxIntegerValues.DefaultInstance; } - } - - public override CustomOptionMaxIntegerValues BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is CustomOptionMaxIntegerValues) { - return MergeFrom((CustomOptionMaxIntegerValues) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(CustomOptionMaxIntegerValues other) { - if (other == global::Google.ProtocolBuffers.TestProtos.CustomOptionMaxIntegerValues.DefaultInstance) return this; - PrepareBuilder(); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_customOptionMaxIntegerValuesFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _customOptionMaxIntegerValuesFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static CustomOptionMaxIntegerValues() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class CustomOptionOtherValues : pb::GeneratedMessage { - private CustomOptionOtherValues() { } - private static readonly CustomOptionOtherValues defaultInstance = new CustomOptionOtherValues().MakeReadOnly(); - private static readonly string[] _customOptionOtherValuesFieldNames = new string[] { }; - private static readonly uint[] _customOptionOtherValuesFieldTags = new uint[] { }; - public static CustomOptionOtherValues DefaultInstance { - get { return defaultInstance; } - } - - public override CustomOptionOtherValues DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override CustomOptionOtherValues ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_CustomOptionOtherValues__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_CustomOptionOtherValues__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _customOptionOtherValuesFieldNames; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static CustomOptionOtherValues ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CustomOptionOtherValues ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CustomOptionOtherValues ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CustomOptionOtherValues ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CustomOptionOtherValues ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CustomOptionOtherValues ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static CustomOptionOtherValues ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static CustomOptionOtherValues ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static CustomOptionOtherValues ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CustomOptionOtherValues ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private CustomOptionOtherValues MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(CustomOptionOtherValues prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(CustomOptionOtherValues cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private CustomOptionOtherValues result; - - private CustomOptionOtherValues PrepareBuilder() { - if (resultIsReadOnly) { - CustomOptionOtherValues original = result; - result = new CustomOptionOtherValues(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override CustomOptionOtherValues MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.CustomOptionOtherValues.Descriptor; } - } - - public override CustomOptionOtherValues DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.CustomOptionOtherValues.DefaultInstance; } - } - - public override CustomOptionOtherValues BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is CustomOptionOtherValues) { - return MergeFrom((CustomOptionOtherValues) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(CustomOptionOtherValues other) { - if (other == global::Google.ProtocolBuffers.TestProtos.CustomOptionOtherValues.DefaultInstance) return this; - PrepareBuilder(); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_customOptionOtherValuesFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _customOptionOtherValuesFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static CustomOptionOtherValues() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class SettingRealsFromPositiveInts : pb::GeneratedMessage { - private SettingRealsFromPositiveInts() { } - private static readonly SettingRealsFromPositiveInts defaultInstance = new SettingRealsFromPositiveInts().MakeReadOnly(); - private static readonly string[] _settingRealsFromPositiveIntsFieldNames = new string[] { }; - private static readonly uint[] _settingRealsFromPositiveIntsFieldTags = new uint[] { }; - public static SettingRealsFromPositiveInts DefaultInstance { - get { return defaultInstance; } - } - - public override SettingRealsFromPositiveInts DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override SettingRealsFromPositiveInts ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_SettingRealsFromPositiveInts__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_SettingRealsFromPositiveInts__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _settingRealsFromPositiveIntsFieldNames; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static SettingRealsFromPositiveInts ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SettingRealsFromPositiveInts ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SettingRealsFromPositiveInts ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SettingRealsFromPositiveInts ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SettingRealsFromPositiveInts ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SettingRealsFromPositiveInts ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SettingRealsFromPositiveInts ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SettingRealsFromPositiveInts ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SettingRealsFromPositiveInts ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SettingRealsFromPositiveInts ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private SettingRealsFromPositiveInts MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SettingRealsFromPositiveInts prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(SettingRealsFromPositiveInts cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private SettingRealsFromPositiveInts result; - - private SettingRealsFromPositiveInts PrepareBuilder() { - if (resultIsReadOnly) { - SettingRealsFromPositiveInts original = result; - result = new SettingRealsFromPositiveInts(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override SettingRealsFromPositiveInts MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.SettingRealsFromPositiveInts.Descriptor; } - } - - public override SettingRealsFromPositiveInts DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.SettingRealsFromPositiveInts.DefaultInstance; } - } - - public override SettingRealsFromPositiveInts BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SettingRealsFromPositiveInts) { - return MergeFrom((SettingRealsFromPositiveInts) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SettingRealsFromPositiveInts other) { - if (other == global::Google.ProtocolBuffers.TestProtos.SettingRealsFromPositiveInts.DefaultInstance) return this; - PrepareBuilder(); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_settingRealsFromPositiveIntsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _settingRealsFromPositiveIntsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static SettingRealsFromPositiveInts() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class SettingRealsFromNegativeInts : pb::GeneratedMessage { - private SettingRealsFromNegativeInts() { } - private static readonly SettingRealsFromNegativeInts defaultInstance = new SettingRealsFromNegativeInts().MakeReadOnly(); - private static readonly string[] _settingRealsFromNegativeIntsFieldNames = new string[] { }; - private static readonly uint[] _settingRealsFromNegativeIntsFieldTags = new uint[] { }; - public static SettingRealsFromNegativeInts DefaultInstance { - get { return defaultInstance; } - } - - public override SettingRealsFromNegativeInts DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override SettingRealsFromNegativeInts ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_SettingRealsFromNegativeInts__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_SettingRealsFromNegativeInts__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _settingRealsFromNegativeIntsFieldNames; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static SettingRealsFromNegativeInts ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SettingRealsFromNegativeInts ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SettingRealsFromNegativeInts ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SettingRealsFromNegativeInts ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SettingRealsFromNegativeInts ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SettingRealsFromNegativeInts ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SettingRealsFromNegativeInts ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SettingRealsFromNegativeInts ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SettingRealsFromNegativeInts ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SettingRealsFromNegativeInts ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private SettingRealsFromNegativeInts MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SettingRealsFromNegativeInts prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(SettingRealsFromNegativeInts cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private SettingRealsFromNegativeInts result; - - private SettingRealsFromNegativeInts PrepareBuilder() { - if (resultIsReadOnly) { - SettingRealsFromNegativeInts original = result; - result = new SettingRealsFromNegativeInts(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override SettingRealsFromNegativeInts MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.SettingRealsFromNegativeInts.Descriptor; } - } - - public override SettingRealsFromNegativeInts DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.SettingRealsFromNegativeInts.DefaultInstance; } - } - - public override SettingRealsFromNegativeInts BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SettingRealsFromNegativeInts) { - return MergeFrom((SettingRealsFromNegativeInts) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SettingRealsFromNegativeInts other) { - if (other == global::Google.ProtocolBuffers.TestProtos.SettingRealsFromNegativeInts.DefaultInstance) return this; - PrepareBuilder(); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_settingRealsFromNegativeIntsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _settingRealsFromNegativeIntsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static SettingRealsFromNegativeInts() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class ComplexOptionType1 : pb::ExtendableMessage { - private ComplexOptionType1() { } - private static readonly ComplexOptionType1 defaultInstance = new ComplexOptionType1().MakeReadOnly(); - private static readonly string[] _complexOptionType1FieldNames = new string[] { "foo", "foo2", "foo3" }; - private static readonly uint[] _complexOptionType1FieldTags = new uint[] { 8, 16, 24 }; - public static ComplexOptionType1 DefaultInstance { - get { return defaultInstance; } - } - - public override ComplexOptionType1 DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override ComplexOptionType1 ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_ComplexOptionType1__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_ComplexOptionType1__FieldAccessorTable; } - } - - public const int FooFieldNumber = 1; - private bool hasFoo; - private int foo_; - public bool HasFoo { - get { return hasFoo; } - } - public int Foo { - get { return foo_; } - } - - public const int Foo2FieldNumber = 2; - private bool hasFoo2; - private int foo2_; - public bool HasFoo2 { - get { return hasFoo2; } - } - public int Foo2 { - get { return foo2_; } - } - - public const int Foo3FieldNumber = 3; - private bool hasFoo3; - private int foo3_; - public bool HasFoo3 { - get { return hasFoo3; } - } - public int Foo3 { - get { return foo3_; } - } - - public override bool IsInitialized { - get { - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _complexOptionType1FieldNames; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - if (hasFoo) { - output.WriteInt32(1, field_names[0], Foo); - } - if (hasFoo2) { - output.WriteInt32(2, field_names[1], Foo2); - } - if (hasFoo3) { - output.WriteInt32(3, field_names[2], Foo3); - } - extensionWriter.WriteUntil(536870912, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasFoo) { - size += pb::CodedOutputStream.ComputeInt32Size(1, Foo); - } - if (hasFoo2) { - size += pb::CodedOutputStream.ComputeInt32Size(2, Foo2); - } - if (hasFoo3) { - size += pb::CodedOutputStream.ComputeInt32Size(3, Foo3); - } - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static ComplexOptionType1 ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ComplexOptionType1 ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ComplexOptionType1 ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ComplexOptionType1 ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ComplexOptionType1 ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ComplexOptionType1 ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ComplexOptionType1 ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ComplexOptionType1 ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ComplexOptionType1 ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ComplexOptionType1 ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private ComplexOptionType1 MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ComplexOptionType1 prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(ComplexOptionType1 cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private ComplexOptionType1 result; - - private ComplexOptionType1 PrepareBuilder() { - if (resultIsReadOnly) { - ComplexOptionType1 original = result; - result = new ComplexOptionType1(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override ComplexOptionType1 MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.ComplexOptionType1.Descriptor; } - } - - public override ComplexOptionType1 DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.ComplexOptionType1.DefaultInstance; } - } - - public override ComplexOptionType1 BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ComplexOptionType1) { - return MergeFrom((ComplexOptionType1) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ComplexOptionType1 other) { - if (other == global::Google.ProtocolBuffers.TestProtos.ComplexOptionType1.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasFoo) { - Foo = other.Foo; - } - if (other.HasFoo2) { - Foo2 = other.Foo2; - } - if (other.HasFoo3) { - Foo3 = other.Foo3; - } - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_complexOptionType1FieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _complexOptionType1FieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasFoo = input.ReadInt32(ref result.foo_); - break; - } - case 16: { - result.hasFoo2 = input.ReadInt32(ref result.foo2_); - break; - } - case 24: { - result.hasFoo3 = input.ReadInt32(ref result.foo3_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasFoo { - get { return result.hasFoo; } - } - public int Foo { - get { return result.Foo; } - set { SetFoo(value); } - } - public Builder SetFoo(int value) { - PrepareBuilder(); - result.hasFoo = true; - result.foo_ = value; - return this; - } - public Builder ClearFoo() { - PrepareBuilder(); - result.hasFoo = false; - result.foo_ = 0; - return this; - } - - public bool HasFoo2 { - get { return result.hasFoo2; } - } - public int Foo2 { - get { return result.Foo2; } - set { SetFoo2(value); } - } - public Builder SetFoo2(int value) { - PrepareBuilder(); - result.hasFoo2 = true; - result.foo2_ = value; - return this; - } - public Builder ClearFoo2() { - PrepareBuilder(); - result.hasFoo2 = false; - result.foo2_ = 0; - return this; - } - - public bool HasFoo3 { - get { return result.hasFoo3; } - } - public int Foo3 { - get { return result.Foo3; } - set { SetFoo3(value); } - } - public Builder SetFoo3(int value) { - PrepareBuilder(); - result.hasFoo3 = true; - result.foo3_ = value; - return this; - } - public Builder ClearFoo3() { - PrepareBuilder(); - result.hasFoo3 = false; - result.foo3_ = 0; - return this; - } - } - static ComplexOptionType1() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class ComplexOptionType2 : pb::ExtendableMessage { - private ComplexOptionType2() { } - private static readonly ComplexOptionType2 defaultInstance = new ComplexOptionType2().MakeReadOnly(); - private static readonly string[] _complexOptionType2FieldNames = new string[] { "bar", "baz", "fred" }; - private static readonly uint[] _complexOptionType2FieldTags = new uint[] { 10, 16, 26 }; - public static ComplexOptionType2 DefaultInstance { - get { return defaultInstance; } - } - - public override ComplexOptionType2 DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override ComplexOptionType2 ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_ComplexOptionType2__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_ComplexOptionType2__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class ComplexOptionType4 : pb::GeneratedMessage { - private ComplexOptionType4() { } - private static readonly ComplexOptionType4 defaultInstance = new ComplexOptionType4().MakeReadOnly(); - private static readonly string[] _complexOptionType4FieldNames = new string[] { "waldo" }; - private static readonly uint[] _complexOptionType4FieldTags = new uint[] { 8 }; - public static ComplexOptionType4 DefaultInstance { - get { return defaultInstance; } - } - - public override ComplexOptionType4 DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override ComplexOptionType4 ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_ComplexOptionType2_ComplexOptionType4__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_ComplexOptionType2_ComplexOptionType4__FieldAccessorTable; } - } - - public const int ComplexOpt4FieldNumber = 7633546; - public static pb::GeneratedExtensionBase ComplexOpt4; - public const int WaldoFieldNumber = 1; - private bool hasWaldo; - private int waldo_; - public bool HasWaldo { - get { return hasWaldo; } - } - public int Waldo { - get { return waldo_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _complexOptionType4FieldNames; - if (hasWaldo) { - output.WriteInt32(1, field_names[0], Waldo); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasWaldo) { - size += pb::CodedOutputStream.ComputeInt32Size(1, Waldo); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static ComplexOptionType4 ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ComplexOptionType4 ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ComplexOptionType4 ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ComplexOptionType4 ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ComplexOptionType4 ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ComplexOptionType4 ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ComplexOptionType4 ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ComplexOptionType4 ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ComplexOptionType4 ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ComplexOptionType4 ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private ComplexOptionType4 MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ComplexOptionType4 prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(ComplexOptionType4 cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private ComplexOptionType4 result; - - private ComplexOptionType4 PrepareBuilder() { - if (resultIsReadOnly) { - ComplexOptionType4 original = result; - result = new ComplexOptionType4(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override ComplexOptionType4 MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.ComplexOptionType2.Types.ComplexOptionType4.Descriptor; } - } - - public override ComplexOptionType4 DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.ComplexOptionType2.Types.ComplexOptionType4.DefaultInstance; } - } - - public override ComplexOptionType4 BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ComplexOptionType4) { - return MergeFrom((ComplexOptionType4) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ComplexOptionType4 other) { - if (other == global::Google.ProtocolBuffers.TestProtos.ComplexOptionType2.Types.ComplexOptionType4.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasWaldo) { - Waldo = other.Waldo; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_complexOptionType4FieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _complexOptionType4FieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasWaldo = input.ReadInt32(ref result.waldo_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasWaldo { - get { return result.hasWaldo; } - } - public int Waldo { - get { return result.Waldo; } - set { SetWaldo(value); } - } - public Builder SetWaldo(int value) { - PrepareBuilder(); - result.hasWaldo = true; - result.waldo_ = value; - return this; - } - public Builder ClearWaldo() { - PrepareBuilder(); - result.hasWaldo = false; - result.waldo_ = 0; - return this; - } - } - static ComplexOptionType4() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor, null); - } - } - - } - #endregion - - public const int BarFieldNumber = 1; - private bool hasBar; - private global::Google.ProtocolBuffers.TestProtos.ComplexOptionType1 bar_; - public bool HasBar { - get { return hasBar; } - } - public global::Google.ProtocolBuffers.TestProtos.ComplexOptionType1 Bar { - get { return bar_ ?? global::Google.ProtocolBuffers.TestProtos.ComplexOptionType1.DefaultInstance; } - } - - public const int BazFieldNumber = 2; - private bool hasBaz; - private int baz_; - public bool HasBaz { - get { return hasBaz; } - } - public int Baz { - get { return baz_; } - } - - public const int FredFieldNumber = 3; - private bool hasFred; - private global::Google.ProtocolBuffers.TestProtos.ComplexOptionType2.Types.ComplexOptionType4 fred_; - public bool HasFred { - get { return hasFred; } - } - public global::Google.ProtocolBuffers.TestProtos.ComplexOptionType2.Types.ComplexOptionType4 Fred { - get { return fred_ ?? global::Google.ProtocolBuffers.TestProtos.ComplexOptionType2.Types.ComplexOptionType4.DefaultInstance; } - } - - public override bool IsInitialized { - get { - if (HasFred) { - if (!Fred.IsInitialized) return false; - } - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _complexOptionType2FieldNames; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - if (hasBar) { - output.WriteMessage(1, field_names[0], Bar); - } - if (hasBaz) { - output.WriteInt32(2, field_names[1], Baz); - } - if (hasFred) { - output.WriteMessage(3, field_names[2], Fred); - } - extensionWriter.WriteUntil(536870912, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasBar) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Bar); - } - if (hasBaz) { - size += pb::CodedOutputStream.ComputeInt32Size(2, Baz); - } - if (hasFred) { - size += pb::CodedOutputStream.ComputeMessageSize(3, Fred); - } - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static ComplexOptionType2 ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ComplexOptionType2 ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ComplexOptionType2 ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ComplexOptionType2 ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ComplexOptionType2 ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ComplexOptionType2 ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ComplexOptionType2 ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ComplexOptionType2 ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ComplexOptionType2 ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ComplexOptionType2 ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private ComplexOptionType2 MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ComplexOptionType2 prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(ComplexOptionType2 cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private ComplexOptionType2 result; - - private ComplexOptionType2 PrepareBuilder() { - if (resultIsReadOnly) { - ComplexOptionType2 original = result; - result = new ComplexOptionType2(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override ComplexOptionType2 MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.ComplexOptionType2.Descriptor; } - } - - public override ComplexOptionType2 DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.ComplexOptionType2.DefaultInstance; } - } - - public override ComplexOptionType2 BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ComplexOptionType2) { - return MergeFrom((ComplexOptionType2) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ComplexOptionType2 other) { - if (other == global::Google.ProtocolBuffers.TestProtos.ComplexOptionType2.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasBar) { - MergeBar(other.Bar); - } - if (other.HasBaz) { - Baz = other.Baz; - } - if (other.HasFred) { - MergeFred(other.Fred); - } - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_complexOptionType2FieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _complexOptionType2FieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - global::Google.ProtocolBuffers.TestProtos.ComplexOptionType1.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.ComplexOptionType1.CreateBuilder(); - if (result.hasBar) { - subBuilder.MergeFrom(Bar); - } - input.ReadMessage(subBuilder, extensionRegistry); - Bar = subBuilder.BuildPartial(); - break; - } - case 16: { - result.hasBaz = input.ReadInt32(ref result.baz_); - break; - } - case 26: { - global::Google.ProtocolBuffers.TestProtos.ComplexOptionType2.Types.ComplexOptionType4.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.ComplexOptionType2.Types.ComplexOptionType4.CreateBuilder(); - if (result.hasFred) { - subBuilder.MergeFrom(Fred); - } - input.ReadMessage(subBuilder, extensionRegistry); - Fred = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasBar { - get { return result.hasBar; } - } - public global::Google.ProtocolBuffers.TestProtos.ComplexOptionType1 Bar { - get { return result.Bar; } - set { SetBar(value); } - } - public Builder SetBar(global::Google.ProtocolBuffers.TestProtos.ComplexOptionType1 value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasBar = true; - result.bar_ = value; - return this; - } - public Builder SetBar(global::Google.ProtocolBuffers.TestProtos.ComplexOptionType1.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasBar = true; - result.bar_ = builderForValue.Build(); - return this; - } - public Builder MergeBar(global::Google.ProtocolBuffers.TestProtos.ComplexOptionType1 value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasBar && - result.bar_ != global::Google.ProtocolBuffers.TestProtos.ComplexOptionType1.DefaultInstance) { - result.bar_ = global::Google.ProtocolBuffers.TestProtos.ComplexOptionType1.CreateBuilder(result.bar_).MergeFrom(value).BuildPartial(); - } else { - result.bar_ = value; - } - result.hasBar = true; - return this; - } - public Builder ClearBar() { - PrepareBuilder(); - result.hasBar = false; - result.bar_ = null; - return this; - } - - public bool HasBaz { - get { return result.hasBaz; } - } - public int Baz { - get { return result.Baz; } - set { SetBaz(value); } - } - public Builder SetBaz(int value) { - PrepareBuilder(); - result.hasBaz = true; - result.baz_ = value; - return this; - } - public Builder ClearBaz() { - PrepareBuilder(); - result.hasBaz = false; - result.baz_ = 0; - return this; - } - - public bool HasFred { - get { return result.hasFred; } - } - public global::Google.ProtocolBuffers.TestProtos.ComplexOptionType2.Types.ComplexOptionType4 Fred { - get { return result.Fred; } - set { SetFred(value); } - } - public Builder SetFred(global::Google.ProtocolBuffers.TestProtos.ComplexOptionType2.Types.ComplexOptionType4 value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasFred = true; - result.fred_ = value; - return this; - } - public Builder SetFred(global::Google.ProtocolBuffers.TestProtos.ComplexOptionType2.Types.ComplexOptionType4.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasFred = true; - result.fred_ = builderForValue.Build(); - return this; - } - public Builder MergeFred(global::Google.ProtocolBuffers.TestProtos.ComplexOptionType2.Types.ComplexOptionType4 value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasFred && - result.fred_ != global::Google.ProtocolBuffers.TestProtos.ComplexOptionType2.Types.ComplexOptionType4.DefaultInstance) { - result.fred_ = global::Google.ProtocolBuffers.TestProtos.ComplexOptionType2.Types.ComplexOptionType4.CreateBuilder(result.fred_).MergeFrom(value).BuildPartial(); - } else { - result.fred_ = value; - } - result.hasFred = true; - return this; - } - public Builder ClearFred() { - PrepareBuilder(); - result.hasFred = false; - result.fred_ = null; - return this; - } - } - static ComplexOptionType2() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class ComplexOptionType3 : pb::GeneratedMessage { - private ComplexOptionType3() { } - private static readonly ComplexOptionType3 defaultInstance = new ComplexOptionType3().MakeReadOnly(); - private static readonly string[] _complexOptionType3FieldNames = new string[] { "complexoptiontype5", "qux" }; - private static readonly uint[] _complexOptionType3FieldTags = new uint[] { 19, 8 }; - public static ComplexOptionType3 DefaultInstance { - get { return defaultInstance; } - } - - public override ComplexOptionType3 DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override ComplexOptionType3 ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_ComplexOptionType3__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_ComplexOptionType3__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class ComplexOptionType5 : pb::GeneratedMessage { - private ComplexOptionType5() { } - private static readonly ComplexOptionType5 defaultInstance = new ComplexOptionType5().MakeReadOnly(); - private static readonly string[] _complexOptionType5FieldNames = new string[] { "plugh" }; - private static readonly uint[] _complexOptionType5FieldTags = new uint[] { 24 }; - public static ComplexOptionType5 DefaultInstance { - get { return defaultInstance; } - } - - public override ComplexOptionType5 DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override ComplexOptionType5 ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_ComplexOptionType3_ComplexOptionType5__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_ComplexOptionType3_ComplexOptionType5__FieldAccessorTable; } - } - - public const int PlughFieldNumber = 3; - private bool hasPlugh; - private int plugh_; - public bool HasPlugh { - get { return hasPlugh; } - } - public int Plugh { - get { return plugh_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _complexOptionType5FieldNames; - if (hasPlugh) { - output.WriteInt32(3, field_names[0], Plugh); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasPlugh) { - size += pb::CodedOutputStream.ComputeInt32Size(3, Plugh); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static ComplexOptionType5 ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ComplexOptionType5 ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ComplexOptionType5 ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ComplexOptionType5 ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ComplexOptionType5 ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ComplexOptionType5 ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ComplexOptionType5 ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ComplexOptionType5 ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ComplexOptionType5 ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ComplexOptionType5 ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private ComplexOptionType5 MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ComplexOptionType5 prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(ComplexOptionType5 cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private ComplexOptionType5 result; - - private ComplexOptionType5 PrepareBuilder() { - if (resultIsReadOnly) { - ComplexOptionType5 original = result; - result = new ComplexOptionType5(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override ComplexOptionType5 MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.ComplexOptionType3.Types.ComplexOptionType5.Descriptor; } - } - - public override ComplexOptionType5 DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.ComplexOptionType3.Types.ComplexOptionType5.DefaultInstance; } - } - - public override ComplexOptionType5 BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ComplexOptionType5) { - return MergeFrom((ComplexOptionType5) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ComplexOptionType5 other) { - if (other == global::Google.ProtocolBuffers.TestProtos.ComplexOptionType3.Types.ComplexOptionType5.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasPlugh) { - Plugh = other.Plugh; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_complexOptionType5FieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _complexOptionType5FieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 24: { - result.hasPlugh = input.ReadInt32(ref result.plugh_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasPlugh { - get { return result.hasPlugh; } - } - public int Plugh { - get { return result.Plugh; } - set { SetPlugh(value); } - } - public Builder SetPlugh(int value) { - PrepareBuilder(); - result.hasPlugh = true; - result.plugh_ = value; - return this; - } - public Builder ClearPlugh() { - PrepareBuilder(); - result.hasPlugh = false; - result.plugh_ = 0; - return this; - } - } - static ComplexOptionType5() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor, null); - } - } - - } - #endregion - - public const int QuxFieldNumber = 1; - private bool hasQux; - private int qux_; - public bool HasQux { - get { return hasQux; } - } - public int Qux { - get { return qux_; } - } - - public const int ComplexOptionType5FieldNumber = 2; - private bool hasComplexOptionType5; - private global::Google.ProtocolBuffers.TestProtos.ComplexOptionType3.Types.ComplexOptionType5 complexOptionType5_; - public bool HasComplexOptionType5 { - get { return hasComplexOptionType5; } - } - public global::Google.ProtocolBuffers.TestProtos.ComplexOptionType3.Types.ComplexOptionType5 ComplexOptionType5 { - get { return complexOptionType5_ ?? global::Google.ProtocolBuffers.TestProtos.ComplexOptionType3.Types.ComplexOptionType5.DefaultInstance; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _complexOptionType3FieldNames; - if (hasQux) { - output.WriteInt32(1, field_names[1], Qux); - } - if (hasComplexOptionType5) { - output.WriteGroup(2, field_names[0], ComplexOptionType5); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasQux) { - size += pb::CodedOutputStream.ComputeInt32Size(1, Qux); - } - if (hasComplexOptionType5) { - size += pb::CodedOutputStream.ComputeGroupSize(2, ComplexOptionType5); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static ComplexOptionType3 ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ComplexOptionType3 ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ComplexOptionType3 ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ComplexOptionType3 ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ComplexOptionType3 ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ComplexOptionType3 ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ComplexOptionType3 ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ComplexOptionType3 ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ComplexOptionType3 ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ComplexOptionType3 ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private ComplexOptionType3 MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ComplexOptionType3 prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(ComplexOptionType3 cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private ComplexOptionType3 result; - - private ComplexOptionType3 PrepareBuilder() { - if (resultIsReadOnly) { - ComplexOptionType3 original = result; - result = new ComplexOptionType3(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override ComplexOptionType3 MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.ComplexOptionType3.Descriptor; } - } - - public override ComplexOptionType3 DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.ComplexOptionType3.DefaultInstance; } - } - - public override ComplexOptionType3 BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ComplexOptionType3) { - return MergeFrom((ComplexOptionType3) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ComplexOptionType3 other) { - if (other == global::Google.ProtocolBuffers.TestProtos.ComplexOptionType3.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasQux) { - Qux = other.Qux; - } - if (other.HasComplexOptionType5) { - MergeComplexOptionType5(other.ComplexOptionType5); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_complexOptionType3FieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _complexOptionType3FieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasQux = input.ReadInt32(ref result.qux_); - break; - } - case 19: { - global::Google.ProtocolBuffers.TestProtos.ComplexOptionType3.Types.ComplexOptionType5.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.ComplexOptionType3.Types.ComplexOptionType5.CreateBuilder(); - if (result.hasComplexOptionType5) { - subBuilder.MergeFrom(ComplexOptionType5); - } - input.ReadGroup(2, subBuilder, extensionRegistry); - ComplexOptionType5 = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasQux { - get { return result.hasQux; } - } - public int Qux { - get { return result.Qux; } - set { SetQux(value); } - } - public Builder SetQux(int value) { - PrepareBuilder(); - result.hasQux = true; - result.qux_ = value; - return this; - } - public Builder ClearQux() { - PrepareBuilder(); - result.hasQux = false; - result.qux_ = 0; - return this; - } - - public bool HasComplexOptionType5 { - get { return result.hasComplexOptionType5; } - } - public global::Google.ProtocolBuffers.TestProtos.ComplexOptionType3.Types.ComplexOptionType5 ComplexOptionType5 { - get { return result.ComplexOptionType5; } - set { SetComplexOptionType5(value); } - } - public Builder SetComplexOptionType5(global::Google.ProtocolBuffers.TestProtos.ComplexOptionType3.Types.ComplexOptionType5 value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasComplexOptionType5 = true; - result.complexOptionType5_ = value; - return this; - } - public Builder SetComplexOptionType5(global::Google.ProtocolBuffers.TestProtos.ComplexOptionType3.Types.ComplexOptionType5.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasComplexOptionType5 = true; - result.complexOptionType5_ = builderForValue.Build(); - return this; - } - public Builder MergeComplexOptionType5(global::Google.ProtocolBuffers.TestProtos.ComplexOptionType3.Types.ComplexOptionType5 value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasComplexOptionType5 && - result.complexOptionType5_ != global::Google.ProtocolBuffers.TestProtos.ComplexOptionType3.Types.ComplexOptionType5.DefaultInstance) { - result.complexOptionType5_ = global::Google.ProtocolBuffers.TestProtos.ComplexOptionType3.Types.ComplexOptionType5.CreateBuilder(result.complexOptionType5_).MergeFrom(value).BuildPartial(); - } else { - result.complexOptionType5_ = value; - } - result.hasComplexOptionType5 = true; - return this; - } - public Builder ClearComplexOptionType5() { - PrepareBuilder(); - result.hasComplexOptionType5 = false; - result.complexOptionType5_ = null; - return this; - } - } - static ComplexOptionType3() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class ComplexOpt6 : pb::GeneratedMessage { - private ComplexOpt6() { } - private static readonly ComplexOpt6 defaultInstance = new ComplexOpt6().MakeReadOnly(); - private static readonly string[] _complexOpt6FieldNames = new string[] { "xyzzy" }; - private static readonly uint[] _complexOpt6FieldTags = new uint[] { 60751608 }; - public static ComplexOpt6 DefaultInstance { - get { return defaultInstance; } - } - - public override ComplexOpt6 DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override ComplexOpt6 ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_ComplexOpt6__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_ComplexOpt6__FieldAccessorTable; } - } - - public const int XyzzyFieldNumber = 7593951; - private bool hasXyzzy; - private int xyzzy_; - public bool HasXyzzy { - get { return hasXyzzy; } - } - public int Xyzzy { - get { return xyzzy_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _complexOpt6FieldNames; - if (hasXyzzy) { - output.WriteInt32(7593951, field_names[0], Xyzzy); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasXyzzy) { - size += pb::CodedOutputStream.ComputeInt32Size(7593951, Xyzzy); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static ComplexOpt6 ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ComplexOpt6 ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ComplexOpt6 ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ComplexOpt6 ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ComplexOpt6 ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ComplexOpt6 ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ComplexOpt6 ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ComplexOpt6 ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ComplexOpt6 ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ComplexOpt6 ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private ComplexOpt6 MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ComplexOpt6 prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(ComplexOpt6 cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private ComplexOpt6 result; - - private ComplexOpt6 PrepareBuilder() { - if (resultIsReadOnly) { - ComplexOpt6 original = result; - result = new ComplexOpt6(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override ComplexOpt6 MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.ComplexOpt6.Descriptor; } - } - - public override ComplexOpt6 DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.ComplexOpt6.DefaultInstance; } - } - - public override ComplexOpt6 BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ComplexOpt6) { - return MergeFrom((ComplexOpt6) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ComplexOpt6 other) { - if (other == global::Google.ProtocolBuffers.TestProtos.ComplexOpt6.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasXyzzy) { - Xyzzy = other.Xyzzy; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_complexOpt6FieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _complexOpt6FieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 60751608: { - result.hasXyzzy = input.ReadInt32(ref result.xyzzy_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasXyzzy { - get { return result.hasXyzzy; } - } - public int Xyzzy { - get { return result.Xyzzy; } - set { SetXyzzy(value); } - } - public Builder SetXyzzy(int value) { - PrepareBuilder(); - result.hasXyzzy = true; - result.xyzzy_ = value; - return this; - } - public Builder ClearXyzzy() { - PrepareBuilder(); - result.hasXyzzy = false; - result.xyzzy_ = 0; - return this; - } - } - static ComplexOpt6() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class VariousComplexOptions : pb::GeneratedMessage { - private VariousComplexOptions() { } - private static readonly VariousComplexOptions defaultInstance = new VariousComplexOptions().MakeReadOnly(); - private static readonly string[] _variousComplexOptionsFieldNames = new string[] { }; - private static readonly uint[] _variousComplexOptionsFieldTags = new uint[] { }; - public static VariousComplexOptions DefaultInstance { - get { return defaultInstance; } - } - - public override VariousComplexOptions DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override VariousComplexOptions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_VariousComplexOptions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_VariousComplexOptions__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _variousComplexOptionsFieldNames; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static VariousComplexOptions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static VariousComplexOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static VariousComplexOptions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static VariousComplexOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static VariousComplexOptions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static VariousComplexOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static VariousComplexOptions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static VariousComplexOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static VariousComplexOptions ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static VariousComplexOptions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private VariousComplexOptions MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(VariousComplexOptions prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(VariousComplexOptions cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private VariousComplexOptions result; - - private VariousComplexOptions PrepareBuilder() { - if (resultIsReadOnly) { - VariousComplexOptions original = result; - result = new VariousComplexOptions(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override VariousComplexOptions MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.VariousComplexOptions.Descriptor; } - } - - public override VariousComplexOptions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.VariousComplexOptions.DefaultInstance; } - } - - public override VariousComplexOptions BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is VariousComplexOptions) { - return MergeFrom((VariousComplexOptions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(VariousComplexOptions other) { - if (other == global::Google.ProtocolBuffers.TestProtos.VariousComplexOptions.DefaultInstance) return this; - PrepareBuilder(); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_variousComplexOptionsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _variousComplexOptionsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static VariousComplexOptions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class AggregateMessageSet : pb::ExtendableMessage { - private AggregateMessageSet() { } - private static readonly AggregateMessageSet defaultInstance = new AggregateMessageSet().MakeReadOnly(); - private static readonly string[] _aggregateMessageSetFieldNames = new string[] { }; - private static readonly uint[] _aggregateMessageSetFieldTags = new uint[] { }; - public static AggregateMessageSet DefaultInstance { - get { return defaultInstance; } - } - - public override AggregateMessageSet DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override AggregateMessageSet ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_AggregateMessageSet__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_AggregateMessageSet__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _aggregateMessageSetFieldNames; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - extensionWriter.WriteUntil(536870912, output); - UnknownFields.WriteAsMessageSetTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSizeAsMessageSet; - memoizedSerializedSize = size; - return size; - } - public static AggregateMessageSet ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static AggregateMessageSet ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static AggregateMessageSet ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static AggregateMessageSet ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static AggregateMessageSet ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static AggregateMessageSet ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static AggregateMessageSet ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static AggregateMessageSet ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static AggregateMessageSet ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static AggregateMessageSet ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private AggregateMessageSet MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(AggregateMessageSet prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(AggregateMessageSet cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private AggregateMessageSet result; - - private AggregateMessageSet PrepareBuilder() { - if (resultIsReadOnly) { - AggregateMessageSet original = result; - result = new AggregateMessageSet(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override AggregateMessageSet MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.AggregateMessageSet.Descriptor; } - } - - public override AggregateMessageSet DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.AggregateMessageSet.DefaultInstance; } - } - - public override AggregateMessageSet BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is AggregateMessageSet) { - return MergeFrom((AggregateMessageSet) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(AggregateMessageSet other) { - if (other == global::Google.ProtocolBuffers.TestProtos.AggregateMessageSet.DefaultInstance) return this; - PrepareBuilder(); - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_aggregateMessageSetFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _aggregateMessageSetFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static AggregateMessageSet() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class AggregateMessageSetElement : pb::GeneratedMessage { - private AggregateMessageSetElement() { } - private static readonly AggregateMessageSetElement defaultInstance = new AggregateMessageSetElement().MakeReadOnly(); - private static readonly string[] _aggregateMessageSetElementFieldNames = new string[] { "s" }; - private static readonly uint[] _aggregateMessageSetElementFieldTags = new uint[] { 10 }; - public static AggregateMessageSetElement DefaultInstance { - get { return defaultInstance; } - } - - public override AggregateMessageSetElement DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override AggregateMessageSetElement ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_AggregateMessageSetElement__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_AggregateMessageSetElement__FieldAccessorTable; } - } - - public const int MessageSetExtensionFieldNumber = 15447542; - public static pb::GeneratedExtensionBase MessageSetExtension; - public const int SFieldNumber = 1; - private bool hasS; - private string s_ = ""; - public bool HasS { - get { return hasS; } - } - public string S { - get { return s_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _aggregateMessageSetElementFieldNames; - if (hasS) { - output.WriteString(1, field_names[0], S); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasS) { - size += pb::CodedOutputStream.ComputeStringSize(1, S); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static AggregateMessageSetElement ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static AggregateMessageSetElement ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static AggregateMessageSetElement ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static AggregateMessageSetElement ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static AggregateMessageSetElement ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static AggregateMessageSetElement ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static AggregateMessageSetElement ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static AggregateMessageSetElement ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static AggregateMessageSetElement ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static AggregateMessageSetElement ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private AggregateMessageSetElement MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(AggregateMessageSetElement prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(AggregateMessageSetElement cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private AggregateMessageSetElement result; - - private AggregateMessageSetElement PrepareBuilder() { - if (resultIsReadOnly) { - AggregateMessageSetElement original = result; - result = new AggregateMessageSetElement(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override AggregateMessageSetElement MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.AggregateMessageSetElement.Descriptor; } - } - - public override AggregateMessageSetElement DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.AggregateMessageSetElement.DefaultInstance; } - } - - public override AggregateMessageSetElement BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is AggregateMessageSetElement) { - return MergeFrom((AggregateMessageSetElement) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(AggregateMessageSetElement other) { - if (other == global::Google.ProtocolBuffers.TestProtos.AggregateMessageSetElement.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasS) { - S = other.S; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_aggregateMessageSetElementFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _aggregateMessageSetElementFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasS = input.ReadString(ref result.s_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasS { - get { return result.hasS; } - } - public string S { - get { return result.S; } - set { SetS(value); } - } - public Builder SetS(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasS = true; - result.s_ = value; - return this; - } - public Builder ClearS() { - PrepareBuilder(); - result.hasS = false; - result.s_ = ""; - return this; - } - } - static AggregateMessageSetElement() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Aggregate : pb::GeneratedMessage { - private Aggregate() { } - private static readonly Aggregate defaultInstance = new Aggregate().MakeReadOnly(); - private static readonly string[] _aggregateFieldNames = new string[] { "file", "i", "mset", "s", "sub" }; - private static readonly uint[] _aggregateFieldTags = new uint[] { 34, 8, 42, 18, 26 }; - public static Aggregate DefaultInstance { - get { return defaultInstance; } - } - - public override Aggregate DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override Aggregate ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_Aggregate__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_Aggregate__FieldAccessorTable; } - } - - public const int NestedFieldNumber = 15476903; - public static pb::GeneratedExtensionBase Nested; - public const int IFieldNumber = 1; - private bool hasI; - private int i_; - public bool HasI { - get { return hasI; } - } - public int I { - get { return i_; } - } - - public const int SFieldNumber = 2; - private bool hasS; - private string s_ = ""; - public bool HasS { - get { return hasS; } - } - public string S { - get { return s_; } - } - - public const int SubFieldNumber = 3; - private bool hasSub; - private global::Google.ProtocolBuffers.TestProtos.Aggregate sub_; - public bool HasSub { - get { return hasSub; } - } - public global::Google.ProtocolBuffers.TestProtos.Aggregate Sub { - get { return sub_ ?? global::Google.ProtocolBuffers.TestProtos.Aggregate.DefaultInstance; } - } - - public const int FileFieldNumber = 4; - private bool hasFile; - private global::Google.ProtocolBuffers.DescriptorProtos.FileOptions file_; - public bool HasFile { - get { return hasFile; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FileOptions File { - get { return file_ ?? global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.DefaultInstance; } - } - - public const int MsetFieldNumber = 5; - private bool hasMset; - private global::Google.ProtocolBuffers.TestProtos.AggregateMessageSet mset_; - public bool HasMset { - get { return hasMset; } - } - public global::Google.ProtocolBuffers.TestProtos.AggregateMessageSet Mset { - get { return mset_ ?? global::Google.ProtocolBuffers.TestProtos.AggregateMessageSet.DefaultInstance; } - } - - public override bool IsInitialized { - get { - if (HasSub) { - if (!Sub.IsInitialized) return false; - } - if (HasFile) { - if (!File.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _aggregateFieldNames; - if (hasI) { - output.WriteInt32(1, field_names[1], I); - } - if (hasS) { - output.WriteString(2, field_names[3], S); - } - if (hasSub) { - output.WriteMessage(3, field_names[4], Sub); - } - if (hasFile) { - output.WriteMessage(4, field_names[0], File); - } - if (hasMset) { - output.WriteMessage(5, field_names[2], Mset); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasI) { - size += pb::CodedOutputStream.ComputeInt32Size(1, I); - } - if (hasS) { - size += pb::CodedOutputStream.ComputeStringSize(2, S); - } - if (hasSub) { - size += pb::CodedOutputStream.ComputeMessageSize(3, Sub); - } - if (hasFile) { - size += pb::CodedOutputStream.ComputeMessageSize(4, File); - } - if (hasMset) { - size += pb::CodedOutputStream.ComputeMessageSize(5, Mset); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static Aggregate ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Aggregate ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Aggregate ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Aggregate ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Aggregate ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Aggregate ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Aggregate ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Aggregate ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Aggregate ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Aggregate ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private Aggregate MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Aggregate prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(Aggregate cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private Aggregate result; - - private Aggregate PrepareBuilder() { - if (resultIsReadOnly) { - Aggregate original = result; - result = new Aggregate(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override Aggregate MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.Aggregate.Descriptor; } - } - - public override Aggregate DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.Aggregate.DefaultInstance; } - } - - public override Aggregate BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Aggregate) { - return MergeFrom((Aggregate) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Aggregate other) { - if (other == global::Google.ProtocolBuffers.TestProtos.Aggregate.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasI) { - I = other.I; - } - if (other.HasS) { - S = other.S; - } - if (other.HasSub) { - MergeSub(other.Sub); - } - if (other.HasFile) { - MergeFile(other.File); - } - if (other.HasMset) { - MergeMset(other.Mset); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_aggregateFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _aggregateFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasI = input.ReadInt32(ref result.i_); - break; - } - case 18: { - result.hasS = input.ReadString(ref result.s_); - break; - } - case 26: { - global::Google.ProtocolBuffers.TestProtos.Aggregate.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.Aggregate.CreateBuilder(); - if (result.hasSub) { - subBuilder.MergeFrom(Sub); - } - input.ReadMessage(subBuilder, extensionRegistry); - Sub = subBuilder.BuildPartial(); - break; - } - case 34: { - global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.CreateBuilder(); - if (result.hasFile) { - subBuilder.MergeFrom(File); - } - input.ReadMessage(subBuilder, extensionRegistry); - File = subBuilder.BuildPartial(); - break; - } - case 42: { - global::Google.ProtocolBuffers.TestProtos.AggregateMessageSet.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.AggregateMessageSet.CreateBuilder(); - if (result.hasMset) { - subBuilder.MergeFrom(Mset); - } - input.ReadMessage(subBuilder, extensionRegistry); - Mset = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasI { - get { return result.hasI; } - } - public int I { - get { return result.I; } - set { SetI(value); } - } - public Builder SetI(int value) { - PrepareBuilder(); - result.hasI = true; - result.i_ = value; - return this; - } - public Builder ClearI() { - PrepareBuilder(); - result.hasI = false; - result.i_ = 0; - return this; - } - - public bool HasS { - get { return result.hasS; } - } - public string S { - get { return result.S; } - set { SetS(value); } - } - public Builder SetS(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasS = true; - result.s_ = value; - return this; - } - public Builder ClearS() { - PrepareBuilder(); - result.hasS = false; - result.s_ = ""; - return this; - } - - public bool HasSub { - get { return result.hasSub; } - } - public global::Google.ProtocolBuffers.TestProtos.Aggregate Sub { - get { return result.Sub; } - set { SetSub(value); } - } - public Builder SetSub(global::Google.ProtocolBuffers.TestProtos.Aggregate value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasSub = true; - result.sub_ = value; - return this; - } - public Builder SetSub(global::Google.ProtocolBuffers.TestProtos.Aggregate.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasSub = true; - result.sub_ = builderForValue.Build(); - return this; - } - public Builder MergeSub(global::Google.ProtocolBuffers.TestProtos.Aggregate value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasSub && - result.sub_ != global::Google.ProtocolBuffers.TestProtos.Aggregate.DefaultInstance) { - result.sub_ = global::Google.ProtocolBuffers.TestProtos.Aggregate.CreateBuilder(result.sub_).MergeFrom(value).BuildPartial(); - } else { - result.sub_ = value; - } - result.hasSub = true; - return this; - } - public Builder ClearSub() { - PrepareBuilder(); - result.hasSub = false; - result.sub_ = null; - return this; - } - - public bool HasFile { - get { return result.hasFile; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FileOptions File { - get { return result.File; } - set { SetFile(value); } - } - public Builder SetFile(global::Google.ProtocolBuffers.DescriptorProtos.FileOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasFile = true; - result.file_ = value; - return this; - } - public Builder SetFile(global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasFile = true; - result.file_ = builderForValue.Build(); - return this; - } - public Builder MergeFile(global::Google.ProtocolBuffers.DescriptorProtos.FileOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasFile && - result.file_ != global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.DefaultInstance) { - result.file_ = global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.CreateBuilder(result.file_).MergeFrom(value).BuildPartial(); - } else { - result.file_ = value; - } - result.hasFile = true; - return this; - } - public Builder ClearFile() { - PrepareBuilder(); - result.hasFile = false; - result.file_ = null; - return this; - } - - public bool HasMset { - get { return result.hasMset; } - } - public global::Google.ProtocolBuffers.TestProtos.AggregateMessageSet Mset { - get { return result.Mset; } - set { SetMset(value); } - } - public Builder SetMset(global::Google.ProtocolBuffers.TestProtos.AggregateMessageSet value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasMset = true; - result.mset_ = value; - return this; - } - public Builder SetMset(global::Google.ProtocolBuffers.TestProtos.AggregateMessageSet.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasMset = true; - result.mset_ = builderForValue.Build(); - return this; - } - public Builder MergeMset(global::Google.ProtocolBuffers.TestProtos.AggregateMessageSet value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasMset && - result.mset_ != global::Google.ProtocolBuffers.TestProtos.AggregateMessageSet.DefaultInstance) { - result.mset_ = global::Google.ProtocolBuffers.TestProtos.AggregateMessageSet.CreateBuilder(result.mset_).MergeFrom(value).BuildPartial(); - } else { - result.mset_ = value; - } - result.hasMset = true; - return this; - } - public Builder ClearMset() { - PrepareBuilder(); - result.hasMset = false; - result.mset_ = null; - return this; - } - } - static Aggregate() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class AggregateMessage : pb::GeneratedMessage { - private AggregateMessage() { } - private static readonly AggregateMessage defaultInstance = new AggregateMessage().MakeReadOnly(); - private static readonly string[] _aggregateMessageFieldNames = new string[] { "fieldname" }; - private static readonly uint[] _aggregateMessageFieldTags = new uint[] { 8 }; - public static AggregateMessage DefaultInstance { - get { return defaultInstance; } - } - - public override AggregateMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override AggregateMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_AggregateMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.internal__static_protobuf_unittest_AggregateMessage__FieldAccessorTable; } - } - - public const int FieldnameFieldNumber = 1; - private bool hasFieldname; - private int fieldname_; - public bool HasFieldname { - get { return hasFieldname; } - } - public int Fieldname { - get { return fieldname_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _aggregateMessageFieldNames; - if (hasFieldname) { - output.WriteInt32(1, field_names[0], Fieldname); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasFieldname) { - size += pb::CodedOutputStream.ComputeInt32Size(1, Fieldname); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static AggregateMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static AggregateMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static AggregateMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static AggregateMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static AggregateMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static AggregateMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static AggregateMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static AggregateMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static AggregateMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static AggregateMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private AggregateMessage MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(AggregateMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(AggregateMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private AggregateMessage result; - - private AggregateMessage PrepareBuilder() { - if (resultIsReadOnly) { - AggregateMessage original = result; - result = new AggregateMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override AggregateMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.AggregateMessage.Descriptor; } - } - - public override AggregateMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.AggregateMessage.DefaultInstance; } - } - - public override AggregateMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is AggregateMessage) { - return MergeFrom((AggregateMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(AggregateMessage other) { - if (other == global::Google.ProtocolBuffers.TestProtos.AggregateMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasFieldname) { - Fieldname = other.Fieldname; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_aggregateMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _aggregateMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasFieldname = input.ReadInt32(ref result.fieldname_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasFieldname { - get { return result.hasFieldname; } - } - public int Fieldname { - get { return result.Fieldname; } - set { SetFieldname(value); } - } - public Builder SetFieldname(int value) { - PrepareBuilder(); - result.hasFieldname = true; - result.fieldname_ = value; - return this; - } - public Builder ClearFieldname() { - PrepareBuilder(); - result.hasFieldname = false; - result.fieldname_ = 0; - return this; - } - } - static AggregateMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor, null); - } - } - - #endregion - - #region Services - /* - * Service generation is now disabled by default, use the following option to enable: - * option (google.protobuf.csharp_file_options).service_generator_type = GENERIC; - */ - /* - * Service generation is now disabled by default, use the following option to enable: - * option (google.protobuf.csharp_file_options).service_generator_type = GENERIC; - */ - #endregion - -} - -#endregion Designer generated code diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestEmbedOptimizeForProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestEmbedOptimizeForProtoFile.cs deleted file mode 100644 index 131b134..0000000 --- a/src/ProtocolBuffers.Test/TestProtos/UnitTestEmbedOptimizeForProtoFile.cs +++ /dev/null @@ -1,442 +0,0 @@ -// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.TestProtos { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class UnitTestEmbedOptimizeForProtoFile { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestEmbedOptimizedForSize__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestEmbedOptimizedForSize__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static UnitTestEmbedOptimizeForProtoFile() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CjFnb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfZW1iZWRfb3B0aW1pemVfZm9y", - "LnByb3RvEhFwcm90b2J1Zl91bml0dGVzdBokZ29vZ2xlL3Byb3RvYnVmL2Nz", - "aGFycF9vcHRpb25zLnByb3RvGitnb29nbGUvcHJvdG9idWYvdW5pdHRlc3Rf", - "b3B0aW1pemVfZm9yLnByb3RvIqEBChlUZXN0RW1iZWRPcHRpbWl6ZWRGb3JT", - "aXplEkEKEG9wdGlvbmFsX21lc3NhZ2UYASABKAsyJy5wcm90b2J1Zl91bml0", - "dGVzdC5UZXN0T3B0aW1pemVkRm9yU2l6ZRJBChByZXBlYXRlZF9tZXNzYWdl", - "GAIgAygLMicucHJvdG9idWZfdW5pdHRlc3QuVGVzdE9wdGltaXplZEZvclNp", - "emVCS0gBwj5GCiFHb29nbGUuUHJvdG9jb2xCdWZmZXJzLlRlc3RQcm90b3MS", - "IVVuaXRUZXN0RW1iZWRPcHRpbWl6ZUZvclByb3RvRmlsZQ==")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_protobuf_unittest_TestEmbedOptimizedForSize__Descriptor = Descriptor.MessageTypes[0]; - internal__static_protobuf_unittest_TestEmbedOptimizedForSize__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestEmbedOptimizedForSize__Descriptor, - new string[] { "OptionalMessage", "RepeatedMessage", }); - pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); - RegisterAllExtensions(registry); - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.RegisterAllExtensions(registry); - global::Google.ProtocolBuffers.TestProtos.UnitTestOptimizeForProtoFile.RegisterAllExtensions(registry); - return registry; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, - global::Google.ProtocolBuffers.TestProtos.UnitTestOptimizeForProtoFile.Descriptor, - }, assigner); - } - #endregion - - } - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestEmbedOptimizedForSize : pb::GeneratedMessage { - private TestEmbedOptimizedForSize() { } - private static readonly TestEmbedOptimizedForSize defaultInstance = new TestEmbedOptimizedForSize().MakeReadOnly(); - private static readonly string[] _testEmbedOptimizedForSizeFieldNames = new string[] { "optional_message", "repeated_message" }; - private static readonly uint[] _testEmbedOptimizedForSizeFieldTags = new uint[] { 10, 18 }; - public static TestEmbedOptimizedForSize DefaultInstance { - get { return defaultInstance; } - } - - public override TestEmbedOptimizedForSize DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestEmbedOptimizedForSize ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestEmbedOptimizeForProtoFile.internal__static_protobuf_unittest_TestEmbedOptimizedForSize__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestEmbedOptimizeForProtoFile.internal__static_protobuf_unittest_TestEmbedOptimizedForSize__FieldAccessorTable; } - } - - public const int OptionalMessageFieldNumber = 1; - private bool hasOptionalMessage; - private global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize optionalMessage_; - public bool HasOptionalMessage { - get { return hasOptionalMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize OptionalMessage { - get { return optionalMessage_ ?? global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.DefaultInstance; } - } - - public const int RepeatedMessageFieldNumber = 2; - private pbc::PopsicleList repeatedMessage_ = new pbc::PopsicleList(); - public scg::IList RepeatedMessageList { - get { return repeatedMessage_; } - } - public int RepeatedMessageCount { - get { return repeatedMessage_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize GetRepeatedMessage(int index) { - return repeatedMessage_[index]; - } - - public override bool IsInitialized { - get { - if (HasOptionalMessage) { - if (!OptionalMessage.IsInitialized) return false; - } - foreach (global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize element in RepeatedMessageList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testEmbedOptimizedForSizeFieldNames; - if (hasOptionalMessage) { - output.WriteMessage(1, field_names[0], OptionalMessage); - } - if (repeatedMessage_.Count > 0) { - output.WriteMessageArray(2, field_names[1], repeatedMessage_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasOptionalMessage) { - size += pb::CodedOutputStream.ComputeMessageSize(1, OptionalMessage); - } - foreach (global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize element in RepeatedMessageList) { - size += pb::CodedOutputStream.ComputeMessageSize(2, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestEmbedOptimizedForSize ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestEmbedOptimizedForSize ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestEmbedOptimizedForSize ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestEmbedOptimizedForSize ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestEmbedOptimizedForSize ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestEmbedOptimizedForSize ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestEmbedOptimizedForSize ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestEmbedOptimizedForSize ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestEmbedOptimizedForSize ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestEmbedOptimizedForSize ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestEmbedOptimizedForSize MakeReadOnly() { - repeatedMessage_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestEmbedOptimizedForSize prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestEmbedOptimizedForSize cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestEmbedOptimizedForSize result; - - private TestEmbedOptimizedForSize PrepareBuilder() { - if (resultIsReadOnly) { - TestEmbedOptimizedForSize original = result; - result = new TestEmbedOptimizedForSize(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestEmbedOptimizedForSize MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize.Descriptor; } - } - - public override TestEmbedOptimizedForSize DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize.DefaultInstance; } - } - - public override TestEmbedOptimizedForSize BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestEmbedOptimizedForSize) { - return MergeFrom((TestEmbedOptimizedForSize) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestEmbedOptimizedForSize other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasOptionalMessage) { - MergeOptionalMessage(other.OptionalMessage); - } - if (other.repeatedMessage_.Count != 0) { - result.repeatedMessage_.Add(other.repeatedMessage_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testEmbedOptimizedForSizeFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testEmbedOptimizedForSizeFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.CreateBuilder(); - if (result.hasOptionalMessage) { - subBuilder.MergeFrom(OptionalMessage); - } - input.ReadMessage(subBuilder, extensionRegistry); - OptionalMessage = subBuilder.BuildPartial(); - break; - } - case 18: { - input.ReadMessageArray(tag, field_name, result.repeatedMessage_, global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.DefaultInstance, extensionRegistry); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasOptionalMessage { - get { return result.hasOptionalMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize OptionalMessage { - get { return result.OptionalMessage; } - set { SetOptionalMessage(value); } - } - public Builder SetOptionalMessage(global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalMessage = true; - result.optionalMessage_ = value; - return this; - } - public Builder SetOptionalMessage(global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptionalMessage = true; - result.optionalMessage_ = builderForValue.Build(); - return this; - } - public Builder MergeOptionalMessage(global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptionalMessage && - result.optionalMessage_ != global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.DefaultInstance) { - result.optionalMessage_ = global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.CreateBuilder(result.optionalMessage_).MergeFrom(value).BuildPartial(); - } else { - result.optionalMessage_ = value; - } - result.hasOptionalMessage = true; - return this; - } - public Builder ClearOptionalMessage() { - PrepareBuilder(); - result.hasOptionalMessage = false; - result.optionalMessage_ = null; - return this; - } - - public pbc::IPopsicleList RepeatedMessageList { - get { return PrepareBuilder().repeatedMessage_; } - } - public int RepeatedMessageCount { - get { return result.RepeatedMessageCount; } - } - public global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize GetRepeatedMessage(int index) { - return result.GetRepeatedMessage(index); - } - public Builder SetRepeatedMessage(int index, global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedMessage_[index] = value; - return this; - } - public Builder SetRepeatedMessage(int index, global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedMessage_[index] = builderForValue.Build(); - return this; - } - public Builder AddRepeatedMessage(global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedMessage_.Add(value); - return this; - } - public Builder AddRepeatedMessage(global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedMessage_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeRepeatedMessage(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedMessage_.Add(values); - return this; - } - public Builder ClearRepeatedMessage() { - PrepareBuilder(); - result.repeatedMessage_.Clear(); - return this; - } - } - static TestEmbedOptimizedForSize() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestEmbedOptimizeForProtoFile.Descriptor, null); - } - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestEmptyProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestEmptyProtoFile.cs deleted file mode 100644 index a0f1034..0000000 --- a/src/ProtocolBuffers.Test/TestProtos/UnitTestEmptyProtoFile.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.TestProtos { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class UnitTestEmptyProtoFile { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static UnitTestEmptyProtoFile() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CiRnb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfZW1wdHkucHJvdG8aJGdvb2ds", - "ZS9wcm90b2J1Zi9jc2hhcnBfb3B0aW9ucy5wcm90b0I+wj47CiFHb29nbGUu", - "UHJvdG9jb2xCdWZmZXJzLlRlc3RQcm90b3MSFlVuaXRUZXN0RW1wdHlQcm90", - "b0ZpbGU=")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); - RegisterAllExtensions(registry); - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.RegisterAllExtensions(registry); - return registry; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, - }, assigner); - } - #endregion - - } -} - -#endregion Designer generated code diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestExtrasIssuesProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestExtrasIssuesProtoFile.cs deleted file mode 100644 index 438f4aa..0000000 --- a/src/ProtocolBuffers.Test/TestProtos/UnitTestExtrasIssuesProtoFile.cs +++ /dev/null @@ -1,3443 +0,0 @@ -// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace UnitTest.Issues.TestProtos { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class UnitTestExtrasIssuesProtoFile { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_unittest_issues_A__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_issues_A__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_unittest_issues_B__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_issues_B__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_unittest_issues_AB__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_issues_AB__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_unittest_issues_NumberField__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_issues_NumberField__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_unittest_issues_MyMessageAReferenceB__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_issues_MyMessageAReferenceB__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_unittest_issues_MyMessageBReferenceA__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_issues_MyMessageBReferenceA__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_unittest_issues_NegativeEnumMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_issues_NegativeEnumMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_unittest_issues_DeprecatedChild__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_issues_DeprecatedChild__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_unittest_issues_DeprecatedFieldsMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_issues_DeprecatedFieldsMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_unittest_issues_ItemField__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_issues_ItemField__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static UnitTestExtrasIssuesProtoFile() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "ChxleHRlc3QvdW5pdHRlc3RfaXNzdWVzLnByb3RvEg91bml0dGVzdF9pc3N1", - "ZXMaJGdvb2dsZS9wcm90b2J1Zi9jc2hhcnBfb3B0aW9ucy5wcm90byIPCgFB", - "EgoKAl9BGAEgASgFIg8KAUISCgoCQl8YASABKAUiEQoCQUISCwoDYV9iGAEg", - "ASgFIhoKC051bWJlckZpZWxkEgsKA18wMRgBIAEoBSJMChRNeU1lc3NhZ2VB", - "UmVmZXJlbmNlQhI0CgV2YWx1ZRgBIAIoCzIlLnVuaXR0ZXN0X2lzc3Vlcy5N", - "eU1lc3NhZ2VCUmVmZXJlbmNlQSJMChRNeU1lc3NhZ2VCUmVmZXJlbmNlQRI0", - "CgV2YWx1ZRgBIAIoCzIlLnVuaXR0ZXN0X2lzc3Vlcy5NeU1lc3NhZ2VBUmVm", - "ZXJlbmNlQiKsAQoTTmVnYXRpdmVFbnVtTWVzc2FnZRIsCgV2YWx1ZRgBIAEo", - "DjIdLnVuaXR0ZXN0X2lzc3Vlcy5OZWdhdGl2ZUVudW0SLQoGdmFsdWVzGAIg", - "AygOMh0udW5pdHRlc3RfaXNzdWVzLk5lZ2F0aXZlRW51bRI4Cg1wYWNrZWRf", - "dmFsdWVzGAMgAygOMh0udW5pdHRlc3RfaXNzdWVzLk5lZ2F0aXZlRW51bUIC", - "EAEiEQoPRGVwcmVjYXRlZENoaWxkIrkCChdEZXByZWNhdGVkRmllbGRzTWVz", - "c2FnZRIaCg5QcmltaXRpdmVWYWx1ZRgBIAEoBUICGAESGgoOUHJpbWl0aXZl", - "QXJyYXkYAiADKAVCAhgBEjoKDE1lc3NhZ2VWYWx1ZRgDIAEoCzIgLnVuaXR0", - "ZXN0X2lzc3Vlcy5EZXByZWNhdGVkQ2hpbGRCAhgBEjoKDE1lc3NhZ2VBcnJh", - "eRgEIAMoCzIgLnVuaXR0ZXN0X2lzc3Vlcy5EZXByZWNhdGVkQ2hpbGRCAhgB", - "EjYKCUVudW1WYWx1ZRgFIAEoDjIfLnVuaXR0ZXN0X2lzc3Vlcy5EZXByZWNh", - "dGVkRW51bUICGAESNgoJRW51bUFycmF5GAYgAygOMh8udW5pdHRlc3RfaXNz", - "dWVzLkRlcHJlY2F0ZWRFbnVtQgIYASIZCglJdGVtRmllbGQSDAoEaXRlbRgB", - "IAEoBSpHCgxOZWdhdGl2ZUVudW0SFgoJRml2ZUJlbG93EPv//////////wES", - "FQoITWludXNPbmUQ////////////ARIICgRaZXJvEAAqGQoORGVwcmVjYXRl", - "ZEVudW0SBwoDb25lEAFCQEgBwj47ChpVbml0VGVzdC5Jc3N1ZXMuVGVzdFBy", - "b3RvcxIdVW5pdFRlc3RFeHRyYXNJc3N1ZXNQcm90b0ZpbGU=")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_unittest_issues_A__Descriptor = Descriptor.MessageTypes[0]; - internal__static_unittest_issues_A__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_unittest_issues_A__Descriptor, - new string[] { "A_", }); - internal__static_unittest_issues_B__Descriptor = Descriptor.MessageTypes[1]; - internal__static_unittest_issues_B__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_unittest_issues_B__Descriptor, - new string[] { "B_", }); - internal__static_unittest_issues_AB__Descriptor = Descriptor.MessageTypes[2]; - internal__static_unittest_issues_AB__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_unittest_issues_AB__Descriptor, - new string[] { "AB_", }); - internal__static_unittest_issues_NumberField__Descriptor = Descriptor.MessageTypes[3]; - internal__static_unittest_issues_NumberField__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_unittest_issues_NumberField__Descriptor, - new string[] { "_01", }); - internal__static_unittest_issues_MyMessageAReferenceB__Descriptor = Descriptor.MessageTypes[4]; - internal__static_unittest_issues_MyMessageAReferenceB__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_unittest_issues_MyMessageAReferenceB__Descriptor, - new string[] { "Value", }); - internal__static_unittest_issues_MyMessageBReferenceA__Descriptor = Descriptor.MessageTypes[5]; - internal__static_unittest_issues_MyMessageBReferenceA__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_unittest_issues_MyMessageBReferenceA__Descriptor, - new string[] { "Value", }); - internal__static_unittest_issues_NegativeEnumMessage__Descriptor = Descriptor.MessageTypes[6]; - internal__static_unittest_issues_NegativeEnumMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_unittest_issues_NegativeEnumMessage__Descriptor, - new string[] { "Value", "Values", "PackedValues", }); - internal__static_unittest_issues_DeprecatedChild__Descriptor = Descriptor.MessageTypes[7]; - internal__static_unittest_issues_DeprecatedChild__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_unittest_issues_DeprecatedChild__Descriptor, - new string[] { }); - internal__static_unittest_issues_DeprecatedFieldsMessage__Descriptor = Descriptor.MessageTypes[8]; - internal__static_unittest_issues_DeprecatedFieldsMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_unittest_issues_DeprecatedFieldsMessage__Descriptor, - new string[] { "PrimitiveValue", "PrimitiveArray", "MessageValue", "MessageArray", "EnumValue", "EnumArray", }); - internal__static_unittest_issues_ItemField__Descriptor = Descriptor.MessageTypes[9]; - internal__static_unittest_issues_ItemField__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_unittest_issues_ItemField__Descriptor, - new string[] { "Item", }); - pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); - RegisterAllExtensions(registry); - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.RegisterAllExtensions(registry); - return registry; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, - }, assigner); - } - #endregion - - } - #region Enums - public enum NegativeEnum { - FiveBelow = -5, - MinusOne = -1, - Zero = 0, - } - - public enum DeprecatedEnum { - one = 1, - } - - #endregion - - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class A : pb::GeneratedMessage { - private A() { } - private static readonly A defaultInstance = new A().MakeReadOnly(); - private static readonly string[] _aFieldNames = new string[] { "_A" }; - private static readonly uint[] _aFieldTags = new uint[] { 8 }; - public static A DefaultInstance { - get { return defaultInstance; } - } - - public override A DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override A ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::UnitTest.Issues.TestProtos.UnitTestExtrasIssuesProtoFile.internal__static_unittest_issues_A__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::UnitTest.Issues.TestProtos.UnitTestExtrasIssuesProtoFile.internal__static_unittest_issues_A__FieldAccessorTable; } - } - - public const int A_FieldNumber = 1; - private bool hasA_; - private int a_; - public bool HasA_ { - get { return hasA_; } - } - public int A_ { - get { return a_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _aFieldNames; - if (hasA_) { - output.WriteInt32(1, field_names[0], A_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA_) { - size += pb::CodedOutputStream.ComputeInt32Size(1, A_); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static A ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static A ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static A ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static A ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static A ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static A ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static A ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static A ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static A ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static A ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private A MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(A prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(A cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private A result; - - private A PrepareBuilder() { - if (resultIsReadOnly) { - A original = result; - result = new A(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override A MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::UnitTest.Issues.TestProtos.A.Descriptor; } - } - - public override A DefaultInstanceForType { - get { return global::UnitTest.Issues.TestProtos.A.DefaultInstance; } - } - - public override A BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is A) { - return MergeFrom((A) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(A other) { - if (other == global::UnitTest.Issues.TestProtos.A.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA_) { - A_ = other.A_; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_aFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _aFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasA_ = input.ReadInt32(ref result.a_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasA_ { - get { return result.hasA_; } - } - public int A_ { - get { return result.A_; } - set { SetA_(value); } - } - public Builder SetA_(int value) { - PrepareBuilder(); - result.hasA_ = true; - result.a_ = value; - return this; - } - public Builder ClearA_() { - PrepareBuilder(); - result.hasA_ = false; - result.a_ = 0; - return this; - } - } - static A() { - object.ReferenceEquals(global::UnitTest.Issues.TestProtos.UnitTestExtrasIssuesProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class B : pb::GeneratedMessage { - private B() { } - private static readonly B defaultInstance = new B().MakeReadOnly(); - private static readonly string[] _bFieldNames = new string[] { "B_" }; - private static readonly uint[] _bFieldTags = new uint[] { 8 }; - public static B DefaultInstance { - get { return defaultInstance; } - } - - public override B DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override B ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::UnitTest.Issues.TestProtos.UnitTestExtrasIssuesProtoFile.internal__static_unittest_issues_B__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::UnitTest.Issues.TestProtos.UnitTestExtrasIssuesProtoFile.internal__static_unittest_issues_B__FieldAccessorTable; } - } - - public const int B_FieldNumber = 1; - private bool hasB_; - private int b_; - public bool HasB_ { - get { return hasB_; } - } - public int B_ { - get { return b_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _bFieldNames; - if (hasB_) { - output.WriteInt32(1, field_names[0], B_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasB_) { - size += pb::CodedOutputStream.ComputeInt32Size(1, B_); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static B ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static B ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static B ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static B ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static B ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static B ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static B ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static B ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static B ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static B ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private B MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(B prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(B cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private B result; - - private B PrepareBuilder() { - if (resultIsReadOnly) { - B original = result; - result = new B(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override B MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::UnitTest.Issues.TestProtos.B.Descriptor; } - } - - public override B DefaultInstanceForType { - get { return global::UnitTest.Issues.TestProtos.B.DefaultInstance; } - } - - public override B BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is B) { - return MergeFrom((B) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(B other) { - if (other == global::UnitTest.Issues.TestProtos.B.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasB_) { - B_ = other.B_; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_bFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _bFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasB_ = input.ReadInt32(ref result.b_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasB_ { - get { return result.hasB_; } - } - public int B_ { - get { return result.B_; } - set { SetB_(value); } - } - public Builder SetB_(int value) { - PrepareBuilder(); - result.hasB_ = true; - result.b_ = value; - return this; - } - public Builder ClearB_() { - PrepareBuilder(); - result.hasB_ = false; - result.b_ = 0; - return this; - } - } - static B() { - object.ReferenceEquals(global::UnitTest.Issues.TestProtos.UnitTestExtrasIssuesProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class AB : pb::GeneratedMessage { - private AB() { } - private static readonly AB defaultInstance = new AB().MakeReadOnly(); - private static readonly string[] _aBFieldNames = new string[] { "a_b" }; - private static readonly uint[] _aBFieldTags = new uint[] { 8 }; - public static AB DefaultInstance { - get { return defaultInstance; } - } - - public override AB DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override AB ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::UnitTest.Issues.TestProtos.UnitTestExtrasIssuesProtoFile.internal__static_unittest_issues_AB__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::UnitTest.Issues.TestProtos.UnitTestExtrasIssuesProtoFile.internal__static_unittest_issues_AB__FieldAccessorTable; } - } - - public const int AB_FieldNumber = 1; - private bool hasAB_; - private int aB_; - public bool HasAB_ { - get { return hasAB_; } - } - public int AB_ { - get { return aB_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _aBFieldNames; - if (hasAB_) { - output.WriteInt32(1, field_names[0], AB_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasAB_) { - size += pb::CodedOutputStream.ComputeInt32Size(1, AB_); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static AB ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static AB ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static AB ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static AB ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static AB ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static AB ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static AB ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static AB ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static AB ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static AB ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private AB MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(AB prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(AB cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private AB result; - - private AB PrepareBuilder() { - if (resultIsReadOnly) { - AB original = result; - result = new AB(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override AB MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::UnitTest.Issues.TestProtos.AB.Descriptor; } - } - - public override AB DefaultInstanceForType { - get { return global::UnitTest.Issues.TestProtos.AB.DefaultInstance; } - } - - public override AB BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is AB) { - return MergeFrom((AB) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(AB other) { - if (other == global::UnitTest.Issues.TestProtos.AB.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasAB_) { - AB_ = other.AB_; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_aBFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _aBFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasAB_ = input.ReadInt32(ref result.aB_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasAB_ { - get { return result.hasAB_; } - } - public int AB_ { - get { return result.AB_; } - set { SetAB_(value); } - } - public Builder SetAB_(int value) { - PrepareBuilder(); - result.hasAB_ = true; - result.aB_ = value; - return this; - } - public Builder ClearAB_() { - PrepareBuilder(); - result.hasAB_ = false; - result.aB_ = 0; - return this; - } - } - static AB() { - object.ReferenceEquals(global::UnitTest.Issues.TestProtos.UnitTestExtrasIssuesProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class NumberField : pb::GeneratedMessage { - private NumberField() { } - private static readonly NumberField defaultInstance = new NumberField().MakeReadOnly(); - private static readonly string[] _numberFieldFieldNames = new string[] { "_01" }; - private static readonly uint[] _numberFieldFieldTags = new uint[] { 8 }; - public static NumberField DefaultInstance { - get { return defaultInstance; } - } - - public override NumberField DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override NumberField ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::UnitTest.Issues.TestProtos.UnitTestExtrasIssuesProtoFile.internal__static_unittest_issues_NumberField__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::UnitTest.Issues.TestProtos.UnitTestExtrasIssuesProtoFile.internal__static_unittest_issues_NumberField__FieldAccessorTable; } - } - - [global::System.CLSCompliant(false)] - public const int _01FieldNumber = 1; - private bool has_01; - private int _01_; - public bool Has_01 { - get { return has_01; } - } - [global::System.CLSCompliant(false)] - public int _01 { - get { return _01_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _numberFieldFieldNames; - if (has_01) { - output.WriteInt32(1, field_names[0], _01); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (has_01) { - size += pb::CodedOutputStream.ComputeInt32Size(1, _01); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static NumberField ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NumberField ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NumberField ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NumberField ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NumberField ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NumberField ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static NumberField ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static NumberField ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static NumberField ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NumberField ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private NumberField MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(NumberField prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(NumberField cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private NumberField result; - - private NumberField PrepareBuilder() { - if (resultIsReadOnly) { - NumberField original = result; - result = new NumberField(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override NumberField MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::UnitTest.Issues.TestProtos.NumberField.Descriptor; } - } - - public override NumberField DefaultInstanceForType { - get { return global::UnitTest.Issues.TestProtos.NumberField.DefaultInstance; } - } - - public override NumberField BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is NumberField) { - return MergeFrom((NumberField) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(NumberField other) { - if (other == global::UnitTest.Issues.TestProtos.NumberField.DefaultInstance) return this; - PrepareBuilder(); - if (other.Has_01) { - _01 = other._01; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_numberFieldFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _numberFieldFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.has_01 = input.ReadInt32(ref result._01_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool Has_01 { - get { return result.has_01; } - } - [global::System.CLSCompliant(false)] - public int _01 { - get { return result._01; } - set { Set_01(value); } - } - [global::System.CLSCompliant(false)] - public Builder Set_01(int value) { - PrepareBuilder(); - result.has_01 = true; - result._01_ = value; - return this; - } - public Builder Clear_01() { - PrepareBuilder(); - result.has_01 = false; - result._01_ = 0; - return this; - } - } - static NumberField() { - object.ReferenceEquals(global::UnitTest.Issues.TestProtos.UnitTestExtrasIssuesProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MyMessageAReferenceB : pb::GeneratedMessage { - private MyMessageAReferenceB() { } - private static readonly MyMessageAReferenceB defaultInstance = new MyMessageAReferenceB().MakeReadOnly(); - private static readonly string[] _myMessageAReferenceBFieldNames = new string[] { "value" }; - private static readonly uint[] _myMessageAReferenceBFieldTags = new uint[] { 10 }; - public static MyMessageAReferenceB DefaultInstance { - get { return defaultInstance; } - } - - public override MyMessageAReferenceB DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override MyMessageAReferenceB ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::UnitTest.Issues.TestProtos.UnitTestExtrasIssuesProtoFile.internal__static_unittest_issues_MyMessageAReferenceB__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::UnitTest.Issues.TestProtos.UnitTestExtrasIssuesProtoFile.internal__static_unittest_issues_MyMessageAReferenceB__FieldAccessorTable; } - } - - public const int ValueFieldNumber = 1; - private bool hasValue; - private global::UnitTest.Issues.TestProtos.MyMessageBReferenceA value_; - public bool HasValue { - get { return hasValue; } - } - public global::UnitTest.Issues.TestProtos.MyMessageBReferenceA Value { - get { return value_ ?? global::UnitTest.Issues.TestProtos.MyMessageBReferenceA.DefaultInstance; } - } - - public override bool IsInitialized { - get { - if (!hasValue) return false; - if (!Value.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _myMessageAReferenceBFieldNames; - if (hasValue) { - output.WriteMessage(1, field_names[0], Value); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasValue) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Value); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static MyMessageAReferenceB ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static MyMessageAReferenceB ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static MyMessageAReferenceB ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static MyMessageAReferenceB ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static MyMessageAReferenceB ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static MyMessageAReferenceB ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static MyMessageAReferenceB ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static MyMessageAReferenceB ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static MyMessageAReferenceB ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static MyMessageAReferenceB ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private MyMessageAReferenceB MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(MyMessageAReferenceB prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(MyMessageAReferenceB cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private MyMessageAReferenceB result; - - private MyMessageAReferenceB PrepareBuilder() { - if (resultIsReadOnly) { - MyMessageAReferenceB original = result; - result = new MyMessageAReferenceB(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override MyMessageAReferenceB MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::UnitTest.Issues.TestProtos.MyMessageAReferenceB.Descriptor; } - } - - public override MyMessageAReferenceB DefaultInstanceForType { - get { return global::UnitTest.Issues.TestProtos.MyMessageAReferenceB.DefaultInstance; } - } - - public override MyMessageAReferenceB BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is MyMessageAReferenceB) { - return MergeFrom((MyMessageAReferenceB) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(MyMessageAReferenceB other) { - if (other == global::UnitTest.Issues.TestProtos.MyMessageAReferenceB.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasValue) { - MergeValue(other.Value); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_myMessageAReferenceBFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _myMessageAReferenceBFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - global::UnitTest.Issues.TestProtos.MyMessageBReferenceA.Builder subBuilder = global::UnitTest.Issues.TestProtos.MyMessageBReferenceA.CreateBuilder(); - if (result.hasValue) { - subBuilder.MergeFrom(Value); - } - input.ReadMessage(subBuilder, extensionRegistry); - Value = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasValue { - get { return result.hasValue; } - } - public global::UnitTest.Issues.TestProtos.MyMessageBReferenceA Value { - get { return result.Value; } - set { SetValue(value); } - } - public Builder SetValue(global::UnitTest.Issues.TestProtos.MyMessageBReferenceA value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasValue = true; - result.value_ = value; - return this; - } - public Builder SetValue(global::UnitTest.Issues.TestProtos.MyMessageBReferenceA.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasValue = true; - result.value_ = builderForValue.Build(); - return this; - } - public Builder MergeValue(global::UnitTest.Issues.TestProtos.MyMessageBReferenceA value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasValue && - result.value_ != global::UnitTest.Issues.TestProtos.MyMessageBReferenceA.DefaultInstance) { - result.value_ = global::UnitTest.Issues.TestProtos.MyMessageBReferenceA.CreateBuilder(result.value_).MergeFrom(value).BuildPartial(); - } else { - result.value_ = value; - } - result.hasValue = true; - return this; - } - public Builder ClearValue() { - PrepareBuilder(); - result.hasValue = false; - result.value_ = null; - return this; - } - } - static MyMessageAReferenceB() { - object.ReferenceEquals(global::UnitTest.Issues.TestProtos.UnitTestExtrasIssuesProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MyMessageBReferenceA : pb::GeneratedMessage { - private MyMessageBReferenceA() { } - private static readonly MyMessageBReferenceA defaultInstance = new MyMessageBReferenceA().MakeReadOnly(); - private static readonly string[] _myMessageBReferenceAFieldNames = new string[] { "value" }; - private static readonly uint[] _myMessageBReferenceAFieldTags = new uint[] { 10 }; - public static MyMessageBReferenceA DefaultInstance { - get { return defaultInstance; } - } - - public override MyMessageBReferenceA DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override MyMessageBReferenceA ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::UnitTest.Issues.TestProtos.UnitTestExtrasIssuesProtoFile.internal__static_unittest_issues_MyMessageBReferenceA__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::UnitTest.Issues.TestProtos.UnitTestExtrasIssuesProtoFile.internal__static_unittest_issues_MyMessageBReferenceA__FieldAccessorTable; } - } - - public const int ValueFieldNumber = 1; - private bool hasValue; - private global::UnitTest.Issues.TestProtos.MyMessageAReferenceB value_; - public bool HasValue { - get { return hasValue; } - } - public global::UnitTest.Issues.TestProtos.MyMessageAReferenceB Value { - get { return value_ ?? global::UnitTest.Issues.TestProtos.MyMessageAReferenceB.DefaultInstance; } - } - - public override bool IsInitialized { - get { - if (!hasValue) return false; - if (!Value.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _myMessageBReferenceAFieldNames; - if (hasValue) { - output.WriteMessage(1, field_names[0], Value); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasValue) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Value); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static MyMessageBReferenceA ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static MyMessageBReferenceA ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static MyMessageBReferenceA ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static MyMessageBReferenceA ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static MyMessageBReferenceA ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static MyMessageBReferenceA ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static MyMessageBReferenceA ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static MyMessageBReferenceA ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static MyMessageBReferenceA ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static MyMessageBReferenceA ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private MyMessageBReferenceA MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(MyMessageBReferenceA prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(MyMessageBReferenceA cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private MyMessageBReferenceA result; - - private MyMessageBReferenceA PrepareBuilder() { - if (resultIsReadOnly) { - MyMessageBReferenceA original = result; - result = new MyMessageBReferenceA(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override MyMessageBReferenceA MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::UnitTest.Issues.TestProtos.MyMessageBReferenceA.Descriptor; } - } - - public override MyMessageBReferenceA DefaultInstanceForType { - get { return global::UnitTest.Issues.TestProtos.MyMessageBReferenceA.DefaultInstance; } - } - - public override MyMessageBReferenceA BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is MyMessageBReferenceA) { - return MergeFrom((MyMessageBReferenceA) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(MyMessageBReferenceA other) { - if (other == global::UnitTest.Issues.TestProtos.MyMessageBReferenceA.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasValue) { - MergeValue(other.Value); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_myMessageBReferenceAFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _myMessageBReferenceAFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - global::UnitTest.Issues.TestProtos.MyMessageAReferenceB.Builder subBuilder = global::UnitTest.Issues.TestProtos.MyMessageAReferenceB.CreateBuilder(); - if (result.hasValue) { - subBuilder.MergeFrom(Value); - } - input.ReadMessage(subBuilder, extensionRegistry); - Value = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasValue { - get { return result.hasValue; } - } - public global::UnitTest.Issues.TestProtos.MyMessageAReferenceB Value { - get { return result.Value; } - set { SetValue(value); } - } - public Builder SetValue(global::UnitTest.Issues.TestProtos.MyMessageAReferenceB value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasValue = true; - result.value_ = value; - return this; - } - public Builder SetValue(global::UnitTest.Issues.TestProtos.MyMessageAReferenceB.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasValue = true; - result.value_ = builderForValue.Build(); - return this; - } - public Builder MergeValue(global::UnitTest.Issues.TestProtos.MyMessageAReferenceB value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasValue && - result.value_ != global::UnitTest.Issues.TestProtos.MyMessageAReferenceB.DefaultInstance) { - result.value_ = global::UnitTest.Issues.TestProtos.MyMessageAReferenceB.CreateBuilder(result.value_).MergeFrom(value).BuildPartial(); - } else { - result.value_ = value; - } - result.hasValue = true; - return this; - } - public Builder ClearValue() { - PrepareBuilder(); - result.hasValue = false; - result.value_ = null; - return this; - } - } - static MyMessageBReferenceA() { - object.ReferenceEquals(global::UnitTest.Issues.TestProtos.UnitTestExtrasIssuesProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class NegativeEnumMessage : pb::GeneratedMessage { - private NegativeEnumMessage() { } - private static readonly NegativeEnumMessage defaultInstance = new NegativeEnumMessage().MakeReadOnly(); - private static readonly string[] _negativeEnumMessageFieldNames = new string[] { "packed_values", "value", "values" }; - private static readonly uint[] _negativeEnumMessageFieldTags = new uint[] { 26, 8, 16 }; - public static NegativeEnumMessage DefaultInstance { - get { return defaultInstance; } - } - - public override NegativeEnumMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override NegativeEnumMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::UnitTest.Issues.TestProtos.UnitTestExtrasIssuesProtoFile.internal__static_unittest_issues_NegativeEnumMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::UnitTest.Issues.TestProtos.UnitTestExtrasIssuesProtoFile.internal__static_unittest_issues_NegativeEnumMessage__FieldAccessorTable; } - } - - public const int ValueFieldNumber = 1; - private bool hasValue; - private global::UnitTest.Issues.TestProtos.NegativeEnum value_ = global::UnitTest.Issues.TestProtos.NegativeEnum.FiveBelow; - public bool HasValue { - get { return hasValue; } - } - public global::UnitTest.Issues.TestProtos.NegativeEnum Value { - get { return value_; } - } - - public const int ValuesFieldNumber = 2; - private pbc::PopsicleList values_ = new pbc::PopsicleList(); - public scg::IList ValuesList { - get { return pbc::Lists.AsReadOnly(values_); } - } - public int ValuesCount { - get { return values_.Count; } - } - public global::UnitTest.Issues.TestProtos.NegativeEnum GetValues(int index) { - return values_[index]; - } - - public const int PackedValuesFieldNumber = 3; - private int packedValuesMemoizedSerializedSize; - private pbc::PopsicleList packedValues_ = new pbc::PopsicleList(); - public scg::IList PackedValuesList { - get { return pbc::Lists.AsReadOnly(packedValues_); } - } - public int PackedValuesCount { - get { return packedValues_.Count; } - } - public global::UnitTest.Issues.TestProtos.NegativeEnum GetPackedValues(int index) { - return packedValues_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _negativeEnumMessageFieldNames; - if (hasValue) { - output.WriteEnum(1, field_names[1], (int) Value, Value); - } - if (values_.Count > 0) { - output.WriteEnumArray(2, field_names[2], values_); - } - if (packedValues_.Count > 0) { - output.WritePackedEnumArray(3, field_names[0], packedValuesMemoizedSerializedSize, packedValues_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasValue) { - size += pb::CodedOutputStream.ComputeEnumSize(1, (int) Value); - } - { - int dataSize = 0; - if (values_.Count > 0) { - foreach (global::UnitTest.Issues.TestProtos.NegativeEnum element in values_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 1 * values_.Count; - } - } - { - int dataSize = 0; - if (packedValues_.Count > 0) { - foreach (global::UnitTest.Issues.TestProtos.NegativeEnum element in packedValues_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 1; - size += pb::CodedOutputStream.ComputeRawVarint32Size((uint) dataSize); - } - packedValuesMemoizedSerializedSize = dataSize; - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static NegativeEnumMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NegativeEnumMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NegativeEnumMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NegativeEnumMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NegativeEnumMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NegativeEnumMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static NegativeEnumMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static NegativeEnumMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static NegativeEnumMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NegativeEnumMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private NegativeEnumMessage MakeReadOnly() { - values_.MakeReadOnly(); - packedValues_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(NegativeEnumMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(NegativeEnumMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private NegativeEnumMessage result; - - private NegativeEnumMessage PrepareBuilder() { - if (resultIsReadOnly) { - NegativeEnumMessage original = result; - result = new NegativeEnumMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override NegativeEnumMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::UnitTest.Issues.TestProtos.NegativeEnumMessage.Descriptor; } - } - - public override NegativeEnumMessage DefaultInstanceForType { - get { return global::UnitTest.Issues.TestProtos.NegativeEnumMessage.DefaultInstance; } - } - - public override NegativeEnumMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is NegativeEnumMessage) { - return MergeFrom((NegativeEnumMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(NegativeEnumMessage other) { - if (other == global::UnitTest.Issues.TestProtos.NegativeEnumMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasValue) { - Value = other.Value; - } - if (other.values_.Count != 0) { - result.values_.Add(other.values_); - } - if (other.packedValues_.Count != 0) { - result.packedValues_.Add(other.packedValues_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_negativeEnumMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _negativeEnumMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - object unknown; - if(input.ReadEnum(ref result.value_, out unknown)) { - result.hasValue = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(1, (ulong)(int)unknown); - } - break; - } - case 18: - case 16: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.values_, out unknownItems); - if (unknownItems != null) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - foreach (object rawValue in unknownItems) - if (rawValue is int) - unknownFields.MergeVarintField(2, (ulong)(int)rawValue); - } - break; - } - case 26: - case 24: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.packedValues_, out unknownItems); - if (unknownItems != null) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - foreach (object rawValue in unknownItems) - if (rawValue is int) - unknownFields.MergeVarintField(3, (ulong)(int)rawValue); - } - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasValue { - get { return result.hasValue; } - } - public global::UnitTest.Issues.TestProtos.NegativeEnum Value { - get { return result.Value; } - set { SetValue(value); } - } - public Builder SetValue(global::UnitTest.Issues.TestProtos.NegativeEnum value) { - PrepareBuilder(); - result.hasValue = true; - result.value_ = value; - return this; - } - public Builder ClearValue() { - PrepareBuilder(); - result.hasValue = false; - result.value_ = global::UnitTest.Issues.TestProtos.NegativeEnum.FiveBelow; - return this; - } - - public pbc::IPopsicleList ValuesList { - get { return PrepareBuilder().values_; } - } - public int ValuesCount { - get { return result.ValuesCount; } - } - public global::UnitTest.Issues.TestProtos.NegativeEnum GetValues(int index) { - return result.GetValues(index); - } - public Builder SetValues(int index, global::UnitTest.Issues.TestProtos.NegativeEnum value) { - PrepareBuilder(); - result.values_[index] = value; - return this; - } - public Builder AddValues(global::UnitTest.Issues.TestProtos.NegativeEnum value) { - PrepareBuilder(); - result.values_.Add(value); - return this; - } - public Builder AddRangeValues(scg::IEnumerable values) { - PrepareBuilder(); - result.values_.Add(values); - return this; - } - public Builder ClearValues() { - PrepareBuilder(); - result.values_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedValuesList { - get { return PrepareBuilder().packedValues_; } - } - public int PackedValuesCount { - get { return result.PackedValuesCount; } - } - public global::UnitTest.Issues.TestProtos.NegativeEnum GetPackedValues(int index) { - return result.GetPackedValues(index); - } - public Builder SetPackedValues(int index, global::UnitTest.Issues.TestProtos.NegativeEnum value) { - PrepareBuilder(); - result.packedValues_[index] = value; - return this; - } - public Builder AddPackedValues(global::UnitTest.Issues.TestProtos.NegativeEnum value) { - PrepareBuilder(); - result.packedValues_.Add(value); - return this; - } - public Builder AddRangePackedValues(scg::IEnumerable values) { - PrepareBuilder(); - result.packedValues_.Add(values); - return this; - } - public Builder ClearPackedValues() { - PrepareBuilder(); - result.packedValues_.Clear(); - return this; - } - } - static NegativeEnumMessage() { - object.ReferenceEquals(global::UnitTest.Issues.TestProtos.UnitTestExtrasIssuesProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class DeprecatedChild : pb::GeneratedMessage { - private DeprecatedChild() { } - private static readonly DeprecatedChild defaultInstance = new DeprecatedChild().MakeReadOnly(); - private static readonly string[] _deprecatedChildFieldNames = new string[] { }; - private static readonly uint[] _deprecatedChildFieldTags = new uint[] { }; - public static DeprecatedChild DefaultInstance { - get { return defaultInstance; } - } - - public override DeprecatedChild DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override DeprecatedChild ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::UnitTest.Issues.TestProtos.UnitTestExtrasIssuesProtoFile.internal__static_unittest_issues_DeprecatedChild__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::UnitTest.Issues.TestProtos.UnitTestExtrasIssuesProtoFile.internal__static_unittest_issues_DeprecatedChild__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _deprecatedChildFieldNames; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static DeprecatedChild ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static DeprecatedChild ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static DeprecatedChild ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static DeprecatedChild ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static DeprecatedChild ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static DeprecatedChild ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static DeprecatedChild ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static DeprecatedChild ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static DeprecatedChild ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static DeprecatedChild ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private DeprecatedChild MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(DeprecatedChild prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(DeprecatedChild cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private DeprecatedChild result; - - private DeprecatedChild PrepareBuilder() { - if (resultIsReadOnly) { - DeprecatedChild original = result; - result = new DeprecatedChild(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override DeprecatedChild MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::UnitTest.Issues.TestProtos.DeprecatedChild.Descriptor; } - } - - public override DeprecatedChild DefaultInstanceForType { - get { return global::UnitTest.Issues.TestProtos.DeprecatedChild.DefaultInstance; } - } - - public override DeprecatedChild BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is DeprecatedChild) { - return MergeFrom((DeprecatedChild) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(DeprecatedChild other) { - if (other == global::UnitTest.Issues.TestProtos.DeprecatedChild.DefaultInstance) return this; - PrepareBuilder(); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_deprecatedChildFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _deprecatedChildFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static DeprecatedChild() { - object.ReferenceEquals(global::UnitTest.Issues.TestProtos.UnitTestExtrasIssuesProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class DeprecatedFieldsMessage : pb::GeneratedMessage { - private DeprecatedFieldsMessage() { } - private static readonly DeprecatedFieldsMessage defaultInstance = new DeprecatedFieldsMessage().MakeReadOnly(); - private static readonly string[] _deprecatedFieldsMessageFieldNames = new string[] { "EnumArray", "EnumValue", "MessageArray", "MessageValue", "PrimitiveArray", "PrimitiveValue" }; - private static readonly uint[] _deprecatedFieldsMessageFieldTags = new uint[] { 48, 40, 34, 26, 16, 8 }; - public static DeprecatedFieldsMessage DefaultInstance { - get { return defaultInstance; } - } - - public override DeprecatedFieldsMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override DeprecatedFieldsMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::UnitTest.Issues.TestProtos.UnitTestExtrasIssuesProtoFile.internal__static_unittest_issues_DeprecatedFieldsMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::UnitTest.Issues.TestProtos.UnitTestExtrasIssuesProtoFile.internal__static_unittest_issues_DeprecatedFieldsMessage__FieldAccessorTable; } - } - - public const int PrimitiveValueFieldNumber = 1; - private bool hasPrimitiveValue; - private int primitiveValue_; - [global::System.ObsoleteAttribute()] - public bool HasPrimitiveValue { - get { return hasPrimitiveValue; } - } - [global::System.ObsoleteAttribute()] - public int PrimitiveValue { - get { return primitiveValue_; } - } - - public const int PrimitiveArrayFieldNumber = 2; - private pbc::PopsicleList primitiveArray_ = new pbc::PopsicleList(); - [global::System.ObsoleteAttribute()] - public scg::IList PrimitiveArrayList { - get { return pbc::Lists.AsReadOnly(primitiveArray_); } - } - [global::System.ObsoleteAttribute()] - public int PrimitiveArrayCount { - get { return primitiveArray_.Count; } - } - [global::System.ObsoleteAttribute()] - public int GetPrimitiveArray(int index) { - return primitiveArray_[index]; - } - - public const int MessageValueFieldNumber = 3; - private bool hasMessageValue; - private global::UnitTest.Issues.TestProtos.DeprecatedChild messageValue_; - [global::System.ObsoleteAttribute()] - public bool HasMessageValue { - get { return hasMessageValue; } - } - [global::System.ObsoleteAttribute()] - public global::UnitTest.Issues.TestProtos.DeprecatedChild MessageValue { - get { return messageValue_ ?? global::UnitTest.Issues.TestProtos.DeprecatedChild.DefaultInstance; } - } - - public const int MessageArrayFieldNumber = 4; - private pbc::PopsicleList messageArray_ = new pbc::PopsicleList(); - [global::System.ObsoleteAttribute()] - public scg::IList MessageArrayList { - get { return messageArray_; } - } - [global::System.ObsoleteAttribute()] - public int MessageArrayCount { - get { return messageArray_.Count; } - } - [global::System.ObsoleteAttribute()] - public global::UnitTest.Issues.TestProtos.DeprecatedChild GetMessageArray(int index) { - return messageArray_[index]; - } - - public const int EnumValueFieldNumber = 5; - private bool hasEnumValue; - private global::UnitTest.Issues.TestProtos.DeprecatedEnum enumValue_ = global::UnitTest.Issues.TestProtos.DeprecatedEnum.one; - [global::System.ObsoleteAttribute()] - public bool HasEnumValue { - get { return hasEnumValue; } - } - [global::System.ObsoleteAttribute()] - public global::UnitTest.Issues.TestProtos.DeprecatedEnum EnumValue { - get { return enumValue_; } - } - - public const int EnumArrayFieldNumber = 6; - private pbc::PopsicleList enumArray_ = new pbc::PopsicleList(); - [global::System.ObsoleteAttribute()] - public scg::IList EnumArrayList { - get { return pbc::Lists.AsReadOnly(enumArray_); } - } - [global::System.ObsoleteAttribute()] - public int EnumArrayCount { - get { return enumArray_.Count; } - } - [global::System.ObsoleteAttribute()] - public global::UnitTest.Issues.TestProtos.DeprecatedEnum GetEnumArray(int index) { - return enumArray_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _deprecatedFieldsMessageFieldNames; - if (hasPrimitiveValue) { - output.WriteInt32(1, field_names[5], PrimitiveValue); - } - if (primitiveArray_.Count > 0) { - output.WriteInt32Array(2, field_names[4], primitiveArray_); - } - if (hasMessageValue) { - output.WriteMessage(3, field_names[3], MessageValue); - } - if (messageArray_.Count > 0) { - output.WriteMessageArray(4, field_names[2], messageArray_); - } - if (hasEnumValue) { - output.WriteEnum(5, field_names[1], (int) EnumValue, EnumValue); - } - if (enumArray_.Count > 0) { - output.WriteEnumArray(6, field_names[0], enumArray_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasPrimitiveValue) { - size += pb::CodedOutputStream.ComputeInt32Size(1, PrimitiveValue); - } - { - int dataSize = 0; - foreach (int element in PrimitiveArrayList) { - dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); - } - size += dataSize; - size += 1 * primitiveArray_.Count; - } - if (hasMessageValue) { - size += pb::CodedOutputStream.ComputeMessageSize(3, MessageValue); - } - foreach (global::UnitTest.Issues.TestProtos.DeprecatedChild element in MessageArrayList) { - size += pb::CodedOutputStream.ComputeMessageSize(4, element); - } - if (hasEnumValue) { - size += pb::CodedOutputStream.ComputeEnumSize(5, (int) EnumValue); - } - { - int dataSize = 0; - if (enumArray_.Count > 0) { - foreach (global::UnitTest.Issues.TestProtos.DeprecatedEnum element in enumArray_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 1 * enumArray_.Count; - } - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static DeprecatedFieldsMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static DeprecatedFieldsMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static DeprecatedFieldsMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static DeprecatedFieldsMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static DeprecatedFieldsMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static DeprecatedFieldsMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static DeprecatedFieldsMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static DeprecatedFieldsMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static DeprecatedFieldsMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static DeprecatedFieldsMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private DeprecatedFieldsMessage MakeReadOnly() { - primitiveArray_.MakeReadOnly(); - messageArray_.MakeReadOnly(); - enumArray_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(DeprecatedFieldsMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(DeprecatedFieldsMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private DeprecatedFieldsMessage result; - - private DeprecatedFieldsMessage PrepareBuilder() { - if (resultIsReadOnly) { - DeprecatedFieldsMessage original = result; - result = new DeprecatedFieldsMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override DeprecatedFieldsMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::UnitTest.Issues.TestProtos.DeprecatedFieldsMessage.Descriptor; } - } - - public override DeprecatedFieldsMessage DefaultInstanceForType { - get { return global::UnitTest.Issues.TestProtos.DeprecatedFieldsMessage.DefaultInstance; } - } - - public override DeprecatedFieldsMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is DeprecatedFieldsMessage) { - return MergeFrom((DeprecatedFieldsMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(DeprecatedFieldsMessage other) { - if (other == global::UnitTest.Issues.TestProtos.DeprecatedFieldsMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasPrimitiveValue) { - PrimitiveValue = other.PrimitiveValue; - } - if (other.primitiveArray_.Count != 0) { - result.primitiveArray_.Add(other.primitiveArray_); - } - if (other.HasMessageValue) { - MergeMessageValue(other.MessageValue); - } - if (other.messageArray_.Count != 0) { - result.messageArray_.Add(other.messageArray_); - } - if (other.HasEnumValue) { - EnumValue = other.EnumValue; - } - if (other.enumArray_.Count != 0) { - result.enumArray_.Add(other.enumArray_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_deprecatedFieldsMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _deprecatedFieldsMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasPrimitiveValue = input.ReadInt32(ref result.primitiveValue_); - break; - } - case 18: - case 16: { - input.ReadInt32Array(tag, field_name, result.primitiveArray_); - break; - } - case 26: { - global::UnitTest.Issues.TestProtos.DeprecatedChild.Builder subBuilder = global::UnitTest.Issues.TestProtos.DeprecatedChild.CreateBuilder(); - if (result.hasMessageValue) { - subBuilder.MergeFrom(MessageValue); - } - input.ReadMessage(subBuilder, extensionRegistry); - MessageValue = subBuilder.BuildPartial(); - break; - } - case 34: { - input.ReadMessageArray(tag, field_name, result.messageArray_, global::UnitTest.Issues.TestProtos.DeprecatedChild.DefaultInstance, extensionRegistry); - break; - } - case 40: { - object unknown; - if(input.ReadEnum(ref result.enumValue_, out unknown)) { - result.hasEnumValue = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(5, (ulong)(int)unknown); - } - break; - } - case 50: - case 48: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.enumArray_, out unknownItems); - if (unknownItems != null) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - foreach (object rawValue in unknownItems) - if (rawValue is int) - unknownFields.MergeVarintField(6, (ulong)(int)rawValue); - } - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - [global::System.ObsoleteAttribute()] - public bool HasPrimitiveValue { - get { return result.hasPrimitiveValue; } - } - [global::System.ObsoleteAttribute()] - public int PrimitiveValue { - get { return result.PrimitiveValue; } - set { SetPrimitiveValue(value); } - } - [global::System.ObsoleteAttribute()] - public Builder SetPrimitiveValue(int value) { - PrepareBuilder(); - result.hasPrimitiveValue = true; - result.primitiveValue_ = value; - return this; - } - [global::System.ObsoleteAttribute()] - public Builder ClearPrimitiveValue() { - PrepareBuilder(); - result.hasPrimitiveValue = false; - result.primitiveValue_ = 0; - return this; - } - - [global::System.ObsoleteAttribute()] - public pbc::IPopsicleList PrimitiveArrayList { - get { return PrepareBuilder().primitiveArray_; } - } - [global::System.ObsoleteAttribute()] - public int PrimitiveArrayCount { - get { return result.PrimitiveArrayCount; } - } - [global::System.ObsoleteAttribute()] - public int GetPrimitiveArray(int index) { - return result.GetPrimitiveArray(index); - } - [global::System.ObsoleteAttribute()] - public Builder SetPrimitiveArray(int index, int value) { - PrepareBuilder(); - result.primitiveArray_[index] = value; - return this; - } - [global::System.ObsoleteAttribute()] - public Builder AddPrimitiveArray(int value) { - PrepareBuilder(); - result.primitiveArray_.Add(value); - return this; - } - [global::System.ObsoleteAttribute()] - public Builder AddRangePrimitiveArray(scg::IEnumerable values) { - PrepareBuilder(); - result.primitiveArray_.Add(values); - return this; - } - [global::System.ObsoleteAttribute()] - public Builder ClearPrimitiveArray() { - PrepareBuilder(); - result.primitiveArray_.Clear(); - return this; - } - - [global::System.ObsoleteAttribute()] - public bool HasMessageValue { - get { return result.hasMessageValue; } - } - [global::System.ObsoleteAttribute()] - public global::UnitTest.Issues.TestProtos.DeprecatedChild MessageValue { - get { return result.MessageValue; } - set { SetMessageValue(value); } - } - [global::System.ObsoleteAttribute()] - public Builder SetMessageValue(global::UnitTest.Issues.TestProtos.DeprecatedChild value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasMessageValue = true; - result.messageValue_ = value; - return this; - } - [global::System.ObsoleteAttribute()] - public Builder SetMessageValue(global::UnitTest.Issues.TestProtos.DeprecatedChild.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasMessageValue = true; - result.messageValue_ = builderForValue.Build(); - return this; - } - [global::System.ObsoleteAttribute()] - public Builder MergeMessageValue(global::UnitTest.Issues.TestProtos.DeprecatedChild value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasMessageValue && - result.messageValue_ != global::UnitTest.Issues.TestProtos.DeprecatedChild.DefaultInstance) { - result.messageValue_ = global::UnitTest.Issues.TestProtos.DeprecatedChild.CreateBuilder(result.messageValue_).MergeFrom(value).BuildPartial(); - } else { - result.messageValue_ = value; - } - result.hasMessageValue = true; - return this; - } - [global::System.ObsoleteAttribute()] - public Builder ClearMessageValue() { - PrepareBuilder(); - result.hasMessageValue = false; - result.messageValue_ = null; - return this; - } - - [global::System.ObsoleteAttribute()] - public pbc::IPopsicleList MessageArrayList { - get { return PrepareBuilder().messageArray_; } - } - [global::System.ObsoleteAttribute()] - public int MessageArrayCount { - get { return result.MessageArrayCount; } - } - [global::System.ObsoleteAttribute()] - public global::UnitTest.Issues.TestProtos.DeprecatedChild GetMessageArray(int index) { - return result.GetMessageArray(index); - } - [global::System.ObsoleteAttribute()] - public Builder SetMessageArray(int index, global::UnitTest.Issues.TestProtos.DeprecatedChild value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.messageArray_[index] = value; - return this; - } - [global::System.ObsoleteAttribute()] - public Builder SetMessageArray(int index, global::UnitTest.Issues.TestProtos.DeprecatedChild.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.messageArray_[index] = builderForValue.Build(); - return this; - } - [global::System.ObsoleteAttribute()] - public Builder AddMessageArray(global::UnitTest.Issues.TestProtos.DeprecatedChild value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.messageArray_.Add(value); - return this; - } - [global::System.ObsoleteAttribute()] - public Builder AddMessageArray(global::UnitTest.Issues.TestProtos.DeprecatedChild.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.messageArray_.Add(builderForValue.Build()); - return this; - } - [global::System.ObsoleteAttribute()] - public Builder AddRangeMessageArray(scg::IEnumerable values) { - PrepareBuilder(); - result.messageArray_.Add(values); - return this; - } - [global::System.ObsoleteAttribute()] - public Builder ClearMessageArray() { - PrepareBuilder(); - result.messageArray_.Clear(); - return this; - } - - [global::System.ObsoleteAttribute()] - public bool HasEnumValue { - get { return result.hasEnumValue; } - } - [global::System.ObsoleteAttribute()] - public global::UnitTest.Issues.TestProtos.DeprecatedEnum EnumValue { - get { return result.EnumValue; } - set { SetEnumValue(value); } - } - [global::System.ObsoleteAttribute()] - public Builder SetEnumValue(global::UnitTest.Issues.TestProtos.DeprecatedEnum value) { - PrepareBuilder(); - result.hasEnumValue = true; - result.enumValue_ = value; - return this; - } - [global::System.ObsoleteAttribute()] - public Builder ClearEnumValue() { - PrepareBuilder(); - result.hasEnumValue = false; - result.enumValue_ = global::UnitTest.Issues.TestProtos.DeprecatedEnum.one; - return this; - } - - [global::System.ObsoleteAttribute()] - public pbc::IPopsicleList EnumArrayList { - get { return PrepareBuilder().enumArray_; } - } - [global::System.ObsoleteAttribute()] - public int EnumArrayCount { - get { return result.EnumArrayCount; } - } - [global::System.ObsoleteAttribute()] - public global::UnitTest.Issues.TestProtos.DeprecatedEnum GetEnumArray(int index) { - return result.GetEnumArray(index); - } - [global::System.ObsoleteAttribute()] - public Builder SetEnumArray(int index, global::UnitTest.Issues.TestProtos.DeprecatedEnum value) { - PrepareBuilder(); - result.enumArray_[index] = value; - return this; - } - [global::System.ObsoleteAttribute()] - public Builder AddEnumArray(global::UnitTest.Issues.TestProtos.DeprecatedEnum value) { - PrepareBuilder(); - result.enumArray_.Add(value); - return this; - } - [global::System.ObsoleteAttribute()] - public Builder AddRangeEnumArray(scg::IEnumerable values) { - PrepareBuilder(); - result.enumArray_.Add(values); - return this; - } - [global::System.ObsoleteAttribute()] - public Builder ClearEnumArray() { - PrepareBuilder(); - result.enumArray_.Clear(); - return this; - } - } - static DeprecatedFieldsMessage() { - object.ReferenceEquals(global::UnitTest.Issues.TestProtos.UnitTestExtrasIssuesProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class ItemField : pb::GeneratedMessage { - private ItemField() { } - private static readonly ItemField defaultInstance = new ItemField().MakeReadOnly(); - private static readonly string[] _itemFieldFieldNames = new string[] { "item" }; - private static readonly uint[] _itemFieldFieldTags = new uint[] { 8 }; - public static ItemField DefaultInstance { - get { return defaultInstance; } - } - - public override ItemField DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override ItemField ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::UnitTest.Issues.TestProtos.UnitTestExtrasIssuesProtoFile.internal__static_unittest_issues_ItemField__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::UnitTest.Issues.TestProtos.UnitTestExtrasIssuesProtoFile.internal__static_unittest_issues_ItemField__FieldAccessorTable; } - } - - public const int ItemFieldNumber = 1; - private bool hasItem; - private int item_; - public bool HasItem { - get { return hasItem; } - } - public int Item { - get { return item_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _itemFieldFieldNames; - if (hasItem) { - output.WriteInt32(1, field_names[0], Item); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasItem) { - size += pb::CodedOutputStream.ComputeInt32Size(1, Item); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static ItemField ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ItemField ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ItemField ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ItemField ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ItemField ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ItemField ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ItemField ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ItemField ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ItemField ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ItemField ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private ItemField MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ItemField prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(ItemField cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private ItemField result; - - private ItemField PrepareBuilder() { - if (resultIsReadOnly) { - ItemField original = result; - result = new ItemField(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override ItemField MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::UnitTest.Issues.TestProtos.ItemField.Descriptor; } - } - - public override ItemField DefaultInstanceForType { - get { return global::UnitTest.Issues.TestProtos.ItemField.DefaultInstance; } - } - - public override ItemField BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ItemField) { - return MergeFrom((ItemField) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ItemField other) { - if (other == global::UnitTest.Issues.TestProtos.ItemField.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasItem) { - Item = other.Item; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_itemFieldFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _itemFieldFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasItem = input.ReadInt32(ref result.item_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasItem { - get { return result.hasItem; } - } - public int Item { - get { return result.Item; } - set { SetItem(value); } - } - public Builder SetItem(int value) { - PrepareBuilder(); - result.hasItem = true; - result.item_ = value; - return this; - } - public Builder ClearItem() { - PrepareBuilder(); - result.hasItem = false; - result.item_ = 0; - return this; - } - } - static ItemField() { - object.ReferenceEquals(global::UnitTest.Issues.TestProtos.UnitTestExtrasIssuesProtoFile.Descriptor, null); - } - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestExtrasProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestExtrasProtoFile.cs deleted file mode 100644 index 4877c60..0000000 --- a/src/ProtocolBuffers.Test/TestProtos/UnitTestExtrasProtoFile.cs +++ /dev/null @@ -1,401 +0,0 @@ -// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.TestProtos { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class UnitTestExtrasProtoFile { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedInt32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedInt64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedUint32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedUint64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedSint32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedSint64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedFixed32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedFixed64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedSfixed32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedSfixed64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedFloatExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedDoubleExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedBoolExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedEnumExtension); - } - #endregion - #region Extensions - public const int UnpackedInt32ExtensionFieldNumber = 90; - public static pb::GeneratedExtensionBase> UnpackedInt32Extension; - public const int UnpackedInt64ExtensionFieldNumber = 91; - public static pb::GeneratedExtensionBase> UnpackedInt64Extension; - public const int UnpackedUint32ExtensionFieldNumber = 92; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase> UnpackedUint32Extension; - public const int UnpackedUint64ExtensionFieldNumber = 93; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase> UnpackedUint64Extension; - public const int UnpackedSint32ExtensionFieldNumber = 94; - public static pb::GeneratedExtensionBase> UnpackedSint32Extension; - public const int UnpackedSint64ExtensionFieldNumber = 95; - public static pb::GeneratedExtensionBase> UnpackedSint64Extension; - public const int UnpackedFixed32ExtensionFieldNumber = 96; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase> UnpackedFixed32Extension; - public const int UnpackedFixed64ExtensionFieldNumber = 97; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase> UnpackedFixed64Extension; - public const int UnpackedSfixed32ExtensionFieldNumber = 98; - public static pb::GeneratedExtensionBase> UnpackedSfixed32Extension; - public const int UnpackedSfixed64ExtensionFieldNumber = 99; - public static pb::GeneratedExtensionBase> UnpackedSfixed64Extension; - public const int UnpackedFloatExtensionFieldNumber = 100; - public static pb::GeneratedExtensionBase> UnpackedFloatExtension; - public const int UnpackedDoubleExtensionFieldNumber = 101; - public static pb::GeneratedExtensionBase> UnpackedDoubleExtension; - public const int UnpackedBoolExtensionFieldNumber = 102; - public static pb::GeneratedExtensionBase> UnpackedBoolExtension; - public const int UnpackedEnumExtensionFieldNumber = 103; - public static pb::GeneratedExtensionBase> UnpackedEnumExtension; - #endregion - - #region Static variables - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_extra_TestUnpackedExtensions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_extra_TestUnpackedExtensions__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static UnitTestExtrasProtoFile() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "ChxleHRlc3QvdW5pdHRlc3RfZXh0cmFzLnByb3RvEhdwcm90b2J1Zl91bml0", - "dGVzdF9leHRyYRokZ29vZ2xlL3Byb3RvYnVmL2NzaGFycF9vcHRpb25zLnBy", - "b3RvIiIKFlRlc3RVbnBhY2tlZEV4dGVuc2lvbnMqCAgBEICAgIACKlIKHVVu", - "cGFja2VkRXh0ZW5zaW9uc0ZvcmVpZ25FbnVtEg8KC0ZPUkVJR05fRk9PEAQS", - "DwoLRk9SRUlHTl9CQVIQBRIPCgtGT1JFSUdOX0JBWhAGOlEKGHVucGFja2Vk", - "X2ludDMyX2V4dGVuc2lvbhIvLnByb3RvYnVmX3VuaXR0ZXN0X2V4dHJhLlRl", - "c3RVbnBhY2tlZEV4dGVuc2lvbnMYWiADKAU6UQoYdW5wYWNrZWRfaW50NjRf", - "ZXh0ZW5zaW9uEi8ucHJvdG9idWZfdW5pdHRlc3RfZXh0cmEuVGVzdFVucGFj", - "a2VkRXh0ZW5zaW9ucxhbIAMoAzpSChl1bnBhY2tlZF91aW50MzJfZXh0ZW5z", - "aW9uEi8ucHJvdG9idWZfdW5pdHRlc3RfZXh0cmEuVGVzdFVucGFja2VkRXh0", - "ZW5zaW9ucxhcIAMoDTpSChl1bnBhY2tlZF91aW50NjRfZXh0ZW5zaW9uEi8u", - "cHJvdG9idWZfdW5pdHRlc3RfZXh0cmEuVGVzdFVucGFja2VkRXh0ZW5zaW9u", - "cxhdIAMoBDpSChl1bnBhY2tlZF9zaW50MzJfZXh0ZW5zaW9uEi8ucHJvdG9i", - "dWZfdW5pdHRlc3RfZXh0cmEuVGVzdFVucGFja2VkRXh0ZW5zaW9ucxheIAMo", - "ETpSChl1bnBhY2tlZF9zaW50NjRfZXh0ZW5zaW9uEi8ucHJvdG9idWZfdW5p", - "dHRlc3RfZXh0cmEuVGVzdFVucGFja2VkRXh0ZW5zaW9ucxhfIAMoEjpTChp1", - "bnBhY2tlZF9maXhlZDMyX2V4dGVuc2lvbhIvLnByb3RvYnVmX3VuaXR0ZXN0", - "X2V4dHJhLlRlc3RVbnBhY2tlZEV4dGVuc2lvbnMYYCADKAc6UwoadW5wYWNr", - "ZWRfZml4ZWQ2NF9leHRlbnNpb24SLy5wcm90b2J1Zl91bml0dGVzdF9leHRy", - "YS5UZXN0VW5wYWNrZWRFeHRlbnNpb25zGGEgAygGOlQKG3VucGFja2VkX3Nm", - "aXhlZDMyX2V4dGVuc2lvbhIvLnByb3RvYnVmX3VuaXR0ZXN0X2V4dHJhLlRl", - "c3RVbnBhY2tlZEV4dGVuc2lvbnMYYiADKA86VAobdW5wYWNrZWRfc2ZpeGVk", - "NjRfZXh0ZW5zaW9uEi8ucHJvdG9idWZfdW5pdHRlc3RfZXh0cmEuVGVzdFVu", - "cGFja2VkRXh0ZW5zaW9ucxhjIAMoEDpRChh1bnBhY2tlZF9mbG9hdF9leHRl", - "bnNpb24SLy5wcm90b2J1Zl91bml0dGVzdF9leHRyYS5UZXN0VW5wYWNrZWRF", - "eHRlbnNpb25zGGQgAygCOlIKGXVucGFja2VkX2RvdWJsZV9leHRlbnNpb24S", - "Ly5wcm90b2J1Zl91bml0dGVzdF9leHRyYS5UZXN0VW5wYWNrZWRFeHRlbnNp", - "b25zGGUgAygBOlAKF3VucGFja2VkX2Jvb2xfZXh0ZW5zaW9uEi8ucHJvdG9i", - "dWZfdW5pdHRlc3RfZXh0cmEuVGVzdFVucGFja2VkRXh0ZW5zaW9ucxhmIAMo", - "CDqIAQoXdW5wYWNrZWRfZW51bV9leHRlbnNpb24SLy5wcm90b2J1Zl91bml0", - "dGVzdF9leHRyYS5UZXN0VW5wYWNrZWRFeHRlbnNpb25zGGcgAygOMjYucHJv", - "dG9idWZfdW5pdHRlc3RfZXh0cmEuVW5wYWNrZWRFeHRlbnNpb25zRm9yZWln", - "bkVudW1CVgoTY29tLmdvb2dsZS5wcm90b2J1ZsI+PgohR29vZ2xlLlByb3Rv", - "Y29sQnVmZmVycy5UZXN0UHJvdG9zEhdVbml0VGVzdEV4dHJhc1Byb3RvRmls", - "ZUgB")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_protobuf_unittest_extra_TestUnpackedExtensions__Descriptor = Descriptor.MessageTypes[0]; - internal__static_protobuf_unittest_extra_TestUnpackedExtensions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_extra_TestUnpackedExtensions__Descriptor, - new string[] { }); - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedInt32Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.Descriptor.Extensions[0]); - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedInt64Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.Descriptor.Extensions[1]); - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedUint32Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.Descriptor.Extensions[2]); - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedUint64Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.Descriptor.Extensions[3]); - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedSint32Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.Descriptor.Extensions[4]); - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedSint64Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.Descriptor.Extensions[5]); - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedFixed32Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.Descriptor.Extensions[6]); - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedFixed64Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.Descriptor.Extensions[7]); - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedSfixed32Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.Descriptor.Extensions[8]); - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedSfixed64Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.Descriptor.Extensions[9]); - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedFloatExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.Descriptor.Extensions[10]); - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedDoubleExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.Descriptor.Extensions[11]); - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedBoolExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.Descriptor.Extensions[12]); - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedEnumExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.Descriptor.Extensions[13]); - pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); - RegisterAllExtensions(registry); - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.RegisterAllExtensions(registry); - return registry; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, - }, assigner); - } - #endregion - - } - #region Enums - public enum UnpackedExtensionsForeignEnum { - FOREIGN_FOO = 4, - FOREIGN_BAR = 5, - FOREIGN_BAZ = 6, - } - - #endregion - - #region Messages - [global::System.SerializableAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestUnpackedExtensions : pb::ExtendableMessage { - private TestUnpackedExtensions() { } - private static readonly TestUnpackedExtensions defaultInstance = new TestUnpackedExtensions().MakeReadOnly(); - private static readonly string[] _testUnpackedExtensionsFieldNames = new string[] { }; - private static readonly uint[] _testUnpackedExtensionsFieldTags = new uint[] { }; - public static TestUnpackedExtensions DefaultInstance { - get { return defaultInstance; } - } - - public override TestUnpackedExtensions DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestUnpackedExtensions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.internal__static_protobuf_unittest_extra_TestUnpackedExtensions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.internal__static_protobuf_unittest_extra_TestUnpackedExtensions__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testUnpackedExtensionsFieldNames; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - extensionWriter.WriteUntil(536870912, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestUnpackedExtensions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestUnpackedExtensions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestUnpackedExtensions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestUnpackedExtensions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestUnpackedExtensions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestUnpackedExtensions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestUnpackedExtensions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestUnpackedExtensions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestUnpackedExtensions ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestUnpackedExtensions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestUnpackedExtensions MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestUnpackedExtensions prototype) { - return new Builder(prototype); - } - - [global::System.SerializableAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestUnpackedExtensions cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestUnpackedExtensions result; - - private TestUnpackedExtensions PrepareBuilder() { - if (resultIsReadOnly) { - TestUnpackedExtensions original = result; - result = new TestUnpackedExtensions(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestUnpackedExtensions MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestUnpackedExtensions.Descriptor; } - } - - public override TestUnpackedExtensions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestUnpackedExtensions.DefaultInstance; } - } - - public override TestUnpackedExtensions BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestUnpackedExtensions) { - return MergeFrom((TestUnpackedExtensions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestUnpackedExtensions other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestUnpackedExtensions.DefaultInstance) return this; - PrepareBuilder(); - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testUnpackedExtensionsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testUnpackedExtensionsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static TestUnpackedExtensions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.Descriptor, null); - } - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestGenericServices.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestGenericServices.cs deleted file mode 100644 index 15b7e08..0000000 --- a/src/ProtocolBuffers.Test/TestProtos/UnitTestGenericServices.cs +++ /dev/null @@ -1,260 +0,0 @@ -// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.TestProtos { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class UnitTestGenericServices { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static UnitTestGenericServices() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CiZleHRlc3QvdW5pdHRlc3RfZ2VuZXJpY19zZXJ2aWNlcy5wcm90bxIRcHJv", - "dG9idWZfdW5pdHRlc3QaJGdvb2dsZS9wcm90b2J1Zi9jc2hhcnBfb3B0aW9u", - "cy5wcm90bxoeZ29vZ2xlL3Byb3RvYnVmL3VuaXR0ZXN0LnByb3RvGi1nb29n", - "bGUvcHJvdG9idWYvdW5pdHRlc3RfY3VzdG9tX29wdGlvbnMucHJvdG8yoAEK", - "ElRlc3RHZW5lcmljU2VydmljZRJECgNGb28SHS5wcm90b2J1Zl91bml0dGVz", - "dC5Gb29SZXF1ZXN0Gh4ucHJvdG9idWZfdW5pdHRlc3QuRm9vUmVzcG9uc2US", - "RAoDQmFyEh0ucHJvdG9idWZfdW5pdHRlc3QuQmFyUmVxdWVzdBoeLnByb3Rv", - "YnVmX3VuaXR0ZXN0LkJhclJlc3BvbnNlMpUBCiNUZXN0R2VuZXJpY1NlcnZp", - "Y2VXaXRoQ3VzdG9tT3B0aW9ucxJjCgNGb28SKS5wcm90b2J1Zl91bml0dGVz", - "dC5DdXN0b21PcHRpb25Gb29SZXF1ZXN0GioucHJvdG9idWZfdW5pdHRlc3Qu", - "Q3VzdG9tT3B0aW9uRm9vUmVzcG9uc2UiBeD6jB4CGgmQsose09uAy0lCREgB", - "wj4/CiFHb29nbGUuUHJvdG9jb2xCdWZmZXJzLlRlc3RQcm90b3MSF1VuaXRU", - "ZXN0R2VuZXJpY1NlcnZpY2VziA4B")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); - RegisterAllExtensions(registry); - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.RegisterAllExtensions(registry); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RegisterAllExtensions(registry); - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.RegisterAllExtensions(registry); - return registry; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, - global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor, - }, assigner); - } - #endregion - - } - #region Services - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public abstract class TestGenericService : pb::IService { - public abstract void Foo( - pb::IRpcController controller, - global::Google.ProtocolBuffers.TestProtos.FooRequest request, - global::System.Action done); - public abstract void Bar( - pb::IRpcController controller, - global::Google.ProtocolBuffers.TestProtos.BarRequest request, - global::System.Action done); - - public static pbd::ServiceDescriptor Descriptor { - get { return UnitTestGenericServices.Descriptor.Services[0]; } - } - public pbd::ServiceDescriptor DescriptorForType { - get { return Descriptor; } - } - - public void CallMethod( - pbd::MethodDescriptor method, - pb::IRpcController controller, - pb::IMessage request, - global::System.Action done) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.CallMethod() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - this.Foo(controller, (global::Google.ProtocolBuffers.TestProtos.FooRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 1: - this.Bar(controller, (global::Google.ProtocolBuffers.TestProtos.BarRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.GetRequestPrototype() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - return global::Google.ProtocolBuffers.TestProtos.FooRequest.DefaultInstance; - case 1: - return global::Google.ProtocolBuffers.TestProtos.BarRequest.DefaultInstance; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.GetResponsePrototype() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - return global::Google.ProtocolBuffers.TestProtos.FooResponse.DefaultInstance; - case 1: - return global::Google.ProtocolBuffers.TestProtos.BarResponse.DefaultInstance; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public static Stub CreateStub(pb::IRpcChannel channel) { - return new Stub(channel); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public class Stub : global::Google.ProtocolBuffers.TestProtos.TestGenericService { - internal Stub(pb::IRpcChannel channel) { - this.channel = channel; - } - - private readonly pb::IRpcChannel channel; - - public pb::IRpcChannel Channel { - get { return channel; } - } - - public override void Foo( - pb::IRpcController controller, - global::Google.ProtocolBuffers.TestProtos.FooRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[0], - controller, request, global::Google.ProtocolBuffers.TestProtos.FooResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::Google.ProtocolBuffers.TestProtos.FooResponse.DefaultInstance)); - } - - public override void Bar( - pb::IRpcController controller, - global::Google.ProtocolBuffers.TestProtos.BarRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[1], - controller, request, global::Google.ProtocolBuffers.TestProtos.BarResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::Google.ProtocolBuffers.TestProtos.BarResponse.DefaultInstance)); - } - } - } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public abstract class TestGenericServiceWithCustomOptions : pb::IService { - public abstract void Foo( - pb::IRpcController controller, - global::Google.ProtocolBuffers.TestProtos.CustomOptionFooRequest request, - global::System.Action done); - - public static pbd::ServiceDescriptor Descriptor { - get { return UnitTestGenericServices.Descriptor.Services[1]; } - } - public pbd::ServiceDescriptor DescriptorForType { - get { return Descriptor; } - } - - public void CallMethod( - pbd::MethodDescriptor method, - pb::IRpcController controller, - pb::IMessage request, - global::System.Action done) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.CallMethod() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - this.Foo(controller, (global::Google.ProtocolBuffers.TestProtos.CustomOptionFooRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.GetRequestPrototype() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - return global::Google.ProtocolBuffers.TestProtos.CustomOptionFooRequest.DefaultInstance; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.GetResponsePrototype() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - return global::Google.ProtocolBuffers.TestProtos.CustomOptionFooResponse.DefaultInstance; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public static Stub CreateStub(pb::IRpcChannel channel) { - return new Stub(channel); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public class Stub : global::Google.ProtocolBuffers.TestProtos.TestGenericServiceWithCustomOptions { - internal Stub(pb::IRpcChannel channel) { - this.channel = channel; - } - - private readonly pb::IRpcChannel channel; - - public pb::IRpcChannel Channel { - get { return channel; } - } - - public override void Foo( - pb::IRpcController controller, - global::Google.ProtocolBuffers.TestProtos.CustomOptionFooRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[0], - controller, request, global::Google.ProtocolBuffers.TestProtos.CustomOptionFooResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::Google.ProtocolBuffers.TestProtos.CustomOptionFooResponse.DefaultInstance)); - } - } - } - #endregion - -} - -#endregion Designer generated code diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestGoogleSizeProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestGoogleSizeProtoFile.cs deleted file mode 100644 index 6def8d5..0000000 --- a/src/ProtocolBuffers.Test/TestProtos/UnitTestGoogleSizeProtoFile.cs +++ /dev/null @@ -1,4573 +0,0 @@ -// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.TestProtos { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class UnitTestGoogleSizeProtoFile { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_unittest_google_size_SizeMessage1__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_google_size_SizeMessage1__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_unittest_google_size_SizeMessage1SubMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_google_size_SizeMessage1SubMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_unittest_google_size_SizeMessage2__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_google_size_SizeMessage2__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_unittest_google_size_SizeMessage2_Group1__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_google_size_SizeMessage2_Group1__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_unittest_google_size_SizeMessage2GroupedMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_google_size_SizeMessage2GroupedMessage__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static UnitTestGoogleSizeProtoFile() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "Ch1nb29nbGUvdGVzdC9nb29nbGVfc2l6ZS5wcm90bxIUdW5pdHRlc3RfZ29v", - "Z2xlX3NpemUaJGdvb2dsZS9wcm90b2J1Zi9jc2hhcnBfb3B0aW9ucy5wcm90", - "byKABwoMU2l6ZU1lc3NhZ2UxEg4KBmZpZWxkMRgBIAIoCRIOCgZmaWVsZDkY", - "CSABKAkSDwoHZmllbGQxOBgSIAEoCRIWCgdmaWVsZDgwGFAgASgIOgVmYWxz", - "ZRIVCgdmaWVsZDgxGFEgASgIOgR0cnVlEg4KBmZpZWxkMhgCIAIoBRIOCgZm", - "aWVsZDMYAyACKAUSEQoIZmllbGQyODAYmAIgASgFEhEKBmZpZWxkNhgGIAEo", - "BToBMBIPCgdmaWVsZDIyGBYgASgDEg4KBmZpZWxkNBgEIAEoCRIOCgZmaWVs", - "ZDUYBSADKAYSFgoHZmllbGQ1ORg7IAEoCDoFZmFsc2USDgoGZmllbGQ3GAcg", - "ASgJEg8KB2ZpZWxkMTYYECABKAUSFAoIZmllbGQxMzAYggEgASgFOgEwEhUK", - "B2ZpZWxkMTIYDCABKAg6BHRydWUSFQoHZmllbGQxNxgRIAEoCDoEdHJ1ZRIV", - "CgdmaWVsZDEzGA0gASgIOgR0cnVlEhUKB2ZpZWxkMTQYDiABKAg6BHRydWUS", - "EwoIZmllbGQxMDQYaCABKAU6ATASEwoIZmllbGQxMDAYZCABKAU6ATASEwoI", - "ZmllbGQxMDEYZSABKAU6ATASEAoIZmllbGQxMDIYZiABKAkSEAoIZmllbGQx", - "MDMYZyABKAkSEgoHZmllbGQyORgdIAEoBToBMBIWCgdmaWVsZDMwGB4gASgI", - "OgVmYWxzZRITCgdmaWVsZDYwGDwgASgFOgItMRIVCghmaWVsZDI3MRiPAiAB", - "KAU6Ai0xEhUKCGZpZWxkMjcyGJACIAEoBToCLTESEQoIZmllbGQxNTAYlgEg", - "ASgFEhIKB2ZpZWxkMjMYFyABKAU6ATASFgoHZmllbGQyNBgYIAEoCDoFZmFs", - "c2USEgoHZmllbGQyNRgZIAEoBToBMBI9CgdmaWVsZDE1GA8gASgLMiwudW5p", - "dHRlc3RfZ29vZ2xlX3NpemUuU2l6ZU1lc3NhZ2UxU3ViTWVzc2FnZRIPCgdm", - "aWVsZDc4GE4gASgIEhIKB2ZpZWxkNjcYQyABKAU6ATASDwoHZmllbGQ2OBhE", - "IAEoBRIUCghmaWVsZDEyOBiAASABKAU6ATASKAoIZmllbGQxMjkYgQEgASgJ", - "OhV4eHh4eHh4eHh4eHh4eHh4eHh4eHgSFAoIZmllbGQxMzEYgwEgASgFOgEw", - "IqEDChZTaXplTWVzc2FnZTFTdWJNZXNzYWdlEhEKBmZpZWxkMRgBIAEoBToB", - "MBIRCgZmaWVsZDIYAiABKAU6ATASEQoGZmllbGQzGAMgASgFOgEwEg8KB2Zp", - "ZWxkMTUYDyABKAkSFQoHZmllbGQxMhgMIAEoCDoEdHJ1ZRIPCgdmaWVsZDEz", - "GA0gASgDEg8KB2ZpZWxkMTQYDiABKAMSDwoHZmllbGQxNhgQIAEoBRISCgdm", - "aWVsZDE5GBMgASgFOgEyEhUKB2ZpZWxkMjAYFCABKAg6BHRydWUSFQoHZmll", - "bGQyOBgcIAEoCDoEdHJ1ZRIPCgdmaWVsZDIxGBUgASgGEg8KB2ZpZWxkMjIY", - "FiABKAUSFgoHZmllbGQyMxgXIAEoCDoFZmFsc2USGAoIZmllbGQyMDYYzgEg", - "ASgIOgVmYWxzZRIRCghmaWVsZDIwMxjLASABKAcSEQoIZmllbGQyMDQYzAEg", - "ASgFEhEKCGZpZWxkMjA1GM0BIAEoCRIRCghmaWVsZDIwNxjPASABKAQSEQoI", - "ZmllbGQzMDAYrAIgASgEItsHCgxTaXplTWVzc2FnZTISDgoGZmllbGQxGAEg", - "ASgJEg4KBmZpZWxkMxgDIAEoAxIOCgZmaWVsZDQYBCABKAMSDwoHZmllbGQz", - "MBgeIAEoAxIWCgdmaWVsZDc1GEsgASgIOgVmYWxzZRIOCgZmaWVsZDYYBiAB", - "KAkSDgoGZmllbGQyGAIgASgMEhIKB2ZpZWxkMjEYFSABKAU6ATASDwoHZmll", - "bGQ3MRhHIAEoBRIPCgdmaWVsZDI1GBkgASgCEhMKCGZpZWxkMTA5GG0gASgF", - "OgEwEhQKCGZpZWxkMjEwGNIBIAEoBToBMBIUCghmaWVsZDIxMRjTASABKAU6", - "ATASFAoIZmllbGQyMTIY1AEgASgFOgEwEhQKCGZpZWxkMjEzGNUBIAEoBToB", - "MBIUCghmaWVsZDIxNhjYASABKAU6ATASFAoIZmllbGQyMTcY2QEgASgFOgEw", - "EhQKCGZpZWxkMjE4GNoBIAEoBToBMBIUCghmaWVsZDIyMBjcASABKAU6ATAS", - "FAoIZmllbGQyMjEY3QEgASgFOgEwEhQKCGZpZWxkMjIyGN4BIAEoAjoBMBIP", - "CgdmaWVsZDYzGD8gASgFEjkKBmdyb3VwMRgKIAMoCjIpLnVuaXR0ZXN0X2dv", - "b2dsZV9zaXplLlNpemVNZXNzYWdlMi5Hcm91cDESEQoIZmllbGQxMjgYgAEg", - "AygJEhEKCGZpZWxkMTMxGIMBIAEoAxIQCghmaWVsZDEyNxh/IAMoCRIRCghm", - "aWVsZDEyORiBASABKAUSEQoIZmllbGQxMzAYggEgAygDEhgKCGZpZWxkMjA1", - "GM0BIAEoCDoFZmFsc2USGAoIZmllbGQyMDYYzgEgASgIOgVmYWxzZRrMAgoG", - "R3JvdXAxEg8KB2ZpZWxkMTEYCyACKAISDwoHZmllbGQyNhgaIAEoAhIPCgdm", - "aWVsZDEyGAwgASgJEg8KB2ZpZWxkMTMYDSABKAkSDwoHZmllbGQxNBgOIAMo", - "CRIPCgdmaWVsZDE1GA8gAigEEg4KBmZpZWxkNRgFIAEoBRIPCgdmaWVsZDI3", - "GBsgASgJEg8KB2ZpZWxkMjgYHCABKAUSDwoHZmllbGQyORgdIAEoCRIPCgdm", - "aWVsZDE2GBAgASgJEg8KB2ZpZWxkMjIYFiADKAkSDwoHZmllbGQ3MxhJIAMo", - "BRISCgdmaWVsZDIwGBQgASgFOgEwEg8KB2ZpZWxkMjQYGCABKAkSQQoHZmll", - "bGQzMRgfIAEoCzIwLnVuaXR0ZXN0X2dvb2dsZV9zaXplLlNpemVNZXNzYWdl", - "Mkdyb3VwZWRNZXNzYWdlIt4BChpTaXplTWVzc2FnZTJHcm91cGVkTWVzc2Fn", - "ZRIOCgZmaWVsZDEYASABKAISDgoGZmllbGQyGAIgASgCEhEKBmZpZWxkMxgD", - "IAEoAjoBMBIOCgZmaWVsZDQYBCABKAgSDgoGZmllbGQ1GAUgASgIEhQKBmZp", - "ZWxkNhgGIAEoCDoEdHJ1ZRIVCgZmaWVsZDcYByABKAg6BWZhbHNlEg4KBmZp", - "ZWxkOBgIIAEoAhIOCgZmaWVsZDkYCSABKAgSDwoHZmllbGQxMBgKIAEoAhIP", - "CgdmaWVsZDExGAsgASgDQlFCCkdvb2dsZVNpemVIAsI+QAohR29vZ2xlLlBy", - "b3RvY29sQnVmZmVycy5UZXN0UHJvdG9zEhtVbml0VGVzdEdvb2dsZVNpemVQ", - "cm90b0ZpbGU=")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_unittest_google_size_SizeMessage1__Descriptor = Descriptor.MessageTypes[0]; - internal__static_unittest_google_size_SizeMessage1__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_unittest_google_size_SizeMessage1__Descriptor, - new string[] { "Field1", "Field9", "Field18", "Field80", "Field81", "Field2", "Field3", "Field280", "Field6", "Field22", "Field4", "Field5", "Field59", "Field7", "Field16", "Field130", "Field12", "Field17", "Field13", "Field14", "Field104", "Field100", "Field101", "Field102", "Field103", "Field29", "Field30", "Field60", "Field271", "Field272", "Field150", "Field23", "Field24", "Field25", "Field15", "Field78", "Field67", "Field68", "Field128", "Field129", "Field131", }); - internal__static_unittest_google_size_SizeMessage1SubMessage__Descriptor = Descriptor.MessageTypes[1]; - internal__static_unittest_google_size_SizeMessage1SubMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_unittest_google_size_SizeMessage1SubMessage__Descriptor, - new string[] { "Field1", "Field2", "Field3", "Field15", "Field12", "Field13", "Field14", "Field16", "Field19", "Field20", "Field28", "Field21", "Field22", "Field23", "Field206", "Field203", "Field204", "Field205", "Field207", "Field300", }); - internal__static_unittest_google_size_SizeMessage2__Descriptor = Descriptor.MessageTypes[2]; - internal__static_unittest_google_size_SizeMessage2__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_unittest_google_size_SizeMessage2__Descriptor, - new string[] { "Field1", "Field3", "Field4", "Field30", "Field75", "Field6", "Field2", "Field21", "Field71", "Field25", "Field109", "Field210", "Field211", "Field212", "Field213", "Field216", "Field217", "Field218", "Field220", "Field221", "Field222", "Field63", "Group1", "Field128", "Field131", "Field127", "Field129", "Field130", "Field205", "Field206", }); - internal__static_unittest_google_size_SizeMessage2_Group1__Descriptor = internal__static_unittest_google_size_SizeMessage2__Descriptor.NestedTypes[0]; - internal__static_unittest_google_size_SizeMessage2_Group1__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_unittest_google_size_SizeMessage2_Group1__Descriptor, - new string[] { "Field11", "Field26", "Field12", "Field13", "Field14", "Field15", "Field5", "Field27", "Field28", "Field29", "Field16", "Field22", "Field73", "Field20", "Field24", "Field31", }); - internal__static_unittest_google_size_SizeMessage2GroupedMessage__Descriptor = Descriptor.MessageTypes[3]; - internal__static_unittest_google_size_SizeMessage2GroupedMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_unittest_google_size_SizeMessage2GroupedMessage__Descriptor, - new string[] { "Field1", "Field2", "Field3", "Field4", "Field5", "Field6", "Field7", "Field8", "Field9", "Field10", "Field11", }); - pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); - RegisterAllExtensions(registry); - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.RegisterAllExtensions(registry); - return registry; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, - }, assigner); - } - #endregion - - } - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class SizeMessage1 : pb::GeneratedMessage { - private SizeMessage1() { } - private static readonly SizeMessage1 defaultInstance = new SizeMessage1().MakeReadOnly(); - public static SizeMessage1 DefaultInstance { - get { return defaultInstance; } - } - - public override SizeMessage1 DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override SizeMessage1 ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestGoogleSizeProtoFile.internal__static_unittest_google_size_SizeMessage1__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestGoogleSizeProtoFile.internal__static_unittest_google_size_SizeMessage1__FieldAccessorTable; } - } - - public const int Field1FieldNumber = 1; - private bool hasField1; - private string field1_ = ""; - public bool HasField1 { - get { return hasField1; } - } - public string Field1 { - get { return field1_; } - } - - public const int Field9FieldNumber = 9; - private bool hasField9; - private string field9_ = ""; - public bool HasField9 { - get { return hasField9; } - } - public string Field9 { - get { return field9_; } - } - - public const int Field18FieldNumber = 18; - private bool hasField18; - private string field18_ = ""; - public bool HasField18 { - get { return hasField18; } - } - public string Field18 { - get { return field18_; } - } - - public const int Field80FieldNumber = 80; - private bool hasField80; - private bool field80_; - public bool HasField80 { - get { return hasField80; } - } - public bool Field80 { - get { return field80_; } - } - - public const int Field81FieldNumber = 81; - private bool hasField81; - private bool field81_ = true; - public bool HasField81 { - get { return hasField81; } - } - public bool Field81 { - get { return field81_; } - } - - public const int Field2FieldNumber = 2; - private bool hasField2; - private int field2_; - public bool HasField2 { - get { return hasField2; } - } - public int Field2 { - get { return field2_; } - } - - public const int Field3FieldNumber = 3; - private bool hasField3; - private int field3_; - public bool HasField3 { - get { return hasField3; } - } - public int Field3 { - get { return field3_; } - } - - public const int Field280FieldNumber = 280; - private bool hasField280; - private int field280_; - public bool HasField280 { - get { return hasField280; } - } - public int Field280 { - get { return field280_; } - } - - public const int Field6FieldNumber = 6; - private bool hasField6; - private int field6_; - public bool HasField6 { - get { return hasField6; } - } - public int Field6 { - get { return field6_; } - } - - public const int Field22FieldNumber = 22; - private bool hasField22; - private long field22_; - public bool HasField22 { - get { return hasField22; } - } - public long Field22 { - get { return field22_; } - } - - public const int Field4FieldNumber = 4; - private bool hasField4; - private string field4_ = ""; - public bool HasField4 { - get { return hasField4; } - } - public string Field4 { - get { return field4_; } - } - - public const int Field5FieldNumber = 5; - private pbc::PopsicleList field5_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList Field5List { - get { return pbc::Lists.AsReadOnly(field5_); } - } - public int Field5Count { - get { return field5_.Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetField5(int index) { - return field5_[index]; - } - - public const int Field59FieldNumber = 59; - private bool hasField59; - private bool field59_; - public bool HasField59 { - get { return hasField59; } - } - public bool Field59 { - get { return field59_; } - } - - public const int Field7FieldNumber = 7; - private bool hasField7; - private string field7_ = ""; - public bool HasField7 { - get { return hasField7; } - } - public string Field7 { - get { return field7_; } - } - - public const int Field16FieldNumber = 16; - private bool hasField16; - private int field16_; - public bool HasField16 { - get { return hasField16; } - } - public int Field16 { - get { return field16_; } - } - - public const int Field130FieldNumber = 130; - private bool hasField130; - private int field130_; - public bool HasField130 { - get { return hasField130; } - } - public int Field130 { - get { return field130_; } - } - - public const int Field12FieldNumber = 12; - private bool hasField12; - private bool field12_ = true; - public bool HasField12 { - get { return hasField12; } - } - public bool Field12 { - get { return field12_; } - } - - public const int Field17FieldNumber = 17; - private bool hasField17; - private bool field17_ = true; - public bool HasField17 { - get { return hasField17; } - } - public bool Field17 { - get { return field17_; } - } - - public const int Field13FieldNumber = 13; - private bool hasField13; - private bool field13_ = true; - public bool HasField13 { - get { return hasField13; } - } - public bool Field13 { - get { return field13_; } - } - - public const int Field14FieldNumber = 14; - private bool hasField14; - private bool field14_ = true; - public bool HasField14 { - get { return hasField14; } - } - public bool Field14 { - get { return field14_; } - } - - public const int Field104FieldNumber = 104; - private bool hasField104; - private int field104_; - public bool HasField104 { - get { return hasField104; } - } - public int Field104 { - get { return field104_; } - } - - public const int Field100FieldNumber = 100; - private bool hasField100; - private int field100_; - public bool HasField100 { - get { return hasField100; } - } - public int Field100 { - get { return field100_; } - } - - public const int Field101FieldNumber = 101; - private bool hasField101; - private int field101_; - public bool HasField101 { - get { return hasField101; } - } - public int Field101 { - get { return field101_; } - } - - public const int Field102FieldNumber = 102; - private bool hasField102; - private string field102_ = ""; - public bool HasField102 { - get { return hasField102; } - } - public string Field102 { - get { return field102_; } - } - - public const int Field103FieldNumber = 103; - private bool hasField103; - private string field103_ = ""; - public bool HasField103 { - get { return hasField103; } - } - public string Field103 { - get { return field103_; } - } - - public const int Field29FieldNumber = 29; - private bool hasField29; - private int field29_; - public bool HasField29 { - get { return hasField29; } - } - public int Field29 { - get { return field29_; } - } - - public const int Field30FieldNumber = 30; - private bool hasField30; - private bool field30_; - public bool HasField30 { - get { return hasField30; } - } - public bool Field30 { - get { return field30_; } - } - - public const int Field60FieldNumber = 60; - private bool hasField60; - private int field60_ = -1; - public bool HasField60 { - get { return hasField60; } - } - public int Field60 { - get { return field60_; } - } - - public const int Field271FieldNumber = 271; - private bool hasField271; - private int field271_ = -1; - public bool HasField271 { - get { return hasField271; } - } - public int Field271 { - get { return field271_; } - } - - public const int Field272FieldNumber = 272; - private bool hasField272; - private int field272_ = -1; - public bool HasField272 { - get { return hasField272; } - } - public int Field272 { - get { return field272_; } - } - - public const int Field150FieldNumber = 150; - private bool hasField150; - private int field150_; - public bool HasField150 { - get { return hasField150; } - } - public int Field150 { - get { return field150_; } - } - - public const int Field23FieldNumber = 23; - private bool hasField23; - private int field23_; - public bool HasField23 { - get { return hasField23; } - } - public int Field23 { - get { return field23_; } - } - - public const int Field24FieldNumber = 24; - private bool hasField24; - private bool field24_; - public bool HasField24 { - get { return hasField24; } - } - public bool Field24 { - get { return field24_; } - } - - public const int Field25FieldNumber = 25; - private bool hasField25; - private int field25_; - public bool HasField25 { - get { return hasField25; } - } - public int Field25 { - get { return field25_; } - } - - public const int Field15FieldNumber = 15; - private bool hasField15; - private global::Google.ProtocolBuffers.TestProtos.SizeMessage1SubMessage field15_; - public bool HasField15 { - get { return hasField15; } - } - public global::Google.ProtocolBuffers.TestProtos.SizeMessage1SubMessage Field15 { - get { return field15_ ?? global::Google.ProtocolBuffers.TestProtos.SizeMessage1SubMessage.DefaultInstance; } - } - - public const int Field78FieldNumber = 78; - private bool hasField78; - private bool field78_; - public bool HasField78 { - get { return hasField78; } - } - public bool Field78 { - get { return field78_; } - } - - public const int Field67FieldNumber = 67; - private bool hasField67; - private int field67_; - public bool HasField67 { - get { return hasField67; } - } - public int Field67 { - get { return field67_; } - } - - public const int Field68FieldNumber = 68; - private bool hasField68; - private int field68_; - public bool HasField68 { - get { return hasField68; } - } - public int Field68 { - get { return field68_; } - } - - public const int Field128FieldNumber = 128; - private bool hasField128; - private int field128_; - public bool HasField128 { - get { return hasField128; } - } - public int Field128 { - get { return field128_; } - } - - public const int Field129FieldNumber = 129; - private bool hasField129; - private string field129_ = "xxxxxxxxxxxxxxxxxxxxx"; - public bool HasField129 { - get { return hasField129; } - } - public string Field129 { - get { return field129_; } - } - - public const int Field131FieldNumber = 131; - private bool hasField131; - private int field131_; - public bool HasField131 { - get { return hasField131; } - } - public int Field131 { - get { return field131_; } - } - - public static SizeMessage1 ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SizeMessage1 ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SizeMessage1 ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SizeMessage1 ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SizeMessage1 ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SizeMessage1 ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SizeMessage1 ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SizeMessage1 ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SizeMessage1 ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SizeMessage1 ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private SizeMessage1 MakeReadOnly() { - field5_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SizeMessage1 prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(SizeMessage1 cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private SizeMessage1 result; - - private SizeMessage1 PrepareBuilder() { - if (resultIsReadOnly) { - SizeMessage1 original = result; - result = new SizeMessage1(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override SizeMessage1 MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.SizeMessage1.Descriptor; } - } - - public override SizeMessage1 DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.SizeMessage1.DefaultInstance; } - } - - public override SizeMessage1 BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - - public bool HasField1 { - get { return result.hasField1; } - } - public string Field1 { - get { return result.Field1; } - set { SetField1(value); } - } - public Builder SetField1(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField1 = true; - result.field1_ = value; - return this; - } - public Builder ClearField1() { - PrepareBuilder(); - result.hasField1 = false; - result.field1_ = ""; - return this; - } - - public bool HasField9 { - get { return result.hasField9; } - } - public string Field9 { - get { return result.Field9; } - set { SetField9(value); } - } - public Builder SetField9(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField9 = true; - result.field9_ = value; - return this; - } - public Builder ClearField9() { - PrepareBuilder(); - result.hasField9 = false; - result.field9_ = ""; - return this; - } - - public bool HasField18 { - get { return result.hasField18; } - } - public string Field18 { - get { return result.Field18; } - set { SetField18(value); } - } - public Builder SetField18(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField18 = true; - result.field18_ = value; - return this; - } - public Builder ClearField18() { - PrepareBuilder(); - result.hasField18 = false; - result.field18_ = ""; - return this; - } - - public bool HasField80 { - get { return result.hasField80; } - } - public bool Field80 { - get { return result.Field80; } - set { SetField80(value); } - } - public Builder SetField80(bool value) { - PrepareBuilder(); - result.hasField80 = true; - result.field80_ = value; - return this; - } - public Builder ClearField80() { - PrepareBuilder(); - result.hasField80 = false; - result.field80_ = false; - return this; - } - - public bool HasField81 { - get { return result.hasField81; } - } - public bool Field81 { - get { return result.Field81; } - set { SetField81(value); } - } - public Builder SetField81(bool value) { - PrepareBuilder(); - result.hasField81 = true; - result.field81_ = value; - return this; - } - public Builder ClearField81() { - PrepareBuilder(); - result.hasField81 = false; - result.field81_ = true; - return this; - } - - public bool HasField2 { - get { return result.hasField2; } - } - public int Field2 { - get { return result.Field2; } - set { SetField2(value); } - } - public Builder SetField2(int value) { - PrepareBuilder(); - result.hasField2 = true; - result.field2_ = value; - return this; - } - public Builder ClearField2() { - PrepareBuilder(); - result.hasField2 = false; - result.field2_ = 0; - return this; - } - - public bool HasField3 { - get { return result.hasField3; } - } - public int Field3 { - get { return result.Field3; } - set { SetField3(value); } - } - public Builder SetField3(int value) { - PrepareBuilder(); - result.hasField3 = true; - result.field3_ = value; - return this; - } - public Builder ClearField3() { - PrepareBuilder(); - result.hasField3 = false; - result.field3_ = 0; - return this; - } - - public bool HasField280 { - get { return result.hasField280; } - } - public int Field280 { - get { return result.Field280; } - set { SetField280(value); } - } - public Builder SetField280(int value) { - PrepareBuilder(); - result.hasField280 = true; - result.field280_ = value; - return this; - } - public Builder ClearField280() { - PrepareBuilder(); - result.hasField280 = false; - result.field280_ = 0; - return this; - } - - public bool HasField6 { - get { return result.hasField6; } - } - public int Field6 { - get { return result.Field6; } - set { SetField6(value); } - } - public Builder SetField6(int value) { - PrepareBuilder(); - result.hasField6 = true; - result.field6_ = value; - return this; - } - public Builder ClearField6() { - PrepareBuilder(); - result.hasField6 = false; - result.field6_ = 0; - return this; - } - - public bool HasField22 { - get { return result.hasField22; } - } - public long Field22 { - get { return result.Field22; } - set { SetField22(value); } - } - public Builder SetField22(long value) { - PrepareBuilder(); - result.hasField22 = true; - result.field22_ = value; - return this; - } - public Builder ClearField22() { - PrepareBuilder(); - result.hasField22 = false; - result.field22_ = 0L; - return this; - } - - public bool HasField4 { - get { return result.hasField4; } - } - public string Field4 { - get { return result.Field4; } - set { SetField4(value); } - } - public Builder SetField4(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField4 = true; - result.field4_ = value; - return this; - } - public Builder ClearField4() { - PrepareBuilder(); - result.hasField4 = false; - result.field4_ = ""; - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList Field5List { - get { return PrepareBuilder().field5_; } - } - public int Field5Count { - get { return result.Field5Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetField5(int index) { - return result.GetField5(index); - } - [global::System.CLSCompliant(false)] - public Builder SetField5(int index, ulong value) { - PrepareBuilder(); - result.field5_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddField5(ulong value) { - PrepareBuilder(); - result.field5_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeField5(scg::IEnumerable values) { - PrepareBuilder(); - result.field5_.Add(values); - return this; - } - public Builder ClearField5() { - PrepareBuilder(); - result.field5_.Clear(); - return this; - } - - public bool HasField59 { - get { return result.hasField59; } - } - public bool Field59 { - get { return result.Field59; } - set { SetField59(value); } - } - public Builder SetField59(bool value) { - PrepareBuilder(); - result.hasField59 = true; - result.field59_ = value; - return this; - } - public Builder ClearField59() { - PrepareBuilder(); - result.hasField59 = false; - result.field59_ = false; - return this; - } - - public bool HasField7 { - get { return result.hasField7; } - } - public string Field7 { - get { return result.Field7; } - set { SetField7(value); } - } - public Builder SetField7(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField7 = true; - result.field7_ = value; - return this; - } - public Builder ClearField7() { - PrepareBuilder(); - result.hasField7 = false; - result.field7_ = ""; - return this; - } - - public bool HasField16 { - get { return result.hasField16; } - } - public int Field16 { - get { return result.Field16; } - set { SetField16(value); } - } - public Builder SetField16(int value) { - PrepareBuilder(); - result.hasField16 = true; - result.field16_ = value; - return this; - } - public Builder ClearField16() { - PrepareBuilder(); - result.hasField16 = false; - result.field16_ = 0; - return this; - } - - public bool HasField130 { - get { return result.hasField130; } - } - public int Field130 { - get { return result.Field130; } - set { SetField130(value); } - } - public Builder SetField130(int value) { - PrepareBuilder(); - result.hasField130 = true; - result.field130_ = value; - return this; - } - public Builder ClearField130() { - PrepareBuilder(); - result.hasField130 = false; - result.field130_ = 0; - return this; - } - - public bool HasField12 { - get { return result.hasField12; } - } - public bool Field12 { - get { return result.Field12; } - set { SetField12(value); } - } - public Builder SetField12(bool value) { - PrepareBuilder(); - result.hasField12 = true; - result.field12_ = value; - return this; - } - public Builder ClearField12() { - PrepareBuilder(); - result.hasField12 = false; - result.field12_ = true; - return this; - } - - public bool HasField17 { - get { return result.hasField17; } - } - public bool Field17 { - get { return result.Field17; } - set { SetField17(value); } - } - public Builder SetField17(bool value) { - PrepareBuilder(); - result.hasField17 = true; - result.field17_ = value; - return this; - } - public Builder ClearField17() { - PrepareBuilder(); - result.hasField17 = false; - result.field17_ = true; - return this; - } - - public bool HasField13 { - get { return result.hasField13; } - } - public bool Field13 { - get { return result.Field13; } - set { SetField13(value); } - } - public Builder SetField13(bool value) { - PrepareBuilder(); - result.hasField13 = true; - result.field13_ = value; - return this; - } - public Builder ClearField13() { - PrepareBuilder(); - result.hasField13 = false; - result.field13_ = true; - return this; - } - - public bool HasField14 { - get { return result.hasField14; } - } - public bool Field14 { - get { return result.Field14; } - set { SetField14(value); } - } - public Builder SetField14(bool value) { - PrepareBuilder(); - result.hasField14 = true; - result.field14_ = value; - return this; - } - public Builder ClearField14() { - PrepareBuilder(); - result.hasField14 = false; - result.field14_ = true; - return this; - } - - public bool HasField104 { - get { return result.hasField104; } - } - public int Field104 { - get { return result.Field104; } - set { SetField104(value); } - } - public Builder SetField104(int value) { - PrepareBuilder(); - result.hasField104 = true; - result.field104_ = value; - return this; - } - public Builder ClearField104() { - PrepareBuilder(); - result.hasField104 = false; - result.field104_ = 0; - return this; - } - - public bool HasField100 { - get { return result.hasField100; } - } - public int Field100 { - get { return result.Field100; } - set { SetField100(value); } - } - public Builder SetField100(int value) { - PrepareBuilder(); - result.hasField100 = true; - result.field100_ = value; - return this; - } - public Builder ClearField100() { - PrepareBuilder(); - result.hasField100 = false; - result.field100_ = 0; - return this; - } - - public bool HasField101 { - get { return result.hasField101; } - } - public int Field101 { - get { return result.Field101; } - set { SetField101(value); } - } - public Builder SetField101(int value) { - PrepareBuilder(); - result.hasField101 = true; - result.field101_ = value; - return this; - } - public Builder ClearField101() { - PrepareBuilder(); - result.hasField101 = false; - result.field101_ = 0; - return this; - } - - public bool HasField102 { - get { return result.hasField102; } - } - public string Field102 { - get { return result.Field102; } - set { SetField102(value); } - } - public Builder SetField102(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField102 = true; - result.field102_ = value; - return this; - } - public Builder ClearField102() { - PrepareBuilder(); - result.hasField102 = false; - result.field102_ = ""; - return this; - } - - public bool HasField103 { - get { return result.hasField103; } - } - public string Field103 { - get { return result.Field103; } - set { SetField103(value); } - } - public Builder SetField103(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField103 = true; - result.field103_ = value; - return this; - } - public Builder ClearField103() { - PrepareBuilder(); - result.hasField103 = false; - result.field103_ = ""; - return this; - } - - public bool HasField29 { - get { return result.hasField29; } - } - public int Field29 { - get { return result.Field29; } - set { SetField29(value); } - } - public Builder SetField29(int value) { - PrepareBuilder(); - result.hasField29 = true; - result.field29_ = value; - return this; - } - public Builder ClearField29() { - PrepareBuilder(); - result.hasField29 = false; - result.field29_ = 0; - return this; - } - - public bool HasField30 { - get { return result.hasField30; } - } - public bool Field30 { - get { return result.Field30; } - set { SetField30(value); } - } - public Builder SetField30(bool value) { - PrepareBuilder(); - result.hasField30 = true; - result.field30_ = value; - return this; - } - public Builder ClearField30() { - PrepareBuilder(); - result.hasField30 = false; - result.field30_ = false; - return this; - } - - public bool HasField60 { - get { return result.hasField60; } - } - public int Field60 { - get { return result.Field60; } - set { SetField60(value); } - } - public Builder SetField60(int value) { - PrepareBuilder(); - result.hasField60 = true; - result.field60_ = value; - return this; - } - public Builder ClearField60() { - PrepareBuilder(); - result.hasField60 = false; - result.field60_ = -1; - return this; - } - - public bool HasField271 { - get { return result.hasField271; } - } - public int Field271 { - get { return result.Field271; } - set { SetField271(value); } - } - public Builder SetField271(int value) { - PrepareBuilder(); - result.hasField271 = true; - result.field271_ = value; - return this; - } - public Builder ClearField271() { - PrepareBuilder(); - result.hasField271 = false; - result.field271_ = -1; - return this; - } - - public bool HasField272 { - get { return result.hasField272; } - } - public int Field272 { - get { return result.Field272; } - set { SetField272(value); } - } - public Builder SetField272(int value) { - PrepareBuilder(); - result.hasField272 = true; - result.field272_ = value; - return this; - } - public Builder ClearField272() { - PrepareBuilder(); - result.hasField272 = false; - result.field272_ = -1; - return this; - } - - public bool HasField150 { - get { return result.hasField150; } - } - public int Field150 { - get { return result.Field150; } - set { SetField150(value); } - } - public Builder SetField150(int value) { - PrepareBuilder(); - result.hasField150 = true; - result.field150_ = value; - return this; - } - public Builder ClearField150() { - PrepareBuilder(); - result.hasField150 = false; - result.field150_ = 0; - return this; - } - - public bool HasField23 { - get { return result.hasField23; } - } - public int Field23 { - get { return result.Field23; } - set { SetField23(value); } - } - public Builder SetField23(int value) { - PrepareBuilder(); - result.hasField23 = true; - result.field23_ = value; - return this; - } - public Builder ClearField23() { - PrepareBuilder(); - result.hasField23 = false; - result.field23_ = 0; - return this; - } - - public bool HasField24 { - get { return result.hasField24; } - } - public bool Field24 { - get { return result.Field24; } - set { SetField24(value); } - } - public Builder SetField24(bool value) { - PrepareBuilder(); - result.hasField24 = true; - result.field24_ = value; - return this; - } - public Builder ClearField24() { - PrepareBuilder(); - result.hasField24 = false; - result.field24_ = false; - return this; - } - - public bool HasField25 { - get { return result.hasField25; } - } - public int Field25 { - get { return result.Field25; } - set { SetField25(value); } - } - public Builder SetField25(int value) { - PrepareBuilder(); - result.hasField25 = true; - result.field25_ = value; - return this; - } - public Builder ClearField25() { - PrepareBuilder(); - result.hasField25 = false; - result.field25_ = 0; - return this; - } - - public bool HasField15 { - get { return result.hasField15; } - } - public global::Google.ProtocolBuffers.TestProtos.SizeMessage1SubMessage Field15 { - get { return result.Field15; } - set { SetField15(value); } - } - public Builder SetField15(global::Google.ProtocolBuffers.TestProtos.SizeMessage1SubMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField15 = true; - result.field15_ = value; - return this; - } - public Builder SetField15(global::Google.ProtocolBuffers.TestProtos.SizeMessage1SubMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasField15 = true; - result.field15_ = builderForValue.Build(); - return this; - } - public Builder MergeField15(global::Google.ProtocolBuffers.TestProtos.SizeMessage1SubMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasField15 && - result.field15_ != global::Google.ProtocolBuffers.TestProtos.SizeMessage1SubMessage.DefaultInstance) { - result.field15_ = global::Google.ProtocolBuffers.TestProtos.SizeMessage1SubMessage.CreateBuilder(result.field15_).MergeFrom(value).BuildPartial(); - } else { - result.field15_ = value; - } - result.hasField15 = true; - return this; - } - public Builder ClearField15() { - PrepareBuilder(); - result.hasField15 = false; - result.field15_ = null; - return this; - } - - public bool HasField78 { - get { return result.hasField78; } - } - public bool Field78 { - get { return result.Field78; } - set { SetField78(value); } - } - public Builder SetField78(bool value) { - PrepareBuilder(); - result.hasField78 = true; - result.field78_ = value; - return this; - } - public Builder ClearField78() { - PrepareBuilder(); - result.hasField78 = false; - result.field78_ = false; - return this; - } - - public bool HasField67 { - get { return result.hasField67; } - } - public int Field67 { - get { return result.Field67; } - set { SetField67(value); } - } - public Builder SetField67(int value) { - PrepareBuilder(); - result.hasField67 = true; - result.field67_ = value; - return this; - } - public Builder ClearField67() { - PrepareBuilder(); - result.hasField67 = false; - result.field67_ = 0; - return this; - } - - public bool HasField68 { - get { return result.hasField68; } - } - public int Field68 { - get { return result.Field68; } - set { SetField68(value); } - } - public Builder SetField68(int value) { - PrepareBuilder(); - result.hasField68 = true; - result.field68_ = value; - return this; - } - public Builder ClearField68() { - PrepareBuilder(); - result.hasField68 = false; - result.field68_ = 0; - return this; - } - - public bool HasField128 { - get { return result.hasField128; } - } - public int Field128 { - get { return result.Field128; } - set { SetField128(value); } - } - public Builder SetField128(int value) { - PrepareBuilder(); - result.hasField128 = true; - result.field128_ = value; - return this; - } - public Builder ClearField128() { - PrepareBuilder(); - result.hasField128 = false; - result.field128_ = 0; - return this; - } - - public bool HasField129 { - get { return result.hasField129; } - } - public string Field129 { - get { return result.Field129; } - set { SetField129(value); } - } - public Builder SetField129(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField129 = true; - result.field129_ = value; - return this; - } - public Builder ClearField129() { - PrepareBuilder(); - result.hasField129 = false; - result.field129_ = "xxxxxxxxxxxxxxxxxxxxx"; - return this; - } - - public bool HasField131 { - get { return result.hasField131; } - } - public int Field131 { - get { return result.Field131; } - set { SetField131(value); } - } - public Builder SetField131(int value) { - PrepareBuilder(); - result.hasField131 = true; - result.field131_ = value; - return this; - } - public Builder ClearField131() { - PrepareBuilder(); - result.hasField131 = false; - result.field131_ = 0; - return this; - } - } - static SizeMessage1() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestGoogleSizeProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class SizeMessage1SubMessage : pb::GeneratedMessage { - private SizeMessage1SubMessage() { } - private static readonly SizeMessage1SubMessage defaultInstance = new SizeMessage1SubMessage().MakeReadOnly(); - public static SizeMessage1SubMessage DefaultInstance { - get { return defaultInstance; } - } - - public override SizeMessage1SubMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override SizeMessage1SubMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestGoogleSizeProtoFile.internal__static_unittest_google_size_SizeMessage1SubMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestGoogleSizeProtoFile.internal__static_unittest_google_size_SizeMessage1SubMessage__FieldAccessorTable; } - } - - public const int Field1FieldNumber = 1; - private bool hasField1; - private int field1_; - public bool HasField1 { - get { return hasField1; } - } - public int Field1 { - get { return field1_; } - } - - public const int Field2FieldNumber = 2; - private bool hasField2; - private int field2_; - public bool HasField2 { - get { return hasField2; } - } - public int Field2 { - get { return field2_; } - } - - public const int Field3FieldNumber = 3; - private bool hasField3; - private int field3_; - public bool HasField3 { - get { return hasField3; } - } - public int Field3 { - get { return field3_; } - } - - public const int Field15FieldNumber = 15; - private bool hasField15; - private string field15_ = ""; - public bool HasField15 { - get { return hasField15; } - } - public string Field15 { - get { return field15_; } - } - - public const int Field12FieldNumber = 12; - private bool hasField12; - private bool field12_ = true; - public bool HasField12 { - get { return hasField12; } - } - public bool Field12 { - get { return field12_; } - } - - public const int Field13FieldNumber = 13; - private bool hasField13; - private long field13_; - public bool HasField13 { - get { return hasField13; } - } - public long Field13 { - get { return field13_; } - } - - public const int Field14FieldNumber = 14; - private bool hasField14; - private long field14_; - public bool HasField14 { - get { return hasField14; } - } - public long Field14 { - get { return field14_; } - } - - public const int Field16FieldNumber = 16; - private bool hasField16; - private int field16_; - public bool HasField16 { - get { return hasField16; } - } - public int Field16 { - get { return field16_; } - } - - public const int Field19FieldNumber = 19; - private bool hasField19; - private int field19_ = 2; - public bool HasField19 { - get { return hasField19; } - } - public int Field19 { - get { return field19_; } - } - - public const int Field20FieldNumber = 20; - private bool hasField20; - private bool field20_ = true; - public bool HasField20 { - get { return hasField20; } - } - public bool Field20 { - get { return field20_; } - } - - public const int Field28FieldNumber = 28; - private bool hasField28; - private bool field28_ = true; - public bool HasField28 { - get { return hasField28; } - } - public bool Field28 { - get { return field28_; } - } - - public const int Field21FieldNumber = 21; - private bool hasField21; - private ulong field21_; - public bool HasField21 { - get { return hasField21; } - } - [global::System.CLSCompliant(false)] - public ulong Field21 { - get { return field21_; } - } - - public const int Field22FieldNumber = 22; - private bool hasField22; - private int field22_; - public bool HasField22 { - get { return hasField22; } - } - public int Field22 { - get { return field22_; } - } - - public const int Field23FieldNumber = 23; - private bool hasField23; - private bool field23_; - public bool HasField23 { - get { return hasField23; } - } - public bool Field23 { - get { return field23_; } - } - - public const int Field206FieldNumber = 206; - private bool hasField206; - private bool field206_; - public bool HasField206 { - get { return hasField206; } - } - public bool Field206 { - get { return field206_; } - } - - public const int Field203FieldNumber = 203; - private bool hasField203; - private uint field203_; - public bool HasField203 { - get { return hasField203; } - } - [global::System.CLSCompliant(false)] - public uint Field203 { - get { return field203_; } - } - - public const int Field204FieldNumber = 204; - private bool hasField204; - private int field204_; - public bool HasField204 { - get { return hasField204; } - } - public int Field204 { - get { return field204_; } - } - - public const int Field205FieldNumber = 205; - private bool hasField205; - private string field205_ = ""; - public bool HasField205 { - get { return hasField205; } - } - public string Field205 { - get { return field205_; } - } - - public const int Field207FieldNumber = 207; - private bool hasField207; - private ulong field207_; - public bool HasField207 { - get { return hasField207; } - } - [global::System.CLSCompliant(false)] - public ulong Field207 { - get { return field207_; } - } - - public const int Field300FieldNumber = 300; - private bool hasField300; - private ulong field300_; - public bool HasField300 { - get { return hasField300; } - } - [global::System.CLSCompliant(false)] - public ulong Field300 { - get { return field300_; } - } - - public static SizeMessage1SubMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SizeMessage1SubMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SizeMessage1SubMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SizeMessage1SubMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SizeMessage1SubMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SizeMessage1SubMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SizeMessage1SubMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SizeMessage1SubMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SizeMessage1SubMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SizeMessage1SubMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private SizeMessage1SubMessage MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SizeMessage1SubMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(SizeMessage1SubMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private SizeMessage1SubMessage result; - - private SizeMessage1SubMessage PrepareBuilder() { - if (resultIsReadOnly) { - SizeMessage1SubMessage original = result; - result = new SizeMessage1SubMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override SizeMessage1SubMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.SizeMessage1SubMessage.Descriptor; } - } - - public override SizeMessage1SubMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.SizeMessage1SubMessage.DefaultInstance; } - } - - public override SizeMessage1SubMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - - public bool HasField1 { - get { return result.hasField1; } - } - public int Field1 { - get { return result.Field1; } - set { SetField1(value); } - } - public Builder SetField1(int value) { - PrepareBuilder(); - result.hasField1 = true; - result.field1_ = value; - return this; - } - public Builder ClearField1() { - PrepareBuilder(); - result.hasField1 = false; - result.field1_ = 0; - return this; - } - - public bool HasField2 { - get { return result.hasField2; } - } - public int Field2 { - get { return result.Field2; } - set { SetField2(value); } - } - public Builder SetField2(int value) { - PrepareBuilder(); - result.hasField2 = true; - result.field2_ = value; - return this; - } - public Builder ClearField2() { - PrepareBuilder(); - result.hasField2 = false; - result.field2_ = 0; - return this; - } - - public bool HasField3 { - get { return result.hasField3; } - } - public int Field3 { - get { return result.Field3; } - set { SetField3(value); } - } - public Builder SetField3(int value) { - PrepareBuilder(); - result.hasField3 = true; - result.field3_ = value; - return this; - } - public Builder ClearField3() { - PrepareBuilder(); - result.hasField3 = false; - result.field3_ = 0; - return this; - } - - public bool HasField15 { - get { return result.hasField15; } - } - public string Field15 { - get { return result.Field15; } - set { SetField15(value); } - } - public Builder SetField15(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField15 = true; - result.field15_ = value; - return this; - } - public Builder ClearField15() { - PrepareBuilder(); - result.hasField15 = false; - result.field15_ = ""; - return this; - } - - public bool HasField12 { - get { return result.hasField12; } - } - public bool Field12 { - get { return result.Field12; } - set { SetField12(value); } - } - public Builder SetField12(bool value) { - PrepareBuilder(); - result.hasField12 = true; - result.field12_ = value; - return this; - } - public Builder ClearField12() { - PrepareBuilder(); - result.hasField12 = false; - result.field12_ = true; - return this; - } - - public bool HasField13 { - get { return result.hasField13; } - } - public long Field13 { - get { return result.Field13; } - set { SetField13(value); } - } - public Builder SetField13(long value) { - PrepareBuilder(); - result.hasField13 = true; - result.field13_ = value; - return this; - } - public Builder ClearField13() { - PrepareBuilder(); - result.hasField13 = false; - result.field13_ = 0L; - return this; - } - - public bool HasField14 { - get { return result.hasField14; } - } - public long Field14 { - get { return result.Field14; } - set { SetField14(value); } - } - public Builder SetField14(long value) { - PrepareBuilder(); - result.hasField14 = true; - result.field14_ = value; - return this; - } - public Builder ClearField14() { - PrepareBuilder(); - result.hasField14 = false; - result.field14_ = 0L; - return this; - } - - public bool HasField16 { - get { return result.hasField16; } - } - public int Field16 { - get { return result.Field16; } - set { SetField16(value); } - } - public Builder SetField16(int value) { - PrepareBuilder(); - result.hasField16 = true; - result.field16_ = value; - return this; - } - public Builder ClearField16() { - PrepareBuilder(); - result.hasField16 = false; - result.field16_ = 0; - return this; - } - - public bool HasField19 { - get { return result.hasField19; } - } - public int Field19 { - get { return result.Field19; } - set { SetField19(value); } - } - public Builder SetField19(int value) { - PrepareBuilder(); - result.hasField19 = true; - result.field19_ = value; - return this; - } - public Builder ClearField19() { - PrepareBuilder(); - result.hasField19 = false; - result.field19_ = 2; - return this; - } - - public bool HasField20 { - get { return result.hasField20; } - } - public bool Field20 { - get { return result.Field20; } - set { SetField20(value); } - } - public Builder SetField20(bool value) { - PrepareBuilder(); - result.hasField20 = true; - result.field20_ = value; - return this; - } - public Builder ClearField20() { - PrepareBuilder(); - result.hasField20 = false; - result.field20_ = true; - return this; - } - - public bool HasField28 { - get { return result.hasField28; } - } - public bool Field28 { - get { return result.Field28; } - set { SetField28(value); } - } - public Builder SetField28(bool value) { - PrepareBuilder(); - result.hasField28 = true; - result.field28_ = value; - return this; - } - public Builder ClearField28() { - PrepareBuilder(); - result.hasField28 = false; - result.field28_ = true; - return this; - } - - public bool HasField21 { - get { return result.hasField21; } - } - [global::System.CLSCompliant(false)] - public ulong Field21 { - get { return result.Field21; } - set { SetField21(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetField21(ulong value) { - PrepareBuilder(); - result.hasField21 = true; - result.field21_ = value; - return this; - } - public Builder ClearField21() { - PrepareBuilder(); - result.hasField21 = false; - result.field21_ = 0; - return this; - } - - public bool HasField22 { - get { return result.hasField22; } - } - public int Field22 { - get { return result.Field22; } - set { SetField22(value); } - } - public Builder SetField22(int value) { - PrepareBuilder(); - result.hasField22 = true; - result.field22_ = value; - return this; - } - public Builder ClearField22() { - PrepareBuilder(); - result.hasField22 = false; - result.field22_ = 0; - return this; - } - - public bool HasField23 { - get { return result.hasField23; } - } - public bool Field23 { - get { return result.Field23; } - set { SetField23(value); } - } - public Builder SetField23(bool value) { - PrepareBuilder(); - result.hasField23 = true; - result.field23_ = value; - return this; - } - public Builder ClearField23() { - PrepareBuilder(); - result.hasField23 = false; - result.field23_ = false; - return this; - } - - public bool HasField206 { - get { return result.hasField206; } - } - public bool Field206 { - get { return result.Field206; } - set { SetField206(value); } - } - public Builder SetField206(bool value) { - PrepareBuilder(); - result.hasField206 = true; - result.field206_ = value; - return this; - } - public Builder ClearField206() { - PrepareBuilder(); - result.hasField206 = false; - result.field206_ = false; - return this; - } - - public bool HasField203 { - get { return result.hasField203; } - } - [global::System.CLSCompliant(false)] - public uint Field203 { - get { return result.Field203; } - set { SetField203(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetField203(uint value) { - PrepareBuilder(); - result.hasField203 = true; - result.field203_ = value; - return this; - } - public Builder ClearField203() { - PrepareBuilder(); - result.hasField203 = false; - result.field203_ = 0; - return this; - } - - public bool HasField204 { - get { return result.hasField204; } - } - public int Field204 { - get { return result.Field204; } - set { SetField204(value); } - } - public Builder SetField204(int value) { - PrepareBuilder(); - result.hasField204 = true; - result.field204_ = value; - return this; - } - public Builder ClearField204() { - PrepareBuilder(); - result.hasField204 = false; - result.field204_ = 0; - return this; - } - - public bool HasField205 { - get { return result.hasField205; } - } - public string Field205 { - get { return result.Field205; } - set { SetField205(value); } - } - public Builder SetField205(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField205 = true; - result.field205_ = value; - return this; - } - public Builder ClearField205() { - PrepareBuilder(); - result.hasField205 = false; - result.field205_ = ""; - return this; - } - - public bool HasField207 { - get { return result.hasField207; } - } - [global::System.CLSCompliant(false)] - public ulong Field207 { - get { return result.Field207; } - set { SetField207(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetField207(ulong value) { - PrepareBuilder(); - result.hasField207 = true; - result.field207_ = value; - return this; - } - public Builder ClearField207() { - PrepareBuilder(); - result.hasField207 = false; - result.field207_ = 0UL; - return this; - } - - public bool HasField300 { - get { return result.hasField300; } - } - [global::System.CLSCompliant(false)] - public ulong Field300 { - get { return result.Field300; } - set { SetField300(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetField300(ulong value) { - PrepareBuilder(); - result.hasField300 = true; - result.field300_ = value; - return this; - } - public Builder ClearField300() { - PrepareBuilder(); - result.hasField300 = false; - result.field300_ = 0UL; - return this; - } - } - static SizeMessage1SubMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestGoogleSizeProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class SizeMessage2 : pb::GeneratedMessage { - private SizeMessage2() { } - private static readonly SizeMessage2 defaultInstance = new SizeMessage2().MakeReadOnly(); - public static SizeMessage2 DefaultInstance { - get { return defaultInstance; } - } - - public override SizeMessage2 DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override SizeMessage2 ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestGoogleSizeProtoFile.internal__static_unittest_google_size_SizeMessage2__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestGoogleSizeProtoFile.internal__static_unittest_google_size_SizeMessage2__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Group1 : pb::GeneratedMessage { - private Group1() { } - private static readonly Group1 defaultInstance = new Group1().MakeReadOnly(); - public static Group1 DefaultInstance { - get { return defaultInstance; } - } - - public override Group1 DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override Group1 ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestGoogleSizeProtoFile.internal__static_unittest_google_size_SizeMessage2_Group1__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestGoogleSizeProtoFile.internal__static_unittest_google_size_SizeMessage2_Group1__FieldAccessorTable; } - } - - public const int Field11FieldNumber = 11; - private bool hasField11; - private float field11_; - public bool HasField11 { - get { return hasField11; } - } - public float Field11 { - get { return field11_; } - } - - public const int Field26FieldNumber = 26; - private bool hasField26; - private float field26_; - public bool HasField26 { - get { return hasField26; } - } - public float Field26 { - get { return field26_; } - } - - public const int Field12FieldNumber = 12; - private bool hasField12; - private string field12_ = ""; - public bool HasField12 { - get { return hasField12; } - } - public string Field12 { - get { return field12_; } - } - - public const int Field13FieldNumber = 13; - private bool hasField13; - private string field13_ = ""; - public bool HasField13 { - get { return hasField13; } - } - public string Field13 { - get { return field13_; } - } - - public const int Field14FieldNumber = 14; - private pbc::PopsicleList field14_ = new pbc::PopsicleList(); - public scg::IList Field14List { - get { return pbc::Lists.AsReadOnly(field14_); } - } - public int Field14Count { - get { return field14_.Count; } - } - public string GetField14(int index) { - return field14_[index]; - } - - public const int Field15FieldNumber = 15; - private bool hasField15; - private ulong field15_; - public bool HasField15 { - get { return hasField15; } - } - [global::System.CLSCompliant(false)] - public ulong Field15 { - get { return field15_; } - } - - public const int Field5FieldNumber = 5; - private bool hasField5; - private int field5_; - public bool HasField5 { - get { return hasField5; } - } - public int Field5 { - get { return field5_; } - } - - public const int Field27FieldNumber = 27; - private bool hasField27; - private string field27_ = ""; - public bool HasField27 { - get { return hasField27; } - } - public string Field27 { - get { return field27_; } - } - - public const int Field28FieldNumber = 28; - private bool hasField28; - private int field28_; - public bool HasField28 { - get { return hasField28; } - } - public int Field28 { - get { return field28_; } - } - - public const int Field29FieldNumber = 29; - private bool hasField29; - private string field29_ = ""; - public bool HasField29 { - get { return hasField29; } - } - public string Field29 { - get { return field29_; } - } - - public const int Field16FieldNumber = 16; - private bool hasField16; - private string field16_ = ""; - public bool HasField16 { - get { return hasField16; } - } - public string Field16 { - get { return field16_; } - } - - public const int Field22FieldNumber = 22; - private pbc::PopsicleList field22_ = new pbc::PopsicleList(); - public scg::IList Field22List { - get { return pbc::Lists.AsReadOnly(field22_); } - } - public int Field22Count { - get { return field22_.Count; } - } - public string GetField22(int index) { - return field22_[index]; - } - - public const int Field73FieldNumber = 73; - private pbc::PopsicleList field73_ = new pbc::PopsicleList(); - public scg::IList Field73List { - get { return pbc::Lists.AsReadOnly(field73_); } - } - public int Field73Count { - get { return field73_.Count; } - } - public int GetField73(int index) { - return field73_[index]; - } - - public const int Field20FieldNumber = 20; - private bool hasField20; - private int field20_; - public bool HasField20 { - get { return hasField20; } - } - public int Field20 { - get { return field20_; } - } - - public const int Field24FieldNumber = 24; - private bool hasField24; - private string field24_ = ""; - public bool HasField24 { - get { return hasField24; } - } - public string Field24 { - get { return field24_; } - } - - public const int Field31FieldNumber = 31; - private bool hasField31; - private global::Google.ProtocolBuffers.TestProtos.SizeMessage2GroupedMessage field31_; - public bool HasField31 { - get { return hasField31; } - } - public global::Google.ProtocolBuffers.TestProtos.SizeMessage2GroupedMessage Field31 { - get { return field31_ ?? global::Google.ProtocolBuffers.TestProtos.SizeMessage2GroupedMessage.DefaultInstance; } - } - - public static Group1 ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Group1 ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Group1 ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Group1 ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Group1 ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Group1 ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Group1 ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Group1 ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Group1 ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Group1 ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private Group1 MakeReadOnly() { - field14_.MakeReadOnly(); - field22_.MakeReadOnly(); - field73_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Group1 prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(Group1 cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private Group1 result; - - private Group1 PrepareBuilder() { - if (resultIsReadOnly) { - Group1 original = result; - result = new Group1(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override Group1 MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.SizeMessage2.Types.Group1.Descriptor; } - } - - public override Group1 DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.SizeMessage2.Types.Group1.DefaultInstance; } - } - - public override Group1 BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - - public bool HasField11 { - get { return result.hasField11; } - } - public float Field11 { - get { return result.Field11; } - set { SetField11(value); } - } - public Builder SetField11(float value) { - PrepareBuilder(); - result.hasField11 = true; - result.field11_ = value; - return this; - } - public Builder ClearField11() { - PrepareBuilder(); - result.hasField11 = false; - result.field11_ = 0F; - return this; - } - - public bool HasField26 { - get { return result.hasField26; } - } - public float Field26 { - get { return result.Field26; } - set { SetField26(value); } - } - public Builder SetField26(float value) { - PrepareBuilder(); - result.hasField26 = true; - result.field26_ = value; - return this; - } - public Builder ClearField26() { - PrepareBuilder(); - result.hasField26 = false; - result.field26_ = 0F; - return this; - } - - public bool HasField12 { - get { return result.hasField12; } - } - public string Field12 { - get { return result.Field12; } - set { SetField12(value); } - } - public Builder SetField12(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField12 = true; - result.field12_ = value; - return this; - } - public Builder ClearField12() { - PrepareBuilder(); - result.hasField12 = false; - result.field12_ = ""; - return this; - } - - public bool HasField13 { - get { return result.hasField13; } - } - public string Field13 { - get { return result.Field13; } - set { SetField13(value); } - } - public Builder SetField13(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField13 = true; - result.field13_ = value; - return this; - } - public Builder ClearField13() { - PrepareBuilder(); - result.hasField13 = false; - result.field13_ = ""; - return this; - } - - public pbc::IPopsicleList Field14List { - get { return PrepareBuilder().field14_; } - } - public int Field14Count { - get { return result.Field14Count; } - } - public string GetField14(int index) { - return result.GetField14(index); - } - public Builder SetField14(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.field14_[index] = value; - return this; - } - public Builder AddField14(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.field14_.Add(value); - return this; - } - public Builder AddRangeField14(scg::IEnumerable values) { - PrepareBuilder(); - result.field14_.Add(values); - return this; - } - public Builder ClearField14() { - PrepareBuilder(); - result.field14_.Clear(); - return this; - } - - public bool HasField15 { - get { return result.hasField15; } - } - [global::System.CLSCompliant(false)] - public ulong Field15 { - get { return result.Field15; } - set { SetField15(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetField15(ulong value) { - PrepareBuilder(); - result.hasField15 = true; - result.field15_ = value; - return this; - } - public Builder ClearField15() { - PrepareBuilder(); - result.hasField15 = false; - result.field15_ = 0UL; - return this; - } - - public bool HasField5 { - get { return result.hasField5; } - } - public int Field5 { - get { return result.Field5; } - set { SetField5(value); } - } - public Builder SetField5(int value) { - PrepareBuilder(); - result.hasField5 = true; - result.field5_ = value; - return this; - } - public Builder ClearField5() { - PrepareBuilder(); - result.hasField5 = false; - result.field5_ = 0; - return this; - } - - public bool HasField27 { - get { return result.hasField27; } - } - public string Field27 { - get { return result.Field27; } - set { SetField27(value); } - } - public Builder SetField27(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField27 = true; - result.field27_ = value; - return this; - } - public Builder ClearField27() { - PrepareBuilder(); - result.hasField27 = false; - result.field27_ = ""; - return this; - } - - public bool HasField28 { - get { return result.hasField28; } - } - public int Field28 { - get { return result.Field28; } - set { SetField28(value); } - } - public Builder SetField28(int value) { - PrepareBuilder(); - result.hasField28 = true; - result.field28_ = value; - return this; - } - public Builder ClearField28() { - PrepareBuilder(); - result.hasField28 = false; - result.field28_ = 0; - return this; - } - - public bool HasField29 { - get { return result.hasField29; } - } - public string Field29 { - get { return result.Field29; } - set { SetField29(value); } - } - public Builder SetField29(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField29 = true; - result.field29_ = value; - return this; - } - public Builder ClearField29() { - PrepareBuilder(); - result.hasField29 = false; - result.field29_ = ""; - return this; - } - - public bool HasField16 { - get { return result.hasField16; } - } - public string Field16 { - get { return result.Field16; } - set { SetField16(value); } - } - public Builder SetField16(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField16 = true; - result.field16_ = value; - return this; - } - public Builder ClearField16() { - PrepareBuilder(); - result.hasField16 = false; - result.field16_ = ""; - return this; - } - - public pbc::IPopsicleList Field22List { - get { return PrepareBuilder().field22_; } - } - public int Field22Count { - get { return result.Field22Count; } - } - public string GetField22(int index) { - return result.GetField22(index); - } - public Builder SetField22(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.field22_[index] = value; - return this; - } - public Builder AddField22(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.field22_.Add(value); - return this; - } - public Builder AddRangeField22(scg::IEnumerable values) { - PrepareBuilder(); - result.field22_.Add(values); - return this; - } - public Builder ClearField22() { - PrepareBuilder(); - result.field22_.Clear(); - return this; - } - - public pbc::IPopsicleList Field73List { - get { return PrepareBuilder().field73_; } - } - public int Field73Count { - get { return result.Field73Count; } - } - public int GetField73(int index) { - return result.GetField73(index); - } - public Builder SetField73(int index, int value) { - PrepareBuilder(); - result.field73_[index] = value; - return this; - } - public Builder AddField73(int value) { - PrepareBuilder(); - result.field73_.Add(value); - return this; - } - public Builder AddRangeField73(scg::IEnumerable values) { - PrepareBuilder(); - result.field73_.Add(values); - return this; - } - public Builder ClearField73() { - PrepareBuilder(); - result.field73_.Clear(); - return this; - } - - public bool HasField20 { - get { return result.hasField20; } - } - public int Field20 { - get { return result.Field20; } - set { SetField20(value); } - } - public Builder SetField20(int value) { - PrepareBuilder(); - result.hasField20 = true; - result.field20_ = value; - return this; - } - public Builder ClearField20() { - PrepareBuilder(); - result.hasField20 = false; - result.field20_ = 0; - return this; - } - - public bool HasField24 { - get { return result.hasField24; } - } - public string Field24 { - get { return result.Field24; } - set { SetField24(value); } - } - public Builder SetField24(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField24 = true; - result.field24_ = value; - return this; - } - public Builder ClearField24() { - PrepareBuilder(); - result.hasField24 = false; - result.field24_ = ""; - return this; - } - - public bool HasField31 { - get { return result.hasField31; } - } - public global::Google.ProtocolBuffers.TestProtos.SizeMessage2GroupedMessage Field31 { - get { return result.Field31; } - set { SetField31(value); } - } - public Builder SetField31(global::Google.ProtocolBuffers.TestProtos.SizeMessage2GroupedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField31 = true; - result.field31_ = value; - return this; - } - public Builder SetField31(global::Google.ProtocolBuffers.TestProtos.SizeMessage2GroupedMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasField31 = true; - result.field31_ = builderForValue.Build(); - return this; - } - public Builder MergeField31(global::Google.ProtocolBuffers.TestProtos.SizeMessage2GroupedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasField31 && - result.field31_ != global::Google.ProtocolBuffers.TestProtos.SizeMessage2GroupedMessage.DefaultInstance) { - result.field31_ = global::Google.ProtocolBuffers.TestProtos.SizeMessage2GroupedMessage.CreateBuilder(result.field31_).MergeFrom(value).BuildPartial(); - } else { - result.field31_ = value; - } - result.hasField31 = true; - return this; - } - public Builder ClearField31() { - PrepareBuilder(); - result.hasField31 = false; - result.field31_ = null; - return this; - } - } - static Group1() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestGoogleSizeProtoFile.Descriptor, null); - } - } - - } - #endregion - - public const int Field1FieldNumber = 1; - private bool hasField1; - private string field1_ = ""; - public bool HasField1 { - get { return hasField1; } - } - public string Field1 { - get { return field1_; } - } - - public const int Field3FieldNumber = 3; - private bool hasField3; - private long field3_; - public bool HasField3 { - get { return hasField3; } - } - public long Field3 { - get { return field3_; } - } - - public const int Field4FieldNumber = 4; - private bool hasField4; - private long field4_; - public bool HasField4 { - get { return hasField4; } - } - public long Field4 { - get { return field4_; } - } - - public const int Field30FieldNumber = 30; - private bool hasField30; - private long field30_; - public bool HasField30 { - get { return hasField30; } - } - public long Field30 { - get { return field30_; } - } - - public const int Field75FieldNumber = 75; - private bool hasField75; - private bool field75_; - public bool HasField75 { - get { return hasField75; } - } - public bool Field75 { - get { return field75_; } - } - - public const int Field6FieldNumber = 6; - private bool hasField6; - private string field6_ = ""; - public bool HasField6 { - get { return hasField6; } - } - public string Field6 { - get { return field6_; } - } - - public const int Field2FieldNumber = 2; - private bool hasField2; - private pb::ByteString field2_ = pb::ByteString.Empty; - public bool HasField2 { - get { return hasField2; } - } - public pb::ByteString Field2 { - get { return field2_; } - } - - public const int Field21FieldNumber = 21; - private bool hasField21; - private int field21_; - public bool HasField21 { - get { return hasField21; } - } - public int Field21 { - get { return field21_; } - } - - public const int Field71FieldNumber = 71; - private bool hasField71; - private int field71_; - public bool HasField71 { - get { return hasField71; } - } - public int Field71 { - get { return field71_; } - } - - public const int Field25FieldNumber = 25; - private bool hasField25; - private float field25_; - public bool HasField25 { - get { return hasField25; } - } - public float Field25 { - get { return field25_; } - } - - public const int Field109FieldNumber = 109; - private bool hasField109; - private int field109_; - public bool HasField109 { - get { return hasField109; } - } - public int Field109 { - get { return field109_; } - } - - public const int Field210FieldNumber = 210; - private bool hasField210; - private int field210_; - public bool HasField210 { - get { return hasField210; } - } - public int Field210 { - get { return field210_; } - } - - public const int Field211FieldNumber = 211; - private bool hasField211; - private int field211_; - public bool HasField211 { - get { return hasField211; } - } - public int Field211 { - get { return field211_; } - } - - public const int Field212FieldNumber = 212; - private bool hasField212; - private int field212_; - public bool HasField212 { - get { return hasField212; } - } - public int Field212 { - get { return field212_; } - } - - public const int Field213FieldNumber = 213; - private bool hasField213; - private int field213_; - public bool HasField213 { - get { return hasField213; } - } - public int Field213 { - get { return field213_; } - } - - public const int Field216FieldNumber = 216; - private bool hasField216; - private int field216_; - public bool HasField216 { - get { return hasField216; } - } - public int Field216 { - get { return field216_; } - } - - public const int Field217FieldNumber = 217; - private bool hasField217; - private int field217_; - public bool HasField217 { - get { return hasField217; } - } - public int Field217 { - get { return field217_; } - } - - public const int Field218FieldNumber = 218; - private bool hasField218; - private int field218_; - public bool HasField218 { - get { return hasField218; } - } - public int Field218 { - get { return field218_; } - } - - public const int Field220FieldNumber = 220; - private bool hasField220; - private int field220_; - public bool HasField220 { - get { return hasField220; } - } - public int Field220 { - get { return field220_; } - } - - public const int Field221FieldNumber = 221; - private bool hasField221; - private int field221_; - public bool HasField221 { - get { return hasField221; } - } - public int Field221 { - get { return field221_; } - } - - public const int Field222FieldNumber = 222; - private bool hasField222; - private float field222_; - public bool HasField222 { - get { return hasField222; } - } - public float Field222 { - get { return field222_; } - } - - public const int Field63FieldNumber = 63; - private bool hasField63; - private int field63_; - public bool HasField63 { - get { return hasField63; } - } - public int Field63 { - get { return field63_; } - } - - public const int Group1FieldNumber = 10; - private pbc::PopsicleList group1_ = new pbc::PopsicleList(); - public scg::IList Group1List { - get { return group1_; } - } - public int Group1Count { - get { return group1_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.SizeMessage2.Types.Group1 GetGroup1(int index) { - return group1_[index]; - } - - public const int Field128FieldNumber = 128; - private pbc::PopsicleList field128_ = new pbc::PopsicleList(); - public scg::IList Field128List { - get { return pbc::Lists.AsReadOnly(field128_); } - } - public int Field128Count { - get { return field128_.Count; } - } - public string GetField128(int index) { - return field128_[index]; - } - - public const int Field131FieldNumber = 131; - private bool hasField131; - private long field131_; - public bool HasField131 { - get { return hasField131; } - } - public long Field131 { - get { return field131_; } - } - - public const int Field127FieldNumber = 127; - private pbc::PopsicleList field127_ = new pbc::PopsicleList(); - public scg::IList Field127List { - get { return pbc::Lists.AsReadOnly(field127_); } - } - public int Field127Count { - get { return field127_.Count; } - } - public string GetField127(int index) { - return field127_[index]; - } - - public const int Field129FieldNumber = 129; - private bool hasField129; - private int field129_; - public bool HasField129 { - get { return hasField129; } - } - public int Field129 { - get { return field129_; } - } - - public const int Field130FieldNumber = 130; - private pbc::PopsicleList field130_ = new pbc::PopsicleList(); - public scg::IList Field130List { - get { return pbc::Lists.AsReadOnly(field130_); } - } - public int Field130Count { - get { return field130_.Count; } - } - public long GetField130(int index) { - return field130_[index]; - } - - public const int Field205FieldNumber = 205; - private bool hasField205; - private bool field205_; - public bool HasField205 { - get { return hasField205; } - } - public bool Field205 { - get { return field205_; } - } - - public const int Field206FieldNumber = 206; - private bool hasField206; - private bool field206_; - public bool HasField206 { - get { return hasField206; } - } - public bool Field206 { - get { return field206_; } - } - - public static SizeMessage2 ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SizeMessage2 ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SizeMessage2 ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SizeMessage2 ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SizeMessage2 ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SizeMessage2 ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SizeMessage2 ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SizeMessage2 ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SizeMessage2 ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SizeMessage2 ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private SizeMessage2 MakeReadOnly() { - group1_.MakeReadOnly(); - field128_.MakeReadOnly(); - field127_.MakeReadOnly(); - field130_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SizeMessage2 prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(SizeMessage2 cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private SizeMessage2 result; - - private SizeMessage2 PrepareBuilder() { - if (resultIsReadOnly) { - SizeMessage2 original = result; - result = new SizeMessage2(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override SizeMessage2 MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.SizeMessage2.Descriptor; } - } - - public override SizeMessage2 DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.SizeMessage2.DefaultInstance; } - } - - public override SizeMessage2 BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - - public bool HasField1 { - get { return result.hasField1; } - } - public string Field1 { - get { return result.Field1; } - set { SetField1(value); } - } - public Builder SetField1(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField1 = true; - result.field1_ = value; - return this; - } - public Builder ClearField1() { - PrepareBuilder(); - result.hasField1 = false; - result.field1_ = ""; - return this; - } - - public bool HasField3 { - get { return result.hasField3; } - } - public long Field3 { - get { return result.Field3; } - set { SetField3(value); } - } - public Builder SetField3(long value) { - PrepareBuilder(); - result.hasField3 = true; - result.field3_ = value; - return this; - } - public Builder ClearField3() { - PrepareBuilder(); - result.hasField3 = false; - result.field3_ = 0L; - return this; - } - - public bool HasField4 { - get { return result.hasField4; } - } - public long Field4 { - get { return result.Field4; } - set { SetField4(value); } - } - public Builder SetField4(long value) { - PrepareBuilder(); - result.hasField4 = true; - result.field4_ = value; - return this; - } - public Builder ClearField4() { - PrepareBuilder(); - result.hasField4 = false; - result.field4_ = 0L; - return this; - } - - public bool HasField30 { - get { return result.hasField30; } - } - public long Field30 { - get { return result.Field30; } - set { SetField30(value); } - } - public Builder SetField30(long value) { - PrepareBuilder(); - result.hasField30 = true; - result.field30_ = value; - return this; - } - public Builder ClearField30() { - PrepareBuilder(); - result.hasField30 = false; - result.field30_ = 0L; - return this; - } - - public bool HasField75 { - get { return result.hasField75; } - } - public bool Field75 { - get { return result.Field75; } - set { SetField75(value); } - } - public Builder SetField75(bool value) { - PrepareBuilder(); - result.hasField75 = true; - result.field75_ = value; - return this; - } - public Builder ClearField75() { - PrepareBuilder(); - result.hasField75 = false; - result.field75_ = false; - return this; - } - - public bool HasField6 { - get { return result.hasField6; } - } - public string Field6 { - get { return result.Field6; } - set { SetField6(value); } - } - public Builder SetField6(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField6 = true; - result.field6_ = value; - return this; - } - public Builder ClearField6() { - PrepareBuilder(); - result.hasField6 = false; - result.field6_ = ""; - return this; - } - - public bool HasField2 { - get { return result.hasField2; } - } - public pb::ByteString Field2 { - get { return result.Field2; } - set { SetField2(value); } - } - public Builder SetField2(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField2 = true; - result.field2_ = value; - return this; - } - public Builder ClearField2() { - PrepareBuilder(); - result.hasField2 = false; - result.field2_ = pb::ByteString.Empty; - return this; - } - - public bool HasField21 { - get { return result.hasField21; } - } - public int Field21 { - get { return result.Field21; } - set { SetField21(value); } - } - public Builder SetField21(int value) { - PrepareBuilder(); - result.hasField21 = true; - result.field21_ = value; - return this; - } - public Builder ClearField21() { - PrepareBuilder(); - result.hasField21 = false; - result.field21_ = 0; - return this; - } - - public bool HasField71 { - get { return result.hasField71; } - } - public int Field71 { - get { return result.Field71; } - set { SetField71(value); } - } - public Builder SetField71(int value) { - PrepareBuilder(); - result.hasField71 = true; - result.field71_ = value; - return this; - } - public Builder ClearField71() { - PrepareBuilder(); - result.hasField71 = false; - result.field71_ = 0; - return this; - } - - public bool HasField25 { - get { return result.hasField25; } - } - public float Field25 { - get { return result.Field25; } - set { SetField25(value); } - } - public Builder SetField25(float value) { - PrepareBuilder(); - result.hasField25 = true; - result.field25_ = value; - return this; - } - public Builder ClearField25() { - PrepareBuilder(); - result.hasField25 = false; - result.field25_ = 0F; - return this; - } - - public bool HasField109 { - get { return result.hasField109; } - } - public int Field109 { - get { return result.Field109; } - set { SetField109(value); } - } - public Builder SetField109(int value) { - PrepareBuilder(); - result.hasField109 = true; - result.field109_ = value; - return this; - } - public Builder ClearField109() { - PrepareBuilder(); - result.hasField109 = false; - result.field109_ = 0; - return this; - } - - public bool HasField210 { - get { return result.hasField210; } - } - public int Field210 { - get { return result.Field210; } - set { SetField210(value); } - } - public Builder SetField210(int value) { - PrepareBuilder(); - result.hasField210 = true; - result.field210_ = value; - return this; - } - public Builder ClearField210() { - PrepareBuilder(); - result.hasField210 = false; - result.field210_ = 0; - return this; - } - - public bool HasField211 { - get { return result.hasField211; } - } - public int Field211 { - get { return result.Field211; } - set { SetField211(value); } - } - public Builder SetField211(int value) { - PrepareBuilder(); - result.hasField211 = true; - result.field211_ = value; - return this; - } - public Builder ClearField211() { - PrepareBuilder(); - result.hasField211 = false; - result.field211_ = 0; - return this; - } - - public bool HasField212 { - get { return result.hasField212; } - } - public int Field212 { - get { return result.Field212; } - set { SetField212(value); } - } - public Builder SetField212(int value) { - PrepareBuilder(); - result.hasField212 = true; - result.field212_ = value; - return this; - } - public Builder ClearField212() { - PrepareBuilder(); - result.hasField212 = false; - result.field212_ = 0; - return this; - } - - public bool HasField213 { - get { return result.hasField213; } - } - public int Field213 { - get { return result.Field213; } - set { SetField213(value); } - } - public Builder SetField213(int value) { - PrepareBuilder(); - result.hasField213 = true; - result.field213_ = value; - return this; - } - public Builder ClearField213() { - PrepareBuilder(); - result.hasField213 = false; - result.field213_ = 0; - return this; - } - - public bool HasField216 { - get { return result.hasField216; } - } - public int Field216 { - get { return result.Field216; } - set { SetField216(value); } - } - public Builder SetField216(int value) { - PrepareBuilder(); - result.hasField216 = true; - result.field216_ = value; - return this; - } - public Builder ClearField216() { - PrepareBuilder(); - result.hasField216 = false; - result.field216_ = 0; - return this; - } - - public bool HasField217 { - get { return result.hasField217; } - } - public int Field217 { - get { return result.Field217; } - set { SetField217(value); } - } - public Builder SetField217(int value) { - PrepareBuilder(); - result.hasField217 = true; - result.field217_ = value; - return this; - } - public Builder ClearField217() { - PrepareBuilder(); - result.hasField217 = false; - result.field217_ = 0; - return this; - } - - public bool HasField218 { - get { return result.hasField218; } - } - public int Field218 { - get { return result.Field218; } - set { SetField218(value); } - } - public Builder SetField218(int value) { - PrepareBuilder(); - result.hasField218 = true; - result.field218_ = value; - return this; - } - public Builder ClearField218() { - PrepareBuilder(); - result.hasField218 = false; - result.field218_ = 0; - return this; - } - - public bool HasField220 { - get { return result.hasField220; } - } - public int Field220 { - get { return result.Field220; } - set { SetField220(value); } - } - public Builder SetField220(int value) { - PrepareBuilder(); - result.hasField220 = true; - result.field220_ = value; - return this; - } - public Builder ClearField220() { - PrepareBuilder(); - result.hasField220 = false; - result.field220_ = 0; - return this; - } - - public bool HasField221 { - get { return result.hasField221; } - } - public int Field221 { - get { return result.Field221; } - set { SetField221(value); } - } - public Builder SetField221(int value) { - PrepareBuilder(); - result.hasField221 = true; - result.field221_ = value; - return this; - } - public Builder ClearField221() { - PrepareBuilder(); - result.hasField221 = false; - result.field221_ = 0; - return this; - } - - public bool HasField222 { - get { return result.hasField222; } - } - public float Field222 { - get { return result.Field222; } - set { SetField222(value); } - } - public Builder SetField222(float value) { - PrepareBuilder(); - result.hasField222 = true; - result.field222_ = value; - return this; - } - public Builder ClearField222() { - PrepareBuilder(); - result.hasField222 = false; - result.field222_ = 0F; - return this; - } - - public bool HasField63 { - get { return result.hasField63; } - } - public int Field63 { - get { return result.Field63; } - set { SetField63(value); } - } - public Builder SetField63(int value) { - PrepareBuilder(); - result.hasField63 = true; - result.field63_ = value; - return this; - } - public Builder ClearField63() { - PrepareBuilder(); - result.hasField63 = false; - result.field63_ = 0; - return this; - } - - public pbc::IPopsicleList Group1List { - get { return PrepareBuilder().group1_; } - } - public int Group1Count { - get { return result.Group1Count; } - } - public global::Google.ProtocolBuffers.TestProtos.SizeMessage2.Types.Group1 GetGroup1(int index) { - return result.GetGroup1(index); - } - public Builder SetGroup1(int index, global::Google.ProtocolBuffers.TestProtos.SizeMessage2.Types.Group1 value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.group1_[index] = value; - return this; - } - public Builder SetGroup1(int index, global::Google.ProtocolBuffers.TestProtos.SizeMessage2.Types.Group1.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.group1_[index] = builderForValue.Build(); - return this; - } - public Builder AddGroup1(global::Google.ProtocolBuffers.TestProtos.SizeMessage2.Types.Group1 value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.group1_.Add(value); - return this; - } - public Builder AddGroup1(global::Google.ProtocolBuffers.TestProtos.SizeMessage2.Types.Group1.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.group1_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeGroup1(scg::IEnumerable values) { - PrepareBuilder(); - result.group1_.Add(values); - return this; - } - public Builder ClearGroup1() { - PrepareBuilder(); - result.group1_.Clear(); - return this; - } - - public pbc::IPopsicleList Field128List { - get { return PrepareBuilder().field128_; } - } - public int Field128Count { - get { return result.Field128Count; } - } - public string GetField128(int index) { - return result.GetField128(index); - } - public Builder SetField128(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.field128_[index] = value; - return this; - } - public Builder AddField128(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.field128_.Add(value); - return this; - } - public Builder AddRangeField128(scg::IEnumerable values) { - PrepareBuilder(); - result.field128_.Add(values); - return this; - } - public Builder ClearField128() { - PrepareBuilder(); - result.field128_.Clear(); - return this; - } - - public bool HasField131 { - get { return result.hasField131; } - } - public long Field131 { - get { return result.Field131; } - set { SetField131(value); } - } - public Builder SetField131(long value) { - PrepareBuilder(); - result.hasField131 = true; - result.field131_ = value; - return this; - } - public Builder ClearField131() { - PrepareBuilder(); - result.hasField131 = false; - result.field131_ = 0L; - return this; - } - - public pbc::IPopsicleList Field127List { - get { return PrepareBuilder().field127_; } - } - public int Field127Count { - get { return result.Field127Count; } - } - public string GetField127(int index) { - return result.GetField127(index); - } - public Builder SetField127(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.field127_[index] = value; - return this; - } - public Builder AddField127(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.field127_.Add(value); - return this; - } - public Builder AddRangeField127(scg::IEnumerable values) { - PrepareBuilder(); - result.field127_.Add(values); - return this; - } - public Builder ClearField127() { - PrepareBuilder(); - result.field127_.Clear(); - return this; - } - - public bool HasField129 { - get { return result.hasField129; } - } - public int Field129 { - get { return result.Field129; } - set { SetField129(value); } - } - public Builder SetField129(int value) { - PrepareBuilder(); - result.hasField129 = true; - result.field129_ = value; - return this; - } - public Builder ClearField129() { - PrepareBuilder(); - result.hasField129 = false; - result.field129_ = 0; - return this; - } - - public pbc::IPopsicleList Field130List { - get { return PrepareBuilder().field130_; } - } - public int Field130Count { - get { return result.Field130Count; } - } - public long GetField130(int index) { - return result.GetField130(index); - } - public Builder SetField130(int index, long value) { - PrepareBuilder(); - result.field130_[index] = value; - return this; - } - public Builder AddField130(long value) { - PrepareBuilder(); - result.field130_.Add(value); - return this; - } - public Builder AddRangeField130(scg::IEnumerable values) { - PrepareBuilder(); - result.field130_.Add(values); - return this; - } - public Builder ClearField130() { - PrepareBuilder(); - result.field130_.Clear(); - return this; - } - - public bool HasField205 { - get { return result.hasField205; } - } - public bool Field205 { - get { return result.Field205; } - set { SetField205(value); } - } - public Builder SetField205(bool value) { - PrepareBuilder(); - result.hasField205 = true; - result.field205_ = value; - return this; - } - public Builder ClearField205() { - PrepareBuilder(); - result.hasField205 = false; - result.field205_ = false; - return this; - } - - public bool HasField206 { - get { return result.hasField206; } - } - public bool Field206 { - get { return result.Field206; } - set { SetField206(value); } - } - public Builder SetField206(bool value) { - PrepareBuilder(); - result.hasField206 = true; - result.field206_ = value; - return this; - } - public Builder ClearField206() { - PrepareBuilder(); - result.hasField206 = false; - result.field206_ = false; - return this; - } - } - static SizeMessage2() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestGoogleSizeProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class SizeMessage2GroupedMessage : pb::GeneratedMessage { - private SizeMessage2GroupedMessage() { } - private static readonly SizeMessage2GroupedMessage defaultInstance = new SizeMessage2GroupedMessage().MakeReadOnly(); - public static SizeMessage2GroupedMessage DefaultInstance { - get { return defaultInstance; } - } - - public override SizeMessage2GroupedMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override SizeMessage2GroupedMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestGoogleSizeProtoFile.internal__static_unittest_google_size_SizeMessage2GroupedMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestGoogleSizeProtoFile.internal__static_unittest_google_size_SizeMessage2GroupedMessage__FieldAccessorTable; } - } - - public const int Field1FieldNumber = 1; - private bool hasField1; - private float field1_; - public bool HasField1 { - get { return hasField1; } - } - public float Field1 { - get { return field1_; } - } - - public const int Field2FieldNumber = 2; - private bool hasField2; - private float field2_; - public bool HasField2 { - get { return hasField2; } - } - public float Field2 { - get { return field2_; } - } - - public const int Field3FieldNumber = 3; - private bool hasField3; - private float field3_; - public bool HasField3 { - get { return hasField3; } - } - public float Field3 { - get { return field3_; } - } - - public const int Field4FieldNumber = 4; - private bool hasField4; - private bool field4_; - public bool HasField4 { - get { return hasField4; } - } - public bool Field4 { - get { return field4_; } - } - - public const int Field5FieldNumber = 5; - private bool hasField5; - private bool field5_; - public bool HasField5 { - get { return hasField5; } - } - public bool Field5 { - get { return field5_; } - } - - public const int Field6FieldNumber = 6; - private bool hasField6; - private bool field6_ = true; - public bool HasField6 { - get { return hasField6; } - } - public bool Field6 { - get { return field6_; } - } - - public const int Field7FieldNumber = 7; - private bool hasField7; - private bool field7_; - public bool HasField7 { - get { return hasField7; } - } - public bool Field7 { - get { return field7_; } - } - - public const int Field8FieldNumber = 8; - private bool hasField8; - private float field8_; - public bool HasField8 { - get { return hasField8; } - } - public float Field8 { - get { return field8_; } - } - - public const int Field9FieldNumber = 9; - private bool hasField9; - private bool field9_; - public bool HasField9 { - get { return hasField9; } - } - public bool Field9 { - get { return field9_; } - } - - public const int Field10FieldNumber = 10; - private bool hasField10; - private float field10_; - public bool HasField10 { - get { return hasField10; } - } - public float Field10 { - get { return field10_; } - } - - public const int Field11FieldNumber = 11; - private bool hasField11; - private long field11_; - public bool HasField11 { - get { return hasField11; } - } - public long Field11 { - get { return field11_; } - } - - public static SizeMessage2GroupedMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SizeMessage2GroupedMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SizeMessage2GroupedMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SizeMessage2GroupedMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SizeMessage2GroupedMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SizeMessage2GroupedMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SizeMessage2GroupedMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SizeMessage2GroupedMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SizeMessage2GroupedMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SizeMessage2GroupedMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private SizeMessage2GroupedMessage MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SizeMessage2GroupedMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(SizeMessage2GroupedMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private SizeMessage2GroupedMessage result; - - private SizeMessage2GroupedMessage PrepareBuilder() { - if (resultIsReadOnly) { - SizeMessage2GroupedMessage original = result; - result = new SizeMessage2GroupedMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override SizeMessage2GroupedMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.SizeMessage2GroupedMessage.Descriptor; } - } - - public override SizeMessage2GroupedMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.SizeMessage2GroupedMessage.DefaultInstance; } - } - - public override SizeMessage2GroupedMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - - public bool HasField1 { - get { return result.hasField1; } - } - public float Field1 { - get { return result.Field1; } - set { SetField1(value); } - } - public Builder SetField1(float value) { - PrepareBuilder(); - result.hasField1 = true; - result.field1_ = value; - return this; - } - public Builder ClearField1() { - PrepareBuilder(); - result.hasField1 = false; - result.field1_ = 0F; - return this; - } - - public bool HasField2 { - get { return result.hasField2; } - } - public float Field2 { - get { return result.Field2; } - set { SetField2(value); } - } - public Builder SetField2(float value) { - PrepareBuilder(); - result.hasField2 = true; - result.field2_ = value; - return this; - } - public Builder ClearField2() { - PrepareBuilder(); - result.hasField2 = false; - result.field2_ = 0F; - return this; - } - - public bool HasField3 { - get { return result.hasField3; } - } - public float Field3 { - get { return result.Field3; } - set { SetField3(value); } - } - public Builder SetField3(float value) { - PrepareBuilder(); - result.hasField3 = true; - result.field3_ = value; - return this; - } - public Builder ClearField3() { - PrepareBuilder(); - result.hasField3 = false; - result.field3_ = 0F; - return this; - } - - public bool HasField4 { - get { return result.hasField4; } - } - public bool Field4 { - get { return result.Field4; } - set { SetField4(value); } - } - public Builder SetField4(bool value) { - PrepareBuilder(); - result.hasField4 = true; - result.field4_ = value; - return this; - } - public Builder ClearField4() { - PrepareBuilder(); - result.hasField4 = false; - result.field4_ = false; - return this; - } - - public bool HasField5 { - get { return result.hasField5; } - } - public bool Field5 { - get { return result.Field5; } - set { SetField5(value); } - } - public Builder SetField5(bool value) { - PrepareBuilder(); - result.hasField5 = true; - result.field5_ = value; - return this; - } - public Builder ClearField5() { - PrepareBuilder(); - result.hasField5 = false; - result.field5_ = false; - return this; - } - - public bool HasField6 { - get { return result.hasField6; } - } - public bool Field6 { - get { return result.Field6; } - set { SetField6(value); } - } - public Builder SetField6(bool value) { - PrepareBuilder(); - result.hasField6 = true; - result.field6_ = value; - return this; - } - public Builder ClearField6() { - PrepareBuilder(); - result.hasField6 = false; - result.field6_ = true; - return this; - } - - public bool HasField7 { - get { return result.hasField7; } - } - public bool Field7 { - get { return result.Field7; } - set { SetField7(value); } - } - public Builder SetField7(bool value) { - PrepareBuilder(); - result.hasField7 = true; - result.field7_ = value; - return this; - } - public Builder ClearField7() { - PrepareBuilder(); - result.hasField7 = false; - result.field7_ = false; - return this; - } - - public bool HasField8 { - get { return result.hasField8; } - } - public float Field8 { - get { return result.Field8; } - set { SetField8(value); } - } - public Builder SetField8(float value) { - PrepareBuilder(); - result.hasField8 = true; - result.field8_ = value; - return this; - } - public Builder ClearField8() { - PrepareBuilder(); - result.hasField8 = false; - result.field8_ = 0F; - return this; - } - - public bool HasField9 { - get { return result.hasField9; } - } - public bool Field9 { - get { return result.Field9; } - set { SetField9(value); } - } - public Builder SetField9(bool value) { - PrepareBuilder(); - result.hasField9 = true; - result.field9_ = value; - return this; - } - public Builder ClearField9() { - PrepareBuilder(); - result.hasField9 = false; - result.field9_ = false; - return this; - } - - public bool HasField10 { - get { return result.hasField10; } - } - public float Field10 { - get { return result.Field10; } - set { SetField10(value); } - } - public Builder SetField10(float value) { - PrepareBuilder(); - result.hasField10 = true; - result.field10_ = value; - return this; - } - public Builder ClearField10() { - PrepareBuilder(); - result.hasField10 = false; - result.field10_ = 0F; - return this; - } - - public bool HasField11 { - get { return result.hasField11; } - } - public long Field11 { - get { return result.Field11; } - set { SetField11(value); } - } - public Builder SetField11(long value) { - PrepareBuilder(); - result.hasField11 = true; - result.field11_ = value; - return this; - } - public Builder ClearField11() { - PrepareBuilder(); - result.hasField11 = false; - result.field11_ = 0L; - return this; - } - } - static SizeMessage2GroupedMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestGoogleSizeProtoFile.Descriptor, null); - } - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestGoogleSpeedProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestGoogleSpeedProtoFile.cs deleted file mode 100644 index ffa0e44..0000000 --- a/src/ProtocolBuffers.Test/TestProtos/UnitTestGoogleSpeedProtoFile.cs +++ /dev/null @@ -1,6638 +0,0 @@ -// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.TestProtos { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class UnitTestGoogleSpeedProtoFile { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_unittest_google_speed_SpeedMessage1__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_google_speed_SpeedMessage1__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_unittest_google_speed_SpeedMessage1SubMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_google_speed_SpeedMessage1SubMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_unittest_google_speed_SpeedMessage2__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_google_speed_SpeedMessage2__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_unittest_google_speed_SpeedMessage2_Group1__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_google_speed_SpeedMessage2_Group1__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_unittest_google_speed_SpeedMessage2GroupedMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_google_speed_SpeedMessage2GroupedMessage__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static UnitTestGoogleSpeedProtoFile() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "Ch5nb29nbGUvdGVzdC9nb29nbGVfc3BlZWQucHJvdG8SFXVuaXR0ZXN0X2dv", - "b2dsZV9zcGVlZBokZ29vZ2xlL3Byb3RvYnVmL2NzaGFycF9vcHRpb25zLnBy", - "b3RvIoMHCg1TcGVlZE1lc3NhZ2UxEg4KBmZpZWxkMRgBIAIoCRIOCgZmaWVs", - "ZDkYCSABKAkSDwoHZmllbGQxOBgSIAEoCRIWCgdmaWVsZDgwGFAgASgIOgVm", - "YWxzZRIVCgdmaWVsZDgxGFEgASgIOgR0cnVlEg4KBmZpZWxkMhgCIAIoBRIO", - "CgZmaWVsZDMYAyACKAUSEQoIZmllbGQyODAYmAIgASgFEhEKBmZpZWxkNhgG", - "IAEoBToBMBIPCgdmaWVsZDIyGBYgASgDEg4KBmZpZWxkNBgEIAEoCRIOCgZm", - "aWVsZDUYBSADKAYSFgoHZmllbGQ1ORg7IAEoCDoFZmFsc2USDgoGZmllbGQ3", - "GAcgASgJEg8KB2ZpZWxkMTYYECABKAUSFAoIZmllbGQxMzAYggEgASgFOgEw", - "EhUKB2ZpZWxkMTIYDCABKAg6BHRydWUSFQoHZmllbGQxNxgRIAEoCDoEdHJ1", - "ZRIVCgdmaWVsZDEzGA0gASgIOgR0cnVlEhUKB2ZpZWxkMTQYDiABKAg6BHRy", - "dWUSEwoIZmllbGQxMDQYaCABKAU6ATASEwoIZmllbGQxMDAYZCABKAU6ATAS", - "EwoIZmllbGQxMDEYZSABKAU6ATASEAoIZmllbGQxMDIYZiABKAkSEAoIZmll", - "bGQxMDMYZyABKAkSEgoHZmllbGQyORgdIAEoBToBMBIWCgdmaWVsZDMwGB4g", - "ASgIOgVmYWxzZRITCgdmaWVsZDYwGDwgASgFOgItMRIVCghmaWVsZDI3MRiP", - "AiABKAU6Ai0xEhUKCGZpZWxkMjcyGJACIAEoBToCLTESEQoIZmllbGQxNTAY", - "lgEgASgFEhIKB2ZpZWxkMjMYFyABKAU6ATASFgoHZmllbGQyNBgYIAEoCDoF", - "ZmFsc2USEgoHZmllbGQyNRgZIAEoBToBMBI/CgdmaWVsZDE1GA8gASgLMi4u", - "dW5pdHRlc3RfZ29vZ2xlX3NwZWVkLlNwZWVkTWVzc2FnZTFTdWJNZXNzYWdl", - "Eg8KB2ZpZWxkNzgYTiABKAgSEgoHZmllbGQ2NxhDIAEoBToBMBIPCgdmaWVs", - "ZDY4GEQgASgFEhQKCGZpZWxkMTI4GIABIAEoBToBMBIoCghmaWVsZDEyORiB", - "ASABKAk6FXh4eHh4eHh4eHh4eHh4eHh4eHh4eBIUCghmaWVsZDEzMRiDASAB", - "KAU6ATAiogMKF1NwZWVkTWVzc2FnZTFTdWJNZXNzYWdlEhEKBmZpZWxkMRgB", - "IAEoBToBMBIRCgZmaWVsZDIYAiABKAU6ATASEQoGZmllbGQzGAMgASgFOgEw", - "Eg8KB2ZpZWxkMTUYDyABKAkSFQoHZmllbGQxMhgMIAEoCDoEdHJ1ZRIPCgdm", - "aWVsZDEzGA0gASgDEg8KB2ZpZWxkMTQYDiABKAMSDwoHZmllbGQxNhgQIAEo", - "BRISCgdmaWVsZDE5GBMgASgFOgEyEhUKB2ZpZWxkMjAYFCABKAg6BHRydWUS", - "FQoHZmllbGQyOBgcIAEoCDoEdHJ1ZRIPCgdmaWVsZDIxGBUgASgGEg8KB2Zp", - "ZWxkMjIYFiABKAUSFgoHZmllbGQyMxgXIAEoCDoFZmFsc2USGAoIZmllbGQy", - "MDYYzgEgASgIOgVmYWxzZRIRCghmaWVsZDIwMxjLASABKAcSEQoIZmllbGQy", - "MDQYzAEgASgFEhEKCGZpZWxkMjA1GM0BIAEoCRIRCghmaWVsZDIwNxjPASAB", - "KAQSEQoIZmllbGQzMDAYrAIgASgEIuAHCg1TcGVlZE1lc3NhZ2UyEg4KBmZp", - "ZWxkMRgBIAEoCRIOCgZmaWVsZDMYAyABKAMSDgoGZmllbGQ0GAQgASgDEg8K", - "B2ZpZWxkMzAYHiABKAMSFgoHZmllbGQ3NRhLIAEoCDoFZmFsc2USDgoGZmll", - "bGQ2GAYgASgJEg4KBmZpZWxkMhgCIAEoDBISCgdmaWVsZDIxGBUgASgFOgEw", - "Eg8KB2ZpZWxkNzEYRyABKAUSDwoHZmllbGQyNRgZIAEoAhITCghmaWVsZDEw", - "ORhtIAEoBToBMBIUCghmaWVsZDIxMBjSASABKAU6ATASFAoIZmllbGQyMTEY", - "0wEgASgFOgEwEhQKCGZpZWxkMjEyGNQBIAEoBToBMBIUCghmaWVsZDIxMxjV", - "ASABKAU6ATASFAoIZmllbGQyMTYY2AEgASgFOgEwEhQKCGZpZWxkMjE3GNkB", - "IAEoBToBMBIUCghmaWVsZDIxOBjaASABKAU6ATASFAoIZmllbGQyMjAY3AEg", - "ASgFOgEwEhQKCGZpZWxkMjIxGN0BIAEoBToBMBIUCghmaWVsZDIyMhjeASAB", - "KAI6ATASDwoHZmllbGQ2Mxg/IAEoBRI7CgZncm91cDEYCiADKAoyKy51bml0", - "dGVzdF9nb29nbGVfc3BlZWQuU3BlZWRNZXNzYWdlMi5Hcm91cDESEQoIZmll", - "bGQxMjgYgAEgAygJEhEKCGZpZWxkMTMxGIMBIAEoAxIQCghmaWVsZDEyNxh/", - "IAMoCRIRCghmaWVsZDEyORiBASABKAUSEQoIZmllbGQxMzAYggEgAygDEhgK", - "CGZpZWxkMjA1GM0BIAEoCDoFZmFsc2USGAoIZmllbGQyMDYYzgEgASgIOgVm", - "YWxzZRrOAgoGR3JvdXAxEg8KB2ZpZWxkMTEYCyACKAISDwoHZmllbGQyNhga", - "IAEoAhIPCgdmaWVsZDEyGAwgASgJEg8KB2ZpZWxkMTMYDSABKAkSDwoHZmll", - "bGQxNBgOIAMoCRIPCgdmaWVsZDE1GA8gAigEEg4KBmZpZWxkNRgFIAEoBRIP", - "CgdmaWVsZDI3GBsgASgJEg8KB2ZpZWxkMjgYHCABKAUSDwoHZmllbGQyORgd", - "IAEoCRIPCgdmaWVsZDE2GBAgASgJEg8KB2ZpZWxkMjIYFiADKAkSDwoHZmll", - "bGQ3MxhJIAMoBRISCgdmaWVsZDIwGBQgASgFOgEwEg8KB2ZpZWxkMjQYGCAB", - "KAkSQwoHZmllbGQzMRgfIAEoCzIyLnVuaXR0ZXN0X2dvb2dsZV9zcGVlZC5T", - "cGVlZE1lc3NhZ2UyR3JvdXBlZE1lc3NhZ2Ui3wEKG1NwZWVkTWVzc2FnZTJH", - "cm91cGVkTWVzc2FnZRIOCgZmaWVsZDEYASABKAISDgoGZmllbGQyGAIgASgC", - "EhEKBmZpZWxkMxgDIAEoAjoBMBIOCgZmaWVsZDQYBCABKAgSDgoGZmllbGQ1", - "GAUgASgIEhQKBmZpZWxkNhgGIAEoCDoEdHJ1ZRIVCgZmaWVsZDcYByABKAg6", - "BWZhbHNlEg4KBmZpZWxkOBgIIAEoAhIOCgZmaWVsZDkYCSABKAgSDwoHZmll", - "bGQxMBgKIAEoAhIPCgdmaWVsZDExGAsgASgDQlNCC0dvb2dsZVNwZWVkSAHC", - "PkEKIUdvb2dsZS5Qcm90b2NvbEJ1ZmZlcnMuVGVzdFByb3RvcxIcVW5pdFRl", - "c3RHb29nbGVTcGVlZFByb3RvRmlsZQ==")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_unittest_google_speed_SpeedMessage1__Descriptor = Descriptor.MessageTypes[0]; - internal__static_unittest_google_speed_SpeedMessage1__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_unittest_google_speed_SpeedMessage1__Descriptor, - new string[] { "Field1", "Field9", "Field18", "Field80", "Field81", "Field2", "Field3", "Field280", "Field6", "Field22", "Field4", "Field5", "Field59", "Field7", "Field16", "Field130", "Field12", "Field17", "Field13", "Field14", "Field104", "Field100", "Field101", "Field102", "Field103", "Field29", "Field30", "Field60", "Field271", "Field272", "Field150", "Field23", "Field24", "Field25", "Field15", "Field78", "Field67", "Field68", "Field128", "Field129", "Field131", }); - internal__static_unittest_google_speed_SpeedMessage1SubMessage__Descriptor = Descriptor.MessageTypes[1]; - internal__static_unittest_google_speed_SpeedMessage1SubMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_unittest_google_speed_SpeedMessage1SubMessage__Descriptor, - new string[] { "Field1", "Field2", "Field3", "Field15", "Field12", "Field13", "Field14", "Field16", "Field19", "Field20", "Field28", "Field21", "Field22", "Field23", "Field206", "Field203", "Field204", "Field205", "Field207", "Field300", }); - internal__static_unittest_google_speed_SpeedMessage2__Descriptor = Descriptor.MessageTypes[2]; - internal__static_unittest_google_speed_SpeedMessage2__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_unittest_google_speed_SpeedMessage2__Descriptor, - new string[] { "Field1", "Field3", "Field4", "Field30", "Field75", "Field6", "Field2", "Field21", "Field71", "Field25", "Field109", "Field210", "Field211", "Field212", "Field213", "Field216", "Field217", "Field218", "Field220", "Field221", "Field222", "Field63", "Group1", "Field128", "Field131", "Field127", "Field129", "Field130", "Field205", "Field206", }); - internal__static_unittest_google_speed_SpeedMessage2_Group1__Descriptor = internal__static_unittest_google_speed_SpeedMessage2__Descriptor.NestedTypes[0]; - internal__static_unittest_google_speed_SpeedMessage2_Group1__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_unittest_google_speed_SpeedMessage2_Group1__Descriptor, - new string[] { "Field11", "Field26", "Field12", "Field13", "Field14", "Field15", "Field5", "Field27", "Field28", "Field29", "Field16", "Field22", "Field73", "Field20", "Field24", "Field31", }); - internal__static_unittest_google_speed_SpeedMessage2GroupedMessage__Descriptor = Descriptor.MessageTypes[3]; - internal__static_unittest_google_speed_SpeedMessage2GroupedMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_unittest_google_speed_SpeedMessage2GroupedMessage__Descriptor, - new string[] { "Field1", "Field2", "Field3", "Field4", "Field5", "Field6", "Field7", "Field8", "Field9", "Field10", "Field11", }); - pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); - RegisterAllExtensions(registry); - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.RegisterAllExtensions(registry); - return registry; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, - }, assigner); - } - #endregion - - } - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class SpeedMessage1 : pb::GeneratedMessage { - private SpeedMessage1() { } - private static readonly SpeedMessage1 defaultInstance = new SpeedMessage1().MakeReadOnly(); - private static readonly string[] _speedMessage1FieldNames = new string[] { "field1", "field100", "field101", "field102", "field103", "field104", "field12", "field128", "field129", "field13", "field130", "field131", "field14", "field15", "field150", "field16", "field17", "field18", "field2", "field22", "field23", "field24", "field25", "field271", "field272", "field280", "field29", "field3", "field30", "field4", "field5", "field59", "field6", "field60", "field67", "field68", "field7", "field78", "field80", "field81", "field9" }; - private static readonly uint[] _speedMessage1FieldTags = new uint[] { 10, 800, 808, 818, 826, 832, 96, 1024, 1034, 104, 1040, 1048, 112, 122, 1200, 128, 136, 146, 16, 176, 184, 192, 200, 2168, 2176, 2240, 232, 24, 240, 34, 41, 472, 48, 480, 536, 544, 58, 624, 640, 648, 74 }; - public static SpeedMessage1 DefaultInstance { - get { return defaultInstance; } - } - - public override SpeedMessage1 DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override SpeedMessage1 ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestGoogleSpeedProtoFile.internal__static_unittest_google_speed_SpeedMessage1__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestGoogleSpeedProtoFile.internal__static_unittest_google_speed_SpeedMessage1__FieldAccessorTable; } - } - - public const int Field1FieldNumber = 1; - private bool hasField1; - private string field1_ = ""; - public bool HasField1 { - get { return hasField1; } - } - public string Field1 { - get { return field1_; } - } - - public const int Field9FieldNumber = 9; - private bool hasField9; - private string field9_ = ""; - public bool HasField9 { - get { return hasField9; } - } - public string Field9 { - get { return field9_; } - } - - public const int Field18FieldNumber = 18; - private bool hasField18; - private string field18_ = ""; - public bool HasField18 { - get { return hasField18; } - } - public string Field18 { - get { return field18_; } - } - - public const int Field80FieldNumber = 80; - private bool hasField80; - private bool field80_; - public bool HasField80 { - get { return hasField80; } - } - public bool Field80 { - get { return field80_; } - } - - public const int Field81FieldNumber = 81; - private bool hasField81; - private bool field81_ = true; - public bool HasField81 { - get { return hasField81; } - } - public bool Field81 { - get { return field81_; } - } - - public const int Field2FieldNumber = 2; - private bool hasField2; - private int field2_; - public bool HasField2 { - get { return hasField2; } - } - public int Field2 { - get { return field2_; } - } - - public const int Field3FieldNumber = 3; - private bool hasField3; - private int field3_; - public bool HasField3 { - get { return hasField3; } - } - public int Field3 { - get { return field3_; } - } - - public const int Field280FieldNumber = 280; - private bool hasField280; - private int field280_; - public bool HasField280 { - get { return hasField280; } - } - public int Field280 { - get { return field280_; } - } - - public const int Field6FieldNumber = 6; - private bool hasField6; - private int field6_; - public bool HasField6 { - get { return hasField6; } - } - public int Field6 { - get { return field6_; } - } - - public const int Field22FieldNumber = 22; - private bool hasField22; - private long field22_; - public bool HasField22 { - get { return hasField22; } - } - public long Field22 { - get { return field22_; } - } - - public const int Field4FieldNumber = 4; - private bool hasField4; - private string field4_ = ""; - public bool HasField4 { - get { return hasField4; } - } - public string Field4 { - get { return field4_; } - } - - public const int Field5FieldNumber = 5; - private pbc::PopsicleList field5_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList Field5List { - get { return pbc::Lists.AsReadOnly(field5_); } - } - public int Field5Count { - get { return field5_.Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetField5(int index) { - return field5_[index]; - } - - public const int Field59FieldNumber = 59; - private bool hasField59; - private bool field59_; - public bool HasField59 { - get { return hasField59; } - } - public bool Field59 { - get { return field59_; } - } - - public const int Field7FieldNumber = 7; - private bool hasField7; - private string field7_ = ""; - public bool HasField7 { - get { return hasField7; } - } - public string Field7 { - get { return field7_; } - } - - public const int Field16FieldNumber = 16; - private bool hasField16; - private int field16_; - public bool HasField16 { - get { return hasField16; } - } - public int Field16 { - get { return field16_; } - } - - public const int Field130FieldNumber = 130; - private bool hasField130; - private int field130_; - public bool HasField130 { - get { return hasField130; } - } - public int Field130 { - get { return field130_; } - } - - public const int Field12FieldNumber = 12; - private bool hasField12; - private bool field12_ = true; - public bool HasField12 { - get { return hasField12; } - } - public bool Field12 { - get { return field12_; } - } - - public const int Field17FieldNumber = 17; - private bool hasField17; - private bool field17_ = true; - public bool HasField17 { - get { return hasField17; } - } - public bool Field17 { - get { return field17_; } - } - - public const int Field13FieldNumber = 13; - private bool hasField13; - private bool field13_ = true; - public bool HasField13 { - get { return hasField13; } - } - public bool Field13 { - get { return field13_; } - } - - public const int Field14FieldNumber = 14; - private bool hasField14; - private bool field14_ = true; - public bool HasField14 { - get { return hasField14; } - } - public bool Field14 { - get { return field14_; } - } - - public const int Field104FieldNumber = 104; - private bool hasField104; - private int field104_; - public bool HasField104 { - get { return hasField104; } - } - public int Field104 { - get { return field104_; } - } - - public const int Field100FieldNumber = 100; - private bool hasField100; - private int field100_; - public bool HasField100 { - get { return hasField100; } - } - public int Field100 { - get { return field100_; } - } - - public const int Field101FieldNumber = 101; - private bool hasField101; - private int field101_; - public bool HasField101 { - get { return hasField101; } - } - public int Field101 { - get { return field101_; } - } - - public const int Field102FieldNumber = 102; - private bool hasField102; - private string field102_ = ""; - public bool HasField102 { - get { return hasField102; } - } - public string Field102 { - get { return field102_; } - } - - public const int Field103FieldNumber = 103; - private bool hasField103; - private string field103_ = ""; - public bool HasField103 { - get { return hasField103; } - } - public string Field103 { - get { return field103_; } - } - - public const int Field29FieldNumber = 29; - private bool hasField29; - private int field29_; - public bool HasField29 { - get { return hasField29; } - } - public int Field29 { - get { return field29_; } - } - - public const int Field30FieldNumber = 30; - private bool hasField30; - private bool field30_; - public bool HasField30 { - get { return hasField30; } - } - public bool Field30 { - get { return field30_; } - } - - public const int Field60FieldNumber = 60; - private bool hasField60; - private int field60_ = -1; - public bool HasField60 { - get { return hasField60; } - } - public int Field60 { - get { return field60_; } - } - - public const int Field271FieldNumber = 271; - private bool hasField271; - private int field271_ = -1; - public bool HasField271 { - get { return hasField271; } - } - public int Field271 { - get { return field271_; } - } - - public const int Field272FieldNumber = 272; - private bool hasField272; - private int field272_ = -1; - public bool HasField272 { - get { return hasField272; } - } - public int Field272 { - get { return field272_; } - } - - public const int Field150FieldNumber = 150; - private bool hasField150; - private int field150_; - public bool HasField150 { - get { return hasField150; } - } - public int Field150 { - get { return field150_; } - } - - public const int Field23FieldNumber = 23; - private bool hasField23; - private int field23_; - public bool HasField23 { - get { return hasField23; } - } - public int Field23 { - get { return field23_; } - } - - public const int Field24FieldNumber = 24; - private bool hasField24; - private bool field24_; - public bool HasField24 { - get { return hasField24; } - } - public bool Field24 { - get { return field24_; } - } - - public const int Field25FieldNumber = 25; - private bool hasField25; - private int field25_; - public bool HasField25 { - get { return hasField25; } - } - public int Field25 { - get { return field25_; } - } - - public const int Field15FieldNumber = 15; - private bool hasField15; - private global::Google.ProtocolBuffers.TestProtos.SpeedMessage1SubMessage field15_; - public bool HasField15 { - get { return hasField15; } - } - public global::Google.ProtocolBuffers.TestProtos.SpeedMessage1SubMessage Field15 { - get { return field15_ ?? global::Google.ProtocolBuffers.TestProtos.SpeedMessage1SubMessage.DefaultInstance; } - } - - public const int Field78FieldNumber = 78; - private bool hasField78; - private bool field78_; - public bool HasField78 { - get { return hasField78; } - } - public bool Field78 { - get { return field78_; } - } - - public const int Field67FieldNumber = 67; - private bool hasField67; - private int field67_; - public bool HasField67 { - get { return hasField67; } - } - public int Field67 { - get { return field67_; } - } - - public const int Field68FieldNumber = 68; - private bool hasField68; - private int field68_; - public bool HasField68 { - get { return hasField68; } - } - public int Field68 { - get { return field68_; } - } - - public const int Field128FieldNumber = 128; - private bool hasField128; - private int field128_; - public bool HasField128 { - get { return hasField128; } - } - public int Field128 { - get { return field128_; } - } - - public const int Field129FieldNumber = 129; - private bool hasField129; - private string field129_ = "xxxxxxxxxxxxxxxxxxxxx"; - public bool HasField129 { - get { return hasField129; } - } - public string Field129 { - get { return field129_; } - } - - public const int Field131FieldNumber = 131; - private bool hasField131; - private int field131_; - public bool HasField131 { - get { return hasField131; } - } - public int Field131 { - get { return field131_; } - } - - public override bool IsInitialized { - get { - if (!hasField1) return false; - if (!hasField2) return false; - if (!hasField3) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _speedMessage1FieldNames; - if (hasField1) { - output.WriteString(1, field_names[0], Field1); - } - if (hasField2) { - output.WriteInt32(2, field_names[18], Field2); - } - if (hasField3) { - output.WriteInt32(3, field_names[27], Field3); - } - if (hasField4) { - output.WriteString(4, field_names[29], Field4); - } - if (field5_.Count > 0) { - output.WriteFixed64Array(5, field_names[30], field5_); - } - if (hasField6) { - output.WriteInt32(6, field_names[32], Field6); - } - if (hasField7) { - output.WriteString(7, field_names[36], Field7); - } - if (hasField9) { - output.WriteString(9, field_names[40], Field9); - } - if (hasField12) { - output.WriteBool(12, field_names[6], Field12); - } - if (hasField13) { - output.WriteBool(13, field_names[9], Field13); - } - if (hasField14) { - output.WriteBool(14, field_names[12], Field14); - } - if (hasField15) { - output.WriteMessage(15, field_names[13], Field15); - } - if (hasField16) { - output.WriteInt32(16, field_names[15], Field16); - } - if (hasField17) { - output.WriteBool(17, field_names[16], Field17); - } - if (hasField18) { - output.WriteString(18, field_names[17], Field18); - } - if (hasField22) { - output.WriteInt64(22, field_names[19], Field22); - } - if (hasField23) { - output.WriteInt32(23, field_names[20], Field23); - } - if (hasField24) { - output.WriteBool(24, field_names[21], Field24); - } - if (hasField25) { - output.WriteInt32(25, field_names[22], Field25); - } - if (hasField29) { - output.WriteInt32(29, field_names[26], Field29); - } - if (hasField30) { - output.WriteBool(30, field_names[28], Field30); - } - if (hasField59) { - output.WriteBool(59, field_names[31], Field59); - } - if (hasField60) { - output.WriteInt32(60, field_names[33], Field60); - } - if (hasField67) { - output.WriteInt32(67, field_names[34], Field67); - } - if (hasField68) { - output.WriteInt32(68, field_names[35], Field68); - } - if (hasField78) { - output.WriteBool(78, field_names[37], Field78); - } - if (hasField80) { - output.WriteBool(80, field_names[38], Field80); - } - if (hasField81) { - output.WriteBool(81, field_names[39], Field81); - } - if (hasField100) { - output.WriteInt32(100, field_names[1], Field100); - } - if (hasField101) { - output.WriteInt32(101, field_names[2], Field101); - } - if (hasField102) { - output.WriteString(102, field_names[3], Field102); - } - if (hasField103) { - output.WriteString(103, field_names[4], Field103); - } - if (hasField104) { - output.WriteInt32(104, field_names[5], Field104); - } - if (hasField128) { - output.WriteInt32(128, field_names[7], Field128); - } - if (hasField129) { - output.WriteString(129, field_names[8], Field129); - } - if (hasField130) { - output.WriteInt32(130, field_names[10], Field130); - } - if (hasField131) { - output.WriteInt32(131, field_names[11], Field131); - } - if (hasField150) { - output.WriteInt32(150, field_names[14], Field150); - } - if (hasField271) { - output.WriteInt32(271, field_names[23], Field271); - } - if (hasField272) { - output.WriteInt32(272, field_names[24], Field272); - } - if (hasField280) { - output.WriteInt32(280, field_names[25], Field280); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasField1) { - size += pb::CodedOutputStream.ComputeStringSize(1, Field1); - } - if (hasField9) { - size += pb::CodedOutputStream.ComputeStringSize(9, Field9); - } - if (hasField18) { - size += pb::CodedOutputStream.ComputeStringSize(18, Field18); - } - if (hasField80) { - size += pb::CodedOutputStream.ComputeBoolSize(80, Field80); - } - if (hasField81) { - size += pb::CodedOutputStream.ComputeBoolSize(81, Field81); - } - if (hasField2) { - size += pb::CodedOutputStream.ComputeInt32Size(2, Field2); - } - if (hasField3) { - size += pb::CodedOutputStream.ComputeInt32Size(3, Field3); - } - if (hasField280) { - size += pb::CodedOutputStream.ComputeInt32Size(280, Field280); - } - if (hasField6) { - size += pb::CodedOutputStream.ComputeInt32Size(6, Field6); - } - if (hasField22) { - size += pb::CodedOutputStream.ComputeInt64Size(22, Field22); - } - if (hasField4) { - size += pb::CodedOutputStream.ComputeStringSize(4, Field4); - } - { - int dataSize = 0; - dataSize = 8 * field5_.Count; - size += dataSize; - size += 1 * field5_.Count; - } - if (hasField59) { - size += pb::CodedOutputStream.ComputeBoolSize(59, Field59); - } - if (hasField7) { - size += pb::CodedOutputStream.ComputeStringSize(7, Field7); - } - if (hasField16) { - size += pb::CodedOutputStream.ComputeInt32Size(16, Field16); - } - if (hasField130) { - size += pb::CodedOutputStream.ComputeInt32Size(130, Field130); - } - if (hasField12) { - size += pb::CodedOutputStream.ComputeBoolSize(12, Field12); - } - if (hasField17) { - size += pb::CodedOutputStream.ComputeBoolSize(17, Field17); - } - if (hasField13) { - size += pb::CodedOutputStream.ComputeBoolSize(13, Field13); - } - if (hasField14) { - size += pb::CodedOutputStream.ComputeBoolSize(14, Field14); - } - if (hasField104) { - size += pb::CodedOutputStream.ComputeInt32Size(104, Field104); - } - if (hasField100) { - size += pb::CodedOutputStream.ComputeInt32Size(100, Field100); - } - if (hasField101) { - size += pb::CodedOutputStream.ComputeInt32Size(101, Field101); - } - if (hasField102) { - size += pb::CodedOutputStream.ComputeStringSize(102, Field102); - } - if (hasField103) { - size += pb::CodedOutputStream.ComputeStringSize(103, Field103); - } - if (hasField29) { - size += pb::CodedOutputStream.ComputeInt32Size(29, Field29); - } - if (hasField30) { - size += pb::CodedOutputStream.ComputeBoolSize(30, Field30); - } - if (hasField60) { - size += pb::CodedOutputStream.ComputeInt32Size(60, Field60); - } - if (hasField271) { - size += pb::CodedOutputStream.ComputeInt32Size(271, Field271); - } - if (hasField272) { - size += pb::CodedOutputStream.ComputeInt32Size(272, Field272); - } - if (hasField150) { - size += pb::CodedOutputStream.ComputeInt32Size(150, Field150); - } - if (hasField23) { - size += pb::CodedOutputStream.ComputeInt32Size(23, Field23); - } - if (hasField24) { - size += pb::CodedOutputStream.ComputeBoolSize(24, Field24); - } - if (hasField25) { - size += pb::CodedOutputStream.ComputeInt32Size(25, Field25); - } - if (hasField15) { - size += pb::CodedOutputStream.ComputeMessageSize(15, Field15); - } - if (hasField78) { - size += pb::CodedOutputStream.ComputeBoolSize(78, Field78); - } - if (hasField67) { - size += pb::CodedOutputStream.ComputeInt32Size(67, Field67); - } - if (hasField68) { - size += pb::CodedOutputStream.ComputeInt32Size(68, Field68); - } - if (hasField128) { - size += pb::CodedOutputStream.ComputeInt32Size(128, Field128); - } - if (hasField129) { - size += pb::CodedOutputStream.ComputeStringSize(129, Field129); - } - if (hasField131) { - size += pb::CodedOutputStream.ComputeInt32Size(131, Field131); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static SpeedMessage1 ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SpeedMessage1 ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SpeedMessage1 ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SpeedMessage1 ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SpeedMessage1 ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SpeedMessage1 ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SpeedMessage1 ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SpeedMessage1 ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SpeedMessage1 ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SpeedMessage1 ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private SpeedMessage1 MakeReadOnly() { - field5_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SpeedMessage1 prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(SpeedMessage1 cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private SpeedMessage1 result; - - private SpeedMessage1 PrepareBuilder() { - if (resultIsReadOnly) { - SpeedMessage1 original = result; - result = new SpeedMessage1(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override SpeedMessage1 MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.SpeedMessage1.Descriptor; } - } - - public override SpeedMessage1 DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.SpeedMessage1.DefaultInstance; } - } - - public override SpeedMessage1 BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SpeedMessage1) { - return MergeFrom((SpeedMessage1) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SpeedMessage1 other) { - if (other == global::Google.ProtocolBuffers.TestProtos.SpeedMessage1.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasField1) { - Field1 = other.Field1; - } - if (other.HasField9) { - Field9 = other.Field9; - } - if (other.HasField18) { - Field18 = other.Field18; - } - if (other.HasField80) { - Field80 = other.Field80; - } - if (other.HasField81) { - Field81 = other.Field81; - } - if (other.HasField2) { - Field2 = other.Field2; - } - if (other.HasField3) { - Field3 = other.Field3; - } - if (other.HasField280) { - Field280 = other.Field280; - } - if (other.HasField6) { - Field6 = other.Field6; - } - if (other.HasField22) { - Field22 = other.Field22; - } - if (other.HasField4) { - Field4 = other.Field4; - } - if (other.field5_.Count != 0) { - result.field5_.Add(other.field5_); - } - if (other.HasField59) { - Field59 = other.Field59; - } - if (other.HasField7) { - Field7 = other.Field7; - } - if (other.HasField16) { - Field16 = other.Field16; - } - if (other.HasField130) { - Field130 = other.Field130; - } - if (other.HasField12) { - Field12 = other.Field12; - } - if (other.HasField17) { - Field17 = other.Field17; - } - if (other.HasField13) { - Field13 = other.Field13; - } - if (other.HasField14) { - Field14 = other.Field14; - } - if (other.HasField104) { - Field104 = other.Field104; - } - if (other.HasField100) { - Field100 = other.Field100; - } - if (other.HasField101) { - Field101 = other.Field101; - } - if (other.HasField102) { - Field102 = other.Field102; - } - if (other.HasField103) { - Field103 = other.Field103; - } - if (other.HasField29) { - Field29 = other.Field29; - } - if (other.HasField30) { - Field30 = other.Field30; - } - if (other.HasField60) { - Field60 = other.Field60; - } - if (other.HasField271) { - Field271 = other.Field271; - } - if (other.HasField272) { - Field272 = other.Field272; - } - if (other.HasField150) { - Field150 = other.Field150; - } - if (other.HasField23) { - Field23 = other.Field23; - } - if (other.HasField24) { - Field24 = other.Field24; - } - if (other.HasField25) { - Field25 = other.Field25; - } - if (other.HasField15) { - MergeField15(other.Field15); - } - if (other.HasField78) { - Field78 = other.Field78; - } - if (other.HasField67) { - Field67 = other.Field67; - } - if (other.HasField68) { - Field68 = other.Field68; - } - if (other.HasField128) { - Field128 = other.Field128; - } - if (other.HasField129) { - Field129 = other.Field129; - } - if (other.HasField131) { - Field131 = other.Field131; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_speedMessage1FieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _speedMessage1FieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasField1 = input.ReadString(ref result.field1_); - break; - } - case 16: { - result.hasField2 = input.ReadInt32(ref result.field2_); - break; - } - case 24: { - result.hasField3 = input.ReadInt32(ref result.field3_); - break; - } - case 34: { - result.hasField4 = input.ReadString(ref result.field4_); - break; - } - case 42: - case 41: { - input.ReadFixed64Array(tag, field_name, result.field5_); - break; - } - case 48: { - result.hasField6 = input.ReadInt32(ref result.field6_); - break; - } - case 58: { - result.hasField7 = input.ReadString(ref result.field7_); - break; - } - case 74: { - result.hasField9 = input.ReadString(ref result.field9_); - break; - } - case 96: { - result.hasField12 = input.ReadBool(ref result.field12_); - break; - } - case 104: { - result.hasField13 = input.ReadBool(ref result.field13_); - break; - } - case 112: { - result.hasField14 = input.ReadBool(ref result.field14_); - break; - } - case 122: { - global::Google.ProtocolBuffers.TestProtos.SpeedMessage1SubMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.SpeedMessage1SubMessage.CreateBuilder(); - if (result.hasField15) { - subBuilder.MergeFrom(Field15); - } - input.ReadMessage(subBuilder, extensionRegistry); - Field15 = subBuilder.BuildPartial(); - break; - } - case 128: { - result.hasField16 = input.ReadInt32(ref result.field16_); - break; - } - case 136: { - result.hasField17 = input.ReadBool(ref result.field17_); - break; - } - case 146: { - result.hasField18 = input.ReadString(ref result.field18_); - break; - } - case 176: { - result.hasField22 = input.ReadInt64(ref result.field22_); - break; - } - case 184: { - result.hasField23 = input.ReadInt32(ref result.field23_); - break; - } - case 192: { - result.hasField24 = input.ReadBool(ref result.field24_); - break; - } - case 200: { - result.hasField25 = input.ReadInt32(ref result.field25_); - break; - } - case 232: { - result.hasField29 = input.ReadInt32(ref result.field29_); - break; - } - case 240: { - result.hasField30 = input.ReadBool(ref result.field30_); - break; - } - case 472: { - result.hasField59 = input.ReadBool(ref result.field59_); - break; - } - case 480: { - result.hasField60 = input.ReadInt32(ref result.field60_); - break; - } - case 536: { - result.hasField67 = input.ReadInt32(ref result.field67_); - break; - } - case 544: { - result.hasField68 = input.ReadInt32(ref result.field68_); - break; - } - case 624: { - result.hasField78 = input.ReadBool(ref result.field78_); - break; - } - case 640: { - result.hasField80 = input.ReadBool(ref result.field80_); - break; - } - case 648: { - result.hasField81 = input.ReadBool(ref result.field81_); - break; - } - case 800: { - result.hasField100 = input.ReadInt32(ref result.field100_); - break; - } - case 808: { - result.hasField101 = input.ReadInt32(ref result.field101_); - break; - } - case 818: { - result.hasField102 = input.ReadString(ref result.field102_); - break; - } - case 826: { - result.hasField103 = input.ReadString(ref result.field103_); - break; - } - case 832: { - result.hasField104 = input.ReadInt32(ref result.field104_); - break; - } - case 1024: { - result.hasField128 = input.ReadInt32(ref result.field128_); - break; - } - case 1034: { - result.hasField129 = input.ReadString(ref result.field129_); - break; - } - case 1040: { - result.hasField130 = input.ReadInt32(ref result.field130_); - break; - } - case 1048: { - result.hasField131 = input.ReadInt32(ref result.field131_); - break; - } - case 1200: { - result.hasField150 = input.ReadInt32(ref result.field150_); - break; - } - case 2168: { - result.hasField271 = input.ReadInt32(ref result.field271_); - break; - } - case 2176: { - result.hasField272 = input.ReadInt32(ref result.field272_); - break; - } - case 2240: { - result.hasField280 = input.ReadInt32(ref result.field280_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasField1 { - get { return result.hasField1; } - } - public string Field1 { - get { return result.Field1; } - set { SetField1(value); } - } - public Builder SetField1(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField1 = true; - result.field1_ = value; - return this; - } - public Builder ClearField1() { - PrepareBuilder(); - result.hasField1 = false; - result.field1_ = ""; - return this; - } - - public bool HasField9 { - get { return result.hasField9; } - } - public string Field9 { - get { return result.Field9; } - set { SetField9(value); } - } - public Builder SetField9(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField9 = true; - result.field9_ = value; - return this; - } - public Builder ClearField9() { - PrepareBuilder(); - result.hasField9 = false; - result.field9_ = ""; - return this; - } - - public bool HasField18 { - get { return result.hasField18; } - } - public string Field18 { - get { return result.Field18; } - set { SetField18(value); } - } - public Builder SetField18(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField18 = true; - result.field18_ = value; - return this; - } - public Builder ClearField18() { - PrepareBuilder(); - result.hasField18 = false; - result.field18_ = ""; - return this; - } - - public bool HasField80 { - get { return result.hasField80; } - } - public bool Field80 { - get { return result.Field80; } - set { SetField80(value); } - } - public Builder SetField80(bool value) { - PrepareBuilder(); - result.hasField80 = true; - result.field80_ = value; - return this; - } - public Builder ClearField80() { - PrepareBuilder(); - result.hasField80 = false; - result.field80_ = false; - return this; - } - - public bool HasField81 { - get { return result.hasField81; } - } - public bool Field81 { - get { return result.Field81; } - set { SetField81(value); } - } - public Builder SetField81(bool value) { - PrepareBuilder(); - result.hasField81 = true; - result.field81_ = value; - return this; - } - public Builder ClearField81() { - PrepareBuilder(); - result.hasField81 = false; - result.field81_ = true; - return this; - } - - public bool HasField2 { - get { return result.hasField2; } - } - public int Field2 { - get { return result.Field2; } - set { SetField2(value); } - } - public Builder SetField2(int value) { - PrepareBuilder(); - result.hasField2 = true; - result.field2_ = value; - return this; - } - public Builder ClearField2() { - PrepareBuilder(); - result.hasField2 = false; - result.field2_ = 0; - return this; - } - - public bool HasField3 { - get { return result.hasField3; } - } - public int Field3 { - get { return result.Field3; } - set { SetField3(value); } - } - public Builder SetField3(int value) { - PrepareBuilder(); - result.hasField3 = true; - result.field3_ = value; - return this; - } - public Builder ClearField3() { - PrepareBuilder(); - result.hasField3 = false; - result.field3_ = 0; - return this; - } - - public bool HasField280 { - get { return result.hasField280; } - } - public int Field280 { - get { return result.Field280; } - set { SetField280(value); } - } - public Builder SetField280(int value) { - PrepareBuilder(); - result.hasField280 = true; - result.field280_ = value; - return this; - } - public Builder ClearField280() { - PrepareBuilder(); - result.hasField280 = false; - result.field280_ = 0; - return this; - } - - public bool HasField6 { - get { return result.hasField6; } - } - public int Field6 { - get { return result.Field6; } - set { SetField6(value); } - } - public Builder SetField6(int value) { - PrepareBuilder(); - result.hasField6 = true; - result.field6_ = value; - return this; - } - public Builder ClearField6() { - PrepareBuilder(); - result.hasField6 = false; - result.field6_ = 0; - return this; - } - - public bool HasField22 { - get { return result.hasField22; } - } - public long Field22 { - get { return result.Field22; } - set { SetField22(value); } - } - public Builder SetField22(long value) { - PrepareBuilder(); - result.hasField22 = true; - result.field22_ = value; - return this; - } - public Builder ClearField22() { - PrepareBuilder(); - result.hasField22 = false; - result.field22_ = 0L; - return this; - } - - public bool HasField4 { - get { return result.hasField4; } - } - public string Field4 { - get { return result.Field4; } - set { SetField4(value); } - } - public Builder SetField4(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField4 = true; - result.field4_ = value; - return this; - } - public Builder ClearField4() { - PrepareBuilder(); - result.hasField4 = false; - result.field4_ = ""; - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList Field5List { - get { return PrepareBuilder().field5_; } - } - public int Field5Count { - get { return result.Field5Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetField5(int index) { - return result.GetField5(index); - } - [global::System.CLSCompliant(false)] - public Builder SetField5(int index, ulong value) { - PrepareBuilder(); - result.field5_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddField5(ulong value) { - PrepareBuilder(); - result.field5_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeField5(scg::IEnumerable values) { - PrepareBuilder(); - result.field5_.Add(values); - return this; - } - public Builder ClearField5() { - PrepareBuilder(); - result.field5_.Clear(); - return this; - } - - public bool HasField59 { - get { return result.hasField59; } - } - public bool Field59 { - get { return result.Field59; } - set { SetField59(value); } - } - public Builder SetField59(bool value) { - PrepareBuilder(); - result.hasField59 = true; - result.field59_ = value; - return this; - } - public Builder ClearField59() { - PrepareBuilder(); - result.hasField59 = false; - result.field59_ = false; - return this; - } - - public bool HasField7 { - get { return result.hasField7; } - } - public string Field7 { - get { return result.Field7; } - set { SetField7(value); } - } - public Builder SetField7(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField7 = true; - result.field7_ = value; - return this; - } - public Builder ClearField7() { - PrepareBuilder(); - result.hasField7 = false; - result.field7_ = ""; - return this; - } - - public bool HasField16 { - get { return result.hasField16; } - } - public int Field16 { - get { return result.Field16; } - set { SetField16(value); } - } - public Builder SetField16(int value) { - PrepareBuilder(); - result.hasField16 = true; - result.field16_ = value; - return this; - } - public Builder ClearField16() { - PrepareBuilder(); - result.hasField16 = false; - result.field16_ = 0; - return this; - } - - public bool HasField130 { - get { return result.hasField130; } - } - public int Field130 { - get { return result.Field130; } - set { SetField130(value); } - } - public Builder SetField130(int value) { - PrepareBuilder(); - result.hasField130 = true; - result.field130_ = value; - return this; - } - public Builder ClearField130() { - PrepareBuilder(); - result.hasField130 = false; - result.field130_ = 0; - return this; - } - - public bool HasField12 { - get { return result.hasField12; } - } - public bool Field12 { - get { return result.Field12; } - set { SetField12(value); } - } - public Builder SetField12(bool value) { - PrepareBuilder(); - result.hasField12 = true; - result.field12_ = value; - return this; - } - public Builder ClearField12() { - PrepareBuilder(); - result.hasField12 = false; - result.field12_ = true; - return this; - } - - public bool HasField17 { - get { return result.hasField17; } - } - public bool Field17 { - get { return result.Field17; } - set { SetField17(value); } - } - public Builder SetField17(bool value) { - PrepareBuilder(); - result.hasField17 = true; - result.field17_ = value; - return this; - } - public Builder ClearField17() { - PrepareBuilder(); - result.hasField17 = false; - result.field17_ = true; - return this; - } - - public bool HasField13 { - get { return result.hasField13; } - } - public bool Field13 { - get { return result.Field13; } - set { SetField13(value); } - } - public Builder SetField13(bool value) { - PrepareBuilder(); - result.hasField13 = true; - result.field13_ = value; - return this; - } - public Builder ClearField13() { - PrepareBuilder(); - result.hasField13 = false; - result.field13_ = true; - return this; - } - - public bool HasField14 { - get { return result.hasField14; } - } - public bool Field14 { - get { return result.Field14; } - set { SetField14(value); } - } - public Builder SetField14(bool value) { - PrepareBuilder(); - result.hasField14 = true; - result.field14_ = value; - return this; - } - public Builder ClearField14() { - PrepareBuilder(); - result.hasField14 = false; - result.field14_ = true; - return this; - } - - public bool HasField104 { - get { return result.hasField104; } - } - public int Field104 { - get { return result.Field104; } - set { SetField104(value); } - } - public Builder SetField104(int value) { - PrepareBuilder(); - result.hasField104 = true; - result.field104_ = value; - return this; - } - public Builder ClearField104() { - PrepareBuilder(); - result.hasField104 = false; - result.field104_ = 0; - return this; - } - - public bool HasField100 { - get { return result.hasField100; } - } - public int Field100 { - get { return result.Field100; } - set { SetField100(value); } - } - public Builder SetField100(int value) { - PrepareBuilder(); - result.hasField100 = true; - result.field100_ = value; - return this; - } - public Builder ClearField100() { - PrepareBuilder(); - result.hasField100 = false; - result.field100_ = 0; - return this; - } - - public bool HasField101 { - get { return result.hasField101; } - } - public int Field101 { - get { return result.Field101; } - set { SetField101(value); } - } - public Builder SetField101(int value) { - PrepareBuilder(); - result.hasField101 = true; - result.field101_ = value; - return this; - } - public Builder ClearField101() { - PrepareBuilder(); - result.hasField101 = false; - result.field101_ = 0; - return this; - } - - public bool HasField102 { - get { return result.hasField102; } - } - public string Field102 { - get { return result.Field102; } - set { SetField102(value); } - } - public Builder SetField102(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField102 = true; - result.field102_ = value; - return this; - } - public Builder ClearField102() { - PrepareBuilder(); - result.hasField102 = false; - result.field102_ = ""; - return this; - } - - public bool HasField103 { - get { return result.hasField103; } - } - public string Field103 { - get { return result.Field103; } - set { SetField103(value); } - } - public Builder SetField103(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField103 = true; - result.field103_ = value; - return this; - } - public Builder ClearField103() { - PrepareBuilder(); - result.hasField103 = false; - result.field103_ = ""; - return this; - } - - public bool HasField29 { - get { return result.hasField29; } - } - public int Field29 { - get { return result.Field29; } - set { SetField29(value); } - } - public Builder SetField29(int value) { - PrepareBuilder(); - result.hasField29 = true; - result.field29_ = value; - return this; - } - public Builder ClearField29() { - PrepareBuilder(); - result.hasField29 = false; - result.field29_ = 0; - return this; - } - - public bool HasField30 { - get { return result.hasField30; } - } - public bool Field30 { - get { return result.Field30; } - set { SetField30(value); } - } - public Builder SetField30(bool value) { - PrepareBuilder(); - result.hasField30 = true; - result.field30_ = value; - return this; - } - public Builder ClearField30() { - PrepareBuilder(); - result.hasField30 = false; - result.field30_ = false; - return this; - } - - public bool HasField60 { - get { return result.hasField60; } - } - public int Field60 { - get { return result.Field60; } - set { SetField60(value); } - } - public Builder SetField60(int value) { - PrepareBuilder(); - result.hasField60 = true; - result.field60_ = value; - return this; - } - public Builder ClearField60() { - PrepareBuilder(); - result.hasField60 = false; - result.field60_ = -1; - return this; - } - - public bool HasField271 { - get { return result.hasField271; } - } - public int Field271 { - get { return result.Field271; } - set { SetField271(value); } - } - public Builder SetField271(int value) { - PrepareBuilder(); - result.hasField271 = true; - result.field271_ = value; - return this; - } - public Builder ClearField271() { - PrepareBuilder(); - result.hasField271 = false; - result.field271_ = -1; - return this; - } - - public bool HasField272 { - get { return result.hasField272; } - } - public int Field272 { - get { return result.Field272; } - set { SetField272(value); } - } - public Builder SetField272(int value) { - PrepareBuilder(); - result.hasField272 = true; - result.field272_ = value; - return this; - } - public Builder ClearField272() { - PrepareBuilder(); - result.hasField272 = false; - result.field272_ = -1; - return this; - } - - public bool HasField150 { - get { return result.hasField150; } - } - public int Field150 { - get { return result.Field150; } - set { SetField150(value); } - } - public Builder SetField150(int value) { - PrepareBuilder(); - result.hasField150 = true; - result.field150_ = value; - return this; - } - public Builder ClearField150() { - PrepareBuilder(); - result.hasField150 = false; - result.field150_ = 0; - return this; - } - - public bool HasField23 { - get { return result.hasField23; } - } - public int Field23 { - get { return result.Field23; } - set { SetField23(value); } - } - public Builder SetField23(int value) { - PrepareBuilder(); - result.hasField23 = true; - result.field23_ = value; - return this; - } - public Builder ClearField23() { - PrepareBuilder(); - result.hasField23 = false; - result.field23_ = 0; - return this; - } - - public bool HasField24 { - get { return result.hasField24; } - } - public bool Field24 { - get { return result.Field24; } - set { SetField24(value); } - } - public Builder SetField24(bool value) { - PrepareBuilder(); - result.hasField24 = true; - result.field24_ = value; - return this; - } - public Builder ClearField24() { - PrepareBuilder(); - result.hasField24 = false; - result.field24_ = false; - return this; - } - - public bool HasField25 { - get { return result.hasField25; } - } - public int Field25 { - get { return result.Field25; } - set { SetField25(value); } - } - public Builder SetField25(int value) { - PrepareBuilder(); - result.hasField25 = true; - result.field25_ = value; - return this; - } - public Builder ClearField25() { - PrepareBuilder(); - result.hasField25 = false; - result.field25_ = 0; - return this; - } - - public bool HasField15 { - get { return result.hasField15; } - } - public global::Google.ProtocolBuffers.TestProtos.SpeedMessage1SubMessage Field15 { - get { return result.Field15; } - set { SetField15(value); } - } - public Builder SetField15(global::Google.ProtocolBuffers.TestProtos.SpeedMessage1SubMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField15 = true; - result.field15_ = value; - return this; - } - public Builder SetField15(global::Google.ProtocolBuffers.TestProtos.SpeedMessage1SubMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasField15 = true; - result.field15_ = builderForValue.Build(); - return this; - } - public Builder MergeField15(global::Google.ProtocolBuffers.TestProtos.SpeedMessage1SubMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasField15 && - result.field15_ != global::Google.ProtocolBuffers.TestProtos.SpeedMessage1SubMessage.DefaultInstance) { - result.field15_ = global::Google.ProtocolBuffers.TestProtos.SpeedMessage1SubMessage.CreateBuilder(result.field15_).MergeFrom(value).BuildPartial(); - } else { - result.field15_ = value; - } - result.hasField15 = true; - return this; - } - public Builder ClearField15() { - PrepareBuilder(); - result.hasField15 = false; - result.field15_ = null; - return this; - } - - public bool HasField78 { - get { return result.hasField78; } - } - public bool Field78 { - get { return result.Field78; } - set { SetField78(value); } - } - public Builder SetField78(bool value) { - PrepareBuilder(); - result.hasField78 = true; - result.field78_ = value; - return this; - } - public Builder ClearField78() { - PrepareBuilder(); - result.hasField78 = false; - result.field78_ = false; - return this; - } - - public bool HasField67 { - get { return result.hasField67; } - } - public int Field67 { - get { return result.Field67; } - set { SetField67(value); } - } - public Builder SetField67(int value) { - PrepareBuilder(); - result.hasField67 = true; - result.field67_ = value; - return this; - } - public Builder ClearField67() { - PrepareBuilder(); - result.hasField67 = false; - result.field67_ = 0; - return this; - } - - public bool HasField68 { - get { return result.hasField68; } - } - public int Field68 { - get { return result.Field68; } - set { SetField68(value); } - } - public Builder SetField68(int value) { - PrepareBuilder(); - result.hasField68 = true; - result.field68_ = value; - return this; - } - public Builder ClearField68() { - PrepareBuilder(); - result.hasField68 = false; - result.field68_ = 0; - return this; - } - - public bool HasField128 { - get { return result.hasField128; } - } - public int Field128 { - get { return result.Field128; } - set { SetField128(value); } - } - public Builder SetField128(int value) { - PrepareBuilder(); - result.hasField128 = true; - result.field128_ = value; - return this; - } - public Builder ClearField128() { - PrepareBuilder(); - result.hasField128 = false; - result.field128_ = 0; - return this; - } - - public bool HasField129 { - get { return result.hasField129; } - } - public string Field129 { - get { return result.Field129; } - set { SetField129(value); } - } - public Builder SetField129(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField129 = true; - result.field129_ = value; - return this; - } - public Builder ClearField129() { - PrepareBuilder(); - result.hasField129 = false; - result.field129_ = "xxxxxxxxxxxxxxxxxxxxx"; - return this; - } - - public bool HasField131 { - get { return result.hasField131; } - } - public int Field131 { - get { return result.Field131; } - set { SetField131(value); } - } - public Builder SetField131(int value) { - PrepareBuilder(); - result.hasField131 = true; - result.field131_ = value; - return this; - } - public Builder ClearField131() { - PrepareBuilder(); - result.hasField131 = false; - result.field131_ = 0; - return this; - } - } - static SpeedMessage1() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestGoogleSpeedProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class SpeedMessage1SubMessage : pb::GeneratedMessage { - private SpeedMessage1SubMessage() { } - private static readonly SpeedMessage1SubMessage defaultInstance = new SpeedMessage1SubMessage().MakeReadOnly(); - private static readonly string[] _speedMessage1SubMessageFieldNames = new string[] { "field1", "field12", "field13", "field14", "field15", "field16", "field19", "field2", "field20", "field203", "field204", "field205", "field206", "field207", "field21", "field22", "field23", "field28", "field3", "field300" }; - private static readonly uint[] _speedMessage1SubMessageFieldTags = new uint[] { 8, 96, 104, 112, 122, 128, 152, 16, 160, 1629, 1632, 1642, 1648, 1656, 169, 176, 184, 224, 24, 2400 }; - public static SpeedMessage1SubMessage DefaultInstance { - get { return defaultInstance; } - } - - public override SpeedMessage1SubMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override SpeedMessage1SubMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestGoogleSpeedProtoFile.internal__static_unittest_google_speed_SpeedMessage1SubMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestGoogleSpeedProtoFile.internal__static_unittest_google_speed_SpeedMessage1SubMessage__FieldAccessorTable; } - } - - public const int Field1FieldNumber = 1; - private bool hasField1; - private int field1_; - public bool HasField1 { - get { return hasField1; } - } - public int Field1 { - get { return field1_; } - } - - public const int Field2FieldNumber = 2; - private bool hasField2; - private int field2_; - public bool HasField2 { - get { return hasField2; } - } - public int Field2 { - get { return field2_; } - } - - public const int Field3FieldNumber = 3; - private bool hasField3; - private int field3_; - public bool HasField3 { - get { return hasField3; } - } - public int Field3 { - get { return field3_; } - } - - public const int Field15FieldNumber = 15; - private bool hasField15; - private string field15_ = ""; - public bool HasField15 { - get { return hasField15; } - } - public string Field15 { - get { return field15_; } - } - - public const int Field12FieldNumber = 12; - private bool hasField12; - private bool field12_ = true; - public bool HasField12 { - get { return hasField12; } - } - public bool Field12 { - get { return field12_; } - } - - public const int Field13FieldNumber = 13; - private bool hasField13; - private long field13_; - public bool HasField13 { - get { return hasField13; } - } - public long Field13 { - get { return field13_; } - } - - public const int Field14FieldNumber = 14; - private bool hasField14; - private long field14_; - public bool HasField14 { - get { return hasField14; } - } - public long Field14 { - get { return field14_; } - } - - public const int Field16FieldNumber = 16; - private bool hasField16; - private int field16_; - public bool HasField16 { - get { return hasField16; } - } - public int Field16 { - get { return field16_; } - } - - public const int Field19FieldNumber = 19; - private bool hasField19; - private int field19_ = 2; - public bool HasField19 { - get { return hasField19; } - } - public int Field19 { - get { return field19_; } - } - - public const int Field20FieldNumber = 20; - private bool hasField20; - private bool field20_ = true; - public bool HasField20 { - get { return hasField20; } - } - public bool Field20 { - get { return field20_; } - } - - public const int Field28FieldNumber = 28; - private bool hasField28; - private bool field28_ = true; - public bool HasField28 { - get { return hasField28; } - } - public bool Field28 { - get { return field28_; } - } - - public const int Field21FieldNumber = 21; - private bool hasField21; - private ulong field21_; - public bool HasField21 { - get { return hasField21; } - } - [global::System.CLSCompliant(false)] - public ulong Field21 { - get { return field21_; } - } - - public const int Field22FieldNumber = 22; - private bool hasField22; - private int field22_; - public bool HasField22 { - get { return hasField22; } - } - public int Field22 { - get { return field22_; } - } - - public const int Field23FieldNumber = 23; - private bool hasField23; - private bool field23_; - public bool HasField23 { - get { return hasField23; } - } - public bool Field23 { - get { return field23_; } - } - - public const int Field206FieldNumber = 206; - private bool hasField206; - private bool field206_; - public bool HasField206 { - get { return hasField206; } - } - public bool Field206 { - get { return field206_; } - } - - public const int Field203FieldNumber = 203; - private bool hasField203; - private uint field203_; - public bool HasField203 { - get { return hasField203; } - } - [global::System.CLSCompliant(false)] - public uint Field203 { - get { return field203_; } - } - - public const int Field204FieldNumber = 204; - private bool hasField204; - private int field204_; - public bool HasField204 { - get { return hasField204; } - } - public int Field204 { - get { return field204_; } - } - - public const int Field205FieldNumber = 205; - private bool hasField205; - private string field205_ = ""; - public bool HasField205 { - get { return hasField205; } - } - public string Field205 { - get { return field205_; } - } - - public const int Field207FieldNumber = 207; - private bool hasField207; - private ulong field207_; - public bool HasField207 { - get { return hasField207; } - } - [global::System.CLSCompliant(false)] - public ulong Field207 { - get { return field207_; } - } - - public const int Field300FieldNumber = 300; - private bool hasField300; - private ulong field300_; - public bool HasField300 { - get { return hasField300; } - } - [global::System.CLSCompliant(false)] - public ulong Field300 { - get { return field300_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _speedMessage1SubMessageFieldNames; - if (hasField1) { - output.WriteInt32(1, field_names[0], Field1); - } - if (hasField2) { - output.WriteInt32(2, field_names[7], Field2); - } - if (hasField3) { - output.WriteInt32(3, field_names[18], Field3); - } - if (hasField12) { - output.WriteBool(12, field_names[1], Field12); - } - if (hasField13) { - output.WriteInt64(13, field_names[2], Field13); - } - if (hasField14) { - output.WriteInt64(14, field_names[3], Field14); - } - if (hasField15) { - output.WriteString(15, field_names[4], Field15); - } - if (hasField16) { - output.WriteInt32(16, field_names[5], Field16); - } - if (hasField19) { - output.WriteInt32(19, field_names[6], Field19); - } - if (hasField20) { - output.WriteBool(20, field_names[8], Field20); - } - if (hasField21) { - output.WriteFixed64(21, field_names[14], Field21); - } - if (hasField22) { - output.WriteInt32(22, field_names[15], Field22); - } - if (hasField23) { - output.WriteBool(23, field_names[16], Field23); - } - if (hasField28) { - output.WriteBool(28, field_names[17], Field28); - } - if (hasField203) { - output.WriteFixed32(203, field_names[9], Field203); - } - if (hasField204) { - output.WriteInt32(204, field_names[10], Field204); - } - if (hasField205) { - output.WriteString(205, field_names[11], Field205); - } - if (hasField206) { - output.WriteBool(206, field_names[12], Field206); - } - if (hasField207) { - output.WriteUInt64(207, field_names[13], Field207); - } - if (hasField300) { - output.WriteUInt64(300, field_names[19], Field300); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasField1) { - size += pb::CodedOutputStream.ComputeInt32Size(1, Field1); - } - if (hasField2) { - size += pb::CodedOutputStream.ComputeInt32Size(2, Field2); - } - if (hasField3) { - size += pb::CodedOutputStream.ComputeInt32Size(3, Field3); - } - if (hasField15) { - size += pb::CodedOutputStream.ComputeStringSize(15, Field15); - } - if (hasField12) { - size += pb::CodedOutputStream.ComputeBoolSize(12, Field12); - } - if (hasField13) { - size += pb::CodedOutputStream.ComputeInt64Size(13, Field13); - } - if (hasField14) { - size += pb::CodedOutputStream.ComputeInt64Size(14, Field14); - } - if (hasField16) { - size += pb::CodedOutputStream.ComputeInt32Size(16, Field16); - } - if (hasField19) { - size += pb::CodedOutputStream.ComputeInt32Size(19, Field19); - } - if (hasField20) { - size += pb::CodedOutputStream.ComputeBoolSize(20, Field20); - } - if (hasField28) { - size += pb::CodedOutputStream.ComputeBoolSize(28, Field28); - } - if (hasField21) { - size += pb::CodedOutputStream.ComputeFixed64Size(21, Field21); - } - if (hasField22) { - size += pb::CodedOutputStream.ComputeInt32Size(22, Field22); - } - if (hasField23) { - size += pb::CodedOutputStream.ComputeBoolSize(23, Field23); - } - if (hasField206) { - size += pb::CodedOutputStream.ComputeBoolSize(206, Field206); - } - if (hasField203) { - size += pb::CodedOutputStream.ComputeFixed32Size(203, Field203); - } - if (hasField204) { - size += pb::CodedOutputStream.ComputeInt32Size(204, Field204); - } - if (hasField205) { - size += pb::CodedOutputStream.ComputeStringSize(205, Field205); - } - if (hasField207) { - size += pb::CodedOutputStream.ComputeUInt64Size(207, Field207); - } - if (hasField300) { - size += pb::CodedOutputStream.ComputeUInt64Size(300, Field300); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static SpeedMessage1SubMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SpeedMessage1SubMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SpeedMessage1SubMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SpeedMessage1SubMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SpeedMessage1SubMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SpeedMessage1SubMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SpeedMessage1SubMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SpeedMessage1SubMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SpeedMessage1SubMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SpeedMessage1SubMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private SpeedMessage1SubMessage MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SpeedMessage1SubMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(SpeedMessage1SubMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private SpeedMessage1SubMessage result; - - private SpeedMessage1SubMessage PrepareBuilder() { - if (resultIsReadOnly) { - SpeedMessage1SubMessage original = result; - result = new SpeedMessage1SubMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override SpeedMessage1SubMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.SpeedMessage1SubMessage.Descriptor; } - } - - public override SpeedMessage1SubMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.SpeedMessage1SubMessage.DefaultInstance; } - } - - public override SpeedMessage1SubMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SpeedMessage1SubMessage) { - return MergeFrom((SpeedMessage1SubMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SpeedMessage1SubMessage other) { - if (other == global::Google.ProtocolBuffers.TestProtos.SpeedMessage1SubMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasField1) { - Field1 = other.Field1; - } - if (other.HasField2) { - Field2 = other.Field2; - } - if (other.HasField3) { - Field3 = other.Field3; - } - if (other.HasField15) { - Field15 = other.Field15; - } - if (other.HasField12) { - Field12 = other.Field12; - } - if (other.HasField13) { - Field13 = other.Field13; - } - if (other.HasField14) { - Field14 = other.Field14; - } - if (other.HasField16) { - Field16 = other.Field16; - } - if (other.HasField19) { - Field19 = other.Field19; - } - if (other.HasField20) { - Field20 = other.Field20; - } - if (other.HasField28) { - Field28 = other.Field28; - } - if (other.HasField21) { - Field21 = other.Field21; - } - if (other.HasField22) { - Field22 = other.Field22; - } - if (other.HasField23) { - Field23 = other.Field23; - } - if (other.HasField206) { - Field206 = other.Field206; - } - if (other.HasField203) { - Field203 = other.Field203; - } - if (other.HasField204) { - Field204 = other.Field204; - } - if (other.HasField205) { - Field205 = other.Field205; - } - if (other.HasField207) { - Field207 = other.Field207; - } - if (other.HasField300) { - Field300 = other.Field300; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_speedMessage1SubMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _speedMessage1SubMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasField1 = input.ReadInt32(ref result.field1_); - break; - } - case 16: { - result.hasField2 = input.ReadInt32(ref result.field2_); - break; - } - case 24: { - result.hasField3 = input.ReadInt32(ref result.field3_); - break; - } - case 96: { - result.hasField12 = input.ReadBool(ref result.field12_); - break; - } - case 104: { - result.hasField13 = input.ReadInt64(ref result.field13_); - break; - } - case 112: { - result.hasField14 = input.ReadInt64(ref result.field14_); - break; - } - case 122: { - result.hasField15 = input.ReadString(ref result.field15_); - break; - } - case 128: { - result.hasField16 = input.ReadInt32(ref result.field16_); - break; - } - case 152: { - result.hasField19 = input.ReadInt32(ref result.field19_); - break; - } - case 160: { - result.hasField20 = input.ReadBool(ref result.field20_); - break; - } - case 169: { - result.hasField21 = input.ReadFixed64(ref result.field21_); - break; - } - case 176: { - result.hasField22 = input.ReadInt32(ref result.field22_); - break; - } - case 184: { - result.hasField23 = input.ReadBool(ref result.field23_); - break; - } - case 224: { - result.hasField28 = input.ReadBool(ref result.field28_); - break; - } - case 1629: { - result.hasField203 = input.ReadFixed32(ref result.field203_); - break; - } - case 1632: { - result.hasField204 = input.ReadInt32(ref result.field204_); - break; - } - case 1642: { - result.hasField205 = input.ReadString(ref result.field205_); - break; - } - case 1648: { - result.hasField206 = input.ReadBool(ref result.field206_); - break; - } - case 1656: { - result.hasField207 = input.ReadUInt64(ref result.field207_); - break; - } - case 2400: { - result.hasField300 = input.ReadUInt64(ref result.field300_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasField1 { - get { return result.hasField1; } - } - public int Field1 { - get { return result.Field1; } - set { SetField1(value); } - } - public Builder SetField1(int value) { - PrepareBuilder(); - result.hasField1 = true; - result.field1_ = value; - return this; - } - public Builder ClearField1() { - PrepareBuilder(); - result.hasField1 = false; - result.field1_ = 0; - return this; - } - - public bool HasField2 { - get { return result.hasField2; } - } - public int Field2 { - get { return result.Field2; } - set { SetField2(value); } - } - public Builder SetField2(int value) { - PrepareBuilder(); - result.hasField2 = true; - result.field2_ = value; - return this; - } - public Builder ClearField2() { - PrepareBuilder(); - result.hasField2 = false; - result.field2_ = 0; - return this; - } - - public bool HasField3 { - get { return result.hasField3; } - } - public int Field3 { - get { return result.Field3; } - set { SetField3(value); } - } - public Builder SetField3(int value) { - PrepareBuilder(); - result.hasField3 = true; - result.field3_ = value; - return this; - } - public Builder ClearField3() { - PrepareBuilder(); - result.hasField3 = false; - result.field3_ = 0; - return this; - } - - public bool HasField15 { - get { return result.hasField15; } - } - public string Field15 { - get { return result.Field15; } - set { SetField15(value); } - } - public Builder SetField15(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField15 = true; - result.field15_ = value; - return this; - } - public Builder ClearField15() { - PrepareBuilder(); - result.hasField15 = false; - result.field15_ = ""; - return this; - } - - public bool HasField12 { - get { return result.hasField12; } - } - public bool Field12 { - get { return result.Field12; } - set { SetField12(value); } - } - public Builder SetField12(bool value) { - PrepareBuilder(); - result.hasField12 = true; - result.field12_ = value; - return this; - } - public Builder ClearField12() { - PrepareBuilder(); - result.hasField12 = false; - result.field12_ = true; - return this; - } - - public bool HasField13 { - get { return result.hasField13; } - } - public long Field13 { - get { return result.Field13; } - set { SetField13(value); } - } - public Builder SetField13(long value) { - PrepareBuilder(); - result.hasField13 = true; - result.field13_ = value; - return this; - } - public Builder ClearField13() { - PrepareBuilder(); - result.hasField13 = false; - result.field13_ = 0L; - return this; - } - - public bool HasField14 { - get { return result.hasField14; } - } - public long Field14 { - get { return result.Field14; } - set { SetField14(value); } - } - public Builder SetField14(long value) { - PrepareBuilder(); - result.hasField14 = true; - result.field14_ = value; - return this; - } - public Builder ClearField14() { - PrepareBuilder(); - result.hasField14 = false; - result.field14_ = 0L; - return this; - } - - public bool HasField16 { - get { return result.hasField16; } - } - public int Field16 { - get { return result.Field16; } - set { SetField16(value); } - } - public Builder SetField16(int value) { - PrepareBuilder(); - result.hasField16 = true; - result.field16_ = value; - return this; - } - public Builder ClearField16() { - PrepareBuilder(); - result.hasField16 = false; - result.field16_ = 0; - return this; - } - - public bool HasField19 { - get { return result.hasField19; } - } - public int Field19 { - get { return result.Field19; } - set { SetField19(value); } - } - public Builder SetField19(int value) { - PrepareBuilder(); - result.hasField19 = true; - result.field19_ = value; - return this; - } - public Builder ClearField19() { - PrepareBuilder(); - result.hasField19 = false; - result.field19_ = 2; - return this; - } - - public bool HasField20 { - get { return result.hasField20; } - } - public bool Field20 { - get { return result.Field20; } - set { SetField20(value); } - } - public Builder SetField20(bool value) { - PrepareBuilder(); - result.hasField20 = true; - result.field20_ = value; - return this; - } - public Builder ClearField20() { - PrepareBuilder(); - result.hasField20 = false; - result.field20_ = true; - return this; - } - - public bool HasField28 { - get { return result.hasField28; } - } - public bool Field28 { - get { return result.Field28; } - set { SetField28(value); } - } - public Builder SetField28(bool value) { - PrepareBuilder(); - result.hasField28 = true; - result.field28_ = value; - return this; - } - public Builder ClearField28() { - PrepareBuilder(); - result.hasField28 = false; - result.field28_ = true; - return this; - } - - public bool HasField21 { - get { return result.hasField21; } - } - [global::System.CLSCompliant(false)] - public ulong Field21 { - get { return result.Field21; } - set { SetField21(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetField21(ulong value) { - PrepareBuilder(); - result.hasField21 = true; - result.field21_ = value; - return this; - } - public Builder ClearField21() { - PrepareBuilder(); - result.hasField21 = false; - result.field21_ = 0; - return this; - } - - public bool HasField22 { - get { return result.hasField22; } - } - public int Field22 { - get { return result.Field22; } - set { SetField22(value); } - } - public Builder SetField22(int value) { - PrepareBuilder(); - result.hasField22 = true; - result.field22_ = value; - return this; - } - public Builder ClearField22() { - PrepareBuilder(); - result.hasField22 = false; - result.field22_ = 0; - return this; - } - - public bool HasField23 { - get { return result.hasField23; } - } - public bool Field23 { - get { return result.Field23; } - set { SetField23(value); } - } - public Builder SetField23(bool value) { - PrepareBuilder(); - result.hasField23 = true; - result.field23_ = value; - return this; - } - public Builder ClearField23() { - PrepareBuilder(); - result.hasField23 = false; - result.field23_ = false; - return this; - } - - public bool HasField206 { - get { return result.hasField206; } - } - public bool Field206 { - get { return result.Field206; } - set { SetField206(value); } - } - public Builder SetField206(bool value) { - PrepareBuilder(); - result.hasField206 = true; - result.field206_ = value; - return this; - } - public Builder ClearField206() { - PrepareBuilder(); - result.hasField206 = false; - result.field206_ = false; - return this; - } - - public bool HasField203 { - get { return result.hasField203; } - } - [global::System.CLSCompliant(false)] - public uint Field203 { - get { return result.Field203; } - set { SetField203(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetField203(uint value) { - PrepareBuilder(); - result.hasField203 = true; - result.field203_ = value; - return this; - } - public Builder ClearField203() { - PrepareBuilder(); - result.hasField203 = false; - result.field203_ = 0; - return this; - } - - public bool HasField204 { - get { return result.hasField204; } - } - public int Field204 { - get { return result.Field204; } - set { SetField204(value); } - } - public Builder SetField204(int value) { - PrepareBuilder(); - result.hasField204 = true; - result.field204_ = value; - return this; - } - public Builder ClearField204() { - PrepareBuilder(); - result.hasField204 = false; - result.field204_ = 0; - return this; - } - - public bool HasField205 { - get { return result.hasField205; } - } - public string Field205 { - get { return result.Field205; } - set { SetField205(value); } - } - public Builder SetField205(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField205 = true; - result.field205_ = value; - return this; - } - public Builder ClearField205() { - PrepareBuilder(); - result.hasField205 = false; - result.field205_ = ""; - return this; - } - - public bool HasField207 { - get { return result.hasField207; } - } - [global::System.CLSCompliant(false)] - public ulong Field207 { - get { return result.Field207; } - set { SetField207(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetField207(ulong value) { - PrepareBuilder(); - result.hasField207 = true; - result.field207_ = value; - return this; - } - public Builder ClearField207() { - PrepareBuilder(); - result.hasField207 = false; - result.field207_ = 0UL; - return this; - } - - public bool HasField300 { - get { return result.hasField300; } - } - [global::System.CLSCompliant(false)] - public ulong Field300 { - get { return result.Field300; } - set { SetField300(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetField300(ulong value) { - PrepareBuilder(); - result.hasField300 = true; - result.field300_ = value; - return this; - } - public Builder ClearField300() { - PrepareBuilder(); - result.hasField300 = false; - result.field300_ = 0UL; - return this; - } - } - static SpeedMessage1SubMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestGoogleSpeedProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class SpeedMessage2 : pb::GeneratedMessage { - private SpeedMessage2() { } - private static readonly SpeedMessage2 defaultInstance = new SpeedMessage2().MakeReadOnly(); - private static readonly string[] _speedMessage2FieldNames = new string[] { "field1", "field109", "field127", "field128", "field129", "field130", "field131", "field2", "field205", "field206", "field21", "field210", "field211", "field212", "field213", "field216", "field217", "field218", "field220", "field221", "field222", "field25", "field3", "field30", "field4", "field6", "field63", "field71", "field75", "group1" }; - private static readonly uint[] _speedMessage2FieldTags = new uint[] { 10, 872, 1018, 1026, 1032, 1040, 1048, 18, 1640, 1648, 168, 1680, 1688, 1696, 1704, 1728, 1736, 1744, 1760, 1768, 1781, 205, 24, 240, 32, 50, 504, 568, 600, 83 }; - public static SpeedMessage2 DefaultInstance { - get { return defaultInstance; } - } - - public override SpeedMessage2 DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override SpeedMessage2 ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestGoogleSpeedProtoFile.internal__static_unittest_google_speed_SpeedMessage2__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestGoogleSpeedProtoFile.internal__static_unittest_google_speed_SpeedMessage2__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Group1 : pb::GeneratedMessage { - private Group1() { } - private static readonly Group1 defaultInstance = new Group1().MakeReadOnly(); - private static readonly string[] _group1FieldNames = new string[] { "field11", "field12", "field13", "field14", "field15", "field16", "field20", "field22", "field24", "field26", "field27", "field28", "field29", "field31", "field5", "field73" }; - private static readonly uint[] _group1FieldTags = new uint[] { 93, 98, 106, 114, 120, 130, 160, 178, 194, 213, 218, 224, 234, 250, 40, 584 }; - public static Group1 DefaultInstance { - get { return defaultInstance; } - } - - public override Group1 DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override Group1 ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestGoogleSpeedProtoFile.internal__static_unittest_google_speed_SpeedMessage2_Group1__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestGoogleSpeedProtoFile.internal__static_unittest_google_speed_SpeedMessage2_Group1__FieldAccessorTable; } - } - - public const int Field11FieldNumber = 11; - private bool hasField11; - private float field11_; - public bool HasField11 { - get { return hasField11; } - } - public float Field11 { - get { return field11_; } - } - - public const int Field26FieldNumber = 26; - private bool hasField26; - private float field26_; - public bool HasField26 { - get { return hasField26; } - } - public float Field26 { - get { return field26_; } - } - - public const int Field12FieldNumber = 12; - private bool hasField12; - private string field12_ = ""; - public bool HasField12 { - get { return hasField12; } - } - public string Field12 { - get { return field12_; } - } - - public const int Field13FieldNumber = 13; - private bool hasField13; - private string field13_ = ""; - public bool HasField13 { - get { return hasField13; } - } - public string Field13 { - get { return field13_; } - } - - public const int Field14FieldNumber = 14; - private pbc::PopsicleList field14_ = new pbc::PopsicleList(); - public scg::IList Field14List { - get { return pbc::Lists.AsReadOnly(field14_); } - } - public int Field14Count { - get { return field14_.Count; } - } - public string GetField14(int index) { - return field14_[index]; - } - - public const int Field15FieldNumber = 15; - private bool hasField15; - private ulong field15_; - public bool HasField15 { - get { return hasField15; } - } - [global::System.CLSCompliant(false)] - public ulong Field15 { - get { return field15_; } - } - - public const int Field5FieldNumber = 5; - private bool hasField5; - private int field5_; - public bool HasField5 { - get { return hasField5; } - } - public int Field5 { - get { return field5_; } - } - - public const int Field27FieldNumber = 27; - private bool hasField27; - private string field27_ = ""; - public bool HasField27 { - get { return hasField27; } - } - public string Field27 { - get { return field27_; } - } - - public const int Field28FieldNumber = 28; - private bool hasField28; - private int field28_; - public bool HasField28 { - get { return hasField28; } - } - public int Field28 { - get { return field28_; } - } - - public const int Field29FieldNumber = 29; - private bool hasField29; - private string field29_ = ""; - public bool HasField29 { - get { return hasField29; } - } - public string Field29 { - get { return field29_; } - } - - public const int Field16FieldNumber = 16; - private bool hasField16; - private string field16_ = ""; - public bool HasField16 { - get { return hasField16; } - } - public string Field16 { - get { return field16_; } - } - - public const int Field22FieldNumber = 22; - private pbc::PopsicleList field22_ = new pbc::PopsicleList(); - public scg::IList Field22List { - get { return pbc::Lists.AsReadOnly(field22_); } - } - public int Field22Count { - get { return field22_.Count; } - } - public string GetField22(int index) { - return field22_[index]; - } - - public const int Field73FieldNumber = 73; - private pbc::PopsicleList field73_ = new pbc::PopsicleList(); - public scg::IList Field73List { - get { return pbc::Lists.AsReadOnly(field73_); } - } - public int Field73Count { - get { return field73_.Count; } - } - public int GetField73(int index) { - return field73_[index]; - } - - public const int Field20FieldNumber = 20; - private bool hasField20; - private int field20_; - public bool HasField20 { - get { return hasField20; } - } - public int Field20 { - get { return field20_; } - } - - public const int Field24FieldNumber = 24; - private bool hasField24; - private string field24_ = ""; - public bool HasField24 { - get { return hasField24; } - } - public string Field24 { - get { return field24_; } - } - - public const int Field31FieldNumber = 31; - private bool hasField31; - private global::Google.ProtocolBuffers.TestProtos.SpeedMessage2GroupedMessage field31_; - public bool HasField31 { - get { return hasField31; } - } - public global::Google.ProtocolBuffers.TestProtos.SpeedMessage2GroupedMessage Field31 { - get { return field31_ ?? global::Google.ProtocolBuffers.TestProtos.SpeedMessage2GroupedMessage.DefaultInstance; } - } - - public override bool IsInitialized { - get { - if (!hasField11) return false; - if (!hasField15) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _group1FieldNames; - if (hasField5) { - output.WriteInt32(5, field_names[14], Field5); - } - if (hasField11) { - output.WriteFloat(11, field_names[0], Field11); - } - if (hasField12) { - output.WriteString(12, field_names[1], Field12); - } - if (hasField13) { - output.WriteString(13, field_names[2], Field13); - } - if (field14_.Count > 0) { - output.WriteStringArray(14, field_names[3], field14_); - } - if (hasField15) { - output.WriteUInt64(15, field_names[4], Field15); - } - if (hasField16) { - output.WriteString(16, field_names[5], Field16); - } - if (hasField20) { - output.WriteInt32(20, field_names[6], Field20); - } - if (field22_.Count > 0) { - output.WriteStringArray(22, field_names[7], field22_); - } - if (hasField24) { - output.WriteString(24, field_names[8], Field24); - } - if (hasField26) { - output.WriteFloat(26, field_names[9], Field26); - } - if (hasField27) { - output.WriteString(27, field_names[10], Field27); - } - if (hasField28) { - output.WriteInt32(28, field_names[11], Field28); - } - if (hasField29) { - output.WriteString(29, field_names[12], Field29); - } - if (hasField31) { - output.WriteMessage(31, field_names[13], Field31); - } - if (field73_.Count > 0) { - output.WriteInt32Array(73, field_names[15], field73_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasField11) { - size += pb::CodedOutputStream.ComputeFloatSize(11, Field11); - } - if (hasField26) { - size += pb::CodedOutputStream.ComputeFloatSize(26, Field26); - } - if (hasField12) { - size += pb::CodedOutputStream.ComputeStringSize(12, Field12); - } - if (hasField13) { - size += pb::CodedOutputStream.ComputeStringSize(13, Field13); - } - { - int dataSize = 0; - foreach (string element in Field14List) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 1 * field14_.Count; - } - if (hasField15) { - size += pb::CodedOutputStream.ComputeUInt64Size(15, Field15); - } - if (hasField5) { - size += pb::CodedOutputStream.ComputeInt32Size(5, Field5); - } - if (hasField27) { - size += pb::CodedOutputStream.ComputeStringSize(27, Field27); - } - if (hasField28) { - size += pb::CodedOutputStream.ComputeInt32Size(28, Field28); - } - if (hasField29) { - size += pb::CodedOutputStream.ComputeStringSize(29, Field29); - } - if (hasField16) { - size += pb::CodedOutputStream.ComputeStringSize(16, Field16); - } - { - int dataSize = 0; - foreach (string element in Field22List) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 2 * field22_.Count; - } - { - int dataSize = 0; - foreach (int element in Field73List) { - dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); - } - size += dataSize; - size += 2 * field73_.Count; - } - if (hasField20) { - size += pb::CodedOutputStream.ComputeInt32Size(20, Field20); - } - if (hasField24) { - size += pb::CodedOutputStream.ComputeStringSize(24, Field24); - } - if (hasField31) { - size += pb::CodedOutputStream.ComputeMessageSize(31, Field31); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static Group1 ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Group1 ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Group1 ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Group1 ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Group1 ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Group1 ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Group1 ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Group1 ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Group1 ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Group1 ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private Group1 MakeReadOnly() { - field14_.MakeReadOnly(); - field22_.MakeReadOnly(); - field73_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Group1 prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(Group1 cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private Group1 result; - - private Group1 PrepareBuilder() { - if (resultIsReadOnly) { - Group1 original = result; - result = new Group1(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override Group1 MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.SpeedMessage2.Types.Group1.Descriptor; } - } - - public override Group1 DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.SpeedMessage2.Types.Group1.DefaultInstance; } - } - - public override Group1 BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Group1) { - return MergeFrom((Group1) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Group1 other) { - if (other == global::Google.ProtocolBuffers.TestProtos.SpeedMessage2.Types.Group1.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasField11) { - Field11 = other.Field11; - } - if (other.HasField26) { - Field26 = other.Field26; - } - if (other.HasField12) { - Field12 = other.Field12; - } - if (other.HasField13) { - Field13 = other.Field13; - } - if (other.field14_.Count != 0) { - result.field14_.Add(other.field14_); - } - if (other.HasField15) { - Field15 = other.Field15; - } - if (other.HasField5) { - Field5 = other.Field5; - } - if (other.HasField27) { - Field27 = other.Field27; - } - if (other.HasField28) { - Field28 = other.Field28; - } - if (other.HasField29) { - Field29 = other.Field29; - } - if (other.HasField16) { - Field16 = other.Field16; - } - if (other.field22_.Count != 0) { - result.field22_.Add(other.field22_); - } - if (other.field73_.Count != 0) { - result.field73_.Add(other.field73_); - } - if (other.HasField20) { - Field20 = other.Field20; - } - if (other.HasField24) { - Field24 = other.Field24; - } - if (other.HasField31) { - MergeField31(other.Field31); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_group1FieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _group1FieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 40: { - result.hasField5 = input.ReadInt32(ref result.field5_); - break; - } - case 93: { - result.hasField11 = input.ReadFloat(ref result.field11_); - break; - } - case 98: { - result.hasField12 = input.ReadString(ref result.field12_); - break; - } - case 106: { - result.hasField13 = input.ReadString(ref result.field13_); - break; - } - case 114: { - input.ReadStringArray(tag, field_name, result.field14_); - break; - } - case 120: { - result.hasField15 = input.ReadUInt64(ref result.field15_); - break; - } - case 130: { - result.hasField16 = input.ReadString(ref result.field16_); - break; - } - case 160: { - result.hasField20 = input.ReadInt32(ref result.field20_); - break; - } - case 178: { - input.ReadStringArray(tag, field_name, result.field22_); - break; - } - case 194: { - result.hasField24 = input.ReadString(ref result.field24_); - break; - } - case 213: { - result.hasField26 = input.ReadFloat(ref result.field26_); - break; - } - case 218: { - result.hasField27 = input.ReadString(ref result.field27_); - break; - } - case 224: { - result.hasField28 = input.ReadInt32(ref result.field28_); - break; - } - case 234: { - result.hasField29 = input.ReadString(ref result.field29_); - break; - } - case 250: { - global::Google.ProtocolBuffers.TestProtos.SpeedMessage2GroupedMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.SpeedMessage2GroupedMessage.CreateBuilder(); - if (result.hasField31) { - subBuilder.MergeFrom(Field31); - } - input.ReadMessage(subBuilder, extensionRegistry); - Field31 = subBuilder.BuildPartial(); - break; - } - case 586: - case 584: { - input.ReadInt32Array(tag, field_name, result.field73_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasField11 { - get { return result.hasField11; } - } - public float Field11 { - get { return result.Field11; } - set { SetField11(value); } - } - public Builder SetField11(float value) { - PrepareBuilder(); - result.hasField11 = true; - result.field11_ = value; - return this; - } - public Builder ClearField11() { - PrepareBuilder(); - result.hasField11 = false; - result.field11_ = 0F; - return this; - } - - public bool HasField26 { - get { return result.hasField26; } - } - public float Field26 { - get { return result.Field26; } - set { SetField26(value); } - } - public Builder SetField26(float value) { - PrepareBuilder(); - result.hasField26 = true; - result.field26_ = value; - return this; - } - public Builder ClearField26() { - PrepareBuilder(); - result.hasField26 = false; - result.field26_ = 0F; - return this; - } - - public bool HasField12 { - get { return result.hasField12; } - } - public string Field12 { - get { return result.Field12; } - set { SetField12(value); } - } - public Builder SetField12(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField12 = true; - result.field12_ = value; - return this; - } - public Builder ClearField12() { - PrepareBuilder(); - result.hasField12 = false; - result.field12_ = ""; - return this; - } - - public bool HasField13 { - get { return result.hasField13; } - } - public string Field13 { - get { return result.Field13; } - set { SetField13(value); } - } - public Builder SetField13(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField13 = true; - result.field13_ = value; - return this; - } - public Builder ClearField13() { - PrepareBuilder(); - result.hasField13 = false; - result.field13_ = ""; - return this; - } - - public pbc::IPopsicleList Field14List { - get { return PrepareBuilder().field14_; } - } - public int Field14Count { - get { return result.Field14Count; } - } - public string GetField14(int index) { - return result.GetField14(index); - } - public Builder SetField14(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.field14_[index] = value; - return this; - } - public Builder AddField14(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.field14_.Add(value); - return this; - } - public Builder AddRangeField14(scg::IEnumerable values) { - PrepareBuilder(); - result.field14_.Add(values); - return this; - } - public Builder ClearField14() { - PrepareBuilder(); - result.field14_.Clear(); - return this; - } - - public bool HasField15 { - get { return result.hasField15; } - } - [global::System.CLSCompliant(false)] - public ulong Field15 { - get { return result.Field15; } - set { SetField15(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetField15(ulong value) { - PrepareBuilder(); - result.hasField15 = true; - result.field15_ = value; - return this; - } - public Builder ClearField15() { - PrepareBuilder(); - result.hasField15 = false; - result.field15_ = 0UL; - return this; - } - - public bool HasField5 { - get { return result.hasField5; } - } - public int Field5 { - get { return result.Field5; } - set { SetField5(value); } - } - public Builder SetField5(int value) { - PrepareBuilder(); - result.hasField5 = true; - result.field5_ = value; - return this; - } - public Builder ClearField5() { - PrepareBuilder(); - result.hasField5 = false; - result.field5_ = 0; - return this; - } - - public bool HasField27 { - get { return result.hasField27; } - } - public string Field27 { - get { return result.Field27; } - set { SetField27(value); } - } - public Builder SetField27(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField27 = true; - result.field27_ = value; - return this; - } - public Builder ClearField27() { - PrepareBuilder(); - result.hasField27 = false; - result.field27_ = ""; - return this; - } - - public bool HasField28 { - get { return result.hasField28; } - } - public int Field28 { - get { return result.Field28; } - set { SetField28(value); } - } - public Builder SetField28(int value) { - PrepareBuilder(); - result.hasField28 = true; - result.field28_ = value; - return this; - } - public Builder ClearField28() { - PrepareBuilder(); - result.hasField28 = false; - result.field28_ = 0; - return this; - } - - public bool HasField29 { - get { return result.hasField29; } - } - public string Field29 { - get { return result.Field29; } - set { SetField29(value); } - } - public Builder SetField29(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField29 = true; - result.field29_ = value; - return this; - } - public Builder ClearField29() { - PrepareBuilder(); - result.hasField29 = false; - result.field29_ = ""; - return this; - } - - public bool HasField16 { - get { return result.hasField16; } - } - public string Field16 { - get { return result.Field16; } - set { SetField16(value); } - } - public Builder SetField16(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField16 = true; - result.field16_ = value; - return this; - } - public Builder ClearField16() { - PrepareBuilder(); - result.hasField16 = false; - result.field16_ = ""; - return this; - } - - public pbc::IPopsicleList Field22List { - get { return PrepareBuilder().field22_; } - } - public int Field22Count { - get { return result.Field22Count; } - } - public string GetField22(int index) { - return result.GetField22(index); - } - public Builder SetField22(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.field22_[index] = value; - return this; - } - public Builder AddField22(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.field22_.Add(value); - return this; - } - public Builder AddRangeField22(scg::IEnumerable values) { - PrepareBuilder(); - result.field22_.Add(values); - return this; - } - public Builder ClearField22() { - PrepareBuilder(); - result.field22_.Clear(); - return this; - } - - public pbc::IPopsicleList Field73List { - get { return PrepareBuilder().field73_; } - } - public int Field73Count { - get { return result.Field73Count; } - } - public int GetField73(int index) { - return result.GetField73(index); - } - public Builder SetField73(int index, int value) { - PrepareBuilder(); - result.field73_[index] = value; - return this; - } - public Builder AddField73(int value) { - PrepareBuilder(); - result.field73_.Add(value); - return this; - } - public Builder AddRangeField73(scg::IEnumerable values) { - PrepareBuilder(); - result.field73_.Add(values); - return this; - } - public Builder ClearField73() { - PrepareBuilder(); - result.field73_.Clear(); - return this; - } - - public bool HasField20 { - get { return result.hasField20; } - } - public int Field20 { - get { return result.Field20; } - set { SetField20(value); } - } - public Builder SetField20(int value) { - PrepareBuilder(); - result.hasField20 = true; - result.field20_ = value; - return this; - } - public Builder ClearField20() { - PrepareBuilder(); - result.hasField20 = false; - result.field20_ = 0; - return this; - } - - public bool HasField24 { - get { return result.hasField24; } - } - public string Field24 { - get { return result.Field24; } - set { SetField24(value); } - } - public Builder SetField24(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField24 = true; - result.field24_ = value; - return this; - } - public Builder ClearField24() { - PrepareBuilder(); - result.hasField24 = false; - result.field24_ = ""; - return this; - } - - public bool HasField31 { - get { return result.hasField31; } - } - public global::Google.ProtocolBuffers.TestProtos.SpeedMessage2GroupedMessage Field31 { - get { return result.Field31; } - set { SetField31(value); } - } - public Builder SetField31(global::Google.ProtocolBuffers.TestProtos.SpeedMessage2GroupedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField31 = true; - result.field31_ = value; - return this; - } - public Builder SetField31(global::Google.ProtocolBuffers.TestProtos.SpeedMessage2GroupedMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasField31 = true; - result.field31_ = builderForValue.Build(); - return this; - } - public Builder MergeField31(global::Google.ProtocolBuffers.TestProtos.SpeedMessage2GroupedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasField31 && - result.field31_ != global::Google.ProtocolBuffers.TestProtos.SpeedMessage2GroupedMessage.DefaultInstance) { - result.field31_ = global::Google.ProtocolBuffers.TestProtos.SpeedMessage2GroupedMessage.CreateBuilder(result.field31_).MergeFrom(value).BuildPartial(); - } else { - result.field31_ = value; - } - result.hasField31 = true; - return this; - } - public Builder ClearField31() { - PrepareBuilder(); - result.hasField31 = false; - result.field31_ = null; - return this; - } - } - static Group1() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestGoogleSpeedProtoFile.Descriptor, null); - } - } - - } - #endregion - - public const int Field1FieldNumber = 1; - private bool hasField1; - private string field1_ = ""; - public bool HasField1 { - get { return hasField1; } - } - public string Field1 { - get { return field1_; } - } - - public const int Field3FieldNumber = 3; - private bool hasField3; - private long field3_; - public bool HasField3 { - get { return hasField3; } - } - public long Field3 { - get { return field3_; } - } - - public const int Field4FieldNumber = 4; - private bool hasField4; - private long field4_; - public bool HasField4 { - get { return hasField4; } - } - public long Field4 { - get { return field4_; } - } - - public const int Field30FieldNumber = 30; - private bool hasField30; - private long field30_; - public bool HasField30 { - get { return hasField30; } - } - public long Field30 { - get { return field30_; } - } - - public const int Field75FieldNumber = 75; - private bool hasField75; - private bool field75_; - public bool HasField75 { - get { return hasField75; } - } - public bool Field75 { - get { return field75_; } - } - - public const int Field6FieldNumber = 6; - private bool hasField6; - private string field6_ = ""; - public bool HasField6 { - get { return hasField6; } - } - public string Field6 { - get { return field6_; } - } - - public const int Field2FieldNumber = 2; - private bool hasField2; - private pb::ByteString field2_ = pb::ByteString.Empty; - public bool HasField2 { - get { return hasField2; } - } - public pb::ByteString Field2 { - get { return field2_; } - } - - public const int Field21FieldNumber = 21; - private bool hasField21; - private int field21_; - public bool HasField21 { - get { return hasField21; } - } - public int Field21 { - get { return field21_; } - } - - public const int Field71FieldNumber = 71; - private bool hasField71; - private int field71_; - public bool HasField71 { - get { return hasField71; } - } - public int Field71 { - get { return field71_; } - } - - public const int Field25FieldNumber = 25; - private bool hasField25; - private float field25_; - public bool HasField25 { - get { return hasField25; } - } - public float Field25 { - get { return field25_; } - } - - public const int Field109FieldNumber = 109; - private bool hasField109; - private int field109_; - public bool HasField109 { - get { return hasField109; } - } - public int Field109 { - get { return field109_; } - } - - public const int Field210FieldNumber = 210; - private bool hasField210; - private int field210_; - public bool HasField210 { - get { return hasField210; } - } - public int Field210 { - get { return field210_; } - } - - public const int Field211FieldNumber = 211; - private bool hasField211; - private int field211_; - public bool HasField211 { - get { return hasField211; } - } - public int Field211 { - get { return field211_; } - } - - public const int Field212FieldNumber = 212; - private bool hasField212; - private int field212_; - public bool HasField212 { - get { return hasField212; } - } - public int Field212 { - get { return field212_; } - } - - public const int Field213FieldNumber = 213; - private bool hasField213; - private int field213_; - public bool HasField213 { - get { return hasField213; } - } - public int Field213 { - get { return field213_; } - } - - public const int Field216FieldNumber = 216; - private bool hasField216; - private int field216_; - public bool HasField216 { - get { return hasField216; } - } - public int Field216 { - get { return field216_; } - } - - public const int Field217FieldNumber = 217; - private bool hasField217; - private int field217_; - public bool HasField217 { - get { return hasField217; } - } - public int Field217 { - get { return field217_; } - } - - public const int Field218FieldNumber = 218; - private bool hasField218; - private int field218_; - public bool HasField218 { - get { return hasField218; } - } - public int Field218 { - get { return field218_; } - } - - public const int Field220FieldNumber = 220; - private bool hasField220; - private int field220_; - public bool HasField220 { - get { return hasField220; } - } - public int Field220 { - get { return field220_; } - } - - public const int Field221FieldNumber = 221; - private bool hasField221; - private int field221_; - public bool HasField221 { - get { return hasField221; } - } - public int Field221 { - get { return field221_; } - } - - public const int Field222FieldNumber = 222; - private bool hasField222; - private float field222_; - public bool HasField222 { - get { return hasField222; } - } - public float Field222 { - get { return field222_; } - } - - public const int Field63FieldNumber = 63; - private bool hasField63; - private int field63_; - public bool HasField63 { - get { return hasField63; } - } - public int Field63 { - get { return field63_; } - } - - public const int Group1FieldNumber = 10; - private pbc::PopsicleList group1_ = new pbc::PopsicleList(); - public scg::IList Group1List { - get { return group1_; } - } - public int Group1Count { - get { return group1_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.SpeedMessage2.Types.Group1 GetGroup1(int index) { - return group1_[index]; - } - - public const int Field128FieldNumber = 128; - private pbc::PopsicleList field128_ = new pbc::PopsicleList(); - public scg::IList Field128List { - get { return pbc::Lists.AsReadOnly(field128_); } - } - public int Field128Count { - get { return field128_.Count; } - } - public string GetField128(int index) { - return field128_[index]; - } - - public const int Field131FieldNumber = 131; - private bool hasField131; - private long field131_; - public bool HasField131 { - get { return hasField131; } - } - public long Field131 { - get { return field131_; } - } - - public const int Field127FieldNumber = 127; - private pbc::PopsicleList field127_ = new pbc::PopsicleList(); - public scg::IList Field127List { - get { return pbc::Lists.AsReadOnly(field127_); } - } - public int Field127Count { - get { return field127_.Count; } - } - public string GetField127(int index) { - return field127_[index]; - } - - public const int Field129FieldNumber = 129; - private bool hasField129; - private int field129_; - public bool HasField129 { - get { return hasField129; } - } - public int Field129 { - get { return field129_; } - } - - public const int Field130FieldNumber = 130; - private pbc::PopsicleList field130_ = new pbc::PopsicleList(); - public scg::IList Field130List { - get { return pbc::Lists.AsReadOnly(field130_); } - } - public int Field130Count { - get { return field130_.Count; } - } - public long GetField130(int index) { - return field130_[index]; - } - - public const int Field205FieldNumber = 205; - private bool hasField205; - private bool field205_; - public bool HasField205 { - get { return hasField205; } - } - public bool Field205 { - get { return field205_; } - } - - public const int Field206FieldNumber = 206; - private bool hasField206; - private bool field206_; - public bool HasField206 { - get { return hasField206; } - } - public bool Field206 { - get { return field206_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _speedMessage2FieldNames; - if (hasField1) { - output.WriteString(1, field_names[0], Field1); - } - if (hasField2) { - output.WriteBytes(2, field_names[7], Field2); - } - if (hasField3) { - output.WriteInt64(3, field_names[22], Field3); - } - if (hasField4) { - output.WriteInt64(4, field_names[24], Field4); - } - if (hasField6) { - output.WriteString(6, field_names[25], Field6); - } - if (group1_.Count > 0) { - output.WriteGroupArray(10, field_names[29], group1_); - } - if (hasField21) { - output.WriteInt32(21, field_names[10], Field21); - } - if (hasField25) { - output.WriteFloat(25, field_names[21], Field25); - } - if (hasField30) { - output.WriteInt64(30, field_names[23], Field30); - } - if (hasField63) { - output.WriteInt32(63, field_names[26], Field63); - } - if (hasField71) { - output.WriteInt32(71, field_names[27], Field71); - } - if (hasField75) { - output.WriteBool(75, field_names[28], Field75); - } - if (hasField109) { - output.WriteInt32(109, field_names[1], Field109); - } - if (field127_.Count > 0) { - output.WriteStringArray(127, field_names[2], field127_); - } - if (field128_.Count > 0) { - output.WriteStringArray(128, field_names[3], field128_); - } - if (hasField129) { - output.WriteInt32(129, field_names[4], Field129); - } - if (field130_.Count > 0) { - output.WriteInt64Array(130, field_names[5], field130_); - } - if (hasField131) { - output.WriteInt64(131, field_names[6], Field131); - } - if (hasField205) { - output.WriteBool(205, field_names[8], Field205); - } - if (hasField206) { - output.WriteBool(206, field_names[9], Field206); - } - if (hasField210) { - output.WriteInt32(210, field_names[11], Field210); - } - if (hasField211) { - output.WriteInt32(211, field_names[12], Field211); - } - if (hasField212) { - output.WriteInt32(212, field_names[13], Field212); - } - if (hasField213) { - output.WriteInt32(213, field_names[14], Field213); - } - if (hasField216) { - output.WriteInt32(216, field_names[15], Field216); - } - if (hasField217) { - output.WriteInt32(217, field_names[16], Field217); - } - if (hasField218) { - output.WriteInt32(218, field_names[17], Field218); - } - if (hasField220) { - output.WriteInt32(220, field_names[18], Field220); - } - if (hasField221) { - output.WriteInt32(221, field_names[19], Field221); - } - if (hasField222) { - output.WriteFloat(222, field_names[20], Field222); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasField1) { - size += pb::CodedOutputStream.ComputeStringSize(1, Field1); - } - if (hasField3) { - size += pb::CodedOutputStream.ComputeInt64Size(3, Field3); - } - if (hasField4) { - size += pb::CodedOutputStream.ComputeInt64Size(4, Field4); - } - if (hasField30) { - size += pb::CodedOutputStream.ComputeInt64Size(30, Field30); - } - if (hasField75) { - size += pb::CodedOutputStream.ComputeBoolSize(75, Field75); - } - if (hasField6) { - size += pb::CodedOutputStream.ComputeStringSize(6, Field6); - } - if (hasField2) { - size += pb::CodedOutputStream.ComputeBytesSize(2, Field2); - } - if (hasField21) { - size += pb::CodedOutputStream.ComputeInt32Size(21, Field21); - } - if (hasField71) { - size += pb::CodedOutputStream.ComputeInt32Size(71, Field71); - } - if (hasField25) { - size += pb::CodedOutputStream.ComputeFloatSize(25, Field25); - } - if (hasField109) { - size += pb::CodedOutputStream.ComputeInt32Size(109, Field109); - } - if (hasField210) { - size += pb::CodedOutputStream.ComputeInt32Size(210, Field210); - } - if (hasField211) { - size += pb::CodedOutputStream.ComputeInt32Size(211, Field211); - } - if (hasField212) { - size += pb::CodedOutputStream.ComputeInt32Size(212, Field212); - } - if (hasField213) { - size += pb::CodedOutputStream.ComputeInt32Size(213, Field213); - } - if (hasField216) { - size += pb::CodedOutputStream.ComputeInt32Size(216, Field216); - } - if (hasField217) { - size += pb::CodedOutputStream.ComputeInt32Size(217, Field217); - } - if (hasField218) { - size += pb::CodedOutputStream.ComputeInt32Size(218, Field218); - } - if (hasField220) { - size += pb::CodedOutputStream.ComputeInt32Size(220, Field220); - } - if (hasField221) { - size += pb::CodedOutputStream.ComputeInt32Size(221, Field221); - } - if (hasField222) { - size += pb::CodedOutputStream.ComputeFloatSize(222, Field222); - } - if (hasField63) { - size += pb::CodedOutputStream.ComputeInt32Size(63, Field63); - } - foreach (global::Google.ProtocolBuffers.TestProtos.SpeedMessage2.Types.Group1 element in Group1List) { - size += pb::CodedOutputStream.ComputeGroupSize(10, element); - } - { - int dataSize = 0; - foreach (string element in Field128List) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 2 * field128_.Count; - } - if (hasField131) { - size += pb::CodedOutputStream.ComputeInt64Size(131, Field131); - } - { - int dataSize = 0; - foreach (string element in Field127List) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 2 * field127_.Count; - } - if (hasField129) { - size += pb::CodedOutputStream.ComputeInt32Size(129, Field129); - } - { - int dataSize = 0; - foreach (long element in Field130List) { - dataSize += pb::CodedOutputStream.ComputeInt64SizeNoTag(element); - } - size += dataSize; - size += 2 * field130_.Count; - } - if (hasField205) { - size += pb::CodedOutputStream.ComputeBoolSize(205, Field205); - } - if (hasField206) { - size += pb::CodedOutputStream.ComputeBoolSize(206, Field206); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static SpeedMessage2 ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SpeedMessage2 ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SpeedMessage2 ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SpeedMessage2 ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SpeedMessage2 ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SpeedMessage2 ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SpeedMessage2 ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SpeedMessage2 ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SpeedMessage2 ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SpeedMessage2 ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private SpeedMessage2 MakeReadOnly() { - group1_.MakeReadOnly(); - field128_.MakeReadOnly(); - field127_.MakeReadOnly(); - field130_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SpeedMessage2 prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(SpeedMessage2 cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private SpeedMessage2 result; - - private SpeedMessage2 PrepareBuilder() { - if (resultIsReadOnly) { - SpeedMessage2 original = result; - result = new SpeedMessage2(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override SpeedMessage2 MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.SpeedMessage2.Descriptor; } - } - - public override SpeedMessage2 DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.SpeedMessage2.DefaultInstance; } - } - - public override SpeedMessage2 BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SpeedMessage2) { - return MergeFrom((SpeedMessage2) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SpeedMessage2 other) { - if (other == global::Google.ProtocolBuffers.TestProtos.SpeedMessage2.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasField1) { - Field1 = other.Field1; - } - if (other.HasField3) { - Field3 = other.Field3; - } - if (other.HasField4) { - Field4 = other.Field4; - } - if (other.HasField30) { - Field30 = other.Field30; - } - if (other.HasField75) { - Field75 = other.Field75; - } - if (other.HasField6) { - Field6 = other.Field6; - } - if (other.HasField2) { - Field2 = other.Field2; - } - if (other.HasField21) { - Field21 = other.Field21; - } - if (other.HasField71) { - Field71 = other.Field71; - } - if (other.HasField25) { - Field25 = other.Field25; - } - if (other.HasField109) { - Field109 = other.Field109; - } - if (other.HasField210) { - Field210 = other.Field210; - } - if (other.HasField211) { - Field211 = other.Field211; - } - if (other.HasField212) { - Field212 = other.Field212; - } - if (other.HasField213) { - Field213 = other.Field213; - } - if (other.HasField216) { - Field216 = other.Field216; - } - if (other.HasField217) { - Field217 = other.Field217; - } - if (other.HasField218) { - Field218 = other.Field218; - } - if (other.HasField220) { - Field220 = other.Field220; - } - if (other.HasField221) { - Field221 = other.Field221; - } - if (other.HasField222) { - Field222 = other.Field222; - } - if (other.HasField63) { - Field63 = other.Field63; - } - if (other.group1_.Count != 0) { - result.group1_.Add(other.group1_); - } - if (other.field128_.Count != 0) { - result.field128_.Add(other.field128_); - } - if (other.HasField131) { - Field131 = other.Field131; - } - if (other.field127_.Count != 0) { - result.field127_.Add(other.field127_); - } - if (other.HasField129) { - Field129 = other.Field129; - } - if (other.field130_.Count != 0) { - result.field130_.Add(other.field130_); - } - if (other.HasField205) { - Field205 = other.Field205; - } - if (other.HasField206) { - Field206 = other.Field206; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_speedMessage2FieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _speedMessage2FieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasField1 = input.ReadString(ref result.field1_); - break; - } - case 18: { - result.hasField2 = input.ReadBytes(ref result.field2_); - break; - } - case 24: { - result.hasField3 = input.ReadInt64(ref result.field3_); - break; - } - case 32: { - result.hasField4 = input.ReadInt64(ref result.field4_); - break; - } - case 50: { - result.hasField6 = input.ReadString(ref result.field6_); - break; - } - case 83: { - input.ReadGroupArray(tag, field_name, result.group1_, global::Google.ProtocolBuffers.TestProtos.SpeedMessage2.Types.Group1.DefaultInstance, extensionRegistry); - break; - } - case 168: { - result.hasField21 = input.ReadInt32(ref result.field21_); - break; - } - case 205: { - result.hasField25 = input.ReadFloat(ref result.field25_); - break; - } - case 240: { - result.hasField30 = input.ReadInt64(ref result.field30_); - break; - } - case 504: { - result.hasField63 = input.ReadInt32(ref result.field63_); - break; - } - case 568: { - result.hasField71 = input.ReadInt32(ref result.field71_); - break; - } - case 600: { - result.hasField75 = input.ReadBool(ref result.field75_); - break; - } - case 872: { - result.hasField109 = input.ReadInt32(ref result.field109_); - break; - } - case 1018: { - input.ReadStringArray(tag, field_name, result.field127_); - break; - } - case 1026: { - input.ReadStringArray(tag, field_name, result.field128_); - break; - } - case 1032: { - result.hasField129 = input.ReadInt32(ref result.field129_); - break; - } - case 1042: - case 1040: { - input.ReadInt64Array(tag, field_name, result.field130_); - break; - } - case 1048: { - result.hasField131 = input.ReadInt64(ref result.field131_); - break; - } - case 1640: { - result.hasField205 = input.ReadBool(ref result.field205_); - break; - } - case 1648: { - result.hasField206 = input.ReadBool(ref result.field206_); - break; - } - case 1680: { - result.hasField210 = input.ReadInt32(ref result.field210_); - break; - } - case 1688: { - result.hasField211 = input.ReadInt32(ref result.field211_); - break; - } - case 1696: { - result.hasField212 = input.ReadInt32(ref result.field212_); - break; - } - case 1704: { - result.hasField213 = input.ReadInt32(ref result.field213_); - break; - } - case 1728: { - result.hasField216 = input.ReadInt32(ref result.field216_); - break; - } - case 1736: { - result.hasField217 = input.ReadInt32(ref result.field217_); - break; - } - case 1744: { - result.hasField218 = input.ReadInt32(ref result.field218_); - break; - } - case 1760: { - result.hasField220 = input.ReadInt32(ref result.field220_); - break; - } - case 1768: { - result.hasField221 = input.ReadInt32(ref result.field221_); - break; - } - case 1781: { - result.hasField222 = input.ReadFloat(ref result.field222_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasField1 { - get { return result.hasField1; } - } - public string Field1 { - get { return result.Field1; } - set { SetField1(value); } - } - public Builder SetField1(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField1 = true; - result.field1_ = value; - return this; - } - public Builder ClearField1() { - PrepareBuilder(); - result.hasField1 = false; - result.field1_ = ""; - return this; - } - - public bool HasField3 { - get { return result.hasField3; } - } - public long Field3 { - get { return result.Field3; } - set { SetField3(value); } - } - public Builder SetField3(long value) { - PrepareBuilder(); - result.hasField3 = true; - result.field3_ = value; - return this; - } - public Builder ClearField3() { - PrepareBuilder(); - result.hasField3 = false; - result.field3_ = 0L; - return this; - } - - public bool HasField4 { - get { return result.hasField4; } - } - public long Field4 { - get { return result.Field4; } - set { SetField4(value); } - } - public Builder SetField4(long value) { - PrepareBuilder(); - result.hasField4 = true; - result.field4_ = value; - return this; - } - public Builder ClearField4() { - PrepareBuilder(); - result.hasField4 = false; - result.field4_ = 0L; - return this; - } - - public bool HasField30 { - get { return result.hasField30; } - } - public long Field30 { - get { return result.Field30; } - set { SetField30(value); } - } - public Builder SetField30(long value) { - PrepareBuilder(); - result.hasField30 = true; - result.field30_ = value; - return this; - } - public Builder ClearField30() { - PrepareBuilder(); - result.hasField30 = false; - result.field30_ = 0L; - return this; - } - - public bool HasField75 { - get { return result.hasField75; } - } - public bool Field75 { - get { return result.Field75; } - set { SetField75(value); } - } - public Builder SetField75(bool value) { - PrepareBuilder(); - result.hasField75 = true; - result.field75_ = value; - return this; - } - public Builder ClearField75() { - PrepareBuilder(); - result.hasField75 = false; - result.field75_ = false; - return this; - } - - public bool HasField6 { - get { return result.hasField6; } - } - public string Field6 { - get { return result.Field6; } - set { SetField6(value); } - } - public Builder SetField6(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField6 = true; - result.field6_ = value; - return this; - } - public Builder ClearField6() { - PrepareBuilder(); - result.hasField6 = false; - result.field6_ = ""; - return this; - } - - public bool HasField2 { - get { return result.hasField2; } - } - public pb::ByteString Field2 { - get { return result.Field2; } - set { SetField2(value); } - } - public Builder SetField2(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasField2 = true; - result.field2_ = value; - return this; - } - public Builder ClearField2() { - PrepareBuilder(); - result.hasField2 = false; - result.field2_ = pb::ByteString.Empty; - return this; - } - - public bool HasField21 { - get { return result.hasField21; } - } - public int Field21 { - get { return result.Field21; } - set { SetField21(value); } - } - public Builder SetField21(int value) { - PrepareBuilder(); - result.hasField21 = true; - result.field21_ = value; - return this; - } - public Builder ClearField21() { - PrepareBuilder(); - result.hasField21 = false; - result.field21_ = 0; - return this; - } - - public bool HasField71 { - get { return result.hasField71; } - } - public int Field71 { - get { return result.Field71; } - set { SetField71(value); } - } - public Builder SetField71(int value) { - PrepareBuilder(); - result.hasField71 = true; - result.field71_ = value; - return this; - } - public Builder ClearField71() { - PrepareBuilder(); - result.hasField71 = false; - result.field71_ = 0; - return this; - } - - public bool HasField25 { - get { return result.hasField25; } - } - public float Field25 { - get { return result.Field25; } - set { SetField25(value); } - } - public Builder SetField25(float value) { - PrepareBuilder(); - result.hasField25 = true; - result.field25_ = value; - return this; - } - public Builder ClearField25() { - PrepareBuilder(); - result.hasField25 = false; - result.field25_ = 0F; - return this; - } - - public bool HasField109 { - get { return result.hasField109; } - } - public int Field109 { - get { return result.Field109; } - set { SetField109(value); } - } - public Builder SetField109(int value) { - PrepareBuilder(); - result.hasField109 = true; - result.field109_ = value; - return this; - } - public Builder ClearField109() { - PrepareBuilder(); - result.hasField109 = false; - result.field109_ = 0; - return this; - } - - public bool HasField210 { - get { return result.hasField210; } - } - public int Field210 { - get { return result.Field210; } - set { SetField210(value); } - } - public Builder SetField210(int value) { - PrepareBuilder(); - result.hasField210 = true; - result.field210_ = value; - return this; - } - public Builder ClearField210() { - PrepareBuilder(); - result.hasField210 = false; - result.field210_ = 0; - return this; - } - - public bool HasField211 { - get { return result.hasField211; } - } - public int Field211 { - get { return result.Field211; } - set { SetField211(value); } - } - public Builder SetField211(int value) { - PrepareBuilder(); - result.hasField211 = true; - result.field211_ = value; - return this; - } - public Builder ClearField211() { - PrepareBuilder(); - result.hasField211 = false; - result.field211_ = 0; - return this; - } - - public bool HasField212 { - get { return result.hasField212; } - } - public int Field212 { - get { return result.Field212; } - set { SetField212(value); } - } - public Builder SetField212(int value) { - PrepareBuilder(); - result.hasField212 = true; - result.field212_ = value; - return this; - } - public Builder ClearField212() { - PrepareBuilder(); - result.hasField212 = false; - result.field212_ = 0; - return this; - } - - public bool HasField213 { - get { return result.hasField213; } - } - public int Field213 { - get { return result.Field213; } - set { SetField213(value); } - } - public Builder SetField213(int value) { - PrepareBuilder(); - result.hasField213 = true; - result.field213_ = value; - return this; - } - public Builder ClearField213() { - PrepareBuilder(); - result.hasField213 = false; - result.field213_ = 0; - return this; - } - - public bool HasField216 { - get { return result.hasField216; } - } - public int Field216 { - get { return result.Field216; } - set { SetField216(value); } - } - public Builder SetField216(int value) { - PrepareBuilder(); - result.hasField216 = true; - result.field216_ = value; - return this; - } - public Builder ClearField216() { - PrepareBuilder(); - result.hasField216 = false; - result.field216_ = 0; - return this; - } - - public bool HasField217 { - get { return result.hasField217; } - } - public int Field217 { - get { return result.Field217; } - set { SetField217(value); } - } - public Builder SetField217(int value) { - PrepareBuilder(); - result.hasField217 = true; - result.field217_ = value; - return this; - } - public Builder ClearField217() { - PrepareBuilder(); - result.hasField217 = false; - result.field217_ = 0; - return this; - } - - public bool HasField218 { - get { return result.hasField218; } - } - public int Field218 { - get { return result.Field218; } - set { SetField218(value); } - } - public Builder SetField218(int value) { - PrepareBuilder(); - result.hasField218 = true; - result.field218_ = value; - return this; - } - public Builder ClearField218() { - PrepareBuilder(); - result.hasField218 = false; - result.field218_ = 0; - return this; - } - - public bool HasField220 { - get { return result.hasField220; } - } - public int Field220 { - get { return result.Field220; } - set { SetField220(value); } - } - public Builder SetField220(int value) { - PrepareBuilder(); - result.hasField220 = true; - result.field220_ = value; - return this; - } - public Builder ClearField220() { - PrepareBuilder(); - result.hasField220 = false; - result.field220_ = 0; - return this; - } - - public bool HasField221 { - get { return result.hasField221; } - } - public int Field221 { - get { return result.Field221; } - set { SetField221(value); } - } - public Builder SetField221(int value) { - PrepareBuilder(); - result.hasField221 = true; - result.field221_ = value; - return this; - } - public Builder ClearField221() { - PrepareBuilder(); - result.hasField221 = false; - result.field221_ = 0; - return this; - } - - public bool HasField222 { - get { return result.hasField222; } - } - public float Field222 { - get { return result.Field222; } - set { SetField222(value); } - } - public Builder SetField222(float value) { - PrepareBuilder(); - result.hasField222 = true; - result.field222_ = value; - return this; - } - public Builder ClearField222() { - PrepareBuilder(); - result.hasField222 = false; - result.field222_ = 0F; - return this; - } - - public bool HasField63 { - get { return result.hasField63; } - } - public int Field63 { - get { return result.Field63; } - set { SetField63(value); } - } - public Builder SetField63(int value) { - PrepareBuilder(); - result.hasField63 = true; - result.field63_ = value; - return this; - } - public Builder ClearField63() { - PrepareBuilder(); - result.hasField63 = false; - result.field63_ = 0; - return this; - } - - public pbc::IPopsicleList Group1List { - get { return PrepareBuilder().group1_; } - } - public int Group1Count { - get { return result.Group1Count; } - } - public global::Google.ProtocolBuffers.TestProtos.SpeedMessage2.Types.Group1 GetGroup1(int index) { - return result.GetGroup1(index); - } - public Builder SetGroup1(int index, global::Google.ProtocolBuffers.TestProtos.SpeedMessage2.Types.Group1 value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.group1_[index] = value; - return this; - } - public Builder SetGroup1(int index, global::Google.ProtocolBuffers.TestProtos.SpeedMessage2.Types.Group1.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.group1_[index] = builderForValue.Build(); - return this; - } - public Builder AddGroup1(global::Google.ProtocolBuffers.TestProtos.SpeedMessage2.Types.Group1 value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.group1_.Add(value); - return this; - } - public Builder AddGroup1(global::Google.ProtocolBuffers.TestProtos.SpeedMessage2.Types.Group1.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.group1_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeGroup1(scg::IEnumerable values) { - PrepareBuilder(); - result.group1_.Add(values); - return this; - } - public Builder ClearGroup1() { - PrepareBuilder(); - result.group1_.Clear(); - return this; - } - - public pbc::IPopsicleList Field128List { - get { return PrepareBuilder().field128_; } - } - public int Field128Count { - get { return result.Field128Count; } - } - public string GetField128(int index) { - return result.GetField128(index); - } - public Builder SetField128(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.field128_[index] = value; - return this; - } - public Builder AddField128(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.field128_.Add(value); - return this; - } - public Builder AddRangeField128(scg::IEnumerable values) { - PrepareBuilder(); - result.field128_.Add(values); - return this; - } - public Builder ClearField128() { - PrepareBuilder(); - result.field128_.Clear(); - return this; - } - - public bool HasField131 { - get { return result.hasField131; } - } - public long Field131 { - get { return result.Field131; } - set { SetField131(value); } - } - public Builder SetField131(long value) { - PrepareBuilder(); - result.hasField131 = true; - result.field131_ = value; - return this; - } - public Builder ClearField131() { - PrepareBuilder(); - result.hasField131 = false; - result.field131_ = 0L; - return this; - } - - public pbc::IPopsicleList Field127List { - get { return PrepareBuilder().field127_; } - } - public int Field127Count { - get { return result.Field127Count; } - } - public string GetField127(int index) { - return result.GetField127(index); - } - public Builder SetField127(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.field127_[index] = value; - return this; - } - public Builder AddField127(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.field127_.Add(value); - return this; - } - public Builder AddRangeField127(scg::IEnumerable values) { - PrepareBuilder(); - result.field127_.Add(values); - return this; - } - public Builder ClearField127() { - PrepareBuilder(); - result.field127_.Clear(); - return this; - } - - public bool HasField129 { - get { return result.hasField129; } - } - public int Field129 { - get { return result.Field129; } - set { SetField129(value); } - } - public Builder SetField129(int value) { - PrepareBuilder(); - result.hasField129 = true; - result.field129_ = value; - return this; - } - public Builder ClearField129() { - PrepareBuilder(); - result.hasField129 = false; - result.field129_ = 0; - return this; - } - - public pbc::IPopsicleList Field130List { - get { return PrepareBuilder().field130_; } - } - public int Field130Count { - get { return result.Field130Count; } - } - public long GetField130(int index) { - return result.GetField130(index); - } - public Builder SetField130(int index, long value) { - PrepareBuilder(); - result.field130_[index] = value; - return this; - } - public Builder AddField130(long value) { - PrepareBuilder(); - result.field130_.Add(value); - return this; - } - public Builder AddRangeField130(scg::IEnumerable values) { - PrepareBuilder(); - result.field130_.Add(values); - return this; - } - public Builder ClearField130() { - PrepareBuilder(); - result.field130_.Clear(); - return this; - } - - public bool HasField205 { - get { return result.hasField205; } - } - public bool Field205 { - get { return result.Field205; } - set { SetField205(value); } - } - public Builder SetField205(bool value) { - PrepareBuilder(); - result.hasField205 = true; - result.field205_ = value; - return this; - } - public Builder ClearField205() { - PrepareBuilder(); - result.hasField205 = false; - result.field205_ = false; - return this; - } - - public bool HasField206 { - get { return result.hasField206; } - } - public bool Field206 { - get { return result.Field206; } - set { SetField206(value); } - } - public Builder SetField206(bool value) { - PrepareBuilder(); - result.hasField206 = true; - result.field206_ = value; - return this; - } - public Builder ClearField206() { - PrepareBuilder(); - result.hasField206 = false; - result.field206_ = false; - return this; - } - } - static SpeedMessage2() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestGoogleSpeedProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class SpeedMessage2GroupedMessage : pb::GeneratedMessage { - private SpeedMessage2GroupedMessage() { } - private static readonly SpeedMessage2GroupedMessage defaultInstance = new SpeedMessage2GroupedMessage().MakeReadOnly(); - private static readonly string[] _speedMessage2GroupedMessageFieldNames = new string[] { "field1", "field10", "field11", "field2", "field3", "field4", "field5", "field6", "field7", "field8", "field9" }; - private static readonly uint[] _speedMessage2GroupedMessageFieldTags = new uint[] { 13, 85, 88, 21, 29, 32, 40, 48, 56, 69, 72 }; - public static SpeedMessage2GroupedMessage DefaultInstance { - get { return defaultInstance; } - } - - public override SpeedMessage2GroupedMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override SpeedMessage2GroupedMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestGoogleSpeedProtoFile.internal__static_unittest_google_speed_SpeedMessage2GroupedMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestGoogleSpeedProtoFile.internal__static_unittest_google_speed_SpeedMessage2GroupedMessage__FieldAccessorTable; } - } - - public const int Field1FieldNumber = 1; - private bool hasField1; - private float field1_; - public bool HasField1 { - get { return hasField1; } - } - public float Field1 { - get { return field1_; } - } - - public const int Field2FieldNumber = 2; - private bool hasField2; - private float field2_; - public bool HasField2 { - get { return hasField2; } - } - public float Field2 { - get { return field2_; } - } - - public const int Field3FieldNumber = 3; - private bool hasField3; - private float field3_; - public bool HasField3 { - get { return hasField3; } - } - public float Field3 { - get { return field3_; } - } - - public const int Field4FieldNumber = 4; - private bool hasField4; - private bool field4_; - public bool HasField4 { - get { return hasField4; } - } - public bool Field4 { - get { return field4_; } - } - - public const int Field5FieldNumber = 5; - private bool hasField5; - private bool field5_; - public bool HasField5 { - get { return hasField5; } - } - public bool Field5 { - get { return field5_; } - } - - public const int Field6FieldNumber = 6; - private bool hasField6; - private bool field6_ = true; - public bool HasField6 { - get { return hasField6; } - } - public bool Field6 { - get { return field6_; } - } - - public const int Field7FieldNumber = 7; - private bool hasField7; - private bool field7_; - public bool HasField7 { - get { return hasField7; } - } - public bool Field7 { - get { return field7_; } - } - - public const int Field8FieldNumber = 8; - private bool hasField8; - private float field8_; - public bool HasField8 { - get { return hasField8; } - } - public float Field8 { - get { return field8_; } - } - - public const int Field9FieldNumber = 9; - private bool hasField9; - private bool field9_; - public bool HasField9 { - get { return hasField9; } - } - public bool Field9 { - get { return field9_; } - } - - public const int Field10FieldNumber = 10; - private bool hasField10; - private float field10_; - public bool HasField10 { - get { return hasField10; } - } - public float Field10 { - get { return field10_; } - } - - public const int Field11FieldNumber = 11; - private bool hasField11; - private long field11_; - public bool HasField11 { - get { return hasField11; } - } - public long Field11 { - get { return field11_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _speedMessage2GroupedMessageFieldNames; - if (hasField1) { - output.WriteFloat(1, field_names[0], Field1); - } - if (hasField2) { - output.WriteFloat(2, field_names[3], Field2); - } - if (hasField3) { - output.WriteFloat(3, field_names[4], Field3); - } - if (hasField4) { - output.WriteBool(4, field_names[5], Field4); - } - if (hasField5) { - output.WriteBool(5, field_names[6], Field5); - } - if (hasField6) { - output.WriteBool(6, field_names[7], Field6); - } - if (hasField7) { - output.WriteBool(7, field_names[8], Field7); - } - if (hasField8) { - output.WriteFloat(8, field_names[9], Field8); - } - if (hasField9) { - output.WriteBool(9, field_names[10], Field9); - } - if (hasField10) { - output.WriteFloat(10, field_names[1], Field10); - } - if (hasField11) { - output.WriteInt64(11, field_names[2], Field11); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasField1) { - size += pb::CodedOutputStream.ComputeFloatSize(1, Field1); - } - if (hasField2) { - size += pb::CodedOutputStream.ComputeFloatSize(2, Field2); - } - if (hasField3) { - size += pb::CodedOutputStream.ComputeFloatSize(3, Field3); - } - if (hasField4) { - size += pb::CodedOutputStream.ComputeBoolSize(4, Field4); - } - if (hasField5) { - size += pb::CodedOutputStream.ComputeBoolSize(5, Field5); - } - if (hasField6) { - size += pb::CodedOutputStream.ComputeBoolSize(6, Field6); - } - if (hasField7) { - size += pb::CodedOutputStream.ComputeBoolSize(7, Field7); - } - if (hasField8) { - size += pb::CodedOutputStream.ComputeFloatSize(8, Field8); - } - if (hasField9) { - size += pb::CodedOutputStream.ComputeBoolSize(9, Field9); - } - if (hasField10) { - size += pb::CodedOutputStream.ComputeFloatSize(10, Field10); - } - if (hasField11) { - size += pb::CodedOutputStream.ComputeInt64Size(11, Field11); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static SpeedMessage2GroupedMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SpeedMessage2GroupedMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SpeedMessage2GroupedMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SpeedMessage2GroupedMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SpeedMessage2GroupedMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SpeedMessage2GroupedMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SpeedMessage2GroupedMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SpeedMessage2GroupedMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SpeedMessage2GroupedMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SpeedMessage2GroupedMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private SpeedMessage2GroupedMessage MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SpeedMessage2GroupedMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(SpeedMessage2GroupedMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private SpeedMessage2GroupedMessage result; - - private SpeedMessage2GroupedMessage PrepareBuilder() { - if (resultIsReadOnly) { - SpeedMessage2GroupedMessage original = result; - result = new SpeedMessage2GroupedMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override SpeedMessage2GroupedMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.SpeedMessage2GroupedMessage.Descriptor; } - } - - public override SpeedMessage2GroupedMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.SpeedMessage2GroupedMessage.DefaultInstance; } - } - - public override SpeedMessage2GroupedMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SpeedMessage2GroupedMessage) { - return MergeFrom((SpeedMessage2GroupedMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SpeedMessage2GroupedMessage other) { - if (other == global::Google.ProtocolBuffers.TestProtos.SpeedMessage2GroupedMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasField1) { - Field1 = other.Field1; - } - if (other.HasField2) { - Field2 = other.Field2; - } - if (other.HasField3) { - Field3 = other.Field3; - } - if (other.HasField4) { - Field4 = other.Field4; - } - if (other.HasField5) { - Field5 = other.Field5; - } - if (other.HasField6) { - Field6 = other.Field6; - } - if (other.HasField7) { - Field7 = other.Field7; - } - if (other.HasField8) { - Field8 = other.Field8; - } - if (other.HasField9) { - Field9 = other.Field9; - } - if (other.HasField10) { - Field10 = other.Field10; - } - if (other.HasField11) { - Field11 = other.Field11; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_speedMessage2GroupedMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _speedMessage2GroupedMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 13: { - result.hasField1 = input.ReadFloat(ref result.field1_); - break; - } - case 21: { - result.hasField2 = input.ReadFloat(ref result.field2_); - break; - } - case 29: { - result.hasField3 = input.ReadFloat(ref result.field3_); - break; - } - case 32: { - result.hasField4 = input.ReadBool(ref result.field4_); - break; - } - case 40: { - result.hasField5 = input.ReadBool(ref result.field5_); - break; - } - case 48: { - result.hasField6 = input.ReadBool(ref result.field6_); - break; - } - case 56: { - result.hasField7 = input.ReadBool(ref result.field7_); - break; - } - case 69: { - result.hasField8 = input.ReadFloat(ref result.field8_); - break; - } - case 72: { - result.hasField9 = input.ReadBool(ref result.field9_); - break; - } - case 85: { - result.hasField10 = input.ReadFloat(ref result.field10_); - break; - } - case 88: { - result.hasField11 = input.ReadInt64(ref result.field11_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasField1 { - get { return result.hasField1; } - } - public float Field1 { - get { return result.Field1; } - set { SetField1(value); } - } - public Builder SetField1(float value) { - PrepareBuilder(); - result.hasField1 = true; - result.field1_ = value; - return this; - } - public Builder ClearField1() { - PrepareBuilder(); - result.hasField1 = false; - result.field1_ = 0F; - return this; - } - - public bool HasField2 { - get { return result.hasField2; } - } - public float Field2 { - get { return result.Field2; } - set { SetField2(value); } - } - public Builder SetField2(float value) { - PrepareBuilder(); - result.hasField2 = true; - result.field2_ = value; - return this; - } - public Builder ClearField2() { - PrepareBuilder(); - result.hasField2 = false; - result.field2_ = 0F; - return this; - } - - public bool HasField3 { - get { return result.hasField3; } - } - public float Field3 { - get { return result.Field3; } - set { SetField3(value); } - } - public Builder SetField3(float value) { - PrepareBuilder(); - result.hasField3 = true; - result.field3_ = value; - return this; - } - public Builder ClearField3() { - PrepareBuilder(); - result.hasField3 = false; - result.field3_ = 0F; - return this; - } - - public bool HasField4 { - get { return result.hasField4; } - } - public bool Field4 { - get { return result.Field4; } - set { SetField4(value); } - } - public Builder SetField4(bool value) { - PrepareBuilder(); - result.hasField4 = true; - result.field4_ = value; - return this; - } - public Builder ClearField4() { - PrepareBuilder(); - result.hasField4 = false; - result.field4_ = false; - return this; - } - - public bool HasField5 { - get { return result.hasField5; } - } - public bool Field5 { - get { return result.Field5; } - set { SetField5(value); } - } - public Builder SetField5(bool value) { - PrepareBuilder(); - result.hasField5 = true; - result.field5_ = value; - return this; - } - public Builder ClearField5() { - PrepareBuilder(); - result.hasField5 = false; - result.field5_ = false; - return this; - } - - public bool HasField6 { - get { return result.hasField6; } - } - public bool Field6 { - get { return result.Field6; } - set { SetField6(value); } - } - public Builder SetField6(bool value) { - PrepareBuilder(); - result.hasField6 = true; - result.field6_ = value; - return this; - } - public Builder ClearField6() { - PrepareBuilder(); - result.hasField6 = false; - result.field6_ = true; - return this; - } - - public bool HasField7 { - get { return result.hasField7; } - } - public bool Field7 { - get { return result.Field7; } - set { SetField7(value); } - } - public Builder SetField7(bool value) { - PrepareBuilder(); - result.hasField7 = true; - result.field7_ = value; - return this; - } - public Builder ClearField7() { - PrepareBuilder(); - result.hasField7 = false; - result.field7_ = false; - return this; - } - - public bool HasField8 { - get { return result.hasField8; } - } - public float Field8 { - get { return result.Field8; } - set { SetField8(value); } - } - public Builder SetField8(float value) { - PrepareBuilder(); - result.hasField8 = true; - result.field8_ = value; - return this; - } - public Builder ClearField8() { - PrepareBuilder(); - result.hasField8 = false; - result.field8_ = 0F; - return this; - } - - public bool HasField9 { - get { return result.hasField9; } - } - public bool Field9 { - get { return result.Field9; } - set { SetField9(value); } - } - public Builder SetField9(bool value) { - PrepareBuilder(); - result.hasField9 = true; - result.field9_ = value; - return this; - } - public Builder ClearField9() { - PrepareBuilder(); - result.hasField9 = false; - result.field9_ = false; - return this; - } - - public bool HasField10 { - get { return result.hasField10; } - } - public float Field10 { - get { return result.Field10; } - set { SetField10(value); } - } - public Builder SetField10(float value) { - PrepareBuilder(); - result.hasField10 = true; - result.field10_ = value; - return this; - } - public Builder ClearField10() { - PrepareBuilder(); - result.hasField10 = false; - result.field10_ = 0F; - return this; - } - - public bool HasField11 { - get { return result.hasField11; } - } - public long Field11 { - get { return result.Field11; } - set { SetField11(value); } - } - public Builder SetField11(long value) { - PrepareBuilder(); - result.hasField11 = true; - result.field11_ = value; - return this; - } - public Builder ClearField11() { - PrepareBuilder(); - result.hasField11 = false; - result.field11_ = 0L; - return this; - } - } - static SpeedMessage2GroupedMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestGoogleSpeedProtoFile.Descriptor, null); - } - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestImportLiteProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestImportLiteProtoFile.cs deleted file mode 100644 index fe1f408..0000000 --- a/src/ProtocolBuffers.Test/TestProtos/UnitTestImportLiteProtoFile.cs +++ /dev/null @@ -1,308 +0,0 @@ -// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.TestProtos { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class UnitTestImportLiteProtoFile { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - #endregion - #region Extensions - internal static readonly object Descriptor; - static UnitTestImportLiteProtoFile() { - Descriptor = null; - } - #endregion - - } - #region Enums - public enum ImportEnumLite { - IMPORT_LITE_FOO = 7, - IMPORT_LITE_BAR = 8, - IMPORT_LITE_BAZ = 9, - } - - #endregion - - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class ImportMessageLite : pb::GeneratedMessageLite { - private ImportMessageLite() { } - private static readonly ImportMessageLite defaultInstance = new ImportMessageLite().MakeReadOnly(); - private static readonly string[] _importMessageLiteFieldNames = new string[] { "d" }; - private static readonly uint[] _importMessageLiteFieldTags = new uint[] { 8 }; - public static ImportMessageLite DefaultInstance { - get { return defaultInstance; } - } - - public override ImportMessageLite DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override ImportMessageLite ThisMessage { - get { return this; } - } - - public const int DFieldNumber = 1; - private bool hasD; - private int d_; - public bool HasD { - get { return hasD; } - } - public int D { - get { return d_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _importMessageLiteFieldNames; - if (hasD) { - output.WriteInt32(1, field_names[0], D); - } - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasD) { - size += pb::CodedOutputStream.ComputeInt32Size(1, D); - } - memoizedSerializedSize = size; - return size; - } - #region Lite runtime methods - public override int GetHashCode() { - int hash = GetType().GetHashCode(); - if (hasD) hash ^= d_.GetHashCode(); - return hash; - } - - public override bool Equals(object obj) { - ImportMessageLite other = obj as ImportMessageLite; - if (other == null) return false; - if (hasD != other.hasD || (hasD && !d_.Equals(other.d_))) return false; - return true; - } - - public override void PrintTo(global::System.IO.TextWriter writer) { - PrintField("d", hasD, d_, writer); - } - #endregion - - public static ImportMessageLite ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ImportMessageLite ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ImportMessageLite ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ImportMessageLite ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ImportMessageLite ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ImportMessageLite ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ImportMessageLite ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ImportMessageLite ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ImportMessageLite ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ImportMessageLite ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private ImportMessageLite MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ImportMessageLite prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilderLite { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(ImportMessageLite cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private ImportMessageLite result; - - private ImportMessageLite PrepareBuilder() { - if (resultIsReadOnly) { - ImportMessageLite original = result; - result = new ImportMessageLite(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override ImportMessageLite MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override ImportMessageLite DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.ImportMessageLite.DefaultInstance; } - } - - public override ImportMessageLite BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessageLite other) { - if (other is ImportMessageLite) { - return MergeFrom((ImportMessageLite) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ImportMessageLite other) { - if (other == global::Google.ProtocolBuffers.TestProtos.ImportMessageLite.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasD) { - D = other.D; - } - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_importMessageLiteFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _importMessageLiteFieldTags[field_ordinal]; - else { - ParseUnknownField(input, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - return this; - } - ParseUnknownField(input, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasD = input.ReadInt32(ref result.d_); - break; - } - } - } - - return this; - } - - - public bool HasD { - get { return result.hasD; } - } - public int D { - get { return result.D; } - set { SetD(value); } - } - public Builder SetD(int value) { - PrepareBuilder(); - result.hasD = true; - result.d_ = value; - return this; - } - public Builder ClearD() { - PrepareBuilder(); - result.hasD = false; - result.d_ = 0; - return this; - } - } - static ImportMessageLite() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestImportLiteProtoFile.Descriptor, null); - } - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestImportProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestImportProtoFile.cs deleted file mode 100644 index 4cae2b8..0000000 --- a/src/ProtocolBuffers.Test/TestProtos/UnitTestImportProtoFile.cs +++ /dev/null @@ -1,346 +0,0 @@ -// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.TestProtos { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class UnitTestImportProtoFile { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_import_ImportMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static UnitTestImportProtoFile() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CiVnb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfaW1wb3J0LnByb3RvEhhwcm90", - "b2J1Zl91bml0dGVzdF9pbXBvcnQaJGdvb2dsZS9wcm90b2J1Zi9jc2hhcnBf", - "b3B0aW9ucy5wcm90byIaCg1JbXBvcnRNZXNzYWdlEgkKAWQYASABKAUqPAoK", - "SW1wb3J0RW51bRIOCgpJTVBPUlRfRk9PEAcSDgoKSU1QT1JUX0JBUhAIEg4K", - "CklNUE9SVF9CQVoQCUJbChhjb20uZ29vZ2xlLnByb3RvYnVmLnRlc3RIAcI+", - "PAohR29vZ2xlLlByb3RvY29sQnVmZmVycy5UZXN0UHJvdG9zEhdVbml0VGVz", - "dEltcG9ydFByb3RvRmlsZQ==")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_protobuf_unittest_import_ImportMessage__Descriptor = Descriptor.MessageTypes[0]; - internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_import_ImportMessage__Descriptor, - new string[] { "D", }); - pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); - RegisterAllExtensions(registry); - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.RegisterAllExtensions(registry); - return registry; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, - }, assigner); - } - #endregion - - } - #region Enums - public enum ImportEnum { - IMPORT_FOO = 7, - IMPORT_BAR = 8, - IMPORT_BAZ = 9, - } - - #endregion - - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class ImportMessage : pb::GeneratedMessage { - private ImportMessage() { } - private static readonly ImportMessage defaultInstance = new ImportMessage().MakeReadOnly(); - private static readonly string[] _importMessageFieldNames = new string[] { "d" }; - private static readonly uint[] _importMessageFieldTags = new uint[] { 8 }; - public static ImportMessage DefaultInstance { - get { return defaultInstance; } - } - - public override ImportMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override ImportMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestImportProtoFile.internal__static_protobuf_unittest_import_ImportMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestImportProtoFile.internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable; } - } - - public const int DFieldNumber = 1; - private bool hasD; - private int d_; - public bool HasD { - get { return hasD; } - } - public int D { - get { return d_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _importMessageFieldNames; - if (hasD) { - output.WriteInt32(1, field_names[0], D); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasD) { - size += pb::CodedOutputStream.ComputeInt32Size(1, D); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static ImportMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ImportMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ImportMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ImportMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ImportMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ImportMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ImportMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ImportMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ImportMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ImportMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private ImportMessage MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ImportMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(ImportMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private ImportMessage result; - - private ImportMessage PrepareBuilder() { - if (resultIsReadOnly) { - ImportMessage original = result; - result = new ImportMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override ImportMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.ImportMessage.Descriptor; } - } - - public override ImportMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.ImportMessage.DefaultInstance; } - } - - public override ImportMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ImportMessage) { - return MergeFrom((ImportMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ImportMessage other) { - if (other == global::Google.ProtocolBuffers.TestProtos.ImportMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasD) { - D = other.D; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_importMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _importMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasD = input.ReadInt32(ref result.d_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasD { - get { return result.hasD; } - } - public int D { - get { return result.D; } - set { SetD(value); } - } - public Builder SetD(int value) { - PrepareBuilder(); - result.hasD = true; - result.d_ = value; - return this; - } - public Builder ClearD() { - PrepareBuilder(); - result.hasD = false; - result.d_ = 0; - return this; - } - } - static ImportMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestImportProtoFile.Descriptor, null); - } - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestMessageSetProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestMessageSetProtoFile.cs deleted file mode 100644 index 7a2875c..0000000 --- a/src/ProtocolBuffers.Test/TestProtos/UnitTestMessageSetProtoFile.cs +++ /dev/null @@ -1,1826 +0,0 @@ -// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.TestProtos { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class UnitTestMessageSetProtoFile { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - registry.Add(global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension1.MessageSetExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension2.MessageSetExtension); - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestMessageSet__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMessageSet__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestMessageSetContainer__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMessageSetContainer__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestMessageSetExtension1__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMessageSetExtension1__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestMessageSetExtension2__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMessageSetExtension2__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_RawMessageSet__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_RawMessageSet__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_RawMessageSet_Item__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_RawMessageSet_Item__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static UnitTestMessageSetProtoFile() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CiNnb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfbXNldC5wcm90bxIRcHJvdG9i", - "dWZfdW5pdHRlc3QaJGdvb2dsZS9wcm90b2J1Zi9jc2hhcnBfb3B0aW9ucy5w", - "cm90byIeCg5UZXN0TWVzc2FnZVNldCoICAQQgICAgAI6AggBIlEKF1Rlc3RN", - "ZXNzYWdlU2V0Q29udGFpbmVyEjYKC21lc3NhZ2Vfc2V0GAEgASgLMiEucHJv", - "dG9idWZfdW5pdHRlc3QuVGVzdE1lc3NhZ2VTZXQilgEKGFRlc3RNZXNzYWdl", - "U2V0RXh0ZW5zaW9uMRIJCgFpGA8gASgFMm8KFW1lc3NhZ2Vfc2V0X2V4dGVu", - "c2lvbhIhLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RNZXNzYWdlU2V0GLCmXiAB", - "KAsyKy5wcm90b2J1Zl91bml0dGVzdC5UZXN0TWVzc2FnZVNldEV4dGVuc2lv", - "bjEimAEKGFRlc3RNZXNzYWdlU2V0RXh0ZW5zaW9uMhILCgNzdHIYGSABKAky", - "bwoVbWVzc2FnZV9zZXRfZXh0ZW5zaW9uEiEucHJvdG9idWZfdW5pdHRlc3Qu", - "VGVzdE1lc3NhZ2VTZXQY+bteIAEoCzIrLnByb3RvYnVmX3VuaXR0ZXN0LlRl", - "c3RNZXNzYWdlU2V0RXh0ZW5zaW9uMiJuCg1SYXdNZXNzYWdlU2V0EjMKBGl0", - "ZW0YASADKAoyJS5wcm90b2J1Zl91bml0dGVzdC5SYXdNZXNzYWdlU2V0Lkl0", - "ZW0aKAoESXRlbRIPCgd0eXBlX2lkGAIgAigFEg8KB21lc3NhZ2UYAyACKAxC", - "RUgBwj5ACiFHb29nbGUuUHJvdG9jb2xCdWZmZXJzLlRlc3RQcm90b3MSG1Vu", - "aXRUZXN0TWVzc2FnZVNldFByb3RvRmlsZQ==")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_protobuf_unittest_TestMessageSet__Descriptor = Descriptor.MessageTypes[0]; - internal__static_protobuf_unittest_TestMessageSet__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestMessageSet__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_TestMessageSetContainer__Descriptor = Descriptor.MessageTypes[1]; - internal__static_protobuf_unittest_TestMessageSetContainer__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestMessageSetContainer__Descriptor, - new string[] { "MessageSet", }); - internal__static_protobuf_unittest_TestMessageSetExtension1__Descriptor = Descriptor.MessageTypes[2]; - internal__static_protobuf_unittest_TestMessageSetExtension1__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestMessageSetExtension1__Descriptor, - new string[] { "I", }); - global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension1.MessageSetExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension1.Descriptor.Extensions[0]); - internal__static_protobuf_unittest_TestMessageSetExtension2__Descriptor = Descriptor.MessageTypes[3]; - internal__static_protobuf_unittest_TestMessageSetExtension2__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestMessageSetExtension2__Descriptor, - new string[] { "Str", }); - global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension2.MessageSetExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension2.Descriptor.Extensions[0]); - internal__static_protobuf_unittest_RawMessageSet__Descriptor = Descriptor.MessageTypes[4]; - internal__static_protobuf_unittest_RawMessageSet__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_RawMessageSet__Descriptor, - new string[] { "Item", }); - internal__static_protobuf_unittest_RawMessageSet_Item__Descriptor = internal__static_protobuf_unittest_RawMessageSet__Descriptor.NestedTypes[0]; - internal__static_protobuf_unittest_RawMessageSet_Item__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_RawMessageSet_Item__Descriptor, - new string[] { "TypeId", "Message", }); - pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); - RegisterAllExtensions(registry); - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.RegisterAllExtensions(registry); - return registry; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, - }, assigner); - } - #endregion - - } - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestMessageSet : pb::ExtendableMessage { - private TestMessageSet() { } - private static readonly TestMessageSet defaultInstance = new TestMessageSet().MakeReadOnly(); - private static readonly string[] _testMessageSetFieldNames = new string[] { }; - private static readonly uint[] _testMessageSetFieldTags = new uint[] { }; - public static TestMessageSet DefaultInstance { - get { return defaultInstance; } - } - - public override TestMessageSet DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestMessageSet ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestMessageSetProtoFile.internal__static_protobuf_unittest_TestMessageSet__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestMessageSetProtoFile.internal__static_protobuf_unittest_TestMessageSet__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testMessageSetFieldNames; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - extensionWriter.WriteUntil(536870912, output); - UnknownFields.WriteAsMessageSetTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSizeAsMessageSet; - memoizedSerializedSize = size; - return size; - } - public static TestMessageSet ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestMessageSet ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestMessageSet ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestMessageSet ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestMessageSet ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestMessageSet ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestMessageSet ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestMessageSet ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestMessageSet ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestMessageSet ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestMessageSet MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestMessageSet prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestMessageSet cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestMessageSet result; - - private TestMessageSet PrepareBuilder() { - if (resultIsReadOnly) { - TestMessageSet original = result; - result = new TestMessageSet(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestMessageSet MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestMessageSet.Descriptor; } - } - - public override TestMessageSet DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestMessageSet.DefaultInstance; } - } - - public override TestMessageSet BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestMessageSet) { - return MergeFrom((TestMessageSet) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestMessageSet other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestMessageSet.DefaultInstance) return this; - PrepareBuilder(); - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testMessageSetFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testMessageSetFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static TestMessageSet() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestMessageSetProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestMessageSetContainer : pb::GeneratedMessage { - private TestMessageSetContainer() { } - private static readonly TestMessageSetContainer defaultInstance = new TestMessageSetContainer().MakeReadOnly(); - private static readonly string[] _testMessageSetContainerFieldNames = new string[] { "message_set" }; - private static readonly uint[] _testMessageSetContainerFieldTags = new uint[] { 10 }; - public static TestMessageSetContainer DefaultInstance { - get { return defaultInstance; } - } - - public override TestMessageSetContainer DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestMessageSetContainer ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestMessageSetProtoFile.internal__static_protobuf_unittest_TestMessageSetContainer__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestMessageSetProtoFile.internal__static_protobuf_unittest_TestMessageSetContainer__FieldAccessorTable; } - } - - public const int MessageSetFieldNumber = 1; - private bool hasMessageSet; - private global::Google.ProtocolBuffers.TestProtos.TestMessageSet messageSet_; - public bool HasMessageSet { - get { return hasMessageSet; } - } - public global::Google.ProtocolBuffers.TestProtos.TestMessageSet MessageSet { - get { return messageSet_ ?? global::Google.ProtocolBuffers.TestProtos.TestMessageSet.DefaultInstance; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testMessageSetContainerFieldNames; - if (hasMessageSet) { - output.WriteMessage(1, field_names[0], MessageSet); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasMessageSet) { - size += pb::CodedOutputStream.ComputeMessageSize(1, MessageSet); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestMessageSetContainer ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestMessageSetContainer ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestMessageSetContainer ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestMessageSetContainer ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestMessageSetContainer ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestMessageSetContainer ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestMessageSetContainer ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestMessageSetContainer ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestMessageSetContainer ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestMessageSetContainer ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestMessageSetContainer MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestMessageSetContainer prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestMessageSetContainer cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestMessageSetContainer result; - - private TestMessageSetContainer PrepareBuilder() { - if (resultIsReadOnly) { - TestMessageSetContainer original = result; - result = new TestMessageSetContainer(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestMessageSetContainer MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestMessageSetContainer.Descriptor; } - } - - public override TestMessageSetContainer DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestMessageSetContainer.DefaultInstance; } - } - - public override TestMessageSetContainer BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestMessageSetContainer) { - return MergeFrom((TestMessageSetContainer) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestMessageSetContainer other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestMessageSetContainer.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasMessageSet) { - MergeMessageSet(other.MessageSet); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testMessageSetContainerFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testMessageSetContainerFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - global::Google.ProtocolBuffers.TestProtos.TestMessageSet.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestMessageSet.CreateBuilder(); - if (result.hasMessageSet) { - subBuilder.MergeFrom(MessageSet); - } - input.ReadMessage(subBuilder, extensionRegistry); - MessageSet = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasMessageSet { - get { return result.hasMessageSet; } - } - public global::Google.ProtocolBuffers.TestProtos.TestMessageSet MessageSet { - get { return result.MessageSet; } - set { SetMessageSet(value); } - } - public Builder SetMessageSet(global::Google.ProtocolBuffers.TestProtos.TestMessageSet value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasMessageSet = true; - result.messageSet_ = value; - return this; - } - public Builder SetMessageSet(global::Google.ProtocolBuffers.TestProtos.TestMessageSet.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasMessageSet = true; - result.messageSet_ = builderForValue.Build(); - return this; - } - public Builder MergeMessageSet(global::Google.ProtocolBuffers.TestProtos.TestMessageSet value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasMessageSet && - result.messageSet_ != global::Google.ProtocolBuffers.TestProtos.TestMessageSet.DefaultInstance) { - result.messageSet_ = global::Google.ProtocolBuffers.TestProtos.TestMessageSet.CreateBuilder(result.messageSet_).MergeFrom(value).BuildPartial(); - } else { - result.messageSet_ = value; - } - result.hasMessageSet = true; - return this; - } - public Builder ClearMessageSet() { - PrepareBuilder(); - result.hasMessageSet = false; - result.messageSet_ = null; - return this; - } - } - static TestMessageSetContainer() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestMessageSetProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestMessageSetExtension1 : pb::GeneratedMessage { - private TestMessageSetExtension1() { } - private static readonly TestMessageSetExtension1 defaultInstance = new TestMessageSetExtension1().MakeReadOnly(); - private static readonly string[] _testMessageSetExtension1FieldNames = new string[] { "i" }; - private static readonly uint[] _testMessageSetExtension1FieldTags = new uint[] { 120 }; - public static TestMessageSetExtension1 DefaultInstance { - get { return defaultInstance; } - } - - public override TestMessageSetExtension1 DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestMessageSetExtension1 ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestMessageSetProtoFile.internal__static_protobuf_unittest_TestMessageSetExtension1__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestMessageSetProtoFile.internal__static_protobuf_unittest_TestMessageSetExtension1__FieldAccessorTable; } - } - - public const int MessageSetExtensionFieldNumber = 1545008; - public static pb::GeneratedExtensionBase MessageSetExtension; - public const int IFieldNumber = 15; - private bool hasI; - private int i_; - public bool HasI { - get { return hasI; } - } - public int I { - get { return i_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testMessageSetExtension1FieldNames; - if (hasI) { - output.WriteInt32(15, field_names[0], I); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasI) { - size += pb::CodedOutputStream.ComputeInt32Size(15, I); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestMessageSetExtension1 ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestMessageSetExtension1 ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestMessageSetExtension1 ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestMessageSetExtension1 ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestMessageSetExtension1 ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestMessageSetExtension1 ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestMessageSetExtension1 ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestMessageSetExtension1 ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestMessageSetExtension1 ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestMessageSetExtension1 ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestMessageSetExtension1 MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestMessageSetExtension1 prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestMessageSetExtension1 cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestMessageSetExtension1 result; - - private TestMessageSetExtension1 PrepareBuilder() { - if (resultIsReadOnly) { - TestMessageSetExtension1 original = result; - result = new TestMessageSetExtension1(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestMessageSetExtension1 MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension1.Descriptor; } - } - - public override TestMessageSetExtension1 DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension1.DefaultInstance; } - } - - public override TestMessageSetExtension1 BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestMessageSetExtension1) { - return MergeFrom((TestMessageSetExtension1) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestMessageSetExtension1 other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension1.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasI) { - I = other.I; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testMessageSetExtension1FieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testMessageSetExtension1FieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 120: { - result.hasI = input.ReadInt32(ref result.i_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasI { - get { return result.hasI; } - } - public int I { - get { return result.I; } - set { SetI(value); } - } - public Builder SetI(int value) { - PrepareBuilder(); - result.hasI = true; - result.i_ = value; - return this; - } - public Builder ClearI() { - PrepareBuilder(); - result.hasI = false; - result.i_ = 0; - return this; - } - } - static TestMessageSetExtension1() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestMessageSetProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestMessageSetExtension2 : pb::GeneratedMessage { - private TestMessageSetExtension2() { } - private static readonly TestMessageSetExtension2 defaultInstance = new TestMessageSetExtension2().MakeReadOnly(); - private static readonly string[] _testMessageSetExtension2FieldNames = new string[] { "str" }; - private static readonly uint[] _testMessageSetExtension2FieldTags = new uint[] { 202 }; - public static TestMessageSetExtension2 DefaultInstance { - get { return defaultInstance; } - } - - public override TestMessageSetExtension2 DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestMessageSetExtension2 ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestMessageSetProtoFile.internal__static_protobuf_unittest_TestMessageSetExtension2__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestMessageSetProtoFile.internal__static_protobuf_unittest_TestMessageSetExtension2__FieldAccessorTable; } - } - - public const int MessageSetExtensionFieldNumber = 1547769; - public static pb::GeneratedExtensionBase MessageSetExtension; - public const int StrFieldNumber = 25; - private bool hasStr; - private string str_ = ""; - public bool HasStr { - get { return hasStr; } - } - public string Str { - get { return str_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testMessageSetExtension2FieldNames; - if (hasStr) { - output.WriteString(25, field_names[0], Str); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasStr) { - size += pb::CodedOutputStream.ComputeStringSize(25, Str); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestMessageSetExtension2 ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestMessageSetExtension2 ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestMessageSetExtension2 ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestMessageSetExtension2 ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestMessageSetExtension2 ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestMessageSetExtension2 ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestMessageSetExtension2 ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestMessageSetExtension2 ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestMessageSetExtension2 ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestMessageSetExtension2 ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestMessageSetExtension2 MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestMessageSetExtension2 prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestMessageSetExtension2 cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestMessageSetExtension2 result; - - private TestMessageSetExtension2 PrepareBuilder() { - if (resultIsReadOnly) { - TestMessageSetExtension2 original = result; - result = new TestMessageSetExtension2(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestMessageSetExtension2 MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension2.Descriptor; } - } - - public override TestMessageSetExtension2 DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension2.DefaultInstance; } - } - - public override TestMessageSetExtension2 BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestMessageSetExtension2) { - return MergeFrom((TestMessageSetExtension2) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestMessageSetExtension2 other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestMessageSetExtension2.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasStr) { - Str = other.Str; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testMessageSetExtension2FieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testMessageSetExtension2FieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 202: { - result.hasStr = input.ReadString(ref result.str_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasStr { - get { return result.hasStr; } - } - public string Str { - get { return result.Str; } - set { SetStr(value); } - } - public Builder SetStr(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasStr = true; - result.str_ = value; - return this; - } - public Builder ClearStr() { - PrepareBuilder(); - result.hasStr = false; - result.str_ = ""; - return this; - } - } - static TestMessageSetExtension2() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestMessageSetProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class RawMessageSet : pb::GeneratedMessage { - private RawMessageSet() { } - private static readonly RawMessageSet defaultInstance = new RawMessageSet().MakeReadOnly(); - private static readonly string[] _rawMessageSetFieldNames = new string[] { "item" }; - private static readonly uint[] _rawMessageSetFieldTags = new uint[] { 11 }; - public static RawMessageSet DefaultInstance { - get { return defaultInstance; } - } - - public override RawMessageSet DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override RawMessageSet ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestMessageSetProtoFile.internal__static_protobuf_unittest_RawMessageSet__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestMessageSetProtoFile.internal__static_protobuf_unittest_RawMessageSet__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Item : pb::GeneratedMessage { - private Item() { } - private static readonly Item defaultInstance = new Item().MakeReadOnly(); - private static readonly string[] _itemFieldNames = new string[] { "message", "type_id" }; - private static readonly uint[] _itemFieldTags = new uint[] { 26, 16 }; - public static Item DefaultInstance { - get { return defaultInstance; } - } - - public override Item DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override Item ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestMessageSetProtoFile.internal__static_protobuf_unittest_RawMessageSet_Item__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestMessageSetProtoFile.internal__static_protobuf_unittest_RawMessageSet_Item__FieldAccessorTable; } - } - - public const int TypeIdFieldNumber = 2; - private bool hasTypeId; - private int typeId_; - public bool HasTypeId { - get { return hasTypeId; } - } - public int TypeId { - get { return typeId_; } - } - - public const int MessageFieldNumber = 3; - private bool hasMessage; - private pb::ByteString message_ = pb::ByteString.Empty; - public bool HasMessage { - get { return hasMessage; } - } - public pb::ByteString Message { - get { return message_; } - } - - public override bool IsInitialized { - get { - if (!hasTypeId) return false; - if (!hasMessage) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _itemFieldNames; - if (hasTypeId) { - output.WriteInt32(2, field_names[1], TypeId); - } - if (hasMessage) { - output.WriteBytes(3, field_names[0], Message); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasTypeId) { - size += pb::CodedOutputStream.ComputeInt32Size(2, TypeId); - } - if (hasMessage) { - size += pb::CodedOutputStream.ComputeBytesSize(3, Message); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static Item ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Item ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Item ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Item ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Item ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Item ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Item ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Item ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Item ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Item ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private Item MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Item prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(Item cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private Item result; - - private Item PrepareBuilder() { - if (resultIsReadOnly) { - Item original = result; - result = new Item(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override Item MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item.Descriptor; } - } - - public override Item DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item.DefaultInstance; } - } - - public override Item BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Item) { - return MergeFrom((Item) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Item other) { - if (other == global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasTypeId) { - TypeId = other.TypeId; - } - if (other.HasMessage) { - Message = other.Message; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_itemFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _itemFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 16: { - result.hasTypeId = input.ReadInt32(ref result.typeId_); - break; - } - case 26: { - result.hasMessage = input.ReadBytes(ref result.message_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasTypeId { - get { return result.hasTypeId; } - } - public int TypeId { - get { return result.TypeId; } - set { SetTypeId(value); } - } - public Builder SetTypeId(int value) { - PrepareBuilder(); - result.hasTypeId = true; - result.typeId_ = value; - return this; - } - public Builder ClearTypeId() { - PrepareBuilder(); - result.hasTypeId = false; - result.typeId_ = 0; - return this; - } - - public bool HasMessage { - get { return result.hasMessage; } - } - public pb::ByteString Message { - get { return result.Message; } - set { SetMessage(value); } - } - public Builder SetMessage(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasMessage = true; - result.message_ = value; - return this; - } - public Builder ClearMessage() { - PrepareBuilder(); - result.hasMessage = false; - result.message_ = pb::ByteString.Empty; - return this; - } - } - static Item() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestMessageSetProtoFile.Descriptor, null); - } - } - - } - #endregion - - public const int ItemFieldNumber = 1; - private pbc::PopsicleList item_ = new pbc::PopsicleList(); - public scg::IList ItemList { - get { return item_; } - } - public int ItemCount { - get { return item_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item GetItem(int index) { - return item_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _rawMessageSetFieldNames; - if (item_.Count > 0) { - output.WriteGroupArray(1, field_names[0], item_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item element in ItemList) { - size += pb::CodedOutputStream.ComputeGroupSize(1, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static RawMessageSet ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RawMessageSet ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RawMessageSet ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RawMessageSet ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RawMessageSet ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RawMessageSet ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static RawMessageSet ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static RawMessageSet ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static RawMessageSet ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RawMessageSet ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private RawMessageSet MakeReadOnly() { - item_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(RawMessageSet prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(RawMessageSet cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private RawMessageSet result; - - private RawMessageSet PrepareBuilder() { - if (resultIsReadOnly) { - RawMessageSet original = result; - result = new RawMessageSet(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override RawMessageSet MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Descriptor; } - } - - public override RawMessageSet DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.RawMessageSet.DefaultInstance; } - } - - public override RawMessageSet BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is RawMessageSet) { - return MergeFrom((RawMessageSet) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(RawMessageSet other) { - if (other == global::Google.ProtocolBuffers.TestProtos.RawMessageSet.DefaultInstance) return this; - PrepareBuilder(); - if (other.item_.Count != 0) { - result.item_.Add(other.item_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_rawMessageSetFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _rawMessageSetFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 11: { - input.ReadGroupArray(tag, field_name, result.item_, global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item.DefaultInstance, extensionRegistry); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public pbc::IPopsicleList ItemList { - get { return PrepareBuilder().item_; } - } - public int ItemCount { - get { return result.ItemCount; } - } - public global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item GetItem(int index) { - return result.GetItem(index); - } - public Builder SetItem(int index, global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.item_[index] = value; - return this; - } - public Builder SetItem(int index, global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.item_[index] = builderForValue.Build(); - return this; - } - public Builder AddItem(global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.item_.Add(value); - return this; - } - public Builder AddItem(global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.item_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeItem(scg::IEnumerable values) { - PrepareBuilder(); - result.item_.Add(values); - return this; - } - public Builder ClearItem() { - PrepareBuilder(); - result.item_.Clear(); - return this; - } - } - static RawMessageSet() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestMessageSetProtoFile.Descriptor, null); - } - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestNoGenericServicesProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestNoGenericServicesProtoFile.cs deleted file mode 100644 index 8ff21c3..0000000 --- a/src/ProtocolBuffers.Test/TestProtos/UnitTestNoGenericServicesProtoFile.cs +++ /dev/null @@ -1,368 +0,0 @@ -// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.TestProtos.NoGenericService { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class UnitTestNoGenericServicesProtoFile { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - registry.Add(global::Google.ProtocolBuffers.TestProtos.NoGenericService.UnitTestNoGenericServicesProtoFile.TestExtension); - } - #endregion - #region Extensions - public const int TestExtensionFieldNumber = 1000; - public static pb::GeneratedExtensionBase TestExtension; - #endregion - - #region Static variables - internal static pbd::MessageDescriptor internal__static_google_protobuf_no_generic_services_test_TestMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_no_generic_services_test_TestMessage__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static UnitTestNoGenericServicesProtoFile() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CjJnb29nbGUvcHJvdG9idWYvdW5pdHRlc3Rfbm9fZ2VuZXJpY19zZXJ2aWNl", - "cy5wcm90bxIoZ29vZ2xlLnByb3RvYnVmLm5vX2dlbmVyaWNfc2VydmljZXNf", - "dGVzdBokZ29vZ2xlL3Byb3RvYnVmL2NzaGFycF9vcHRpb25zLnByb3RvIiMK", - "C1Rlc3RNZXNzYWdlEgkKAWEYASABKAUqCQjoBxCAgICAAioTCghUZXN0RW51", - "bRIHCgNGT08QATKCAQoLVGVzdFNlcnZpY2UScwoDRm9vEjUuZ29vZ2xlLnBy", - "b3RvYnVmLm5vX2dlbmVyaWNfc2VydmljZXNfdGVzdC5UZXN0TWVzc2FnZRo1", - "Lmdvb2dsZS5wcm90b2J1Zi5ub19nZW5lcmljX3NlcnZpY2VzX3Rlc3QuVGVz", - "dE1lc3NhZ2U6TgoOdGVzdF9leHRlbnNpb24SNS5nb29nbGUucHJvdG9idWYu", - "bm9fZ2VuZXJpY19zZXJ2aWNlc190ZXN0LlRlc3RNZXNzYWdlGOgHIAEoBUJb", - "wj5YCjJHb29nbGUuUHJvdG9jb2xCdWZmZXJzLlRlc3RQcm90b3MuTm9HZW5l", - "cmljU2VydmljZRIiVW5pdFRlc3ROb0dlbmVyaWNTZXJ2aWNlc1Byb3RvRmls", - "ZQ==")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_google_protobuf_no_generic_services_test_TestMessage__Descriptor = Descriptor.MessageTypes[0]; - internal__static_google_protobuf_no_generic_services_test_TestMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_no_generic_services_test_TestMessage__Descriptor, - new string[] { "A", }); - global::Google.ProtocolBuffers.TestProtos.NoGenericService.UnitTestNoGenericServicesProtoFile.TestExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.NoGenericService.UnitTestNoGenericServicesProtoFile.Descriptor.Extensions[0]); - pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); - RegisterAllExtensions(registry); - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.RegisterAllExtensions(registry); - return registry; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, - }, assigner); - } - #endregion - - } - #region Enums - public enum TestEnum { - FOO = 1, - } - - #endregion - - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestMessage : pb::ExtendableMessage { - private TestMessage() { } - private static readonly TestMessage defaultInstance = new TestMessage().MakeReadOnly(); - private static readonly string[] _testMessageFieldNames = new string[] { "a" }; - private static readonly uint[] _testMessageFieldTags = new uint[] { 8 }; - public static TestMessage DefaultInstance { - get { return defaultInstance; } - } - - public override TestMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.NoGenericService.UnitTestNoGenericServicesProtoFile.internal__static_google_protobuf_no_generic_services_test_TestMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.NoGenericService.UnitTestNoGenericServicesProtoFile.internal__static_google_protobuf_no_generic_services_test_TestMessage__FieldAccessorTable; } - } - - public const int AFieldNumber = 1; - private bool hasA; - private int a_; - public bool HasA { - get { return hasA; } - } - public int A { - get { return a_; } - } - - public override bool IsInitialized { - get { - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testMessageFieldNames; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - if (hasA) { - output.WriteInt32(1, field_names[0], A); - } - extensionWriter.WriteUntil(536870912, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA) { - size += pb::CodedOutputStream.ComputeInt32Size(1, A); - } - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestMessage MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestMessage result; - - private TestMessage PrepareBuilder() { - if (resultIsReadOnly) { - TestMessage original = result; - result = new TestMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.NoGenericService.TestMessage.Descriptor; } - } - - public override TestMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.NoGenericService.TestMessage.DefaultInstance; } - } - - public override TestMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestMessage) { - return MergeFrom((TestMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestMessage other) { - if (other == global::Google.ProtocolBuffers.TestProtos.NoGenericService.TestMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA) { - A = other.A; - } - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasA = input.ReadInt32(ref result.a_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasA { - get { return result.hasA; } - } - public int A { - get { return result.A; } - set { SetA(value); } - } - public Builder SetA(int value) { - PrepareBuilder(); - result.hasA = true; - result.a_ = value; - return this; - } - public Builder ClearA() { - PrepareBuilder(); - result.hasA = false; - result.a_ = 0; - return this; - } - } - static TestMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.NoGenericService.UnitTestNoGenericServicesProtoFile.Descriptor, null); - } - } - - #endregion - - #region Services - /* - * Service generation is now disabled by default, use the following option to enable: - * option (google.protobuf.csharp_file_options).service_generator_type = GENERIC; - */ - #endregion - -} - -#endregion Designer generated code diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestOptimizeForProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestOptimizeForProtoFile.cs deleted file mode 100644 index e5b45c0..0000000 --- a/src/ProtocolBuffers.Test/TestProtos/UnitTestOptimizeForProtoFile.cs +++ /dev/null @@ -1,659 +0,0 @@ -// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.TestProtos { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class UnitTestOptimizeForProtoFile { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - registry.Add(global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.TestExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.TestExtension2); - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestOptimizedForSize__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestOptimizedForSize__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestRequiredOptimizedForSize__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestRequiredOptimizedForSize__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestOptionalOptimizedForSize__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestOptionalOptimizedForSize__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static UnitTestOptimizeForProtoFile() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "Citnb29nbGUvcHJvdG9idWYvdW5pdHRlc3Rfb3B0aW1pemVfZm9yLnByb3Rv", - "EhFwcm90b2J1Zl91bml0dGVzdBokZ29vZ2xlL3Byb3RvYnVmL2NzaGFycF9v", - "cHRpb25zLnByb3RvGh5nb29nbGUvcHJvdG9idWYvdW5pdHRlc3QucHJvdG8i", - "kgIKFFRlc3RPcHRpbWl6ZWRGb3JTaXplEgkKAWkYASABKAUSLgoDbXNnGBMg", - "ASgLMiEucHJvdG9idWZfdW5pdHRlc3QuRm9yZWlnbk1lc3NhZ2UqCQjoBxCA", - "gICAAjJACg50ZXN0X2V4dGVuc2lvbhInLnByb3RvYnVmX3VuaXR0ZXN0LlRl", - "c3RPcHRpbWl6ZWRGb3JTaXplGNIJIAEoBTJyCg90ZXN0X2V4dGVuc2lvbjIS", - "Jy5wcm90b2J1Zl91bml0dGVzdC5UZXN0T3B0aW1pemVkRm9yU2l6ZRjTCSAB", - "KAsyLy5wcm90b2J1Zl91bml0dGVzdC5UZXN0UmVxdWlyZWRPcHRpbWl6ZWRG", - "b3JTaXplIikKHFRlc3RSZXF1aXJlZE9wdGltaXplZEZvclNpemUSCQoBeBgB", - "IAIoBSJaChxUZXN0T3B0aW9uYWxPcHRpbWl6ZWRGb3JTaXplEjoKAW8YASAB", - "KAsyLy5wcm90b2J1Zl91bml0dGVzdC5UZXN0UmVxdWlyZWRPcHRpbWl6ZWRG", - "b3JTaXplQkZIAsI+QQohR29vZ2xlLlByb3RvY29sQnVmZmVycy5UZXN0UHJv", - "dG9zEhxVbml0VGVzdE9wdGltaXplRm9yUHJvdG9GaWxl")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_protobuf_unittest_TestOptimizedForSize__Descriptor = Descriptor.MessageTypes[0]; - internal__static_protobuf_unittest_TestOptimizedForSize__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestOptimizedForSize__Descriptor, - new string[] { "I", "Msg", }); - global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.TestExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.Descriptor.Extensions[0]); - global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.TestExtension2 = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.Descriptor.Extensions[1]); - internal__static_protobuf_unittest_TestRequiredOptimizedForSize__Descriptor = Descriptor.MessageTypes[1]; - internal__static_protobuf_unittest_TestRequiredOptimizedForSize__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestRequiredOptimizedForSize__Descriptor, - new string[] { "X", }); - internal__static_protobuf_unittest_TestOptionalOptimizedForSize__Descriptor = Descriptor.MessageTypes[2]; - internal__static_protobuf_unittest_TestOptionalOptimizedForSize__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestOptionalOptimizedForSize__Descriptor, - new string[] { "O", }); - pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); - RegisterAllExtensions(registry); - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.RegisterAllExtensions(registry); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RegisterAllExtensions(registry); - return registry; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, - }, assigner); - } - #endregion - - } - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestOptimizedForSize : pb::ExtendableMessage { - private TestOptimizedForSize() { } - private static readonly TestOptimizedForSize defaultInstance = new TestOptimizedForSize().MakeReadOnly(); - public static TestOptimizedForSize DefaultInstance { - get { return defaultInstance; } - } - - public override TestOptimizedForSize DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestOptimizedForSize ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestOptimizeForProtoFile.internal__static_protobuf_unittest_TestOptimizedForSize__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestOptimizeForProtoFile.internal__static_protobuf_unittest_TestOptimizedForSize__FieldAccessorTable; } - } - - public const int TestExtensionFieldNumber = 1234; - public static pb::GeneratedExtensionBase TestExtension; - public const int TestExtension2FieldNumber = 1235; - public static pb::GeneratedExtensionBase TestExtension2; - public const int IFieldNumber = 1; - private bool hasI; - private int i_; - public bool HasI { - get { return hasI; } - } - public int I { - get { return i_; } - } - - public const int MsgFieldNumber = 19; - private bool hasMsg; - private global::Google.ProtocolBuffers.TestProtos.ForeignMessage msg_; - public bool HasMsg { - get { return hasMsg; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage Msg { - get { return msg_ ?? global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance; } - } - - public static TestOptimizedForSize ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestOptimizedForSize ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestOptimizedForSize ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestOptimizedForSize ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestOptimizedForSize ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestOptimizedForSize ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestOptimizedForSize ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestOptimizedForSize ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestOptimizedForSize ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestOptimizedForSize ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestOptimizedForSize MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestOptimizedForSize prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestOptimizedForSize cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestOptimizedForSize result; - - private TestOptimizedForSize PrepareBuilder() { - if (resultIsReadOnly) { - TestOptimizedForSize original = result; - result = new TestOptimizedForSize(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestOptimizedForSize MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.Descriptor; } - } - - public override TestOptimizedForSize DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.DefaultInstance; } - } - - public override TestOptimizedForSize BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - - public bool HasI { - get { return result.hasI; } - } - public int I { - get { return result.I; } - set { SetI(value); } - } - public Builder SetI(int value) { - PrepareBuilder(); - result.hasI = true; - result.i_ = value; - return this; - } - public Builder ClearI() { - PrepareBuilder(); - result.hasI = false; - result.i_ = 0; - return this; - } - - public bool HasMsg { - get { return result.hasMsg; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage Msg { - get { return result.Msg; } - set { SetMsg(value); } - } - public Builder SetMsg(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasMsg = true; - result.msg_ = value; - return this; - } - public Builder SetMsg(global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasMsg = true; - result.msg_ = builderForValue.Build(); - return this; - } - public Builder MergeMsg(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasMsg && - result.msg_ != global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance) { - result.msg_ = global::Google.ProtocolBuffers.TestProtos.ForeignMessage.CreateBuilder(result.msg_).MergeFrom(value).BuildPartial(); - } else { - result.msg_ = value; - } - result.hasMsg = true; - return this; - } - public Builder ClearMsg() { - PrepareBuilder(); - result.hasMsg = false; - result.msg_ = null; - return this; - } - } - static TestOptimizedForSize() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestOptimizeForProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestRequiredOptimizedForSize : pb::GeneratedMessage { - private TestRequiredOptimizedForSize() { } - private static readonly TestRequiredOptimizedForSize defaultInstance = new TestRequiredOptimizedForSize().MakeReadOnly(); - public static TestRequiredOptimizedForSize DefaultInstance { - get { return defaultInstance; } - } - - public override TestRequiredOptimizedForSize DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestRequiredOptimizedForSize ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestOptimizeForProtoFile.internal__static_protobuf_unittest_TestRequiredOptimizedForSize__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestOptimizeForProtoFile.internal__static_protobuf_unittest_TestRequiredOptimizedForSize__FieldAccessorTable; } - } - - public const int XFieldNumber = 1; - private bool hasX; - private int x_; - public bool HasX { - get { return hasX; } - } - public int X { - get { return x_; } - } - - public static TestRequiredOptimizedForSize ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestRequiredOptimizedForSize ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestRequiredOptimizedForSize ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestRequiredOptimizedForSize ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestRequiredOptimizedForSize ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestRequiredOptimizedForSize ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestRequiredOptimizedForSize ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestRequiredOptimizedForSize ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestRequiredOptimizedForSize ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestRequiredOptimizedForSize ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestRequiredOptimizedForSize MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestRequiredOptimizedForSize prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestRequiredOptimizedForSize cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestRequiredOptimizedForSize result; - - private TestRequiredOptimizedForSize PrepareBuilder() { - if (resultIsReadOnly) { - TestRequiredOptimizedForSize original = result; - result = new TestRequiredOptimizedForSize(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestRequiredOptimizedForSize MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize.Descriptor; } - } - - public override TestRequiredOptimizedForSize DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize.DefaultInstance; } - } - - public override TestRequiredOptimizedForSize BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - - public bool HasX { - get { return result.hasX; } - } - public int X { - get { return result.X; } - set { SetX(value); } - } - public Builder SetX(int value) { - PrepareBuilder(); - result.hasX = true; - result.x_ = value; - return this; - } - public Builder ClearX() { - PrepareBuilder(); - result.hasX = false; - result.x_ = 0; - return this; - } - } - static TestRequiredOptimizedForSize() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestOptimizeForProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestOptionalOptimizedForSize : pb::GeneratedMessage { - private TestOptionalOptimizedForSize() { } - private static readonly TestOptionalOptimizedForSize defaultInstance = new TestOptionalOptimizedForSize().MakeReadOnly(); - public static TestOptionalOptimizedForSize DefaultInstance { - get { return defaultInstance; } - } - - public override TestOptionalOptimizedForSize DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestOptionalOptimizedForSize ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestOptimizeForProtoFile.internal__static_protobuf_unittest_TestOptionalOptimizedForSize__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestOptimizeForProtoFile.internal__static_protobuf_unittest_TestOptionalOptimizedForSize__FieldAccessorTable; } - } - - public const int OFieldNumber = 1; - private bool hasO; - private global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize o_; - public bool HasO { - get { return hasO; } - } - public global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize O { - get { return o_ ?? global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize.DefaultInstance; } - } - - public static TestOptionalOptimizedForSize ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestOptionalOptimizedForSize ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestOptionalOptimizedForSize ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestOptionalOptimizedForSize ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestOptionalOptimizedForSize ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestOptionalOptimizedForSize ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestOptionalOptimizedForSize ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestOptionalOptimizedForSize ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestOptionalOptimizedForSize ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestOptionalOptimizedForSize ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestOptionalOptimizedForSize MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestOptionalOptimizedForSize prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestOptionalOptimizedForSize cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestOptionalOptimizedForSize result; - - private TestOptionalOptimizedForSize PrepareBuilder() { - if (resultIsReadOnly) { - TestOptionalOptimizedForSize original = result; - result = new TestOptionalOptimizedForSize(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestOptionalOptimizedForSize MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize.Descriptor; } - } - - public override TestOptionalOptimizedForSize DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestOptionalOptimizedForSize.DefaultInstance; } - } - - public override TestOptionalOptimizedForSize BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - - public bool HasO { - get { return result.hasO; } - } - public global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize O { - get { return result.O; } - set { SetO(value); } - } - public Builder SetO(global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasO = true; - result.o_ = value; - return this; - } - public Builder SetO(global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasO = true; - result.o_ = builderForValue.Build(); - return this; - } - public Builder MergeO(global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasO && - result.o_ != global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize.DefaultInstance) { - result.o_ = global::Google.ProtocolBuffers.TestProtos.TestRequiredOptimizedForSize.CreateBuilder(result.o_).MergeFrom(value).BuildPartial(); - } else { - result.o_ = value; - } - result.hasO = true; - return this; - } - public Builder ClearO() { - PrepareBuilder(); - result.hasO = false; - result.o_ = null; - return this; - } - } - static TestOptionalOptimizedForSize() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestOptimizeForProtoFile.Descriptor, null); - } - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestProtoFile.cs deleted file mode 100644 index dd31c67..0000000 --- a/src/ProtocolBuffers.Test/TestProtos/UnitTestProtoFile.cs +++ /dev/null @@ -1,21602 +0,0 @@ -// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.TestProtos { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class UnitTestProtoFile { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalInt32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalInt64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalUint32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalUint64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalSint32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalSint64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalFixed32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalFixed64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalSfixed32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalSfixed64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalFloatExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalDoubleExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalBoolExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalStringExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalBytesExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalGroupExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalNestedMessageExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalForeignMessageExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalImportMessageExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalNestedEnumExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalForeignEnumExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalImportEnumExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalStringPieceExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalCordExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedInt32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedInt64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedUint32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedUint64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedSint32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedSint64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedFixed32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedFixed64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedSfixed32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedSfixed64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedFloatExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedDoubleExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedBoolExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedStringExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedBytesExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedGroupExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedNestedMessageExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedForeignMessageExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedImportMessageExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedNestedEnumExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedForeignEnumExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedImportEnumExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedStringPieceExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedCordExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultInt32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultInt64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultUint32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultUint64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultSint32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultSint64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultFixed32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultFixed64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultSfixed32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultSfixed64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultFloatExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultDoubleExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultBoolExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultStringExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultBytesExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultNestedEnumExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultForeignEnumExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultImportEnumExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultStringPieceExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultCordExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.MyExtensionString); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.MyExtensionInt); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedInt32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedInt64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedUint32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedUint64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedSint32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedSint64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedFixed32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedFixed64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedSfixed32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedSfixed64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedFloatExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedDoubleExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedBoolExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedEnumExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.TestNestedExtension.Test); - registry.Add(global::Google.ProtocolBuffers.TestProtos.TestRequired.Single); - registry.Add(global::Google.ProtocolBuffers.TestProtos.TestRequired.Multi); - } - #endregion - #region Extensions - public const int OptionalInt32ExtensionFieldNumber = 1; - public static pb::GeneratedExtensionBase OptionalInt32Extension; - public const int OptionalInt64ExtensionFieldNumber = 2; - public static pb::GeneratedExtensionBase OptionalInt64Extension; - public const int OptionalUint32ExtensionFieldNumber = 3; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase OptionalUint32Extension; - public const int OptionalUint64ExtensionFieldNumber = 4; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase OptionalUint64Extension; - public const int OptionalSint32ExtensionFieldNumber = 5; - public static pb::GeneratedExtensionBase OptionalSint32Extension; - public const int OptionalSint64ExtensionFieldNumber = 6; - public static pb::GeneratedExtensionBase OptionalSint64Extension; - public const int OptionalFixed32ExtensionFieldNumber = 7; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase OptionalFixed32Extension; - public const int OptionalFixed64ExtensionFieldNumber = 8; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase OptionalFixed64Extension; - public const int OptionalSfixed32ExtensionFieldNumber = 9; - public static pb::GeneratedExtensionBase OptionalSfixed32Extension; - public const int OptionalSfixed64ExtensionFieldNumber = 10; - public static pb::GeneratedExtensionBase OptionalSfixed64Extension; - public const int OptionalFloatExtensionFieldNumber = 11; - public static pb::GeneratedExtensionBase OptionalFloatExtension; - public const int OptionalDoubleExtensionFieldNumber = 12; - public static pb::GeneratedExtensionBase OptionalDoubleExtension; - public const int OptionalBoolExtensionFieldNumber = 13; - public static pb::GeneratedExtensionBase OptionalBoolExtension; - public const int OptionalStringExtensionFieldNumber = 14; - public static pb::GeneratedExtensionBase OptionalStringExtension; - public const int OptionalBytesExtensionFieldNumber = 15; - public static pb::GeneratedExtensionBase OptionalBytesExtension; - public const int OptionalGroupExtensionFieldNumber = 16; - public static pb::GeneratedExtensionBase OptionalGroupExtension; - public const int OptionalNestedMessageExtensionFieldNumber = 18; - public static pb::GeneratedExtensionBase OptionalNestedMessageExtension; - public const int OptionalForeignMessageExtensionFieldNumber = 19; - public static pb::GeneratedExtensionBase OptionalForeignMessageExtension; - public const int OptionalImportMessageExtensionFieldNumber = 20; - public static pb::GeneratedExtensionBase OptionalImportMessageExtension; - public const int OptionalNestedEnumExtensionFieldNumber = 21; - public static pb::GeneratedExtensionBase OptionalNestedEnumExtension; - public const int OptionalForeignEnumExtensionFieldNumber = 22; - public static pb::GeneratedExtensionBase OptionalForeignEnumExtension; - public const int OptionalImportEnumExtensionFieldNumber = 23; - public static pb::GeneratedExtensionBase OptionalImportEnumExtension; - public const int OptionalStringPieceExtensionFieldNumber = 24; - public static pb::GeneratedExtensionBase OptionalStringPieceExtension; - public const int OptionalCordExtensionFieldNumber = 25; - public static pb::GeneratedExtensionBase OptionalCordExtension; - public const int RepeatedInt32ExtensionFieldNumber = 31; - public static pb::GeneratedExtensionBase> RepeatedInt32Extension; - public const int RepeatedInt64ExtensionFieldNumber = 32; - public static pb::GeneratedExtensionBase> RepeatedInt64Extension; - public const int RepeatedUint32ExtensionFieldNumber = 33; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase> RepeatedUint32Extension; - public const int RepeatedUint64ExtensionFieldNumber = 34; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase> RepeatedUint64Extension; - public const int RepeatedSint32ExtensionFieldNumber = 35; - public static pb::GeneratedExtensionBase> RepeatedSint32Extension; - public const int RepeatedSint64ExtensionFieldNumber = 36; - public static pb::GeneratedExtensionBase> RepeatedSint64Extension; - public const int RepeatedFixed32ExtensionFieldNumber = 37; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase> RepeatedFixed32Extension; - public const int RepeatedFixed64ExtensionFieldNumber = 38; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase> RepeatedFixed64Extension; - public const int RepeatedSfixed32ExtensionFieldNumber = 39; - public static pb::GeneratedExtensionBase> RepeatedSfixed32Extension; - public const int RepeatedSfixed64ExtensionFieldNumber = 40; - public static pb::GeneratedExtensionBase> RepeatedSfixed64Extension; - public const int RepeatedFloatExtensionFieldNumber = 41; - public static pb::GeneratedExtensionBase> RepeatedFloatExtension; - public const int RepeatedDoubleExtensionFieldNumber = 42; - public static pb::GeneratedExtensionBase> RepeatedDoubleExtension; - public const int RepeatedBoolExtensionFieldNumber = 43; - public static pb::GeneratedExtensionBase> RepeatedBoolExtension; - public const int RepeatedStringExtensionFieldNumber = 44; - public static pb::GeneratedExtensionBase> RepeatedStringExtension; - public const int RepeatedBytesExtensionFieldNumber = 45; - public static pb::GeneratedExtensionBase> RepeatedBytesExtension; - public const int RepeatedGroupExtensionFieldNumber = 46; - public static pb::GeneratedExtensionBase> RepeatedGroupExtension; - public const int RepeatedNestedMessageExtensionFieldNumber = 48; - public static pb::GeneratedExtensionBase> RepeatedNestedMessageExtension; - public const int RepeatedForeignMessageExtensionFieldNumber = 49; - public static pb::GeneratedExtensionBase> RepeatedForeignMessageExtension; - public const int RepeatedImportMessageExtensionFieldNumber = 50; - public static pb::GeneratedExtensionBase> RepeatedImportMessageExtension; - public const int RepeatedNestedEnumExtensionFieldNumber = 51; - public static pb::GeneratedExtensionBase> RepeatedNestedEnumExtension; - public const int RepeatedForeignEnumExtensionFieldNumber = 52; - public static pb::GeneratedExtensionBase> RepeatedForeignEnumExtension; - public const int RepeatedImportEnumExtensionFieldNumber = 53; - public static pb::GeneratedExtensionBase> RepeatedImportEnumExtension; - public const int RepeatedStringPieceExtensionFieldNumber = 54; - public static pb::GeneratedExtensionBase> RepeatedStringPieceExtension; - public const int RepeatedCordExtensionFieldNumber = 55; - public static pb::GeneratedExtensionBase> RepeatedCordExtension; - public const int DefaultInt32ExtensionFieldNumber = 61; - public static pb::GeneratedExtensionBase DefaultInt32Extension; - public const int DefaultInt64ExtensionFieldNumber = 62; - public static pb::GeneratedExtensionBase DefaultInt64Extension; - public const int DefaultUint32ExtensionFieldNumber = 63; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase DefaultUint32Extension; - public const int DefaultUint64ExtensionFieldNumber = 64; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase DefaultUint64Extension; - public const int DefaultSint32ExtensionFieldNumber = 65; - public static pb::GeneratedExtensionBase DefaultSint32Extension; - public const int DefaultSint64ExtensionFieldNumber = 66; - public static pb::GeneratedExtensionBase DefaultSint64Extension; - public const int DefaultFixed32ExtensionFieldNumber = 67; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase DefaultFixed32Extension; - public const int DefaultFixed64ExtensionFieldNumber = 68; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase DefaultFixed64Extension; - public const int DefaultSfixed32ExtensionFieldNumber = 69; - public static pb::GeneratedExtensionBase DefaultSfixed32Extension; - public const int DefaultSfixed64ExtensionFieldNumber = 70; - public static pb::GeneratedExtensionBase DefaultSfixed64Extension; - public const int DefaultFloatExtensionFieldNumber = 71; - public static pb::GeneratedExtensionBase DefaultFloatExtension; - public const int DefaultDoubleExtensionFieldNumber = 72; - public static pb::GeneratedExtensionBase DefaultDoubleExtension; - public const int DefaultBoolExtensionFieldNumber = 73; - public static pb::GeneratedExtensionBase DefaultBoolExtension; - public const int DefaultStringExtensionFieldNumber = 74; - public static pb::GeneratedExtensionBase DefaultStringExtension; - public const int DefaultBytesExtensionFieldNumber = 75; - public static pb::GeneratedExtensionBase DefaultBytesExtension; - public const int DefaultNestedEnumExtensionFieldNumber = 81; - public static pb::GeneratedExtensionBase DefaultNestedEnumExtension; - public const int DefaultForeignEnumExtensionFieldNumber = 82; - public static pb::GeneratedExtensionBase DefaultForeignEnumExtension; - public const int DefaultImportEnumExtensionFieldNumber = 83; - public static pb::GeneratedExtensionBase DefaultImportEnumExtension; - public const int DefaultStringPieceExtensionFieldNumber = 84; - public static pb::GeneratedExtensionBase DefaultStringPieceExtension; - public const int DefaultCordExtensionFieldNumber = 85; - public static pb::GeneratedExtensionBase DefaultCordExtension; - public const int MyExtensionStringFieldNumber = 50; - public static pb::GeneratedExtensionBase MyExtensionString; - public const int MyExtensionIntFieldNumber = 5; - public static pb::GeneratedExtensionBase MyExtensionInt; - public const int PackedInt32ExtensionFieldNumber = 90; - public static pb::GeneratedExtensionBase> PackedInt32Extension; - public const int PackedInt64ExtensionFieldNumber = 91; - public static pb::GeneratedExtensionBase> PackedInt64Extension; - public const int PackedUint32ExtensionFieldNumber = 92; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase> PackedUint32Extension; - public const int PackedUint64ExtensionFieldNumber = 93; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase> PackedUint64Extension; - public const int PackedSint32ExtensionFieldNumber = 94; - public static pb::GeneratedExtensionBase> PackedSint32Extension; - public const int PackedSint64ExtensionFieldNumber = 95; - public static pb::GeneratedExtensionBase> PackedSint64Extension; - public const int PackedFixed32ExtensionFieldNumber = 96; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase> PackedFixed32Extension; - public const int PackedFixed64ExtensionFieldNumber = 97; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase> PackedFixed64Extension; - public const int PackedSfixed32ExtensionFieldNumber = 98; - public static pb::GeneratedExtensionBase> PackedSfixed32Extension; - public const int PackedSfixed64ExtensionFieldNumber = 99; - public static pb::GeneratedExtensionBase> PackedSfixed64Extension; - public const int PackedFloatExtensionFieldNumber = 100; - public static pb::GeneratedExtensionBase> PackedFloatExtension; - public const int PackedDoubleExtensionFieldNumber = 101; - public static pb::GeneratedExtensionBase> PackedDoubleExtension; - public const int PackedBoolExtensionFieldNumber = 102; - public static pb::GeneratedExtensionBase> PackedBoolExtension; - public const int PackedEnumExtensionFieldNumber = 103; - public static pb::GeneratedExtensionBase> PackedEnumExtension; - #endregion - - #region Static variables - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestAllTypes__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestAllTypes__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestAllTypes_NestedMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestAllTypes_NestedMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestAllTypes_OptionalGroup__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestAllTypes_OptionalGroup__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestAllTypes_RepeatedGroup__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestAllTypes_RepeatedGroup__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestDeprecatedFields__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestDeprecatedFields__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_ForeignMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_ForeignMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestAllExtensions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestAllExtensions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_OptionalGroup_extension__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_OptionalGroup_extension__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_RepeatedGroup_extension__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_RepeatedGroup_extension__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestNestedExtension__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestNestedExtension__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestRequired__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestRequired__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestRequiredForeign__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestRequiredForeign__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestForeignNested__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestForeignNested__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestEmptyMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestEmptyMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestEmptyMessageWithExtensions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestEmptyMessageWithExtensions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestMultipleExtensionRanges__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMultipleExtensionRanges__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestReallyLargeTagNumber__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestReallyLargeTagNumber__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestRecursiveMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestRecursiveMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestMutualRecursionA__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMutualRecursionA__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestMutualRecursionB__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMutualRecursionB__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestDupFieldNumber__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestDupFieldNumber__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestDupFieldNumber_Foo__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestDupFieldNumber_Foo__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestDupFieldNumber_Bar__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestDupFieldNumber_Bar__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestNestedMessageHasBits__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestNestedMessageHasBits__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestNestedMessageHasBits_NestedMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestNestedMessageHasBits_NestedMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestCamelCaseFieldNames__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestCamelCaseFieldNames__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestFieldOrderings__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestFieldOrderings__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestExtremeDefaultValues__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestExtremeDefaultValues__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_SparseEnumMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_SparseEnumMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_OneString__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_OneString__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_OneBytes__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_OneBytes__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestPackedTypes__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestPackedTypes__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestUnpackedTypes__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestUnpackedTypes__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestPackedExtensions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestPackedExtensions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestDynamicExtensions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestDynamicExtensions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestDynamicExtensions_DynamicMessageType__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestDynamicExtensions_DynamicMessageType__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestRepeatedScalarDifferentTagSizes__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestRepeatedScalarDifferentTagSizes__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_FooRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_FooRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_FooResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_FooResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_BarRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_BarRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_BarResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_BarResponse__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static UnitTestProtoFile() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "Ch5nb29nbGUvcHJvdG9idWYvdW5pdHRlc3QucHJvdG8SEXByb3RvYnVmX3Vu", - "aXR0ZXN0GiRnb29nbGUvcHJvdG9idWYvY3NoYXJwX29wdGlvbnMucHJvdG8a", - "JWdvb2dsZS9wcm90b2J1Zi91bml0dGVzdF9pbXBvcnQucHJvdG8iuxUKDFRl", - "c3RBbGxUeXBlcxIWCg5vcHRpb25hbF9pbnQzMhgBIAEoBRIWCg5vcHRpb25h", - "bF9pbnQ2NBgCIAEoAxIXCg9vcHRpb25hbF91aW50MzIYAyABKA0SFwoPb3B0", - "aW9uYWxfdWludDY0GAQgASgEEhcKD29wdGlvbmFsX3NpbnQzMhgFIAEoERIX", - "Cg9vcHRpb25hbF9zaW50NjQYBiABKBISGAoQb3B0aW9uYWxfZml4ZWQzMhgH", - "IAEoBxIYChBvcHRpb25hbF9maXhlZDY0GAggASgGEhkKEW9wdGlvbmFsX3Nm", - "aXhlZDMyGAkgASgPEhkKEW9wdGlvbmFsX3NmaXhlZDY0GAogASgQEhYKDm9w", - "dGlvbmFsX2Zsb2F0GAsgASgCEhcKD29wdGlvbmFsX2RvdWJsZRgMIAEoARIV", - "Cg1vcHRpb25hbF9ib29sGA0gASgIEhcKD29wdGlvbmFsX3N0cmluZxgOIAEo", - "CRIWCg5vcHRpb25hbF9ieXRlcxgPIAEoDBJECg1vcHRpb25hbGdyb3VwGBAg", - "ASgKMi0ucHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbFR5cGVzLk9wdGlvbmFs", - "R3JvdXASTgoXb3B0aW9uYWxfbmVzdGVkX21lc3NhZ2UYEiABKAsyLS5wcm90", - "b2J1Zl91bml0dGVzdC5UZXN0QWxsVHlwZXMuTmVzdGVkTWVzc2FnZRJDChhv", - "cHRpb25hbF9mb3JlaWduX21lc3NhZ2UYEyABKAsyIS5wcm90b2J1Zl91bml0", - "dGVzdC5Gb3JlaWduTWVzc2FnZRJIChdvcHRpb25hbF9pbXBvcnRfbWVzc2Fn", - "ZRgUIAEoCzInLnByb3RvYnVmX3VuaXR0ZXN0X2ltcG9ydC5JbXBvcnRNZXNz", - "YWdlEkgKFG9wdGlvbmFsX25lc3RlZF9lbnVtGBUgASgOMioucHJvdG9idWZf", - "dW5pdHRlc3QuVGVzdEFsbFR5cGVzLk5lc3RlZEVudW0SPQoVb3B0aW9uYWxf", - "Zm9yZWlnbl9lbnVtGBYgASgOMh4ucHJvdG9idWZfdW5pdHRlc3QuRm9yZWln", - "bkVudW0SQgoUb3B0aW9uYWxfaW1wb3J0X2VudW0YFyABKA4yJC5wcm90b2J1", - "Zl91bml0dGVzdF9pbXBvcnQuSW1wb3J0RW51bRIhChVvcHRpb25hbF9zdHJp", - "bmdfcGllY2UYGCABKAlCAggCEhkKDW9wdGlvbmFsX2NvcmQYGSABKAlCAggB", - "EhYKDnJlcGVhdGVkX2ludDMyGB8gAygFEhYKDnJlcGVhdGVkX2ludDY0GCAg", - "AygDEhcKD3JlcGVhdGVkX3VpbnQzMhghIAMoDRIXCg9yZXBlYXRlZF91aW50", - "NjQYIiADKAQSFwoPcmVwZWF0ZWRfc2ludDMyGCMgAygREhcKD3JlcGVhdGVk", - "X3NpbnQ2NBgkIAMoEhIYChByZXBlYXRlZF9maXhlZDMyGCUgAygHEhgKEHJl", - "cGVhdGVkX2ZpeGVkNjQYJiADKAYSGQoRcmVwZWF0ZWRfc2ZpeGVkMzIYJyAD", - "KA8SGQoRcmVwZWF0ZWRfc2ZpeGVkNjQYKCADKBASFgoOcmVwZWF0ZWRfZmxv", - "YXQYKSADKAISFwoPcmVwZWF0ZWRfZG91YmxlGCogAygBEhUKDXJlcGVhdGVk", - "X2Jvb2wYKyADKAgSFwoPcmVwZWF0ZWRfc3RyaW5nGCwgAygJEhYKDnJlcGVh", - "dGVkX2J5dGVzGC0gAygMEkQKDXJlcGVhdGVkZ3JvdXAYLiADKAoyLS5wcm90", - "b2J1Zl91bml0dGVzdC5UZXN0QWxsVHlwZXMuUmVwZWF0ZWRHcm91cBJOChdy", - "ZXBlYXRlZF9uZXN0ZWRfbWVzc2FnZRgwIAMoCzItLnByb3RvYnVmX3VuaXR0", - "ZXN0LlRlc3RBbGxUeXBlcy5OZXN0ZWRNZXNzYWdlEkMKGHJlcGVhdGVkX2Zv", - "cmVpZ25fbWVzc2FnZRgxIAMoCzIhLnByb3RvYnVmX3VuaXR0ZXN0LkZvcmVp", - "Z25NZXNzYWdlEkgKF3JlcGVhdGVkX2ltcG9ydF9tZXNzYWdlGDIgAygLMicu", - "cHJvdG9idWZfdW5pdHRlc3RfaW1wb3J0LkltcG9ydE1lc3NhZ2USSAoUcmVw", - "ZWF0ZWRfbmVzdGVkX2VudW0YMyADKA4yKi5wcm90b2J1Zl91bml0dGVzdC5U", - "ZXN0QWxsVHlwZXMuTmVzdGVkRW51bRI9ChVyZXBlYXRlZF9mb3JlaWduX2Vu", - "dW0YNCADKA4yHi5wcm90b2J1Zl91bml0dGVzdC5Gb3JlaWduRW51bRJCChRy", - "ZXBlYXRlZF9pbXBvcnRfZW51bRg1IAMoDjIkLnByb3RvYnVmX3VuaXR0ZXN0", - "X2ltcG9ydC5JbXBvcnRFbnVtEiEKFXJlcGVhdGVkX3N0cmluZ19waWVjZRg2", - "IAMoCUICCAISGQoNcmVwZWF0ZWRfY29yZBg3IAMoCUICCAESGQoNZGVmYXVs", - "dF9pbnQzMhg9IAEoBToCNDESGQoNZGVmYXVsdF9pbnQ2NBg+IAEoAzoCNDIS", - "GgoOZGVmYXVsdF91aW50MzIYPyABKA06AjQzEhoKDmRlZmF1bHRfdWludDY0", - "GEAgASgEOgI0NBIbCg5kZWZhdWx0X3NpbnQzMhhBIAEoEToDLTQ1EhoKDmRl", - "ZmF1bHRfc2ludDY0GEIgASgSOgI0NhIbCg9kZWZhdWx0X2ZpeGVkMzIYQyAB", - "KAc6AjQ3EhsKD2RlZmF1bHRfZml4ZWQ2NBhEIAEoBjoCNDgSHAoQZGVmYXVs", - "dF9zZml4ZWQzMhhFIAEoDzoCNDkSHQoQZGVmYXVsdF9zZml4ZWQ2NBhGIAEo", - "EDoDLTUwEhsKDWRlZmF1bHRfZmxvYXQYRyABKAI6BDUxLjUSHQoOZGVmYXVs", - "dF9kb3VibGUYSCABKAE6BTUyMDAwEhoKDGRlZmF1bHRfYm9vbBhJIAEoCDoE", - "dHJ1ZRIdCg5kZWZhdWx0X3N0cmluZxhKIAEoCToFaGVsbG8SHAoNZGVmYXVs", - "dF9ieXRlcxhLIAEoDDoFd29ybGQSTAoTZGVmYXVsdF9uZXN0ZWRfZW51bRhR", - "IAEoDjIqLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RBbGxUeXBlcy5OZXN0ZWRF", - "bnVtOgNCQVISSQoUZGVmYXVsdF9mb3JlaWduX2VudW0YUiABKA4yHi5wcm90", - "b2J1Zl91bml0dGVzdC5Gb3JlaWduRW51bToLRk9SRUlHTl9CQVISTQoTZGVm", - "YXVsdF9pbXBvcnRfZW51bRhTIAEoDjIkLnByb3RvYnVmX3VuaXR0ZXN0X2lt", - "cG9ydC5JbXBvcnRFbnVtOgpJTVBPUlRfQkFSEiUKFGRlZmF1bHRfc3RyaW5n", - "X3BpZWNlGFQgASgJOgNhYmNCAggCEh0KDGRlZmF1bHRfY29yZBhVIAEoCToD", - "MTIzQgIIARobCg1OZXN0ZWRNZXNzYWdlEgoKAmJiGAEgASgFGhoKDU9wdGlv", - "bmFsR3JvdXASCQoBYRgRIAEoBRoaCg1SZXBlYXRlZEdyb3VwEgkKAWEYLyAB", - "KAUiJwoKTmVzdGVkRW51bRIHCgNGT08QARIHCgNCQVIQAhIHCgNCQVoQAyI0", - "ChRUZXN0RGVwcmVjYXRlZEZpZWxkcxIcChBkZXByZWNhdGVkX2ludDMyGAEg", - "ASgFQgIYASIbCg5Gb3JlaWduTWVzc2FnZRIJCgFjGAEgASgFIh0KEVRlc3RB", - "bGxFeHRlbnNpb25zKggIARCAgICAAiIkChdPcHRpb25hbEdyb3VwX2V4dGVu", - "c2lvbhIJCgFhGBEgASgFIiQKF1JlcGVhdGVkR3JvdXBfZXh0ZW5zaW9uEgkK", - "AWEYLyABKAUiUAoTVGVzdE5lc3RlZEV4dGVuc2lvbjI5CgR0ZXN0EiQucHJv", - "dG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMY6gcgASgJOgR0ZXN0", - "ItUFCgxUZXN0UmVxdWlyZWQSCQoBYRgBIAIoBRIOCgZkdW1teTIYAiABKAUS", - "CQoBYhgDIAIoBRIOCgZkdW1teTQYBCABKAUSDgoGZHVtbXk1GAUgASgFEg4K", - "BmR1bW15NhgGIAEoBRIOCgZkdW1teTcYByABKAUSDgoGZHVtbXk4GAggASgF", - "Eg4KBmR1bW15ORgJIAEoBRIPCgdkdW1teTEwGAogASgFEg8KB2R1bW15MTEY", - "CyABKAUSDwoHZHVtbXkxMhgMIAEoBRIPCgdkdW1teTEzGA0gASgFEg8KB2R1", - "bW15MTQYDiABKAUSDwoHZHVtbXkxNRgPIAEoBRIPCgdkdW1teTE2GBAgASgF", - "Eg8KB2R1bW15MTcYESABKAUSDwoHZHVtbXkxOBgSIAEoBRIPCgdkdW1teTE5", - "GBMgASgFEg8KB2R1bW15MjAYFCABKAUSDwoHZHVtbXkyMRgVIAEoBRIPCgdk", - "dW1teTIyGBYgASgFEg8KB2R1bW15MjMYFyABKAUSDwoHZHVtbXkyNBgYIAEo", - "BRIPCgdkdW1teTI1GBkgASgFEg8KB2R1bW15MjYYGiABKAUSDwoHZHVtbXky", - "NxgbIAEoBRIPCgdkdW1teTI4GBwgASgFEg8KB2R1bW15MjkYHSABKAUSDwoH", - "ZHVtbXkzMBgeIAEoBRIPCgdkdW1teTMxGB8gASgFEg8KB2R1bW15MzIYICAB", - "KAUSCQoBYxghIAIoBTJWCgZzaW5nbGUSJC5wcm90b2J1Zl91bml0dGVzdC5U", - "ZXN0QWxsRXh0ZW5zaW9ucxjoByABKAsyHy5wcm90b2J1Zl91bml0dGVzdC5U", - "ZXN0UmVxdWlyZWQyVQoFbXVsdGkSJC5wcm90b2J1Zl91bml0dGVzdC5UZXN0", - "QWxsRXh0ZW5zaW9ucxjpByADKAsyHy5wcm90b2J1Zl91bml0dGVzdC5UZXN0", - "UmVxdWlyZWQimgEKE1Rlc3RSZXF1aXJlZEZvcmVpZ24SOQoQb3B0aW9uYWxf", - "bWVzc2FnZRgBIAEoCzIfLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RSZXF1aXJl", - "ZBI5ChByZXBlYXRlZF9tZXNzYWdlGAIgAygLMh8ucHJvdG9idWZfdW5pdHRl", - "c3QuVGVzdFJlcXVpcmVkEg0KBWR1bW15GAMgASgFIloKEVRlc3RGb3JlaWdu", - "TmVzdGVkEkUKDmZvcmVpZ25fbmVzdGVkGAEgASgLMi0ucHJvdG9idWZfdW5p", - "dHRlc3QuVGVzdEFsbFR5cGVzLk5lc3RlZE1lc3NhZ2UiEgoQVGVzdEVtcHR5", - "TWVzc2FnZSIqCh5UZXN0RW1wdHlNZXNzYWdlV2l0aEV4dGVuc2lvbnMqCAgB", - "EICAgIACIjcKG1Rlc3RNdWx0aXBsZUV4dGVuc2lvblJhbmdlcyoECCoQKyoG", - "CK8gEJQhKgoIgIAEEICAgIACIjQKGFRlc3RSZWFsbHlMYXJnZVRhZ051bWJl", - "chIJCgFhGAEgASgFEg0KAmJiGP///38gASgFIlUKFFRlc3RSZWN1cnNpdmVN", - "ZXNzYWdlEjIKAWEYASABKAsyJy5wcm90b2J1Zl91bml0dGVzdC5UZXN0UmVj", - "dXJzaXZlTWVzc2FnZRIJCgFpGAIgASgFIksKFFRlc3RNdXR1YWxSZWN1cnNp", - "b25BEjMKAmJiGAEgASgLMicucHJvdG9idWZfdW5pdHRlc3QuVGVzdE11dHVh", - "bFJlY3Vyc2lvbkIiYgoUVGVzdE11dHVhbFJlY3Vyc2lvbkISMgoBYRgBIAEo", - "CzInLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RNdXR1YWxSZWN1cnNpb25BEhYK", - "Dm9wdGlvbmFsX2ludDMyGAIgASgFIrMBChJUZXN0RHVwRmllbGROdW1iZXIS", - "CQoBYRgBIAEoBRI2CgNmb28YAiABKAoyKS5wcm90b2J1Zl91bml0dGVzdC5U", - "ZXN0RHVwRmllbGROdW1iZXIuRm9vEjYKA2JhchgDIAEoCjIpLnByb3RvYnVm", - "X3VuaXR0ZXN0LlRlc3REdXBGaWVsZE51bWJlci5CYXIaEAoDRm9vEgkKAWEY", - "ASABKAUaEAoDQmFyEgkKAWEYASABKAUigAIKGFRlc3ROZXN0ZWRNZXNzYWdl", - "SGFzQml0cxJaChdvcHRpb25hbF9uZXN0ZWRfbWVzc2FnZRgBIAEoCzI5LnBy", - "b3RvYnVmX3VuaXR0ZXN0LlRlc3ROZXN0ZWRNZXNzYWdlSGFzQml0cy5OZXN0", - "ZWRNZXNzYWdlGocBCg1OZXN0ZWRNZXNzYWdlEiQKHG5lc3RlZG1lc3NhZ2Vf", - "cmVwZWF0ZWRfaW50MzIYASADKAUSUAolbmVzdGVkbWVzc2FnZV9yZXBlYXRl", - "ZF9mb3JlaWdubWVzc2FnZRgCIAMoCzIhLnByb3RvYnVmX3VuaXR0ZXN0LkZv", - "cmVpZ25NZXNzYWdlIuUDChdUZXN0Q2FtZWxDYXNlRmllbGROYW1lcxIWCg5Q", - "cmltaXRpdmVGaWVsZBgBIAEoBRITCgtTdHJpbmdGaWVsZBgCIAEoCRIxCglF", - "bnVtRmllbGQYAyABKA4yHi5wcm90b2J1Zl91bml0dGVzdC5Gb3JlaWduRW51", - "bRI3CgxNZXNzYWdlRmllbGQYBCABKAsyIS5wcm90b2J1Zl91bml0dGVzdC5G", - "b3JlaWduTWVzc2FnZRIcChBTdHJpbmdQaWVjZUZpZWxkGAUgASgJQgIIAhIV", - "CglDb3JkRmllbGQYBiABKAlCAggBEh4KFlJlcGVhdGVkUHJpbWl0aXZlRmll", - "bGQYByADKAUSGwoTUmVwZWF0ZWRTdHJpbmdGaWVsZBgIIAMoCRI5ChFSZXBl", - "YXRlZEVudW1GaWVsZBgJIAMoDjIeLnByb3RvYnVmX3VuaXR0ZXN0LkZvcmVp", - "Z25FbnVtEj8KFFJlcGVhdGVkTWVzc2FnZUZpZWxkGAogAygLMiEucHJvdG9i", - "dWZfdW5pdHRlc3QuRm9yZWlnbk1lc3NhZ2USJAoYUmVwZWF0ZWRTdHJpbmdQ", - "aWVjZUZpZWxkGAsgAygJQgIIAhIdChFSZXBlYXRlZENvcmRGaWVsZBgMIAMo", - "CUICCAEiVQoSVGVzdEZpZWxkT3JkZXJpbmdzEhEKCW15X3N0cmluZxgLIAEo", - "CRIOCgZteV9pbnQYASABKAMSEAoIbXlfZmxvYXQYZSABKAIqBAgCEAsqBAgM", - "EGUiowUKGFRlc3RFeHRyZW1lRGVmYXVsdFZhbHVlcxI/Cg1lc2NhcGVkX2J5", - "dGVzGAEgASgMOihcMDAwXDAwMVwwMDdcMDEwXDAxNFxuXHJcdFwwMTNcXFwn", - "XCJcMzc2EiAKDGxhcmdlX3VpbnQzMhgCIAEoDToKNDI5NDk2NzI5NRIqCgxs", - "YXJnZV91aW50NjQYAyABKAQ6FDE4NDQ2NzQ0MDczNzA5NTUxNjE1EiAKC3Nt", - "YWxsX2ludDMyGAQgASgFOgstMjE0NzQ4MzY0NxIpCgtzbWFsbF9pbnQ2NBgF", - "IAEoAzoULTkyMjMzNzIwMzY4NTQ3NzU4MDcSGAoLdXRmOF9zdHJpbmcYBiAB", - "KAk6A+GItBIVCgp6ZXJvX2Zsb2F0GAcgASgCOgEwEhQKCW9uZV9mbG9hdBgI", - "IAEoAjoBMRIYCgtzbWFsbF9mbG9hdBgJIAEoAjoDMS41Eh4KEm5lZ2F0aXZl", - "X29uZV9mbG9hdBgKIAEoAjoCLTESHAoObmVnYXRpdmVfZmxvYXQYCyABKAI6", - "BC0xLjUSGwoLbGFyZ2VfZmxvYXQYDCABKAI6BjJlKzAwOBIlChRzbWFsbF9u", - "ZWdhdGl2ZV9mbG9hdBgNIAEoAjoHLThlLTAyOBIXCgppbmZfZG91YmxlGA4g", - "ASgBOgNpbmYSHAoObmVnX2luZl9kb3VibGUYDyABKAE6BC1pbmYSFwoKbmFu", - "X2RvdWJsZRgQIAEoAToDbmFuEhYKCWluZl9mbG9hdBgRIAEoAjoDaW5mEhsK", - "DW5lZ19pbmZfZmxvYXQYEiABKAI6BC1pbmYSFgoJbmFuX2Zsb2F0GBMgASgC", - "OgNuYW4SKwoMY3BwX3RyaWdyYXBoGBQgASgJOhU/ID8gPz8gPz8gPz8/ID8/", - "LyA/Py0iSwoRU3BhcnNlRW51bU1lc3NhZ2USNgoLc3BhcnNlX2VudW0YASAB", - "KA4yIS5wcm90b2J1Zl91bml0dGVzdC5UZXN0U3BhcnNlRW51bSIZCglPbmVT", - "dHJpbmcSDAoEZGF0YRgBIAEoCSIYCghPbmVCeXRlcxIMCgRkYXRhGAEgASgM", - "IqoDCg9UZXN0UGFja2VkVHlwZXMSGAoMcGFja2VkX2ludDMyGFogAygFQgIQ", - "ARIYCgxwYWNrZWRfaW50NjQYWyADKANCAhABEhkKDXBhY2tlZF91aW50MzIY", - "XCADKA1CAhABEhkKDXBhY2tlZF91aW50NjQYXSADKARCAhABEhkKDXBhY2tl", - "ZF9zaW50MzIYXiADKBFCAhABEhkKDXBhY2tlZF9zaW50NjQYXyADKBJCAhAB", - "EhoKDnBhY2tlZF9maXhlZDMyGGAgAygHQgIQARIaCg5wYWNrZWRfZml4ZWQ2", - "NBhhIAMoBkICEAESGwoPcGFja2VkX3NmaXhlZDMyGGIgAygPQgIQARIbCg9w", - "YWNrZWRfc2ZpeGVkNjQYYyADKBBCAhABEhgKDHBhY2tlZF9mbG9hdBhkIAMo", - "AkICEAESGQoNcGFja2VkX2RvdWJsZRhlIAMoAUICEAESFwoLcGFja2VkX2Jv", - "b2wYZiADKAhCAhABEjcKC3BhY2tlZF9lbnVtGGcgAygOMh4ucHJvdG9idWZf", - "dW5pdHRlc3QuRm9yZWlnbkVudW1CAhABIsgDChFUZXN0VW5wYWNrZWRUeXBl", - "cxIaCg51bnBhY2tlZF9pbnQzMhhaIAMoBUICEAASGgoOdW5wYWNrZWRfaW50", - "NjQYWyADKANCAhAAEhsKD3VucGFja2VkX3VpbnQzMhhcIAMoDUICEAASGwoP", - "dW5wYWNrZWRfdWludDY0GF0gAygEQgIQABIbCg91bnBhY2tlZF9zaW50MzIY", - "XiADKBFCAhAAEhsKD3VucGFja2VkX3NpbnQ2NBhfIAMoEkICEAASHAoQdW5w", - "YWNrZWRfZml4ZWQzMhhgIAMoB0ICEAASHAoQdW5wYWNrZWRfZml4ZWQ2NBhh", - "IAMoBkICEAASHQoRdW5wYWNrZWRfc2ZpeGVkMzIYYiADKA9CAhAAEh0KEXVu", - "cGFja2VkX3NmaXhlZDY0GGMgAygQQgIQABIaCg51bnBhY2tlZF9mbG9hdBhk", - "IAMoAkICEAASGwoPdW5wYWNrZWRfZG91YmxlGGUgAygBQgIQABIZCg11bnBh", - "Y2tlZF9ib29sGGYgAygIQgIQABI5Cg11bnBhY2tlZF9lbnVtGGcgAygOMh4u", - "cHJvdG9idWZfdW5pdHRlc3QuRm9yZWlnbkVudW1CAhAAIiAKFFRlc3RQYWNr", - "ZWRFeHRlbnNpb25zKggIARCAgICAAiKZBAoVVGVzdER5bmFtaWNFeHRlbnNp", - "b25zEhkKEHNjYWxhcl9leHRlbnNpb24Y0A8gASgHEjcKDmVudW1fZXh0ZW5z", - "aW9uGNEPIAEoDjIeLnByb3RvYnVmX3VuaXR0ZXN0LkZvcmVpZ25FbnVtElkK", - "FmR5bmFtaWNfZW51bV9leHRlbnNpb24Y0g8gASgOMjgucHJvdG9idWZfdW5p", - "dHRlc3QuVGVzdER5bmFtaWNFeHRlbnNpb25zLkR5bmFtaWNFbnVtVHlwZRI9", - "ChFtZXNzYWdlX2V4dGVuc2lvbhjTDyABKAsyIS5wcm90b2J1Zl91bml0dGVz", - "dC5Gb3JlaWduTWVzc2FnZRJfChlkeW5hbWljX21lc3NhZ2VfZXh0ZW5zaW9u", - "GNQPIAEoCzI7LnByb3RvYnVmX3VuaXR0ZXN0LlRlc3REeW5hbWljRXh0ZW5z", - "aW9ucy5EeW5hbWljTWVzc2FnZVR5cGUSGwoScmVwZWF0ZWRfZXh0ZW5zaW9u", - "GNUPIAMoCRIdChBwYWNrZWRfZXh0ZW5zaW9uGNYPIAMoEUICEAEaLAoSRHlu", - "YW1pY01lc3NhZ2VUeXBlEhYKDWR5bmFtaWNfZmllbGQYtBAgASgFIkcKD0R5", - "bmFtaWNFbnVtVHlwZRIQCgtEWU5BTUlDX0ZPTxCYERIQCgtEWU5BTUlDX0JB", - "UhCZERIQCgtEWU5BTUlDX0JBWhCaESLAAQojVGVzdFJlcGVhdGVkU2NhbGFy", - "RGlmZmVyZW50VGFnU2l6ZXMSGAoQcmVwZWF0ZWRfZml4ZWQzMhgMIAMoBxIW", - "Cg5yZXBlYXRlZF9pbnQzMhgNIAMoBRIZChByZXBlYXRlZF9maXhlZDY0GP4P", - "IAMoBhIXCg5yZXBlYXRlZF9pbnQ2NBj/DyADKAMSGAoOcmVwZWF0ZWRfZmxv", - "YXQY/v8PIAMoAhIZCg9yZXBlYXRlZF91aW50NjQY//8PIAMoBCIMCgpGb29S", - "ZXF1ZXN0Ig0KC0Zvb1Jlc3BvbnNlIgwKCkJhclJlcXVlc3QiDQoLQmFyUmVz", - "cG9uc2UqQAoLRm9yZWlnbkVudW0SDwoLRk9SRUlHTl9GT08QBBIPCgtGT1JF", - "SUdOX0JBUhAFEg8KC0ZPUkVJR05fQkFaEAYqRwoUVGVzdEVudW1XaXRoRHVw", - "VmFsdWUSCAoERk9PMRABEggKBEJBUjEQAhIHCgNCQVoQAxIICgRGT08yEAES", - "CAoEQkFSMhACKokBCg5UZXN0U3BhcnNlRW51bRIMCghTUEFSU0VfQRB7Eg4K", - "CFNQQVJTRV9CEKbnAxIPCghTUEFSU0VfQxCysYAGEhUKCFNQQVJTRV9EEPH/", - "/////////wESFQoIU1BBUlNFX0UQtN78////////ARIMCghTUEFSU0VfRhAA", - "EgwKCFNQQVJTRV9HEAIymQEKC1Rlc3RTZXJ2aWNlEkQKA0ZvbxIdLnByb3Rv", - "YnVmX3VuaXR0ZXN0LkZvb1JlcXVlc3QaHi5wcm90b2J1Zl91bml0dGVzdC5G", - "b29SZXNwb25zZRJECgNCYXISHS5wcm90b2J1Zl91bml0dGVzdC5CYXJSZXF1", - "ZXN0Gh4ucHJvdG9idWZfdW5pdHRlc3QuQmFyUmVzcG9uc2U6RgoYb3B0aW9u", - "YWxfaW50MzJfZXh0ZW5zaW9uEiQucHJvdG9idWZfdW5pdHRlc3QuVGVzdEFs", - "bEV4dGVuc2lvbnMYASABKAU6RgoYb3B0aW9uYWxfaW50NjRfZXh0ZW5zaW9u", - "EiQucHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYAiABKAM6", - "RwoZb3B0aW9uYWxfdWludDMyX2V4dGVuc2lvbhIkLnByb3RvYnVmX3VuaXR0", - "ZXN0LlRlc3RBbGxFeHRlbnNpb25zGAMgASgNOkcKGW9wdGlvbmFsX3VpbnQ2", - "NF9leHRlbnNpb24SJC5wcm90b2J1Zl91bml0dGVzdC5UZXN0QWxsRXh0ZW5z", - "aW9ucxgEIAEoBDpHChlvcHRpb25hbF9zaW50MzJfZXh0ZW5zaW9uEiQucHJv", - "dG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYBSABKBE6RwoZb3B0", - "aW9uYWxfc2ludDY0X2V4dGVuc2lvbhIkLnByb3RvYnVmX3VuaXR0ZXN0LlRl", - "c3RBbGxFeHRlbnNpb25zGAYgASgSOkgKGm9wdGlvbmFsX2ZpeGVkMzJfZXh0", - "ZW5zaW9uEiQucHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMY", - "ByABKAc6SAoab3B0aW9uYWxfZml4ZWQ2NF9leHRlbnNpb24SJC5wcm90b2J1", - "Zl91bml0dGVzdC5UZXN0QWxsRXh0ZW5zaW9ucxgIIAEoBjpJChtvcHRpb25h", - "bF9zZml4ZWQzMl9leHRlbnNpb24SJC5wcm90b2J1Zl91bml0dGVzdC5UZXN0", - "QWxsRXh0ZW5zaW9ucxgJIAEoDzpJChtvcHRpb25hbF9zZml4ZWQ2NF9leHRl", - "bnNpb24SJC5wcm90b2J1Zl91bml0dGVzdC5UZXN0QWxsRXh0ZW5zaW9ucxgK", - "IAEoEDpGChhvcHRpb25hbF9mbG9hdF9leHRlbnNpb24SJC5wcm90b2J1Zl91", - "bml0dGVzdC5UZXN0QWxsRXh0ZW5zaW9ucxgLIAEoAjpHChlvcHRpb25hbF9k", - "b3VibGVfZXh0ZW5zaW9uEiQucHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4", - "dGVuc2lvbnMYDCABKAE6RQoXb3B0aW9uYWxfYm9vbF9leHRlbnNpb24SJC5w", - "cm90b2J1Zl91bml0dGVzdC5UZXN0QWxsRXh0ZW5zaW9ucxgNIAEoCDpHChlv", - "cHRpb25hbF9zdHJpbmdfZXh0ZW5zaW9uEiQucHJvdG9idWZfdW5pdHRlc3Qu", - "VGVzdEFsbEV4dGVuc2lvbnMYDiABKAk6RgoYb3B0aW9uYWxfYnl0ZXNfZXh0", - "ZW5zaW9uEiQucHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMY", - "DyABKAw6cQoXb3B0aW9uYWxncm91cF9leHRlbnNpb24SJC5wcm90b2J1Zl91", - "bml0dGVzdC5UZXN0QWxsRXh0ZW5zaW9ucxgQIAEoCjIqLnByb3RvYnVmX3Vu", - "aXR0ZXN0Lk9wdGlvbmFsR3JvdXBfZXh0ZW5zaW9uOn4KIW9wdGlvbmFsX25l", - "c3RlZF9tZXNzYWdlX2V4dGVuc2lvbhIkLnByb3RvYnVmX3VuaXR0ZXN0LlRl", - "c3RBbGxFeHRlbnNpb25zGBIgASgLMi0ucHJvdG9idWZfdW5pdHRlc3QuVGVz", - "dEFsbFR5cGVzLk5lc3RlZE1lc3NhZ2U6cwoib3B0aW9uYWxfZm9yZWlnbl9t", - "ZXNzYWdlX2V4dGVuc2lvbhIkLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RBbGxF", - "eHRlbnNpb25zGBMgASgLMiEucHJvdG9idWZfdW5pdHRlc3QuRm9yZWlnbk1l", - "c3NhZ2U6eAohb3B0aW9uYWxfaW1wb3J0X21lc3NhZ2VfZXh0ZW5zaW9uEiQu", - "cHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYFCABKAsyJy5w", - "cm90b2J1Zl91bml0dGVzdF9pbXBvcnQuSW1wb3J0TWVzc2FnZTp4Ch5vcHRp", - "b25hbF9uZXN0ZWRfZW51bV9leHRlbnNpb24SJC5wcm90b2J1Zl91bml0dGVz", - "dC5UZXN0QWxsRXh0ZW5zaW9ucxgVIAEoDjIqLnByb3RvYnVmX3VuaXR0ZXN0", - "LlRlc3RBbGxUeXBlcy5OZXN0ZWRFbnVtOm0KH29wdGlvbmFsX2ZvcmVpZ25f", - "ZW51bV9leHRlbnNpb24SJC5wcm90b2J1Zl91bml0dGVzdC5UZXN0QWxsRXh0", - "ZW5zaW9ucxgWIAEoDjIeLnByb3RvYnVmX3VuaXR0ZXN0LkZvcmVpZ25FbnVt", - "OnIKHm9wdGlvbmFsX2ltcG9ydF9lbnVtX2V4dGVuc2lvbhIkLnByb3RvYnVm", - "X3VuaXR0ZXN0LlRlc3RBbGxFeHRlbnNpb25zGBcgASgOMiQucHJvdG9idWZf", - "dW5pdHRlc3RfaW1wb3J0LkltcG9ydEVudW06UQofb3B0aW9uYWxfc3RyaW5n", - "X3BpZWNlX2V4dGVuc2lvbhIkLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RBbGxF", - "eHRlbnNpb25zGBggASgJQgIIAjpJChdvcHRpb25hbF9jb3JkX2V4dGVuc2lv", - "bhIkLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RBbGxFeHRlbnNpb25zGBkgASgJ", - "QgIIATpGChhyZXBlYXRlZF9pbnQzMl9leHRlbnNpb24SJC5wcm90b2J1Zl91", - "bml0dGVzdC5UZXN0QWxsRXh0ZW5zaW9ucxgfIAMoBTpGChhyZXBlYXRlZF9p", - "bnQ2NF9leHRlbnNpb24SJC5wcm90b2J1Zl91bml0dGVzdC5UZXN0QWxsRXh0", - "ZW5zaW9ucxggIAMoAzpHChlyZXBlYXRlZF91aW50MzJfZXh0ZW5zaW9uEiQu", - "cHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYISADKA06RwoZ", - "cmVwZWF0ZWRfdWludDY0X2V4dGVuc2lvbhIkLnByb3RvYnVmX3VuaXR0ZXN0", - "LlRlc3RBbGxFeHRlbnNpb25zGCIgAygEOkcKGXJlcGVhdGVkX3NpbnQzMl9l", - "eHRlbnNpb24SJC5wcm90b2J1Zl91bml0dGVzdC5UZXN0QWxsRXh0ZW5zaW9u", - "cxgjIAMoETpHChlyZXBlYXRlZF9zaW50NjRfZXh0ZW5zaW9uEiQucHJvdG9i", - "dWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYJCADKBI6SAoacmVwZWF0", - "ZWRfZml4ZWQzMl9leHRlbnNpb24SJC5wcm90b2J1Zl91bml0dGVzdC5UZXN0", - "QWxsRXh0ZW5zaW9ucxglIAMoBzpIChpyZXBlYXRlZF9maXhlZDY0X2V4dGVu", - "c2lvbhIkLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RBbGxFeHRlbnNpb25zGCYg", - "AygGOkkKG3JlcGVhdGVkX3NmaXhlZDMyX2V4dGVuc2lvbhIkLnByb3RvYnVm", - "X3VuaXR0ZXN0LlRlc3RBbGxFeHRlbnNpb25zGCcgAygPOkkKG3JlcGVhdGVk", - "X3NmaXhlZDY0X2V4dGVuc2lvbhIkLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RB", - "bGxFeHRlbnNpb25zGCggAygQOkYKGHJlcGVhdGVkX2Zsb2F0X2V4dGVuc2lv", - "bhIkLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RBbGxFeHRlbnNpb25zGCkgAygC", - "OkcKGXJlcGVhdGVkX2RvdWJsZV9leHRlbnNpb24SJC5wcm90b2J1Zl91bml0", - "dGVzdC5UZXN0QWxsRXh0ZW5zaW9ucxgqIAMoATpFChdyZXBlYXRlZF9ib29s", - "X2V4dGVuc2lvbhIkLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RBbGxFeHRlbnNp", - "b25zGCsgAygIOkcKGXJlcGVhdGVkX3N0cmluZ19leHRlbnNpb24SJC5wcm90", - "b2J1Zl91bml0dGVzdC5UZXN0QWxsRXh0ZW5zaW9ucxgsIAMoCTpGChhyZXBl", - "YXRlZF9ieXRlc19leHRlbnNpb24SJC5wcm90b2J1Zl91bml0dGVzdC5UZXN0", - "QWxsRXh0ZW5zaW9ucxgtIAMoDDpxChdyZXBlYXRlZGdyb3VwX2V4dGVuc2lv", - "bhIkLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RBbGxFeHRlbnNpb25zGC4gAygK", - "MioucHJvdG9idWZfdW5pdHRlc3QuUmVwZWF0ZWRHcm91cF9leHRlbnNpb246", - "fgohcmVwZWF0ZWRfbmVzdGVkX21lc3NhZ2VfZXh0ZW5zaW9uEiQucHJvdG9i", - "dWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYMCADKAsyLS5wcm90b2J1", - "Zl91bml0dGVzdC5UZXN0QWxsVHlwZXMuTmVzdGVkTWVzc2FnZTpzCiJyZXBl", - "YXRlZF9mb3JlaWduX21lc3NhZ2VfZXh0ZW5zaW9uEiQucHJvdG9idWZfdW5p", - "dHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYMSADKAsyIS5wcm90b2J1Zl91bml0", - "dGVzdC5Gb3JlaWduTWVzc2FnZTp4CiFyZXBlYXRlZF9pbXBvcnRfbWVzc2Fn", - "ZV9leHRlbnNpb24SJC5wcm90b2J1Zl91bml0dGVzdC5UZXN0QWxsRXh0ZW5z", - "aW9ucxgyIAMoCzInLnByb3RvYnVmX3VuaXR0ZXN0X2ltcG9ydC5JbXBvcnRN", - "ZXNzYWdlOngKHnJlcGVhdGVkX25lc3RlZF9lbnVtX2V4dGVuc2lvbhIkLnBy", - "b3RvYnVmX3VuaXR0ZXN0LlRlc3RBbGxFeHRlbnNpb25zGDMgAygOMioucHJv", - "dG9idWZfdW5pdHRlc3QuVGVzdEFsbFR5cGVzLk5lc3RlZEVudW06bQofcmVw", - "ZWF0ZWRfZm9yZWlnbl9lbnVtX2V4dGVuc2lvbhIkLnByb3RvYnVmX3VuaXR0", - "ZXN0LlRlc3RBbGxFeHRlbnNpb25zGDQgAygOMh4ucHJvdG9idWZfdW5pdHRl", - "c3QuRm9yZWlnbkVudW06cgoecmVwZWF0ZWRfaW1wb3J0X2VudW1fZXh0ZW5z", - "aW9uEiQucHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYNSAD", - "KA4yJC5wcm90b2J1Zl91bml0dGVzdF9pbXBvcnQuSW1wb3J0RW51bTpRCh9y", - "ZXBlYXRlZF9zdHJpbmdfcGllY2VfZXh0ZW5zaW9uEiQucHJvdG9idWZfdW5p", - "dHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYNiADKAlCAggCOkkKF3JlcGVhdGVk", - "X2NvcmRfZXh0ZW5zaW9uEiQucHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4", - "dGVuc2lvbnMYNyADKAlCAggBOkkKF2RlZmF1bHRfaW50MzJfZXh0ZW5zaW9u", - "EiQucHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYPSABKAU6", - "AjQxOkkKF2RlZmF1bHRfaW50NjRfZXh0ZW5zaW9uEiQucHJvdG9idWZfdW5p", - "dHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYPiABKAM6AjQyOkoKGGRlZmF1bHRf", - "dWludDMyX2V4dGVuc2lvbhIkLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RBbGxF", - "eHRlbnNpb25zGD8gASgNOgI0MzpKChhkZWZhdWx0X3VpbnQ2NF9leHRlbnNp", - "b24SJC5wcm90b2J1Zl91bml0dGVzdC5UZXN0QWxsRXh0ZW5zaW9ucxhAIAEo", - "BDoCNDQ6SwoYZGVmYXVsdF9zaW50MzJfZXh0ZW5zaW9uEiQucHJvdG9idWZf", - "dW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYQSABKBE6Ay00NTpKChhkZWZh", - "dWx0X3NpbnQ2NF9leHRlbnNpb24SJC5wcm90b2J1Zl91bml0dGVzdC5UZXN0", - "QWxsRXh0ZW5zaW9ucxhCIAEoEjoCNDY6SwoZZGVmYXVsdF9maXhlZDMyX2V4", - "dGVuc2lvbhIkLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RBbGxFeHRlbnNpb25z", - "GEMgASgHOgI0NzpLChlkZWZhdWx0X2ZpeGVkNjRfZXh0ZW5zaW9uEiQucHJv", - "dG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYRCABKAY6AjQ4OkwK", - "GmRlZmF1bHRfc2ZpeGVkMzJfZXh0ZW5zaW9uEiQucHJvdG9idWZfdW5pdHRl", - "c3QuVGVzdEFsbEV4dGVuc2lvbnMYRSABKA86AjQ5Ok0KGmRlZmF1bHRfc2Zp", - "eGVkNjRfZXh0ZW5zaW9uEiQucHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4", - "dGVuc2lvbnMYRiABKBA6Ay01MDpLChdkZWZhdWx0X2Zsb2F0X2V4dGVuc2lv", - "bhIkLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RBbGxFeHRlbnNpb25zGEcgASgC", - "OgQ1MS41Ok0KGGRlZmF1bHRfZG91YmxlX2V4dGVuc2lvbhIkLnByb3RvYnVm", - "X3VuaXR0ZXN0LlRlc3RBbGxFeHRlbnNpb25zGEggASgBOgU1MjAwMDpKChZk", - "ZWZhdWx0X2Jvb2xfZXh0ZW5zaW9uEiQucHJvdG9idWZfdW5pdHRlc3QuVGVz", - "dEFsbEV4dGVuc2lvbnMYSSABKAg6BHRydWU6TQoYZGVmYXVsdF9zdHJpbmdf", - "ZXh0ZW5zaW9uEiQucHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lv", - "bnMYSiABKAk6BWhlbGxvOkwKF2RlZmF1bHRfYnl0ZXNfZXh0ZW5zaW9uEiQu", - "cHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYSyABKAw6BXdv", - "cmxkOnwKHWRlZmF1bHRfbmVzdGVkX2VudW1fZXh0ZW5zaW9uEiQucHJvdG9i", - "dWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYUSABKA4yKi5wcm90b2J1", - "Zl91bml0dGVzdC5UZXN0QWxsVHlwZXMuTmVzdGVkRW51bToDQkFSOnkKHmRl", - "ZmF1bHRfZm9yZWlnbl9lbnVtX2V4dGVuc2lvbhIkLnByb3RvYnVmX3VuaXR0", - "ZXN0LlRlc3RBbGxFeHRlbnNpb25zGFIgASgOMh4ucHJvdG9idWZfdW5pdHRl", - "c3QuRm9yZWlnbkVudW06C0ZPUkVJR05fQkFSOn0KHWRlZmF1bHRfaW1wb3J0", - "X2VudW1fZXh0ZW5zaW9uEiQucHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4", - "dGVuc2lvbnMYUyABKA4yJC5wcm90b2J1Zl91bml0dGVzdF9pbXBvcnQuSW1w", - "b3J0RW51bToKSU1QT1JUX0JBUjpVCh5kZWZhdWx0X3N0cmluZ19waWVjZV9l", - "eHRlbnNpb24SJC5wcm90b2J1Zl91bml0dGVzdC5UZXN0QWxsRXh0ZW5zaW9u", - "cxhUIAEoCToDYWJjQgIIAjpNChZkZWZhdWx0X2NvcmRfZXh0ZW5zaW9uEiQu", - "cHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYVSABKAk6AzEy", - "M0ICCAE6QgoTbXlfZXh0ZW5zaW9uX3N0cmluZxIlLnByb3RvYnVmX3VuaXR0", - "ZXN0LlRlc3RGaWVsZE9yZGVyaW5ncxgyIAEoCTo/ChBteV9leHRlbnNpb25f", - "aW50EiUucHJvdG9idWZfdW5pdHRlc3QuVGVzdEZpZWxkT3JkZXJpbmdzGAUg", - "ASgFOksKFnBhY2tlZF9pbnQzMl9leHRlbnNpb24SJy5wcm90b2J1Zl91bml0", - "dGVzdC5UZXN0UGFja2VkRXh0ZW5zaW9ucxhaIAMoBUICEAE6SwoWcGFja2Vk", - "X2ludDY0X2V4dGVuc2lvbhInLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RQYWNr", - "ZWRFeHRlbnNpb25zGFsgAygDQgIQATpMChdwYWNrZWRfdWludDMyX2V4dGVu", - "c2lvbhInLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RQYWNrZWRFeHRlbnNpb25z", - "GFwgAygNQgIQATpMChdwYWNrZWRfdWludDY0X2V4dGVuc2lvbhInLnByb3Rv", - "YnVmX3VuaXR0ZXN0LlRlc3RQYWNrZWRFeHRlbnNpb25zGF0gAygEQgIQATpM", - "ChdwYWNrZWRfc2ludDMyX2V4dGVuc2lvbhInLnByb3RvYnVmX3VuaXR0ZXN0", - "LlRlc3RQYWNrZWRFeHRlbnNpb25zGF4gAygRQgIQATpMChdwYWNrZWRfc2lu", - "dDY0X2V4dGVuc2lvbhInLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RQYWNrZWRF", - "eHRlbnNpb25zGF8gAygSQgIQATpNChhwYWNrZWRfZml4ZWQzMl9leHRlbnNp", - "b24SJy5wcm90b2J1Zl91bml0dGVzdC5UZXN0UGFja2VkRXh0ZW5zaW9ucxhg", - "IAMoB0ICEAE6TQoYcGFja2VkX2ZpeGVkNjRfZXh0ZW5zaW9uEicucHJvdG9i", - "dWZfdW5pdHRlc3QuVGVzdFBhY2tlZEV4dGVuc2lvbnMYYSADKAZCAhABOk4K", - "GXBhY2tlZF9zZml4ZWQzMl9leHRlbnNpb24SJy5wcm90b2J1Zl91bml0dGVz", - "dC5UZXN0UGFja2VkRXh0ZW5zaW9ucxhiIAMoD0ICEAE6TgoZcGFja2VkX3Nm", - "aXhlZDY0X2V4dGVuc2lvbhInLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RQYWNr", - "ZWRFeHRlbnNpb25zGGMgAygQQgIQATpLChZwYWNrZWRfZmxvYXRfZXh0ZW5z", - "aW9uEicucHJvdG9idWZfdW5pdHRlc3QuVGVzdFBhY2tlZEV4dGVuc2lvbnMY", - "ZCADKAJCAhABOkwKF3BhY2tlZF9kb3VibGVfZXh0ZW5zaW9uEicucHJvdG9i", - "dWZfdW5pdHRlc3QuVGVzdFBhY2tlZEV4dGVuc2lvbnMYZSADKAFCAhABOkoK", - "FXBhY2tlZF9ib29sX2V4dGVuc2lvbhInLnByb3RvYnVmX3VuaXR0ZXN0LlRl", - "c3RQYWNrZWRFeHRlbnNpb25zGGYgAygIQgIQATpqChVwYWNrZWRfZW51bV9l", - "eHRlbnNpb24SJy5wcm90b2J1Zl91bml0dGVzdC5UZXN0UGFja2VkRXh0ZW5z", - "aW9ucxhnIAMoDjIeLnByb3RvYnVmX3VuaXR0ZXN0LkZvcmVpZ25FbnVtQgIQ", - "AUJTQg1Vbml0dGVzdFByb3RvSAGAAQGIAQGQAQHCPjYKIUdvb2dsZS5Qcm90", - "b2NvbEJ1ZmZlcnMuVGVzdFByb3RvcxIRVW5pdFRlc3RQcm90b0ZpbGU=")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_protobuf_unittest_TestAllTypes__Descriptor = Descriptor.MessageTypes[0]; - internal__static_protobuf_unittest_TestAllTypes__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestAllTypes__Descriptor, - new string[] { "OptionalInt32", "OptionalInt64", "OptionalUint32", "OptionalUint64", "OptionalSint32", "OptionalSint64", "OptionalFixed32", "OptionalFixed64", "OptionalSfixed32", "OptionalSfixed64", "OptionalFloat", "OptionalDouble", "OptionalBool", "OptionalString", "OptionalBytes", "OptionalGroup", "OptionalNestedMessage", "OptionalForeignMessage", "OptionalImportMessage", "OptionalNestedEnum", "OptionalForeignEnum", "OptionalImportEnum", "OptionalStringPiece", "OptionalCord", "RepeatedInt32", "RepeatedInt64", "RepeatedUint32", "RepeatedUint64", "RepeatedSint32", "RepeatedSint64", "RepeatedFixed32", "RepeatedFixed64", "RepeatedSfixed32", "RepeatedSfixed64", "RepeatedFloat", "RepeatedDouble", "RepeatedBool", "RepeatedString", "RepeatedBytes", "RepeatedGroup", "RepeatedNestedMessage", "RepeatedForeignMessage", "RepeatedImportMessage", "RepeatedNestedEnum", "RepeatedForeignEnum", "RepeatedImportEnum", "RepeatedStringPiece", "RepeatedCord", "DefaultInt32", "DefaultInt64", "DefaultUint32", "DefaultUint64", "DefaultSint32", "DefaultSint64", "DefaultFixed32", "DefaultFixed64", "DefaultSfixed32", "DefaultSfixed64", "DefaultFloat", "DefaultDouble", "DefaultBool", "DefaultString", "DefaultBytes", "DefaultNestedEnum", "DefaultForeignEnum", "DefaultImportEnum", "DefaultStringPiece", "DefaultCord", }); - internal__static_protobuf_unittest_TestAllTypes_NestedMessage__Descriptor = internal__static_protobuf_unittest_TestAllTypes__Descriptor.NestedTypes[0]; - internal__static_protobuf_unittest_TestAllTypes_NestedMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestAllTypes_NestedMessage__Descriptor, - new string[] { "Bb", }); - internal__static_protobuf_unittest_TestAllTypes_OptionalGroup__Descriptor = internal__static_protobuf_unittest_TestAllTypes__Descriptor.NestedTypes[1]; - internal__static_protobuf_unittest_TestAllTypes_OptionalGroup__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestAllTypes_OptionalGroup__Descriptor, - new string[] { "A", }); - internal__static_protobuf_unittest_TestAllTypes_RepeatedGroup__Descriptor = internal__static_protobuf_unittest_TestAllTypes__Descriptor.NestedTypes[2]; - internal__static_protobuf_unittest_TestAllTypes_RepeatedGroup__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestAllTypes_RepeatedGroup__Descriptor, - new string[] { "A", }); - internal__static_protobuf_unittest_TestDeprecatedFields__Descriptor = Descriptor.MessageTypes[1]; - internal__static_protobuf_unittest_TestDeprecatedFields__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestDeprecatedFields__Descriptor, - new string[] { "DeprecatedInt32", }); - internal__static_protobuf_unittest_ForeignMessage__Descriptor = Descriptor.MessageTypes[2]; - internal__static_protobuf_unittest_ForeignMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_ForeignMessage__Descriptor, - new string[] { "C", }); - internal__static_protobuf_unittest_TestAllExtensions__Descriptor = Descriptor.MessageTypes[3]; - internal__static_protobuf_unittest_TestAllExtensions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestAllExtensions__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_OptionalGroup_extension__Descriptor = Descriptor.MessageTypes[4]; - internal__static_protobuf_unittest_OptionalGroup_extension__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_OptionalGroup_extension__Descriptor, - new string[] { "A", }); - internal__static_protobuf_unittest_RepeatedGroup_extension__Descriptor = Descriptor.MessageTypes[5]; - internal__static_protobuf_unittest_RepeatedGroup_extension__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_RepeatedGroup_extension__Descriptor, - new string[] { "A", }); - internal__static_protobuf_unittest_TestNestedExtension__Descriptor = Descriptor.MessageTypes[6]; - internal__static_protobuf_unittest_TestNestedExtension__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestNestedExtension__Descriptor, - new string[] { }); - global::Google.ProtocolBuffers.TestProtos.TestNestedExtension.Test = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.TestNestedExtension.Descriptor.Extensions[0]); - internal__static_protobuf_unittest_TestRequired__Descriptor = Descriptor.MessageTypes[7]; - internal__static_protobuf_unittest_TestRequired__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestRequired__Descriptor, - new string[] { "A", "Dummy2", "B", "Dummy4", "Dummy5", "Dummy6", "Dummy7", "Dummy8", "Dummy9", "Dummy10", "Dummy11", "Dummy12", "Dummy13", "Dummy14", "Dummy15", "Dummy16", "Dummy17", "Dummy18", "Dummy19", "Dummy20", "Dummy21", "Dummy22", "Dummy23", "Dummy24", "Dummy25", "Dummy26", "Dummy27", "Dummy28", "Dummy29", "Dummy30", "Dummy31", "Dummy32", "C", }); - global::Google.ProtocolBuffers.TestProtos.TestRequired.Single = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.TestRequired.Descriptor.Extensions[0]); - global::Google.ProtocolBuffers.TestProtos.TestRequired.Multi = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.TestRequired.Descriptor.Extensions[1]); - internal__static_protobuf_unittest_TestRequiredForeign__Descriptor = Descriptor.MessageTypes[8]; - internal__static_protobuf_unittest_TestRequiredForeign__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestRequiredForeign__Descriptor, - new string[] { "OptionalMessage", "RepeatedMessage", "Dummy", }); - internal__static_protobuf_unittest_TestForeignNested__Descriptor = Descriptor.MessageTypes[9]; - internal__static_protobuf_unittest_TestForeignNested__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestForeignNested__Descriptor, - new string[] { "ForeignNested", }); - internal__static_protobuf_unittest_TestEmptyMessage__Descriptor = Descriptor.MessageTypes[10]; - internal__static_protobuf_unittest_TestEmptyMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestEmptyMessage__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_TestEmptyMessageWithExtensions__Descriptor = Descriptor.MessageTypes[11]; - internal__static_protobuf_unittest_TestEmptyMessageWithExtensions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestEmptyMessageWithExtensions__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_TestMultipleExtensionRanges__Descriptor = Descriptor.MessageTypes[12]; - internal__static_protobuf_unittest_TestMultipleExtensionRanges__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestMultipleExtensionRanges__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_TestReallyLargeTagNumber__Descriptor = Descriptor.MessageTypes[13]; - internal__static_protobuf_unittest_TestReallyLargeTagNumber__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestReallyLargeTagNumber__Descriptor, - new string[] { "A", "Bb", }); - internal__static_protobuf_unittest_TestRecursiveMessage__Descriptor = Descriptor.MessageTypes[14]; - internal__static_protobuf_unittest_TestRecursiveMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestRecursiveMessage__Descriptor, - new string[] { "A", "I", }); - internal__static_protobuf_unittest_TestMutualRecursionA__Descriptor = Descriptor.MessageTypes[15]; - internal__static_protobuf_unittest_TestMutualRecursionA__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestMutualRecursionA__Descriptor, - new string[] { "Bb", }); - internal__static_protobuf_unittest_TestMutualRecursionB__Descriptor = Descriptor.MessageTypes[16]; - internal__static_protobuf_unittest_TestMutualRecursionB__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestMutualRecursionB__Descriptor, - new string[] { "A", "OptionalInt32", }); - internal__static_protobuf_unittest_TestDupFieldNumber__Descriptor = Descriptor.MessageTypes[17]; - internal__static_protobuf_unittest_TestDupFieldNumber__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestDupFieldNumber__Descriptor, - new string[] { "A", "Foo", "Bar", }); - internal__static_protobuf_unittest_TestDupFieldNumber_Foo__Descriptor = internal__static_protobuf_unittest_TestDupFieldNumber__Descriptor.NestedTypes[0]; - internal__static_protobuf_unittest_TestDupFieldNumber_Foo__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestDupFieldNumber_Foo__Descriptor, - new string[] { "A", }); - internal__static_protobuf_unittest_TestDupFieldNumber_Bar__Descriptor = internal__static_protobuf_unittest_TestDupFieldNumber__Descriptor.NestedTypes[1]; - internal__static_protobuf_unittest_TestDupFieldNumber_Bar__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestDupFieldNumber_Bar__Descriptor, - new string[] { "A", }); - internal__static_protobuf_unittest_TestNestedMessageHasBits__Descriptor = Descriptor.MessageTypes[18]; - internal__static_protobuf_unittest_TestNestedMessageHasBits__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestNestedMessageHasBits__Descriptor, - new string[] { "OptionalNestedMessage", }); - internal__static_protobuf_unittest_TestNestedMessageHasBits_NestedMessage__Descriptor = internal__static_protobuf_unittest_TestNestedMessageHasBits__Descriptor.NestedTypes[0]; - internal__static_protobuf_unittest_TestNestedMessageHasBits_NestedMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestNestedMessageHasBits_NestedMessage__Descriptor, - new string[] { "NestedmessageRepeatedInt32", "NestedmessageRepeatedForeignmessage", }); - internal__static_protobuf_unittest_TestCamelCaseFieldNames__Descriptor = Descriptor.MessageTypes[19]; - internal__static_protobuf_unittest_TestCamelCaseFieldNames__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestCamelCaseFieldNames__Descriptor, - new string[] { "PrimitiveField", "StringField", "EnumField", "MessageField", "StringPieceField", "CordField", "RepeatedPrimitiveField", "RepeatedStringField", "RepeatedEnumField", "RepeatedMessageField", "RepeatedStringPieceField", "RepeatedCordField", }); - internal__static_protobuf_unittest_TestFieldOrderings__Descriptor = Descriptor.MessageTypes[20]; - internal__static_protobuf_unittest_TestFieldOrderings__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestFieldOrderings__Descriptor, - new string[] { "MyString", "MyInt", "MyFloat", }); - internal__static_protobuf_unittest_TestExtremeDefaultValues__Descriptor = Descriptor.MessageTypes[21]; - internal__static_protobuf_unittest_TestExtremeDefaultValues__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestExtremeDefaultValues__Descriptor, - new string[] { "EscapedBytes", "LargeUint32", "LargeUint64", "SmallInt32", "SmallInt64", "Utf8String", "ZeroFloat", "OneFloat", "SmallFloat", "NegativeOneFloat", "NegativeFloat", "LargeFloat", "SmallNegativeFloat", "InfDouble", "NegInfDouble", "NanDouble", "InfFloat", "NegInfFloat", "NanFloat", "CppTrigraph", }); - internal__static_protobuf_unittest_SparseEnumMessage__Descriptor = Descriptor.MessageTypes[22]; - internal__static_protobuf_unittest_SparseEnumMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_SparseEnumMessage__Descriptor, - new string[] { "SparseEnum", }); - internal__static_protobuf_unittest_OneString__Descriptor = Descriptor.MessageTypes[23]; - internal__static_protobuf_unittest_OneString__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_OneString__Descriptor, - new string[] { "Data", }); - internal__static_protobuf_unittest_OneBytes__Descriptor = Descriptor.MessageTypes[24]; - internal__static_protobuf_unittest_OneBytes__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_OneBytes__Descriptor, - new string[] { "Data", }); - internal__static_protobuf_unittest_TestPackedTypes__Descriptor = Descriptor.MessageTypes[25]; - internal__static_protobuf_unittest_TestPackedTypes__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestPackedTypes__Descriptor, - new string[] { "PackedInt32", "PackedInt64", "PackedUint32", "PackedUint64", "PackedSint32", "PackedSint64", "PackedFixed32", "PackedFixed64", "PackedSfixed32", "PackedSfixed64", "PackedFloat", "PackedDouble", "PackedBool", "PackedEnum", }); - internal__static_protobuf_unittest_TestUnpackedTypes__Descriptor = Descriptor.MessageTypes[26]; - internal__static_protobuf_unittest_TestUnpackedTypes__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestUnpackedTypes__Descriptor, - new string[] { "UnpackedInt32", "UnpackedInt64", "UnpackedUint32", "UnpackedUint64", "UnpackedSint32", "UnpackedSint64", "UnpackedFixed32", "UnpackedFixed64", "UnpackedSfixed32", "UnpackedSfixed64", "UnpackedFloat", "UnpackedDouble", "UnpackedBool", "UnpackedEnum", }); - internal__static_protobuf_unittest_TestPackedExtensions__Descriptor = Descriptor.MessageTypes[27]; - internal__static_protobuf_unittest_TestPackedExtensions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestPackedExtensions__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_TestDynamicExtensions__Descriptor = Descriptor.MessageTypes[28]; - internal__static_protobuf_unittest_TestDynamicExtensions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestDynamicExtensions__Descriptor, - new string[] { "ScalarExtension", "EnumExtension", "DynamicEnumExtension", "MessageExtension", "DynamicMessageExtension", "RepeatedExtension", "PackedExtension", }); - internal__static_protobuf_unittest_TestDynamicExtensions_DynamicMessageType__Descriptor = internal__static_protobuf_unittest_TestDynamicExtensions__Descriptor.NestedTypes[0]; - internal__static_protobuf_unittest_TestDynamicExtensions_DynamicMessageType__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestDynamicExtensions_DynamicMessageType__Descriptor, - new string[] { "DynamicField", }); - internal__static_protobuf_unittest_TestRepeatedScalarDifferentTagSizes__Descriptor = Descriptor.MessageTypes[29]; - internal__static_protobuf_unittest_TestRepeatedScalarDifferentTagSizes__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestRepeatedScalarDifferentTagSizes__Descriptor, - new string[] { "RepeatedFixed32", "RepeatedInt32", "RepeatedFixed64", "RepeatedInt64", "RepeatedFloat", "RepeatedUint64", }); - internal__static_protobuf_unittest_FooRequest__Descriptor = Descriptor.MessageTypes[30]; - internal__static_protobuf_unittest_FooRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_FooRequest__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_FooResponse__Descriptor = Descriptor.MessageTypes[31]; - internal__static_protobuf_unittest_FooResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_FooResponse__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_BarRequest__Descriptor = Descriptor.MessageTypes[32]; - internal__static_protobuf_unittest_BarRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_BarRequest__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_BarResponse__Descriptor = Descriptor.MessageTypes[33]; - internal__static_protobuf_unittest_BarResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_BarResponse__Descriptor, - new string[] { }); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalInt32Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[0]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalInt64Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[1]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalUint32Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[2]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalUint64Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[3]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalSint32Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[4]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalSint64Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[5]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalFixed32Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[6]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalFixed64Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[7]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalSfixed32Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[8]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalSfixed64Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[9]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalFloatExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[10]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalDoubleExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[11]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalBoolExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[12]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalStringExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[13]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalBytesExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[14]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalGroupExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[15]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalNestedMessageExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[16]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalForeignMessageExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[17]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalImportMessageExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[18]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalNestedEnumExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[19]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalForeignEnumExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[20]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalImportEnumExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[21]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalStringPieceExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[22]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalCordExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[23]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedInt32Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[24]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedInt64Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[25]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedUint32Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[26]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedUint64Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[27]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedSint32Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[28]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedSint64Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[29]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedFixed32Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[30]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedFixed64Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[31]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedSfixed32Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[32]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedSfixed64Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[33]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedFloatExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[34]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedDoubleExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[35]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedBoolExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[36]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedStringExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[37]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedBytesExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[38]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedGroupExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[39]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedNestedMessageExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[40]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedForeignMessageExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[41]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedImportMessageExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[42]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedNestedEnumExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[43]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedForeignEnumExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[44]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedImportEnumExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[45]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedStringPieceExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[46]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedCordExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[47]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultInt32Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[48]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultInt64Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[49]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultUint32Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[50]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultUint64Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[51]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultSint32Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[52]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultSint64Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[53]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultFixed32Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[54]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultFixed64Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[55]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultSfixed32Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[56]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultSfixed64Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[57]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultFloatExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[58]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultDoubleExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[59]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultBoolExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[60]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultStringExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[61]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultBytesExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[62]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultNestedEnumExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[63]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultForeignEnumExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[64]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultImportEnumExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[65]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultStringPieceExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[66]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultCordExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[67]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.MyExtensionString = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[68]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.MyExtensionInt = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[69]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedInt32Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[70]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedInt64Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[71]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedUint32Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[72]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedUint64Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[73]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedSint32Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[74]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedSint64Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[75]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedFixed32Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[76]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedFixed64Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[77]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedSfixed32Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[78]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedSfixed64Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[79]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedFloatExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[80]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedDoubleExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[81]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedBoolExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[82]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedEnumExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[83]); - pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); - RegisterAllExtensions(registry); - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.RegisterAllExtensions(registry); - global::Google.ProtocolBuffers.TestProtos.UnitTestImportProtoFile.RegisterAllExtensions(registry); - return registry; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, - global::Google.ProtocolBuffers.TestProtos.UnitTestImportProtoFile.Descriptor, - }, assigner); - } - #endregion - - } - #region Enums - public enum ForeignEnum { - FOREIGN_FOO = 4, - FOREIGN_BAR = 5, - FOREIGN_BAZ = 6, - } - - public enum TestEnumWithDupValue { - FOO1 = 1, - BAR1 = 2, - BAZ = 3, - FOO2 = 1, - BAR2 = 2, - } - - public enum TestSparseEnum { - SPARSE_A = 123, - SPARSE_B = 62374, - SPARSE_C = 12589234, - SPARSE_D = -15, - SPARSE_E = -53452, - SPARSE_F = 0, - SPARSE_G = 2, - } - - #endregion - - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestAllTypes : pb::GeneratedMessage { - private TestAllTypes() { } - private static readonly TestAllTypes defaultInstance = new TestAllTypes().MakeReadOnly(); - private static readonly string[] _testAllTypesFieldNames = new string[] { "default_bool", "default_bytes", "default_cord", "default_double", "default_fixed32", "default_fixed64", "default_float", "default_foreign_enum", "default_import_enum", "default_int32", "default_int64", "default_nested_enum", "default_sfixed32", "default_sfixed64", "default_sint32", "default_sint64", "default_string", "default_string_piece", "default_uint32", "default_uint64", "optional_bool", "optional_bytes", "optional_cord", "optional_double", "optional_fixed32", "optional_fixed64", "optional_float", "optional_foreign_enum", "optional_foreign_message", "optional_import_enum", "optional_import_message", "optional_int32", "optional_int64", "optional_nested_enum", "optional_nested_message", "optional_sfixed32", "optional_sfixed64", "optional_sint32", "optional_sint64", "optional_string", "optional_string_piece", "optional_uint32", "optional_uint64", "optionalgroup", "repeated_bool", "repeated_bytes", "repeated_cord", "repeated_double", "repeated_fixed32", "repeated_fixed64", "repeated_float", "repeated_foreign_enum", "repeated_foreign_message", "repeated_import_enum", "repeated_import_message", "repeated_int32", "repeated_int64", "repeated_nested_enum", "repeated_nested_message", "repeated_sfixed32", "repeated_sfixed64", "repeated_sint32", "repeated_sint64", "repeated_string", "repeated_string_piece", "repeated_uint32", "repeated_uint64", "repeatedgroup" }; - private static readonly uint[] _testAllTypesFieldTags = new uint[] { 584, 602, 682, 577, 541, 545, 573, 656, 664, 488, 496, 648, 557, 561, 520, 528, 594, 674, 504, 512, 104, 122, 202, 97, 61, 65, 93, 176, 154, 184, 162, 8, 16, 168, 146, 77, 81, 40, 48, 114, 194, 24, 32, 131, 344, 362, 442, 337, 301, 305, 333, 416, 394, 424, 402, 248, 256, 408, 386, 317, 321, 280, 288, 354, 434, 264, 272, 371 }; - public static TestAllTypes DefaultInstance { - get { return defaultInstance; } - } - - public override TestAllTypes DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestAllTypes ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllTypes__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllTypes__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - public enum NestedEnum { - FOO = 1, - BAR = 2, - BAZ = 3, - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class NestedMessage : pb::GeneratedMessage { - private NestedMessage() { } - private static readonly NestedMessage defaultInstance = new NestedMessage().MakeReadOnly(); - private static readonly string[] _nestedMessageFieldNames = new string[] { "bb" }; - private static readonly uint[] _nestedMessageFieldTags = new uint[] { 8 }; - public static NestedMessage DefaultInstance { - get { return defaultInstance; } - } - - public override NestedMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override NestedMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllTypes_NestedMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllTypes_NestedMessage__FieldAccessorTable; } - } - - public const int BbFieldNumber = 1; - private bool hasBb; - private int bb_; - public bool HasBb { - get { return hasBb; } - } - public int Bb { - get { return bb_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _nestedMessageFieldNames; - if (hasBb) { - output.WriteInt32(1, field_names[0], Bb); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasBb) { - size += pb::CodedOutputStream.ComputeInt32Size(1, Bb); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static NestedMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NestedMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NestedMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NestedMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NestedMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NestedMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static NestedMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NestedMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private NestedMessage MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(NestedMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(NestedMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private NestedMessage result; - - private NestedMessage PrepareBuilder() { - if (resultIsReadOnly) { - NestedMessage original = result; - result = new NestedMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override NestedMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Descriptor; } - } - - public override NestedMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.DefaultInstance; } - } - - public override NestedMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is NestedMessage) { - return MergeFrom((NestedMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(NestedMessage other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasBb) { - Bb = other.Bb; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_nestedMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _nestedMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasBb = input.ReadInt32(ref result.bb_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasBb { - get { return result.hasBb; } - } - public int Bb { - get { return result.Bb; } - set { SetBb(value); } - } - public Builder SetBb(int value) { - PrepareBuilder(); - result.hasBb = true; - result.bb_ = value; - return this; - } - public Builder ClearBb() { - PrepareBuilder(); - result.hasBb = false; - result.bb_ = 0; - return this; - } - } - static NestedMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class OptionalGroup : pb::GeneratedMessage { - private OptionalGroup() { } - private static readonly OptionalGroup defaultInstance = new OptionalGroup().MakeReadOnly(); - private static readonly string[] _optionalGroupFieldNames = new string[] { "a" }; - private static readonly uint[] _optionalGroupFieldTags = new uint[] { 136 }; - public static OptionalGroup DefaultInstance { - get { return defaultInstance; } - } - - public override OptionalGroup DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override OptionalGroup ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllTypes_OptionalGroup__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllTypes_OptionalGroup__FieldAccessorTable; } - } - - public const int AFieldNumber = 17; - private bool hasA; - private int a_; - public bool HasA { - get { return hasA; } - } - public int A { - get { return a_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _optionalGroupFieldNames; - if (hasA) { - output.WriteInt32(17, field_names[0], A); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA) { - size += pb::CodedOutputStream.ComputeInt32Size(17, A); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static OptionalGroup ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OptionalGroup ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OptionalGroup ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OptionalGroup ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OptionalGroup ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OptionalGroup ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static OptionalGroup ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static OptionalGroup ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static OptionalGroup ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OptionalGroup ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private OptionalGroup MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(OptionalGroup prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(OptionalGroup cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private OptionalGroup result; - - private OptionalGroup PrepareBuilder() { - if (resultIsReadOnly) { - OptionalGroup original = result; - result = new OptionalGroup(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override OptionalGroup MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.Descriptor; } - } - - public override OptionalGroup DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.DefaultInstance; } - } - - public override OptionalGroup BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is OptionalGroup) { - return MergeFrom((OptionalGroup) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(OptionalGroup other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA) { - A = other.A; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_optionalGroupFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _optionalGroupFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 136: { - result.hasA = input.ReadInt32(ref result.a_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasA { - get { return result.hasA; } - } - public int A { - get { return result.A; } - set { SetA(value); } - } - public Builder SetA(int value) { - PrepareBuilder(); - result.hasA = true; - result.a_ = value; - return this; - } - public Builder ClearA() { - PrepareBuilder(); - result.hasA = false; - result.a_ = 0; - return this; - } - } - static OptionalGroup() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class RepeatedGroup : pb::GeneratedMessage { - private RepeatedGroup() { } - private static readonly RepeatedGroup defaultInstance = new RepeatedGroup().MakeReadOnly(); - private static readonly string[] _repeatedGroupFieldNames = new string[] { "a" }; - private static readonly uint[] _repeatedGroupFieldTags = new uint[] { 376 }; - public static RepeatedGroup DefaultInstance { - get { return defaultInstance; } - } - - public override RepeatedGroup DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override RepeatedGroup ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllTypes_RepeatedGroup__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllTypes_RepeatedGroup__FieldAccessorTable; } - } - - public const int AFieldNumber = 47; - private bool hasA; - private int a_; - public bool HasA { - get { return hasA; } - } - public int A { - get { return a_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _repeatedGroupFieldNames; - if (hasA) { - output.WriteInt32(47, field_names[0], A); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA) { - size += pb::CodedOutputStream.ComputeInt32Size(47, A); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static RepeatedGroup ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RepeatedGroup ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RepeatedGroup ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RepeatedGroup ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RepeatedGroup ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RepeatedGroup ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static RepeatedGroup ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static RepeatedGroup ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static RepeatedGroup ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RepeatedGroup ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private RepeatedGroup MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(RepeatedGroup prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(RepeatedGroup cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private RepeatedGroup result; - - private RepeatedGroup PrepareBuilder() { - if (resultIsReadOnly) { - RepeatedGroup original = result; - result = new RepeatedGroup(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override RepeatedGroup MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup.Descriptor; } - } - - public override RepeatedGroup DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup.DefaultInstance; } - } - - public override RepeatedGroup BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is RepeatedGroup) { - return MergeFrom((RepeatedGroup) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(RepeatedGroup other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA) { - A = other.A; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_repeatedGroupFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _repeatedGroupFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 376: { - result.hasA = input.ReadInt32(ref result.a_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasA { - get { return result.hasA; } - } - public int A { - get { return result.A; } - set { SetA(value); } - } - public Builder SetA(int value) { - PrepareBuilder(); - result.hasA = true; - result.a_ = value; - return this; - } - public Builder ClearA() { - PrepareBuilder(); - result.hasA = false; - result.a_ = 0; - return this; - } - } - static RepeatedGroup() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - } - #endregion - - public const int OptionalInt32FieldNumber = 1; - private bool hasOptionalInt32; - private int optionalInt32_; - public bool HasOptionalInt32 { - get { return hasOptionalInt32; } - } - public int OptionalInt32 { - get { return optionalInt32_; } - } - - public const int OptionalInt64FieldNumber = 2; - private bool hasOptionalInt64; - private long optionalInt64_; - public bool HasOptionalInt64 { - get { return hasOptionalInt64; } - } - public long OptionalInt64 { - get { return optionalInt64_; } - } - - public const int OptionalUint32FieldNumber = 3; - private bool hasOptionalUint32; - private uint optionalUint32_; - public bool HasOptionalUint32 { - get { return hasOptionalUint32; } - } - [global::System.CLSCompliant(false)] - public uint OptionalUint32 { - get { return optionalUint32_; } - } - - public const int OptionalUint64FieldNumber = 4; - private bool hasOptionalUint64; - private ulong optionalUint64_; - public bool HasOptionalUint64 { - get { return hasOptionalUint64; } - } - [global::System.CLSCompliant(false)] - public ulong OptionalUint64 { - get { return optionalUint64_; } - } - - public const int OptionalSint32FieldNumber = 5; - private bool hasOptionalSint32; - private int optionalSint32_; - public bool HasOptionalSint32 { - get { return hasOptionalSint32; } - } - public int OptionalSint32 { - get { return optionalSint32_; } - } - - public const int OptionalSint64FieldNumber = 6; - private bool hasOptionalSint64; - private long optionalSint64_; - public bool HasOptionalSint64 { - get { return hasOptionalSint64; } - } - public long OptionalSint64 { - get { return optionalSint64_; } - } - - public const int OptionalFixed32FieldNumber = 7; - private bool hasOptionalFixed32; - private uint optionalFixed32_; - public bool HasOptionalFixed32 { - get { return hasOptionalFixed32; } - } - [global::System.CLSCompliant(false)] - public uint OptionalFixed32 { - get { return optionalFixed32_; } - } - - public const int OptionalFixed64FieldNumber = 8; - private bool hasOptionalFixed64; - private ulong optionalFixed64_; - public bool HasOptionalFixed64 { - get { return hasOptionalFixed64; } - } - [global::System.CLSCompliant(false)] - public ulong OptionalFixed64 { - get { return optionalFixed64_; } - } - - public const int OptionalSfixed32FieldNumber = 9; - private bool hasOptionalSfixed32; - private int optionalSfixed32_; - public bool HasOptionalSfixed32 { - get { return hasOptionalSfixed32; } - } - public int OptionalSfixed32 { - get { return optionalSfixed32_; } - } - - public const int OptionalSfixed64FieldNumber = 10; - private bool hasOptionalSfixed64; - private long optionalSfixed64_; - public bool HasOptionalSfixed64 { - get { return hasOptionalSfixed64; } - } - public long OptionalSfixed64 { - get { return optionalSfixed64_; } - } - - public const int OptionalFloatFieldNumber = 11; - private bool hasOptionalFloat; - private float optionalFloat_; - public bool HasOptionalFloat { - get { return hasOptionalFloat; } - } - public float OptionalFloat { - get { return optionalFloat_; } - } - - public const int OptionalDoubleFieldNumber = 12; - private bool hasOptionalDouble; - private double optionalDouble_; - public bool HasOptionalDouble { - get { return hasOptionalDouble; } - } - public double OptionalDouble { - get { return optionalDouble_; } - } - - public const int OptionalBoolFieldNumber = 13; - private bool hasOptionalBool; - private bool optionalBool_; - public bool HasOptionalBool { - get { return hasOptionalBool; } - } - public bool OptionalBool { - get { return optionalBool_; } - } - - public const int OptionalStringFieldNumber = 14; - private bool hasOptionalString; - private string optionalString_ = ""; - public bool HasOptionalString { - get { return hasOptionalString; } - } - public string OptionalString { - get { return optionalString_; } - } - - public const int OptionalBytesFieldNumber = 15; - private bool hasOptionalBytes; - private pb::ByteString optionalBytes_ = pb::ByteString.Empty; - public bool HasOptionalBytes { - get { return hasOptionalBytes; } - } - public pb::ByteString OptionalBytes { - get { return optionalBytes_; } - } - - public const int OptionalGroupFieldNumber = 16; - private bool hasOptionalGroup; - private global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup optionalGroup_; - public bool HasOptionalGroup { - get { return hasOptionalGroup; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup OptionalGroup { - get { return optionalGroup_ ?? global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.DefaultInstance; } - } - - public const int OptionalNestedMessageFieldNumber = 18; - private bool hasOptionalNestedMessage; - private global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage optionalNestedMessage_; - public bool HasOptionalNestedMessage { - get { return hasOptionalNestedMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage OptionalNestedMessage { - get { return optionalNestedMessage_ ?? global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.DefaultInstance; } - } - - public const int OptionalForeignMessageFieldNumber = 19; - private bool hasOptionalForeignMessage; - private global::Google.ProtocolBuffers.TestProtos.ForeignMessage optionalForeignMessage_; - public bool HasOptionalForeignMessage { - get { return hasOptionalForeignMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage OptionalForeignMessage { - get { return optionalForeignMessage_ ?? global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance; } - } - - public const int OptionalImportMessageFieldNumber = 20; - private bool hasOptionalImportMessage; - private global::Google.ProtocolBuffers.TestProtos.ImportMessage optionalImportMessage_; - public bool HasOptionalImportMessage { - get { return hasOptionalImportMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportMessage OptionalImportMessage { - get { return optionalImportMessage_ ?? global::Google.ProtocolBuffers.TestProtos.ImportMessage.DefaultInstance; } - } - - public const int OptionalNestedEnumFieldNumber = 21; - private bool hasOptionalNestedEnum; - private global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum optionalNestedEnum_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum.FOO; - public bool HasOptionalNestedEnum { - get { return hasOptionalNestedEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum OptionalNestedEnum { - get { return optionalNestedEnum_; } - } - - public const int OptionalForeignEnumFieldNumber = 22; - private bool hasOptionalForeignEnum; - private global::Google.ProtocolBuffers.TestProtos.ForeignEnum optionalForeignEnum_ = global::Google.ProtocolBuffers.TestProtos.ForeignEnum.FOREIGN_FOO; - public bool HasOptionalForeignEnum { - get { return hasOptionalForeignEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum OptionalForeignEnum { - get { return optionalForeignEnum_; } - } - - public const int OptionalImportEnumFieldNumber = 23; - private bool hasOptionalImportEnum; - private global::Google.ProtocolBuffers.TestProtos.ImportEnum optionalImportEnum_ = global::Google.ProtocolBuffers.TestProtos.ImportEnum.IMPORT_FOO; - public bool HasOptionalImportEnum { - get { return hasOptionalImportEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportEnum OptionalImportEnum { - get { return optionalImportEnum_; } - } - - public const int OptionalStringPieceFieldNumber = 24; - private bool hasOptionalStringPiece; - private string optionalStringPiece_ = ""; - public bool HasOptionalStringPiece { - get { return hasOptionalStringPiece; } - } - public string OptionalStringPiece { - get { return optionalStringPiece_; } - } - - public const int OptionalCordFieldNumber = 25; - private bool hasOptionalCord; - private string optionalCord_ = ""; - public bool HasOptionalCord { - get { return hasOptionalCord; } - } - public string OptionalCord { - get { return optionalCord_; } - } - - public const int RepeatedInt32FieldNumber = 31; - private pbc::PopsicleList repeatedInt32_ = new pbc::PopsicleList(); - public scg::IList RepeatedInt32List { - get { return pbc::Lists.AsReadOnly(repeatedInt32_); } - } - public int RepeatedInt32Count { - get { return repeatedInt32_.Count; } - } - public int GetRepeatedInt32(int index) { - return repeatedInt32_[index]; - } - - public const int RepeatedInt64FieldNumber = 32; - private pbc::PopsicleList repeatedInt64_ = new pbc::PopsicleList(); - public scg::IList RepeatedInt64List { - get { return pbc::Lists.AsReadOnly(repeatedInt64_); } - } - public int RepeatedInt64Count { - get { return repeatedInt64_.Count; } - } - public long GetRepeatedInt64(int index) { - return repeatedInt64_[index]; - } - - public const int RepeatedUint32FieldNumber = 33; - private pbc::PopsicleList repeatedUint32_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList RepeatedUint32List { - get { return pbc::Lists.AsReadOnly(repeatedUint32_); } - } - public int RepeatedUint32Count { - get { return repeatedUint32_.Count; } - } - [global::System.CLSCompliant(false)] - public uint GetRepeatedUint32(int index) { - return repeatedUint32_[index]; - } - - public const int RepeatedUint64FieldNumber = 34; - private pbc::PopsicleList repeatedUint64_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList RepeatedUint64List { - get { return pbc::Lists.AsReadOnly(repeatedUint64_); } - } - public int RepeatedUint64Count { - get { return repeatedUint64_.Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetRepeatedUint64(int index) { - return repeatedUint64_[index]; - } - - public const int RepeatedSint32FieldNumber = 35; - private pbc::PopsicleList repeatedSint32_ = new pbc::PopsicleList(); - public scg::IList RepeatedSint32List { - get { return pbc::Lists.AsReadOnly(repeatedSint32_); } - } - public int RepeatedSint32Count { - get { return repeatedSint32_.Count; } - } - public int GetRepeatedSint32(int index) { - return repeatedSint32_[index]; - } - - public const int RepeatedSint64FieldNumber = 36; - private pbc::PopsicleList repeatedSint64_ = new pbc::PopsicleList(); - public scg::IList RepeatedSint64List { - get { return pbc::Lists.AsReadOnly(repeatedSint64_); } - } - public int RepeatedSint64Count { - get { return repeatedSint64_.Count; } - } - public long GetRepeatedSint64(int index) { - return repeatedSint64_[index]; - } - - public const int RepeatedFixed32FieldNumber = 37; - private pbc::PopsicleList repeatedFixed32_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList RepeatedFixed32List { - get { return pbc::Lists.AsReadOnly(repeatedFixed32_); } - } - public int RepeatedFixed32Count { - get { return repeatedFixed32_.Count; } - } - [global::System.CLSCompliant(false)] - public uint GetRepeatedFixed32(int index) { - return repeatedFixed32_[index]; - } - - public const int RepeatedFixed64FieldNumber = 38; - private pbc::PopsicleList repeatedFixed64_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList RepeatedFixed64List { - get { return pbc::Lists.AsReadOnly(repeatedFixed64_); } - } - public int RepeatedFixed64Count { - get { return repeatedFixed64_.Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetRepeatedFixed64(int index) { - return repeatedFixed64_[index]; - } - - public const int RepeatedSfixed32FieldNumber = 39; - private pbc::PopsicleList repeatedSfixed32_ = new pbc::PopsicleList(); - public scg::IList RepeatedSfixed32List { - get { return pbc::Lists.AsReadOnly(repeatedSfixed32_); } - } - public int RepeatedSfixed32Count { - get { return repeatedSfixed32_.Count; } - } - public int GetRepeatedSfixed32(int index) { - return repeatedSfixed32_[index]; - } - - public const int RepeatedSfixed64FieldNumber = 40; - private pbc::PopsicleList repeatedSfixed64_ = new pbc::PopsicleList(); - public scg::IList RepeatedSfixed64List { - get { return pbc::Lists.AsReadOnly(repeatedSfixed64_); } - } - public int RepeatedSfixed64Count { - get { return repeatedSfixed64_.Count; } - } - public long GetRepeatedSfixed64(int index) { - return repeatedSfixed64_[index]; - } - - public const int RepeatedFloatFieldNumber = 41; - private pbc::PopsicleList repeatedFloat_ = new pbc::PopsicleList(); - public scg::IList RepeatedFloatList { - get { return pbc::Lists.AsReadOnly(repeatedFloat_); } - } - public int RepeatedFloatCount { - get { return repeatedFloat_.Count; } - } - public float GetRepeatedFloat(int index) { - return repeatedFloat_[index]; - } - - public const int RepeatedDoubleFieldNumber = 42; - private pbc::PopsicleList repeatedDouble_ = new pbc::PopsicleList(); - public scg::IList RepeatedDoubleList { - get { return pbc::Lists.AsReadOnly(repeatedDouble_); } - } - public int RepeatedDoubleCount { - get { return repeatedDouble_.Count; } - } - public double GetRepeatedDouble(int index) { - return repeatedDouble_[index]; - } - - public const int RepeatedBoolFieldNumber = 43; - private pbc::PopsicleList repeatedBool_ = new pbc::PopsicleList(); - public scg::IList RepeatedBoolList { - get { return pbc::Lists.AsReadOnly(repeatedBool_); } - } - public int RepeatedBoolCount { - get { return repeatedBool_.Count; } - } - public bool GetRepeatedBool(int index) { - return repeatedBool_[index]; - } - - public const int RepeatedStringFieldNumber = 44; - private pbc::PopsicleList repeatedString_ = new pbc::PopsicleList(); - public scg::IList RepeatedStringList { - get { return pbc::Lists.AsReadOnly(repeatedString_); } - } - public int RepeatedStringCount { - get { return repeatedString_.Count; } - } - public string GetRepeatedString(int index) { - return repeatedString_[index]; - } - - public const int RepeatedBytesFieldNumber = 45; - private pbc::PopsicleList repeatedBytes_ = new pbc::PopsicleList(); - public scg::IList RepeatedBytesList { - get { return pbc::Lists.AsReadOnly(repeatedBytes_); } - } - public int RepeatedBytesCount { - get { return repeatedBytes_.Count; } - } - public pb::ByteString GetRepeatedBytes(int index) { - return repeatedBytes_[index]; - } - - public const int RepeatedGroupFieldNumber = 46; - private pbc::PopsicleList repeatedGroup_ = new pbc::PopsicleList(); - public scg::IList RepeatedGroupList { - get { return repeatedGroup_; } - } - public int RepeatedGroupCount { - get { return repeatedGroup_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup GetRepeatedGroup(int index) { - return repeatedGroup_[index]; - } - - public const int RepeatedNestedMessageFieldNumber = 48; - private pbc::PopsicleList repeatedNestedMessage_ = new pbc::PopsicleList(); - public scg::IList RepeatedNestedMessageList { - get { return repeatedNestedMessage_; } - } - public int RepeatedNestedMessageCount { - get { return repeatedNestedMessage_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage GetRepeatedNestedMessage(int index) { - return repeatedNestedMessage_[index]; - } - - public const int RepeatedForeignMessageFieldNumber = 49; - private pbc::PopsicleList repeatedForeignMessage_ = new pbc::PopsicleList(); - public scg::IList RepeatedForeignMessageList { - get { return repeatedForeignMessage_; } - } - public int RepeatedForeignMessageCount { - get { return repeatedForeignMessage_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage GetRepeatedForeignMessage(int index) { - return repeatedForeignMessage_[index]; - } - - public const int RepeatedImportMessageFieldNumber = 50; - private pbc::PopsicleList repeatedImportMessage_ = new pbc::PopsicleList(); - public scg::IList RepeatedImportMessageList { - get { return repeatedImportMessage_; } - } - public int RepeatedImportMessageCount { - get { return repeatedImportMessage_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportMessage GetRepeatedImportMessage(int index) { - return repeatedImportMessage_[index]; - } - - public const int RepeatedNestedEnumFieldNumber = 51; - private pbc::PopsicleList repeatedNestedEnum_ = new pbc::PopsicleList(); - public scg::IList RepeatedNestedEnumList { - get { return pbc::Lists.AsReadOnly(repeatedNestedEnum_); } - } - public int RepeatedNestedEnumCount { - get { return repeatedNestedEnum_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum GetRepeatedNestedEnum(int index) { - return repeatedNestedEnum_[index]; - } - - public const int RepeatedForeignEnumFieldNumber = 52; - private pbc::PopsicleList repeatedForeignEnum_ = new pbc::PopsicleList(); - public scg::IList RepeatedForeignEnumList { - get { return pbc::Lists.AsReadOnly(repeatedForeignEnum_); } - } - public int RepeatedForeignEnumCount { - get { return repeatedForeignEnum_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum GetRepeatedForeignEnum(int index) { - return repeatedForeignEnum_[index]; - } - - public const int RepeatedImportEnumFieldNumber = 53; - private pbc::PopsicleList repeatedImportEnum_ = new pbc::PopsicleList(); - public scg::IList RepeatedImportEnumList { - get { return pbc::Lists.AsReadOnly(repeatedImportEnum_); } - } - public int RepeatedImportEnumCount { - get { return repeatedImportEnum_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportEnum GetRepeatedImportEnum(int index) { - return repeatedImportEnum_[index]; - } - - public const int RepeatedStringPieceFieldNumber = 54; - private pbc::PopsicleList repeatedStringPiece_ = new pbc::PopsicleList(); - public scg::IList RepeatedStringPieceList { - get { return pbc::Lists.AsReadOnly(repeatedStringPiece_); } - } - public int RepeatedStringPieceCount { - get { return repeatedStringPiece_.Count; } - } - public string GetRepeatedStringPiece(int index) { - return repeatedStringPiece_[index]; - } - - public const int RepeatedCordFieldNumber = 55; - private pbc::PopsicleList repeatedCord_ = new pbc::PopsicleList(); - public scg::IList RepeatedCordList { - get { return pbc::Lists.AsReadOnly(repeatedCord_); } - } - public int RepeatedCordCount { - get { return repeatedCord_.Count; } - } - public string GetRepeatedCord(int index) { - return repeatedCord_[index]; - } - - public const int DefaultInt32FieldNumber = 61; - private bool hasDefaultInt32; - private int defaultInt32_ = 41; - public bool HasDefaultInt32 { - get { return hasDefaultInt32; } - } - public int DefaultInt32 { - get { return defaultInt32_; } - } - - public const int DefaultInt64FieldNumber = 62; - private bool hasDefaultInt64; - private long defaultInt64_ = 42L; - public bool HasDefaultInt64 { - get { return hasDefaultInt64; } - } - public long DefaultInt64 { - get { return defaultInt64_; } - } - - public const int DefaultUint32FieldNumber = 63; - private bool hasDefaultUint32; - private uint defaultUint32_ = 43; - public bool HasDefaultUint32 { - get { return hasDefaultUint32; } - } - [global::System.CLSCompliant(false)] - public uint DefaultUint32 { - get { return defaultUint32_; } - } - - public const int DefaultUint64FieldNumber = 64; - private bool hasDefaultUint64; - private ulong defaultUint64_ = 44UL; - public bool HasDefaultUint64 { - get { return hasDefaultUint64; } - } - [global::System.CLSCompliant(false)] - public ulong DefaultUint64 { - get { return defaultUint64_; } - } - - public const int DefaultSint32FieldNumber = 65; - private bool hasDefaultSint32; - private int defaultSint32_ = -45; - public bool HasDefaultSint32 { - get { return hasDefaultSint32; } - } - public int DefaultSint32 { - get { return defaultSint32_; } - } - - public const int DefaultSint64FieldNumber = 66; - private bool hasDefaultSint64; - private long defaultSint64_ = 46; - public bool HasDefaultSint64 { - get { return hasDefaultSint64; } - } - public long DefaultSint64 { - get { return defaultSint64_; } - } - - public const int DefaultFixed32FieldNumber = 67; - private bool hasDefaultFixed32; - private uint defaultFixed32_ = 47; - public bool HasDefaultFixed32 { - get { return hasDefaultFixed32; } - } - [global::System.CLSCompliant(false)] - public uint DefaultFixed32 { - get { return defaultFixed32_; } - } - - public const int DefaultFixed64FieldNumber = 68; - private bool hasDefaultFixed64; - private ulong defaultFixed64_ = 48; - public bool HasDefaultFixed64 { - get { return hasDefaultFixed64; } - } - [global::System.CLSCompliant(false)] - public ulong DefaultFixed64 { - get { return defaultFixed64_; } - } - - public const int DefaultSfixed32FieldNumber = 69; - private bool hasDefaultSfixed32; - private int defaultSfixed32_ = 49; - public bool HasDefaultSfixed32 { - get { return hasDefaultSfixed32; } - } - public int DefaultSfixed32 { - get { return defaultSfixed32_; } - } - - public const int DefaultSfixed64FieldNumber = 70; - private bool hasDefaultSfixed64; - private long defaultSfixed64_ = -50; - public bool HasDefaultSfixed64 { - get { return hasDefaultSfixed64; } - } - public long DefaultSfixed64 { - get { return defaultSfixed64_; } - } - - public const int DefaultFloatFieldNumber = 71; - private bool hasDefaultFloat; - private float defaultFloat_ = 51.5F; - public bool HasDefaultFloat { - get { return hasDefaultFloat; } - } - public float DefaultFloat { - get { return defaultFloat_; } - } - - public const int DefaultDoubleFieldNumber = 72; - private bool hasDefaultDouble; - private double defaultDouble_ = 52000D; - public bool HasDefaultDouble { - get { return hasDefaultDouble; } - } - public double DefaultDouble { - get { return defaultDouble_; } - } - - public const int DefaultBoolFieldNumber = 73; - private bool hasDefaultBool; - private bool defaultBool_ = true; - public bool HasDefaultBool { - get { return hasDefaultBool; } - } - public bool DefaultBool { - get { return defaultBool_; } - } - - public const int DefaultStringFieldNumber = 74; - private bool hasDefaultString; - private string defaultString_ = "hello"; - public bool HasDefaultString { - get { return hasDefaultString; } - } - public string DefaultString { - get { return defaultString_; } - } - - public const int DefaultBytesFieldNumber = 75; - private bool hasDefaultBytes; - private pb::ByteString defaultBytes_ = (pb::ByteString) global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Descriptor.Fields[62].DefaultValue; - public bool HasDefaultBytes { - get { return hasDefaultBytes; } - } - public pb::ByteString DefaultBytes { - get { return defaultBytes_; } - } - - public const int DefaultNestedEnumFieldNumber = 81; - private bool hasDefaultNestedEnum; - private global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum defaultNestedEnum_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum.BAR; - public bool HasDefaultNestedEnum { - get { return hasDefaultNestedEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum DefaultNestedEnum { - get { return defaultNestedEnum_; } - } - - public const int DefaultForeignEnumFieldNumber = 82; - private bool hasDefaultForeignEnum; - private global::Google.ProtocolBuffers.TestProtos.ForeignEnum defaultForeignEnum_ = global::Google.ProtocolBuffers.TestProtos.ForeignEnum.FOREIGN_BAR; - public bool HasDefaultForeignEnum { - get { return hasDefaultForeignEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum DefaultForeignEnum { - get { return defaultForeignEnum_; } - } - - public const int DefaultImportEnumFieldNumber = 83; - private bool hasDefaultImportEnum; - private global::Google.ProtocolBuffers.TestProtos.ImportEnum defaultImportEnum_ = global::Google.ProtocolBuffers.TestProtos.ImportEnum.IMPORT_BAR; - public bool HasDefaultImportEnum { - get { return hasDefaultImportEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportEnum DefaultImportEnum { - get { return defaultImportEnum_; } - } - - public const int DefaultStringPieceFieldNumber = 84; - private bool hasDefaultStringPiece; - private string defaultStringPiece_ = "abc"; - public bool HasDefaultStringPiece { - get { return hasDefaultStringPiece; } - } - public string DefaultStringPiece { - get { return defaultStringPiece_; } - } - - public const int DefaultCordFieldNumber = 85; - private bool hasDefaultCord; - private string defaultCord_ = "123"; - public bool HasDefaultCord { - get { return hasDefaultCord; } - } - public string DefaultCord { - get { return defaultCord_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testAllTypesFieldNames; - if (hasOptionalInt32) { - output.WriteInt32(1, field_names[31], OptionalInt32); - } - if (hasOptionalInt64) { - output.WriteInt64(2, field_names[32], OptionalInt64); - } - if (hasOptionalUint32) { - output.WriteUInt32(3, field_names[41], OptionalUint32); - } - if (hasOptionalUint64) { - output.WriteUInt64(4, field_names[42], OptionalUint64); - } - if (hasOptionalSint32) { - output.WriteSInt32(5, field_names[37], OptionalSint32); - } - if (hasOptionalSint64) { - output.WriteSInt64(6, field_names[38], OptionalSint64); - } - if (hasOptionalFixed32) { - output.WriteFixed32(7, field_names[24], OptionalFixed32); - } - if (hasOptionalFixed64) { - output.WriteFixed64(8, field_names[25], OptionalFixed64); - } - if (hasOptionalSfixed32) { - output.WriteSFixed32(9, field_names[35], OptionalSfixed32); - } - if (hasOptionalSfixed64) { - output.WriteSFixed64(10, field_names[36], OptionalSfixed64); - } - if (hasOptionalFloat) { - output.WriteFloat(11, field_names[26], OptionalFloat); - } - if (hasOptionalDouble) { - output.WriteDouble(12, field_names[23], OptionalDouble); - } - if (hasOptionalBool) { - output.WriteBool(13, field_names[20], OptionalBool); - } - if (hasOptionalString) { - output.WriteString(14, field_names[39], OptionalString); - } - if (hasOptionalBytes) { - output.WriteBytes(15, field_names[21], OptionalBytes); - } - if (hasOptionalGroup) { - output.WriteGroup(16, field_names[43], OptionalGroup); - } - if (hasOptionalNestedMessage) { - output.WriteMessage(18, field_names[34], OptionalNestedMessage); - } - if (hasOptionalForeignMessage) { - output.WriteMessage(19, field_names[28], OptionalForeignMessage); - } - if (hasOptionalImportMessage) { - output.WriteMessage(20, field_names[30], OptionalImportMessage); - } - if (hasOptionalNestedEnum) { - output.WriteEnum(21, field_names[33], (int) OptionalNestedEnum, OptionalNestedEnum); - } - if (hasOptionalForeignEnum) { - output.WriteEnum(22, field_names[27], (int) OptionalForeignEnum, OptionalForeignEnum); - } - if (hasOptionalImportEnum) { - output.WriteEnum(23, field_names[29], (int) OptionalImportEnum, OptionalImportEnum); - } - if (hasOptionalStringPiece) { - output.WriteString(24, field_names[40], OptionalStringPiece); - } - if (hasOptionalCord) { - output.WriteString(25, field_names[22], OptionalCord); - } - if (repeatedInt32_.Count > 0) { - output.WriteInt32Array(31, field_names[55], repeatedInt32_); - } - if (repeatedInt64_.Count > 0) { - output.WriteInt64Array(32, field_names[56], repeatedInt64_); - } - if (repeatedUint32_.Count > 0) { - output.WriteUInt32Array(33, field_names[65], repeatedUint32_); - } - if (repeatedUint64_.Count > 0) { - output.WriteUInt64Array(34, field_names[66], repeatedUint64_); - } - if (repeatedSint32_.Count > 0) { - output.WriteSInt32Array(35, field_names[61], repeatedSint32_); - } - if (repeatedSint64_.Count > 0) { - output.WriteSInt64Array(36, field_names[62], repeatedSint64_); - } - if (repeatedFixed32_.Count > 0) { - output.WriteFixed32Array(37, field_names[48], repeatedFixed32_); - } - if (repeatedFixed64_.Count > 0) { - output.WriteFixed64Array(38, field_names[49], repeatedFixed64_); - } - if (repeatedSfixed32_.Count > 0) { - output.WriteSFixed32Array(39, field_names[59], repeatedSfixed32_); - } - if (repeatedSfixed64_.Count > 0) { - output.WriteSFixed64Array(40, field_names[60], repeatedSfixed64_); - } - if (repeatedFloat_.Count > 0) { - output.WriteFloatArray(41, field_names[50], repeatedFloat_); - } - if (repeatedDouble_.Count > 0) { - output.WriteDoubleArray(42, field_names[47], repeatedDouble_); - } - if (repeatedBool_.Count > 0) { - output.WriteBoolArray(43, field_names[44], repeatedBool_); - } - if (repeatedString_.Count > 0) { - output.WriteStringArray(44, field_names[63], repeatedString_); - } - if (repeatedBytes_.Count > 0) { - output.WriteBytesArray(45, field_names[45], repeatedBytes_); - } - if (repeatedGroup_.Count > 0) { - output.WriteGroupArray(46, field_names[67], repeatedGroup_); - } - if (repeatedNestedMessage_.Count > 0) { - output.WriteMessageArray(48, field_names[58], repeatedNestedMessage_); - } - if (repeatedForeignMessage_.Count > 0) { - output.WriteMessageArray(49, field_names[52], repeatedForeignMessage_); - } - if (repeatedImportMessage_.Count > 0) { - output.WriteMessageArray(50, field_names[54], repeatedImportMessage_); - } - if (repeatedNestedEnum_.Count > 0) { - output.WriteEnumArray(51, field_names[57], repeatedNestedEnum_); - } - if (repeatedForeignEnum_.Count > 0) { - output.WriteEnumArray(52, field_names[51], repeatedForeignEnum_); - } - if (repeatedImportEnum_.Count > 0) { - output.WriteEnumArray(53, field_names[53], repeatedImportEnum_); - } - if (repeatedStringPiece_.Count > 0) { - output.WriteStringArray(54, field_names[64], repeatedStringPiece_); - } - if (repeatedCord_.Count > 0) { - output.WriteStringArray(55, field_names[46], repeatedCord_); - } - if (hasDefaultInt32) { - output.WriteInt32(61, field_names[9], DefaultInt32); - } - if (hasDefaultInt64) { - output.WriteInt64(62, field_names[10], DefaultInt64); - } - if (hasDefaultUint32) { - output.WriteUInt32(63, field_names[18], DefaultUint32); - } - if (hasDefaultUint64) { - output.WriteUInt64(64, field_names[19], DefaultUint64); - } - if (hasDefaultSint32) { - output.WriteSInt32(65, field_names[14], DefaultSint32); - } - if (hasDefaultSint64) { - output.WriteSInt64(66, field_names[15], DefaultSint64); - } - if (hasDefaultFixed32) { - output.WriteFixed32(67, field_names[4], DefaultFixed32); - } - if (hasDefaultFixed64) { - output.WriteFixed64(68, field_names[5], DefaultFixed64); - } - if (hasDefaultSfixed32) { - output.WriteSFixed32(69, field_names[12], DefaultSfixed32); - } - if (hasDefaultSfixed64) { - output.WriteSFixed64(70, field_names[13], DefaultSfixed64); - } - if (hasDefaultFloat) { - output.WriteFloat(71, field_names[6], DefaultFloat); - } - if (hasDefaultDouble) { - output.WriteDouble(72, field_names[3], DefaultDouble); - } - if (hasDefaultBool) { - output.WriteBool(73, field_names[0], DefaultBool); - } - if (hasDefaultString) { - output.WriteString(74, field_names[16], DefaultString); - } - if (hasDefaultBytes) { - output.WriteBytes(75, field_names[1], DefaultBytes); - } - if (hasDefaultNestedEnum) { - output.WriteEnum(81, field_names[11], (int) DefaultNestedEnum, DefaultNestedEnum); - } - if (hasDefaultForeignEnum) { - output.WriteEnum(82, field_names[7], (int) DefaultForeignEnum, DefaultForeignEnum); - } - if (hasDefaultImportEnum) { - output.WriteEnum(83, field_names[8], (int) DefaultImportEnum, DefaultImportEnum); - } - if (hasDefaultStringPiece) { - output.WriteString(84, field_names[17], DefaultStringPiece); - } - if (hasDefaultCord) { - output.WriteString(85, field_names[2], DefaultCord); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasOptionalInt32) { - size += pb::CodedOutputStream.ComputeInt32Size(1, OptionalInt32); - } - if (hasOptionalInt64) { - size += pb::CodedOutputStream.ComputeInt64Size(2, OptionalInt64); - } - if (hasOptionalUint32) { - size += pb::CodedOutputStream.ComputeUInt32Size(3, OptionalUint32); - } - if (hasOptionalUint64) { - size += pb::CodedOutputStream.ComputeUInt64Size(4, OptionalUint64); - } - if (hasOptionalSint32) { - size += pb::CodedOutputStream.ComputeSInt32Size(5, OptionalSint32); - } - if (hasOptionalSint64) { - size += pb::CodedOutputStream.ComputeSInt64Size(6, OptionalSint64); - } - if (hasOptionalFixed32) { - size += pb::CodedOutputStream.ComputeFixed32Size(7, OptionalFixed32); - } - if (hasOptionalFixed64) { - size += pb::CodedOutputStream.ComputeFixed64Size(8, OptionalFixed64); - } - if (hasOptionalSfixed32) { - size += pb::CodedOutputStream.ComputeSFixed32Size(9, OptionalSfixed32); - } - if (hasOptionalSfixed64) { - size += pb::CodedOutputStream.ComputeSFixed64Size(10, OptionalSfixed64); - } - if (hasOptionalFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(11, OptionalFloat); - } - if (hasOptionalDouble) { - size += pb::CodedOutputStream.ComputeDoubleSize(12, OptionalDouble); - } - if (hasOptionalBool) { - size += pb::CodedOutputStream.ComputeBoolSize(13, OptionalBool); - } - if (hasOptionalString) { - size += pb::CodedOutputStream.ComputeStringSize(14, OptionalString); - } - if (hasOptionalBytes) { - size += pb::CodedOutputStream.ComputeBytesSize(15, OptionalBytes); - } - if (hasOptionalGroup) { - size += pb::CodedOutputStream.ComputeGroupSize(16, OptionalGroup); - } - if (hasOptionalNestedMessage) { - size += pb::CodedOutputStream.ComputeMessageSize(18, OptionalNestedMessage); - } - if (hasOptionalForeignMessage) { - size += pb::CodedOutputStream.ComputeMessageSize(19, OptionalForeignMessage); - } - if (hasOptionalImportMessage) { - size += pb::CodedOutputStream.ComputeMessageSize(20, OptionalImportMessage); - } - if (hasOptionalNestedEnum) { - size += pb::CodedOutputStream.ComputeEnumSize(21, (int) OptionalNestedEnum); - } - if (hasOptionalForeignEnum) { - size += pb::CodedOutputStream.ComputeEnumSize(22, (int) OptionalForeignEnum); - } - if (hasOptionalImportEnum) { - size += pb::CodedOutputStream.ComputeEnumSize(23, (int) OptionalImportEnum); - } - if (hasOptionalStringPiece) { - size += pb::CodedOutputStream.ComputeStringSize(24, OptionalStringPiece); - } - if (hasOptionalCord) { - size += pb::CodedOutputStream.ComputeStringSize(25, OptionalCord); - } - { - int dataSize = 0; - foreach (int element in RepeatedInt32List) { - dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedInt32_.Count; - } - { - int dataSize = 0; - foreach (long element in RepeatedInt64List) { - dataSize += pb::CodedOutputStream.ComputeInt64SizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedInt64_.Count; - } - { - int dataSize = 0; - foreach (uint element in RepeatedUint32List) { - dataSize += pb::CodedOutputStream.ComputeUInt32SizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedUint32_.Count; - } - { - int dataSize = 0; - foreach (ulong element in RepeatedUint64List) { - dataSize += pb::CodedOutputStream.ComputeUInt64SizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedUint64_.Count; - } - { - int dataSize = 0; - foreach (int element in RepeatedSint32List) { - dataSize += pb::CodedOutputStream.ComputeSInt32SizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedSint32_.Count; - } - { - int dataSize = 0; - foreach (long element in RepeatedSint64List) { - dataSize += pb::CodedOutputStream.ComputeSInt64SizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedSint64_.Count; - } - { - int dataSize = 0; - dataSize = 4 * repeatedFixed32_.Count; - size += dataSize; - size += 2 * repeatedFixed32_.Count; - } - { - int dataSize = 0; - dataSize = 8 * repeatedFixed64_.Count; - size += dataSize; - size += 2 * repeatedFixed64_.Count; - } - { - int dataSize = 0; - dataSize = 4 * repeatedSfixed32_.Count; - size += dataSize; - size += 2 * repeatedSfixed32_.Count; - } - { - int dataSize = 0; - dataSize = 8 * repeatedSfixed64_.Count; - size += dataSize; - size += 2 * repeatedSfixed64_.Count; - } - { - int dataSize = 0; - dataSize = 4 * repeatedFloat_.Count; - size += dataSize; - size += 2 * repeatedFloat_.Count; - } - { - int dataSize = 0; - dataSize = 8 * repeatedDouble_.Count; - size += dataSize; - size += 2 * repeatedDouble_.Count; - } - { - int dataSize = 0; - dataSize = 1 * repeatedBool_.Count; - size += dataSize; - size += 2 * repeatedBool_.Count; - } - { - int dataSize = 0; - foreach (string element in RepeatedStringList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedString_.Count; - } - { - int dataSize = 0; - foreach (pb::ByteString element in RepeatedBytesList) { - dataSize += pb::CodedOutputStream.ComputeBytesSizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedBytes_.Count; - } - foreach (global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup element in RepeatedGroupList) { - size += pb::CodedOutputStream.ComputeGroupSize(46, element); - } - foreach (global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage element in RepeatedNestedMessageList) { - size += pb::CodedOutputStream.ComputeMessageSize(48, element); - } - foreach (global::Google.ProtocolBuffers.TestProtos.ForeignMessage element in RepeatedForeignMessageList) { - size += pb::CodedOutputStream.ComputeMessageSize(49, element); - } - foreach (global::Google.ProtocolBuffers.TestProtos.ImportMessage element in RepeatedImportMessageList) { - size += pb::CodedOutputStream.ComputeMessageSize(50, element); - } - { - int dataSize = 0; - if (repeatedNestedEnum_.Count > 0) { - foreach (global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum element in repeatedNestedEnum_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 2 * repeatedNestedEnum_.Count; - } - } - { - int dataSize = 0; - if (repeatedForeignEnum_.Count > 0) { - foreach (global::Google.ProtocolBuffers.TestProtos.ForeignEnum element in repeatedForeignEnum_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 2 * repeatedForeignEnum_.Count; - } - } - { - int dataSize = 0; - if (repeatedImportEnum_.Count > 0) { - foreach (global::Google.ProtocolBuffers.TestProtos.ImportEnum element in repeatedImportEnum_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 2 * repeatedImportEnum_.Count; - } - } - { - int dataSize = 0; - foreach (string element in RepeatedStringPieceList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedStringPiece_.Count; - } - { - int dataSize = 0; - foreach (string element in RepeatedCordList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedCord_.Count; - } - if (hasDefaultInt32) { - size += pb::CodedOutputStream.ComputeInt32Size(61, DefaultInt32); - } - if (hasDefaultInt64) { - size += pb::CodedOutputStream.ComputeInt64Size(62, DefaultInt64); - } - if (hasDefaultUint32) { - size += pb::CodedOutputStream.ComputeUInt32Size(63, DefaultUint32); - } - if (hasDefaultUint64) { - size += pb::CodedOutputStream.ComputeUInt64Size(64, DefaultUint64); - } - if (hasDefaultSint32) { - size += pb::CodedOutputStream.ComputeSInt32Size(65, DefaultSint32); - } - if (hasDefaultSint64) { - size += pb::CodedOutputStream.ComputeSInt64Size(66, DefaultSint64); - } - if (hasDefaultFixed32) { - size += pb::CodedOutputStream.ComputeFixed32Size(67, DefaultFixed32); - } - if (hasDefaultFixed64) { - size += pb::CodedOutputStream.ComputeFixed64Size(68, DefaultFixed64); - } - if (hasDefaultSfixed32) { - size += pb::CodedOutputStream.ComputeSFixed32Size(69, DefaultSfixed32); - } - if (hasDefaultSfixed64) { - size += pb::CodedOutputStream.ComputeSFixed64Size(70, DefaultSfixed64); - } - if (hasDefaultFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(71, DefaultFloat); - } - if (hasDefaultDouble) { - size += pb::CodedOutputStream.ComputeDoubleSize(72, DefaultDouble); - } - if (hasDefaultBool) { - size += pb::CodedOutputStream.ComputeBoolSize(73, DefaultBool); - } - if (hasDefaultString) { - size += pb::CodedOutputStream.ComputeStringSize(74, DefaultString); - } - if (hasDefaultBytes) { - size += pb::CodedOutputStream.ComputeBytesSize(75, DefaultBytes); - } - if (hasDefaultNestedEnum) { - size += pb::CodedOutputStream.ComputeEnumSize(81, (int) DefaultNestedEnum); - } - if (hasDefaultForeignEnum) { - size += pb::CodedOutputStream.ComputeEnumSize(82, (int) DefaultForeignEnum); - } - if (hasDefaultImportEnum) { - size += pb::CodedOutputStream.ComputeEnumSize(83, (int) DefaultImportEnum); - } - if (hasDefaultStringPiece) { - size += pb::CodedOutputStream.ComputeStringSize(84, DefaultStringPiece); - } - if (hasDefaultCord) { - size += pb::CodedOutputStream.ComputeStringSize(85, DefaultCord); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestAllTypes ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestAllTypes ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestAllTypes ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestAllTypes ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestAllTypes ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestAllTypes ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestAllTypes ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestAllTypes ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestAllTypes ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestAllTypes ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestAllTypes MakeReadOnly() { - repeatedInt32_.MakeReadOnly(); - repeatedInt64_.MakeReadOnly(); - repeatedUint32_.MakeReadOnly(); - repeatedUint64_.MakeReadOnly(); - repeatedSint32_.MakeReadOnly(); - repeatedSint64_.MakeReadOnly(); - repeatedFixed32_.MakeReadOnly(); - repeatedFixed64_.MakeReadOnly(); - repeatedSfixed32_.MakeReadOnly(); - repeatedSfixed64_.MakeReadOnly(); - repeatedFloat_.MakeReadOnly(); - repeatedDouble_.MakeReadOnly(); - repeatedBool_.MakeReadOnly(); - repeatedString_.MakeReadOnly(); - repeatedBytes_.MakeReadOnly(); - repeatedGroup_.MakeReadOnly(); - repeatedNestedMessage_.MakeReadOnly(); - repeatedForeignMessage_.MakeReadOnly(); - repeatedImportMessage_.MakeReadOnly(); - repeatedNestedEnum_.MakeReadOnly(); - repeatedForeignEnum_.MakeReadOnly(); - repeatedImportEnum_.MakeReadOnly(); - repeatedStringPiece_.MakeReadOnly(); - repeatedCord_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestAllTypes prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestAllTypes cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestAllTypes result; - - private TestAllTypes PrepareBuilder() { - if (resultIsReadOnly) { - TestAllTypes original = result; - result = new TestAllTypes(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestAllTypes MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Descriptor; } - } - - public override TestAllTypes DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypes.DefaultInstance; } - } - - public override TestAllTypes BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestAllTypes) { - return MergeFrom((TestAllTypes) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestAllTypes other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestAllTypes.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasOptionalInt32) { - OptionalInt32 = other.OptionalInt32; - } - if (other.HasOptionalInt64) { - OptionalInt64 = other.OptionalInt64; - } - if (other.HasOptionalUint32) { - OptionalUint32 = other.OptionalUint32; - } - if (other.HasOptionalUint64) { - OptionalUint64 = other.OptionalUint64; - } - if (other.HasOptionalSint32) { - OptionalSint32 = other.OptionalSint32; - } - if (other.HasOptionalSint64) { - OptionalSint64 = other.OptionalSint64; - } - if (other.HasOptionalFixed32) { - OptionalFixed32 = other.OptionalFixed32; - } - if (other.HasOptionalFixed64) { - OptionalFixed64 = other.OptionalFixed64; - } - if (other.HasOptionalSfixed32) { - OptionalSfixed32 = other.OptionalSfixed32; - } - if (other.HasOptionalSfixed64) { - OptionalSfixed64 = other.OptionalSfixed64; - } - if (other.HasOptionalFloat) { - OptionalFloat = other.OptionalFloat; - } - if (other.HasOptionalDouble) { - OptionalDouble = other.OptionalDouble; - } - if (other.HasOptionalBool) { - OptionalBool = other.OptionalBool; - } - if (other.HasOptionalString) { - OptionalString = other.OptionalString; - } - if (other.HasOptionalBytes) { - OptionalBytes = other.OptionalBytes; - } - if (other.HasOptionalGroup) { - MergeOptionalGroup(other.OptionalGroup); - } - if (other.HasOptionalNestedMessage) { - MergeOptionalNestedMessage(other.OptionalNestedMessage); - } - if (other.HasOptionalForeignMessage) { - MergeOptionalForeignMessage(other.OptionalForeignMessage); - } - if (other.HasOptionalImportMessage) { - MergeOptionalImportMessage(other.OptionalImportMessage); - } - if (other.HasOptionalNestedEnum) { - OptionalNestedEnum = other.OptionalNestedEnum; - } - if (other.HasOptionalForeignEnum) { - OptionalForeignEnum = other.OptionalForeignEnum; - } - if (other.HasOptionalImportEnum) { - OptionalImportEnum = other.OptionalImportEnum; - } - if (other.HasOptionalStringPiece) { - OptionalStringPiece = other.OptionalStringPiece; - } - if (other.HasOptionalCord) { - OptionalCord = other.OptionalCord; - } - if (other.repeatedInt32_.Count != 0) { - result.repeatedInt32_.Add(other.repeatedInt32_); - } - if (other.repeatedInt64_.Count != 0) { - result.repeatedInt64_.Add(other.repeatedInt64_); - } - if (other.repeatedUint32_.Count != 0) { - result.repeatedUint32_.Add(other.repeatedUint32_); - } - if (other.repeatedUint64_.Count != 0) { - result.repeatedUint64_.Add(other.repeatedUint64_); - } - if (other.repeatedSint32_.Count != 0) { - result.repeatedSint32_.Add(other.repeatedSint32_); - } - if (other.repeatedSint64_.Count != 0) { - result.repeatedSint64_.Add(other.repeatedSint64_); - } - if (other.repeatedFixed32_.Count != 0) { - result.repeatedFixed32_.Add(other.repeatedFixed32_); - } - if (other.repeatedFixed64_.Count != 0) { - result.repeatedFixed64_.Add(other.repeatedFixed64_); - } - if (other.repeatedSfixed32_.Count != 0) { - result.repeatedSfixed32_.Add(other.repeatedSfixed32_); - } - if (other.repeatedSfixed64_.Count != 0) { - result.repeatedSfixed64_.Add(other.repeatedSfixed64_); - } - if (other.repeatedFloat_.Count != 0) { - result.repeatedFloat_.Add(other.repeatedFloat_); - } - if (other.repeatedDouble_.Count != 0) { - result.repeatedDouble_.Add(other.repeatedDouble_); - } - if (other.repeatedBool_.Count != 0) { - result.repeatedBool_.Add(other.repeatedBool_); - } - if (other.repeatedString_.Count != 0) { - result.repeatedString_.Add(other.repeatedString_); - } - if (other.repeatedBytes_.Count != 0) { - result.repeatedBytes_.Add(other.repeatedBytes_); - } - if (other.repeatedGroup_.Count != 0) { - result.repeatedGroup_.Add(other.repeatedGroup_); - } - if (other.repeatedNestedMessage_.Count != 0) { - result.repeatedNestedMessage_.Add(other.repeatedNestedMessage_); - } - if (other.repeatedForeignMessage_.Count != 0) { - result.repeatedForeignMessage_.Add(other.repeatedForeignMessage_); - } - if (other.repeatedImportMessage_.Count != 0) { - result.repeatedImportMessage_.Add(other.repeatedImportMessage_); - } - if (other.repeatedNestedEnum_.Count != 0) { - result.repeatedNestedEnum_.Add(other.repeatedNestedEnum_); - } - if (other.repeatedForeignEnum_.Count != 0) { - result.repeatedForeignEnum_.Add(other.repeatedForeignEnum_); - } - if (other.repeatedImportEnum_.Count != 0) { - result.repeatedImportEnum_.Add(other.repeatedImportEnum_); - } - if (other.repeatedStringPiece_.Count != 0) { - result.repeatedStringPiece_.Add(other.repeatedStringPiece_); - } - if (other.repeatedCord_.Count != 0) { - result.repeatedCord_.Add(other.repeatedCord_); - } - if (other.HasDefaultInt32) { - DefaultInt32 = other.DefaultInt32; - } - if (other.HasDefaultInt64) { - DefaultInt64 = other.DefaultInt64; - } - if (other.HasDefaultUint32) { - DefaultUint32 = other.DefaultUint32; - } - if (other.HasDefaultUint64) { - DefaultUint64 = other.DefaultUint64; - } - if (other.HasDefaultSint32) { - DefaultSint32 = other.DefaultSint32; - } - if (other.HasDefaultSint64) { - DefaultSint64 = other.DefaultSint64; - } - if (other.HasDefaultFixed32) { - DefaultFixed32 = other.DefaultFixed32; - } - if (other.HasDefaultFixed64) { - DefaultFixed64 = other.DefaultFixed64; - } - if (other.HasDefaultSfixed32) { - DefaultSfixed32 = other.DefaultSfixed32; - } - if (other.HasDefaultSfixed64) { - DefaultSfixed64 = other.DefaultSfixed64; - } - if (other.HasDefaultFloat) { - DefaultFloat = other.DefaultFloat; - } - if (other.HasDefaultDouble) { - DefaultDouble = other.DefaultDouble; - } - if (other.HasDefaultBool) { - DefaultBool = other.DefaultBool; - } - if (other.HasDefaultString) { - DefaultString = other.DefaultString; - } - if (other.HasDefaultBytes) { - DefaultBytes = other.DefaultBytes; - } - if (other.HasDefaultNestedEnum) { - DefaultNestedEnum = other.DefaultNestedEnum; - } - if (other.HasDefaultForeignEnum) { - DefaultForeignEnum = other.DefaultForeignEnum; - } - if (other.HasDefaultImportEnum) { - DefaultImportEnum = other.DefaultImportEnum; - } - if (other.HasDefaultStringPiece) { - DefaultStringPiece = other.DefaultStringPiece; - } - if (other.HasDefaultCord) { - DefaultCord = other.DefaultCord; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testAllTypesFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testAllTypesFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasOptionalInt32 = input.ReadInt32(ref result.optionalInt32_); - break; - } - case 16: { - result.hasOptionalInt64 = input.ReadInt64(ref result.optionalInt64_); - break; - } - case 24: { - result.hasOptionalUint32 = input.ReadUInt32(ref result.optionalUint32_); - break; - } - case 32: { - result.hasOptionalUint64 = input.ReadUInt64(ref result.optionalUint64_); - break; - } - case 40: { - result.hasOptionalSint32 = input.ReadSInt32(ref result.optionalSint32_); - break; - } - case 48: { - result.hasOptionalSint64 = input.ReadSInt64(ref result.optionalSint64_); - break; - } - case 61: { - result.hasOptionalFixed32 = input.ReadFixed32(ref result.optionalFixed32_); - break; - } - case 65: { - result.hasOptionalFixed64 = input.ReadFixed64(ref result.optionalFixed64_); - break; - } - case 77: { - result.hasOptionalSfixed32 = input.ReadSFixed32(ref result.optionalSfixed32_); - break; - } - case 81: { - result.hasOptionalSfixed64 = input.ReadSFixed64(ref result.optionalSfixed64_); - break; - } - case 93: { - result.hasOptionalFloat = input.ReadFloat(ref result.optionalFloat_); - break; - } - case 97: { - result.hasOptionalDouble = input.ReadDouble(ref result.optionalDouble_); - break; - } - case 104: { - result.hasOptionalBool = input.ReadBool(ref result.optionalBool_); - break; - } - case 114: { - result.hasOptionalString = input.ReadString(ref result.optionalString_); - break; - } - case 122: { - result.hasOptionalBytes = input.ReadBytes(ref result.optionalBytes_); - break; - } - case 131: { - global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.CreateBuilder(); - if (result.hasOptionalGroup) { - subBuilder.MergeFrom(OptionalGroup); - } - input.ReadGroup(16, subBuilder, extensionRegistry); - OptionalGroup = subBuilder.BuildPartial(); - break; - } - case 146: { - global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.CreateBuilder(); - if (result.hasOptionalNestedMessage) { - subBuilder.MergeFrom(OptionalNestedMessage); - } - input.ReadMessage(subBuilder, extensionRegistry); - OptionalNestedMessage = subBuilder.BuildPartial(); - break; - } - case 154: { - global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.ForeignMessage.CreateBuilder(); - if (result.hasOptionalForeignMessage) { - subBuilder.MergeFrom(OptionalForeignMessage); - } - input.ReadMessage(subBuilder, extensionRegistry); - OptionalForeignMessage = subBuilder.BuildPartial(); - break; - } - case 162: { - global::Google.ProtocolBuffers.TestProtos.ImportMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.ImportMessage.CreateBuilder(); - if (result.hasOptionalImportMessage) { - subBuilder.MergeFrom(OptionalImportMessage); - } - input.ReadMessage(subBuilder, extensionRegistry); - OptionalImportMessage = subBuilder.BuildPartial(); - break; - } - case 168: { - object unknown; - if(input.ReadEnum(ref result.optionalNestedEnum_, out unknown)) { - result.hasOptionalNestedEnum = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(21, (ulong)(int)unknown); - } - break; - } - case 176: { - object unknown; - if(input.ReadEnum(ref result.optionalForeignEnum_, out unknown)) { - result.hasOptionalForeignEnum = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(22, (ulong)(int)unknown); - } - break; - } - case 184: { - object unknown; - if(input.ReadEnum(ref result.optionalImportEnum_, out unknown)) { - result.hasOptionalImportEnum = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(23, (ulong)(int)unknown); - } - break; - } - case 194: { - result.hasOptionalStringPiece = input.ReadString(ref result.optionalStringPiece_); - break; - } - case 202: { - result.hasOptionalCord = input.ReadString(ref result.optionalCord_); - break; - } - case 250: - case 248: { - input.ReadInt32Array(tag, field_name, result.repeatedInt32_); - break; - } - case 258: - case 256: { - input.ReadInt64Array(tag, field_name, result.repeatedInt64_); - break; - } - case 266: - case 264: { - input.ReadUInt32Array(tag, field_name, result.repeatedUint32_); - break; - } - case 274: - case 272: { - input.ReadUInt64Array(tag, field_name, result.repeatedUint64_); - break; - } - case 282: - case 280: { - input.ReadSInt32Array(tag, field_name, result.repeatedSint32_); - break; - } - case 290: - case 288: { - input.ReadSInt64Array(tag, field_name, result.repeatedSint64_); - break; - } - case 298: - case 301: { - input.ReadFixed32Array(tag, field_name, result.repeatedFixed32_); - break; - } - case 306: - case 305: { - input.ReadFixed64Array(tag, field_name, result.repeatedFixed64_); - break; - } - case 314: - case 317: { - input.ReadSFixed32Array(tag, field_name, result.repeatedSfixed32_); - break; - } - case 322: - case 321: { - input.ReadSFixed64Array(tag, field_name, result.repeatedSfixed64_); - break; - } - case 330: - case 333: { - input.ReadFloatArray(tag, field_name, result.repeatedFloat_); - break; - } - case 338: - case 337: { - input.ReadDoubleArray(tag, field_name, result.repeatedDouble_); - break; - } - case 346: - case 344: { - input.ReadBoolArray(tag, field_name, result.repeatedBool_); - break; - } - case 354: { - input.ReadStringArray(tag, field_name, result.repeatedString_); - break; - } - case 362: { - input.ReadBytesArray(tag, field_name, result.repeatedBytes_); - break; - } - case 371: { - input.ReadGroupArray(tag, field_name, result.repeatedGroup_, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup.DefaultInstance, extensionRegistry); - break; - } - case 386: { - input.ReadMessageArray(tag, field_name, result.repeatedNestedMessage_, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.DefaultInstance, extensionRegistry); - break; - } - case 394: { - input.ReadMessageArray(tag, field_name, result.repeatedForeignMessage_, global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance, extensionRegistry); - break; - } - case 402: { - input.ReadMessageArray(tag, field_name, result.repeatedImportMessage_, global::Google.ProtocolBuffers.TestProtos.ImportMessage.DefaultInstance, extensionRegistry); - break; - } - case 410: - case 408: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.repeatedNestedEnum_, out unknownItems); - if (unknownItems != null) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - foreach (object rawValue in unknownItems) - if (rawValue is int) - unknownFields.MergeVarintField(51, (ulong)(int)rawValue); - } - break; - } - case 418: - case 416: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.repeatedForeignEnum_, out unknownItems); - if (unknownItems != null) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - foreach (object rawValue in unknownItems) - if (rawValue is int) - unknownFields.MergeVarintField(52, (ulong)(int)rawValue); - } - break; - } - case 426: - case 424: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.repeatedImportEnum_, out unknownItems); - if (unknownItems != null) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - foreach (object rawValue in unknownItems) - if (rawValue is int) - unknownFields.MergeVarintField(53, (ulong)(int)rawValue); - } - break; - } - case 434: { - input.ReadStringArray(tag, field_name, result.repeatedStringPiece_); - break; - } - case 442: { - input.ReadStringArray(tag, field_name, result.repeatedCord_); - break; - } - case 488: { - result.hasDefaultInt32 = input.ReadInt32(ref result.defaultInt32_); - break; - } - case 496: { - result.hasDefaultInt64 = input.ReadInt64(ref result.defaultInt64_); - break; - } - case 504: { - result.hasDefaultUint32 = input.ReadUInt32(ref result.defaultUint32_); - break; - } - case 512: { - result.hasDefaultUint64 = input.ReadUInt64(ref result.defaultUint64_); - break; - } - case 520: { - result.hasDefaultSint32 = input.ReadSInt32(ref result.defaultSint32_); - break; - } - case 528: { - result.hasDefaultSint64 = input.ReadSInt64(ref result.defaultSint64_); - break; - } - case 541: { - result.hasDefaultFixed32 = input.ReadFixed32(ref result.defaultFixed32_); - break; - } - case 545: { - result.hasDefaultFixed64 = input.ReadFixed64(ref result.defaultFixed64_); - break; - } - case 557: { - result.hasDefaultSfixed32 = input.ReadSFixed32(ref result.defaultSfixed32_); - break; - } - case 561: { - result.hasDefaultSfixed64 = input.ReadSFixed64(ref result.defaultSfixed64_); - break; - } - case 573: { - result.hasDefaultFloat = input.ReadFloat(ref result.defaultFloat_); - break; - } - case 577: { - result.hasDefaultDouble = input.ReadDouble(ref result.defaultDouble_); - break; - } - case 584: { - result.hasDefaultBool = input.ReadBool(ref result.defaultBool_); - break; - } - case 594: { - result.hasDefaultString = input.ReadString(ref result.defaultString_); - break; - } - case 602: { - result.hasDefaultBytes = input.ReadBytes(ref result.defaultBytes_); - break; - } - case 648: { - object unknown; - if(input.ReadEnum(ref result.defaultNestedEnum_, out unknown)) { - result.hasDefaultNestedEnum = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(81, (ulong)(int)unknown); - } - break; - } - case 656: { - object unknown; - if(input.ReadEnum(ref result.defaultForeignEnum_, out unknown)) { - result.hasDefaultForeignEnum = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(82, (ulong)(int)unknown); - } - break; - } - case 664: { - object unknown; - if(input.ReadEnum(ref result.defaultImportEnum_, out unknown)) { - result.hasDefaultImportEnum = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(83, (ulong)(int)unknown); - } - break; - } - case 674: { - result.hasDefaultStringPiece = input.ReadString(ref result.defaultStringPiece_); - break; - } - case 682: { - result.hasDefaultCord = input.ReadString(ref result.defaultCord_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasOptionalInt32 { - get { return result.hasOptionalInt32; } - } - public int OptionalInt32 { - get { return result.OptionalInt32; } - set { SetOptionalInt32(value); } - } - public Builder SetOptionalInt32(int value) { - PrepareBuilder(); - result.hasOptionalInt32 = true; - result.optionalInt32_ = value; - return this; - } - public Builder ClearOptionalInt32() { - PrepareBuilder(); - result.hasOptionalInt32 = false; - result.optionalInt32_ = 0; - return this; - } - - public bool HasOptionalInt64 { - get { return result.hasOptionalInt64; } - } - public long OptionalInt64 { - get { return result.OptionalInt64; } - set { SetOptionalInt64(value); } - } - public Builder SetOptionalInt64(long value) { - PrepareBuilder(); - result.hasOptionalInt64 = true; - result.optionalInt64_ = value; - return this; - } - public Builder ClearOptionalInt64() { - PrepareBuilder(); - result.hasOptionalInt64 = false; - result.optionalInt64_ = 0L; - return this; - } - - public bool HasOptionalUint32 { - get { return result.hasOptionalUint32; } - } - [global::System.CLSCompliant(false)] - public uint OptionalUint32 { - get { return result.OptionalUint32; } - set { SetOptionalUint32(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetOptionalUint32(uint value) { - PrepareBuilder(); - result.hasOptionalUint32 = true; - result.optionalUint32_ = value; - return this; - } - public Builder ClearOptionalUint32() { - PrepareBuilder(); - result.hasOptionalUint32 = false; - result.optionalUint32_ = 0; - return this; - } - - public bool HasOptionalUint64 { - get { return result.hasOptionalUint64; } - } - [global::System.CLSCompliant(false)] - public ulong OptionalUint64 { - get { return result.OptionalUint64; } - set { SetOptionalUint64(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetOptionalUint64(ulong value) { - PrepareBuilder(); - result.hasOptionalUint64 = true; - result.optionalUint64_ = value; - return this; - } - public Builder ClearOptionalUint64() { - PrepareBuilder(); - result.hasOptionalUint64 = false; - result.optionalUint64_ = 0UL; - return this; - } - - public bool HasOptionalSint32 { - get { return result.hasOptionalSint32; } - } - public int OptionalSint32 { - get { return result.OptionalSint32; } - set { SetOptionalSint32(value); } - } - public Builder SetOptionalSint32(int value) { - PrepareBuilder(); - result.hasOptionalSint32 = true; - result.optionalSint32_ = value; - return this; - } - public Builder ClearOptionalSint32() { - PrepareBuilder(); - result.hasOptionalSint32 = false; - result.optionalSint32_ = 0; - return this; - } - - public bool HasOptionalSint64 { - get { return result.hasOptionalSint64; } - } - public long OptionalSint64 { - get { return result.OptionalSint64; } - set { SetOptionalSint64(value); } - } - public Builder SetOptionalSint64(long value) { - PrepareBuilder(); - result.hasOptionalSint64 = true; - result.optionalSint64_ = value; - return this; - } - public Builder ClearOptionalSint64() { - PrepareBuilder(); - result.hasOptionalSint64 = false; - result.optionalSint64_ = 0; - return this; - } - - public bool HasOptionalFixed32 { - get { return result.hasOptionalFixed32; } - } - [global::System.CLSCompliant(false)] - public uint OptionalFixed32 { - get { return result.OptionalFixed32; } - set { SetOptionalFixed32(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetOptionalFixed32(uint value) { - PrepareBuilder(); - result.hasOptionalFixed32 = true; - result.optionalFixed32_ = value; - return this; - } - public Builder ClearOptionalFixed32() { - PrepareBuilder(); - result.hasOptionalFixed32 = false; - result.optionalFixed32_ = 0; - return this; - } - - public bool HasOptionalFixed64 { - get { return result.hasOptionalFixed64; } - } - [global::System.CLSCompliant(false)] - public ulong OptionalFixed64 { - get { return result.OptionalFixed64; } - set { SetOptionalFixed64(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetOptionalFixed64(ulong value) { - PrepareBuilder(); - result.hasOptionalFixed64 = true; - result.optionalFixed64_ = value; - return this; - } - public Builder ClearOptionalFixed64() { - PrepareBuilder(); - result.hasOptionalFixed64 = false; - result.optionalFixed64_ = 0; - return this; - } - - public bool HasOptionalSfixed32 { - get { return result.hasOptionalSfixed32; } - } - public int OptionalSfixed32 { - get { return result.OptionalSfixed32; } - set { SetOptionalSfixed32(value); } - } - public Builder SetOptionalSfixed32(int value) { - PrepareBuilder(); - result.hasOptionalSfixed32 = true; - result.optionalSfixed32_ = value; - return this; - } - public Builder ClearOptionalSfixed32() { - PrepareBuilder(); - result.hasOptionalSfixed32 = false; - result.optionalSfixed32_ = 0; - return this; - } - - public bool HasOptionalSfixed64 { - get { return result.hasOptionalSfixed64; } - } - public long OptionalSfixed64 { - get { return result.OptionalSfixed64; } - set { SetOptionalSfixed64(value); } - } - public Builder SetOptionalSfixed64(long value) { - PrepareBuilder(); - result.hasOptionalSfixed64 = true; - result.optionalSfixed64_ = value; - return this; - } - public Builder ClearOptionalSfixed64() { - PrepareBuilder(); - result.hasOptionalSfixed64 = false; - result.optionalSfixed64_ = 0; - return this; - } - - public bool HasOptionalFloat { - get { return result.hasOptionalFloat; } - } - public float OptionalFloat { - get { return result.OptionalFloat; } - set { SetOptionalFloat(value); } - } - public Builder SetOptionalFloat(float value) { - PrepareBuilder(); - result.hasOptionalFloat = true; - result.optionalFloat_ = value; - return this; - } - public Builder ClearOptionalFloat() { - PrepareBuilder(); - result.hasOptionalFloat = false; - result.optionalFloat_ = 0F; - return this; - } - - public bool HasOptionalDouble { - get { return result.hasOptionalDouble; } - } - public double OptionalDouble { - get { return result.OptionalDouble; } - set { SetOptionalDouble(value); } - } - public Builder SetOptionalDouble(double value) { - PrepareBuilder(); - result.hasOptionalDouble = true; - result.optionalDouble_ = value; - return this; - } - public Builder ClearOptionalDouble() { - PrepareBuilder(); - result.hasOptionalDouble = false; - result.optionalDouble_ = 0D; - return this; - } - - public bool HasOptionalBool { - get { return result.hasOptionalBool; } - } - public bool OptionalBool { - get { return result.OptionalBool; } - set { SetOptionalBool(value); } - } - public Builder SetOptionalBool(bool value) { - PrepareBuilder(); - result.hasOptionalBool = true; - result.optionalBool_ = value; - return this; - } - public Builder ClearOptionalBool() { - PrepareBuilder(); - result.hasOptionalBool = false; - result.optionalBool_ = false; - return this; - } - - public bool HasOptionalString { - get { return result.hasOptionalString; } - } - public string OptionalString { - get { return result.OptionalString; } - set { SetOptionalString(value); } - } - public Builder SetOptionalString(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalString = true; - result.optionalString_ = value; - return this; - } - public Builder ClearOptionalString() { - PrepareBuilder(); - result.hasOptionalString = false; - result.optionalString_ = ""; - return this; - } - - public bool HasOptionalBytes { - get { return result.hasOptionalBytes; } - } - public pb::ByteString OptionalBytes { - get { return result.OptionalBytes; } - set { SetOptionalBytes(value); } - } - public Builder SetOptionalBytes(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalBytes = true; - result.optionalBytes_ = value; - return this; - } - public Builder ClearOptionalBytes() { - PrepareBuilder(); - result.hasOptionalBytes = false; - result.optionalBytes_ = pb::ByteString.Empty; - return this; - } - - public bool HasOptionalGroup { - get { return result.hasOptionalGroup; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup OptionalGroup { - get { return result.OptionalGroup; } - set { SetOptionalGroup(value); } - } - public Builder SetOptionalGroup(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalGroup = true; - result.optionalGroup_ = value; - return this; - } - public Builder SetOptionalGroup(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptionalGroup = true; - result.optionalGroup_ = builderForValue.Build(); - return this; - } - public Builder MergeOptionalGroup(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptionalGroup && - result.optionalGroup_ != global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.DefaultInstance) { - result.optionalGroup_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.CreateBuilder(result.optionalGroup_).MergeFrom(value).BuildPartial(); - } else { - result.optionalGroup_ = value; - } - result.hasOptionalGroup = true; - return this; - } - public Builder ClearOptionalGroup() { - PrepareBuilder(); - result.hasOptionalGroup = false; - result.optionalGroup_ = null; - return this; - } - - public bool HasOptionalNestedMessage { - get { return result.hasOptionalNestedMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage OptionalNestedMessage { - get { return result.OptionalNestedMessage; } - set { SetOptionalNestedMessage(value); } - } - public Builder SetOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalNestedMessage = true; - result.optionalNestedMessage_ = value; - return this; - } - public Builder SetOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptionalNestedMessage = true; - result.optionalNestedMessage_ = builderForValue.Build(); - return this; - } - public Builder MergeOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptionalNestedMessage && - result.optionalNestedMessage_ != global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.DefaultInstance) { - result.optionalNestedMessage_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.CreateBuilder(result.optionalNestedMessage_).MergeFrom(value).BuildPartial(); - } else { - result.optionalNestedMessage_ = value; - } - result.hasOptionalNestedMessage = true; - return this; - } - public Builder ClearOptionalNestedMessage() { - PrepareBuilder(); - result.hasOptionalNestedMessage = false; - result.optionalNestedMessage_ = null; - return this; - } - - public bool HasOptionalForeignMessage { - get { return result.hasOptionalForeignMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage OptionalForeignMessage { - get { return result.OptionalForeignMessage; } - set { SetOptionalForeignMessage(value); } - } - public Builder SetOptionalForeignMessage(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalForeignMessage = true; - result.optionalForeignMessage_ = value; - return this; - } - public Builder SetOptionalForeignMessage(global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptionalForeignMessage = true; - result.optionalForeignMessage_ = builderForValue.Build(); - return this; - } - public Builder MergeOptionalForeignMessage(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptionalForeignMessage && - result.optionalForeignMessage_ != global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance) { - result.optionalForeignMessage_ = global::Google.ProtocolBuffers.TestProtos.ForeignMessage.CreateBuilder(result.optionalForeignMessage_).MergeFrom(value).BuildPartial(); - } else { - result.optionalForeignMessage_ = value; - } - result.hasOptionalForeignMessage = true; - return this; - } - public Builder ClearOptionalForeignMessage() { - PrepareBuilder(); - result.hasOptionalForeignMessage = false; - result.optionalForeignMessage_ = null; - return this; - } - - public bool HasOptionalImportMessage { - get { return result.hasOptionalImportMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportMessage OptionalImportMessage { - get { return result.OptionalImportMessage; } - set { SetOptionalImportMessage(value); } - } - public Builder SetOptionalImportMessage(global::Google.ProtocolBuffers.TestProtos.ImportMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalImportMessage = true; - result.optionalImportMessage_ = value; - return this; - } - public Builder SetOptionalImportMessage(global::Google.ProtocolBuffers.TestProtos.ImportMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptionalImportMessage = true; - result.optionalImportMessage_ = builderForValue.Build(); - return this; - } - public Builder MergeOptionalImportMessage(global::Google.ProtocolBuffers.TestProtos.ImportMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptionalImportMessage && - result.optionalImportMessage_ != global::Google.ProtocolBuffers.TestProtos.ImportMessage.DefaultInstance) { - result.optionalImportMessage_ = global::Google.ProtocolBuffers.TestProtos.ImportMessage.CreateBuilder(result.optionalImportMessage_).MergeFrom(value).BuildPartial(); - } else { - result.optionalImportMessage_ = value; - } - result.hasOptionalImportMessage = true; - return this; - } - public Builder ClearOptionalImportMessage() { - PrepareBuilder(); - result.hasOptionalImportMessage = false; - result.optionalImportMessage_ = null; - return this; - } - - public bool HasOptionalNestedEnum { - get { return result.hasOptionalNestedEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum OptionalNestedEnum { - get { return result.OptionalNestedEnum; } - set { SetOptionalNestedEnum(value); } - } - public Builder SetOptionalNestedEnum(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum value) { - PrepareBuilder(); - result.hasOptionalNestedEnum = true; - result.optionalNestedEnum_ = value; - return this; - } - public Builder ClearOptionalNestedEnum() { - PrepareBuilder(); - result.hasOptionalNestedEnum = false; - result.optionalNestedEnum_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum.FOO; - return this; - } - - public bool HasOptionalForeignEnum { - get { return result.hasOptionalForeignEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum OptionalForeignEnum { - get { return result.OptionalForeignEnum; } - set { SetOptionalForeignEnum(value); } - } - public Builder SetOptionalForeignEnum(global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) { - PrepareBuilder(); - result.hasOptionalForeignEnum = true; - result.optionalForeignEnum_ = value; - return this; - } - public Builder ClearOptionalForeignEnum() { - PrepareBuilder(); - result.hasOptionalForeignEnum = false; - result.optionalForeignEnum_ = global::Google.ProtocolBuffers.TestProtos.ForeignEnum.FOREIGN_FOO; - return this; - } - - public bool HasOptionalImportEnum { - get { return result.hasOptionalImportEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportEnum OptionalImportEnum { - get { return result.OptionalImportEnum; } - set { SetOptionalImportEnum(value); } - } - public Builder SetOptionalImportEnum(global::Google.ProtocolBuffers.TestProtos.ImportEnum value) { - PrepareBuilder(); - result.hasOptionalImportEnum = true; - result.optionalImportEnum_ = value; - return this; - } - public Builder ClearOptionalImportEnum() { - PrepareBuilder(); - result.hasOptionalImportEnum = false; - result.optionalImportEnum_ = global::Google.ProtocolBuffers.TestProtos.ImportEnum.IMPORT_FOO; - return this; - } - - public bool HasOptionalStringPiece { - get { return result.hasOptionalStringPiece; } - } - public string OptionalStringPiece { - get { return result.OptionalStringPiece; } - set { SetOptionalStringPiece(value); } - } - public Builder SetOptionalStringPiece(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalStringPiece = true; - result.optionalStringPiece_ = value; - return this; - } - public Builder ClearOptionalStringPiece() { - PrepareBuilder(); - result.hasOptionalStringPiece = false; - result.optionalStringPiece_ = ""; - return this; - } - - public bool HasOptionalCord { - get { return result.hasOptionalCord; } - } - public string OptionalCord { - get { return result.OptionalCord; } - set { SetOptionalCord(value); } - } - public Builder SetOptionalCord(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalCord = true; - result.optionalCord_ = value; - return this; - } - public Builder ClearOptionalCord() { - PrepareBuilder(); - result.hasOptionalCord = false; - result.optionalCord_ = ""; - return this; - } - - public pbc::IPopsicleList RepeatedInt32List { - get { return PrepareBuilder().repeatedInt32_; } - } - public int RepeatedInt32Count { - get { return result.RepeatedInt32Count; } - } - public int GetRepeatedInt32(int index) { - return result.GetRepeatedInt32(index); - } - public Builder SetRepeatedInt32(int index, int value) { - PrepareBuilder(); - result.repeatedInt32_[index] = value; - return this; - } - public Builder AddRepeatedInt32(int value) { - PrepareBuilder(); - result.repeatedInt32_.Add(value); - return this; - } - public Builder AddRangeRepeatedInt32(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedInt32_.Add(values); - return this; - } - public Builder ClearRepeatedInt32() { - PrepareBuilder(); - result.repeatedInt32_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedInt64List { - get { return PrepareBuilder().repeatedInt64_; } - } - public int RepeatedInt64Count { - get { return result.RepeatedInt64Count; } - } - public long GetRepeatedInt64(int index) { - return result.GetRepeatedInt64(index); - } - public Builder SetRepeatedInt64(int index, long value) { - PrepareBuilder(); - result.repeatedInt64_[index] = value; - return this; - } - public Builder AddRepeatedInt64(long value) { - PrepareBuilder(); - result.repeatedInt64_.Add(value); - return this; - } - public Builder AddRangeRepeatedInt64(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedInt64_.Add(values); - return this; - } - public Builder ClearRepeatedInt64() { - PrepareBuilder(); - result.repeatedInt64_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList RepeatedUint32List { - get { return PrepareBuilder().repeatedUint32_; } - } - public int RepeatedUint32Count { - get { return result.RepeatedUint32Count; } - } - [global::System.CLSCompliant(false)] - public uint GetRepeatedUint32(int index) { - return result.GetRepeatedUint32(index); - } - [global::System.CLSCompliant(false)] - public Builder SetRepeatedUint32(int index, uint value) { - PrepareBuilder(); - result.repeatedUint32_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRepeatedUint32(uint value) { - PrepareBuilder(); - result.repeatedUint32_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeRepeatedUint32(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedUint32_.Add(values); - return this; - } - public Builder ClearRepeatedUint32() { - PrepareBuilder(); - result.repeatedUint32_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList RepeatedUint64List { - get { return PrepareBuilder().repeatedUint64_; } - } - public int RepeatedUint64Count { - get { return result.RepeatedUint64Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetRepeatedUint64(int index) { - return result.GetRepeatedUint64(index); - } - [global::System.CLSCompliant(false)] - public Builder SetRepeatedUint64(int index, ulong value) { - PrepareBuilder(); - result.repeatedUint64_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRepeatedUint64(ulong value) { - PrepareBuilder(); - result.repeatedUint64_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeRepeatedUint64(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedUint64_.Add(values); - return this; - } - public Builder ClearRepeatedUint64() { - PrepareBuilder(); - result.repeatedUint64_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedSint32List { - get { return PrepareBuilder().repeatedSint32_; } - } - public int RepeatedSint32Count { - get { return result.RepeatedSint32Count; } - } - public int GetRepeatedSint32(int index) { - return result.GetRepeatedSint32(index); - } - public Builder SetRepeatedSint32(int index, int value) { - PrepareBuilder(); - result.repeatedSint32_[index] = value; - return this; - } - public Builder AddRepeatedSint32(int value) { - PrepareBuilder(); - result.repeatedSint32_.Add(value); - return this; - } - public Builder AddRangeRepeatedSint32(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedSint32_.Add(values); - return this; - } - public Builder ClearRepeatedSint32() { - PrepareBuilder(); - result.repeatedSint32_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedSint64List { - get { return PrepareBuilder().repeatedSint64_; } - } - public int RepeatedSint64Count { - get { return result.RepeatedSint64Count; } - } - public long GetRepeatedSint64(int index) { - return result.GetRepeatedSint64(index); - } - public Builder SetRepeatedSint64(int index, long value) { - PrepareBuilder(); - result.repeatedSint64_[index] = value; - return this; - } - public Builder AddRepeatedSint64(long value) { - PrepareBuilder(); - result.repeatedSint64_.Add(value); - return this; - } - public Builder AddRangeRepeatedSint64(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedSint64_.Add(values); - return this; - } - public Builder ClearRepeatedSint64() { - PrepareBuilder(); - result.repeatedSint64_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList RepeatedFixed32List { - get { return PrepareBuilder().repeatedFixed32_; } - } - public int RepeatedFixed32Count { - get { return result.RepeatedFixed32Count; } - } - [global::System.CLSCompliant(false)] - public uint GetRepeatedFixed32(int index) { - return result.GetRepeatedFixed32(index); - } - [global::System.CLSCompliant(false)] - public Builder SetRepeatedFixed32(int index, uint value) { - PrepareBuilder(); - result.repeatedFixed32_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRepeatedFixed32(uint value) { - PrepareBuilder(); - result.repeatedFixed32_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeRepeatedFixed32(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedFixed32_.Add(values); - return this; - } - public Builder ClearRepeatedFixed32() { - PrepareBuilder(); - result.repeatedFixed32_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList RepeatedFixed64List { - get { return PrepareBuilder().repeatedFixed64_; } - } - public int RepeatedFixed64Count { - get { return result.RepeatedFixed64Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetRepeatedFixed64(int index) { - return result.GetRepeatedFixed64(index); - } - [global::System.CLSCompliant(false)] - public Builder SetRepeatedFixed64(int index, ulong value) { - PrepareBuilder(); - result.repeatedFixed64_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRepeatedFixed64(ulong value) { - PrepareBuilder(); - result.repeatedFixed64_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeRepeatedFixed64(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedFixed64_.Add(values); - return this; - } - public Builder ClearRepeatedFixed64() { - PrepareBuilder(); - result.repeatedFixed64_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedSfixed32List { - get { return PrepareBuilder().repeatedSfixed32_; } - } - public int RepeatedSfixed32Count { - get { return result.RepeatedSfixed32Count; } - } - public int GetRepeatedSfixed32(int index) { - return result.GetRepeatedSfixed32(index); - } - public Builder SetRepeatedSfixed32(int index, int value) { - PrepareBuilder(); - result.repeatedSfixed32_[index] = value; - return this; - } - public Builder AddRepeatedSfixed32(int value) { - PrepareBuilder(); - result.repeatedSfixed32_.Add(value); - return this; - } - public Builder AddRangeRepeatedSfixed32(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedSfixed32_.Add(values); - return this; - } - public Builder ClearRepeatedSfixed32() { - PrepareBuilder(); - result.repeatedSfixed32_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedSfixed64List { - get { return PrepareBuilder().repeatedSfixed64_; } - } - public int RepeatedSfixed64Count { - get { return result.RepeatedSfixed64Count; } - } - public long GetRepeatedSfixed64(int index) { - return result.GetRepeatedSfixed64(index); - } - public Builder SetRepeatedSfixed64(int index, long value) { - PrepareBuilder(); - result.repeatedSfixed64_[index] = value; - return this; - } - public Builder AddRepeatedSfixed64(long value) { - PrepareBuilder(); - result.repeatedSfixed64_.Add(value); - return this; - } - public Builder AddRangeRepeatedSfixed64(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedSfixed64_.Add(values); - return this; - } - public Builder ClearRepeatedSfixed64() { - PrepareBuilder(); - result.repeatedSfixed64_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedFloatList { - get { return PrepareBuilder().repeatedFloat_; } - } - public int RepeatedFloatCount { - get { return result.RepeatedFloatCount; } - } - public float GetRepeatedFloat(int index) { - return result.GetRepeatedFloat(index); - } - public Builder SetRepeatedFloat(int index, float value) { - PrepareBuilder(); - result.repeatedFloat_[index] = value; - return this; - } - public Builder AddRepeatedFloat(float value) { - PrepareBuilder(); - result.repeatedFloat_.Add(value); - return this; - } - public Builder AddRangeRepeatedFloat(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedFloat_.Add(values); - return this; - } - public Builder ClearRepeatedFloat() { - PrepareBuilder(); - result.repeatedFloat_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedDoubleList { - get { return PrepareBuilder().repeatedDouble_; } - } - public int RepeatedDoubleCount { - get { return result.RepeatedDoubleCount; } - } - public double GetRepeatedDouble(int index) { - return result.GetRepeatedDouble(index); - } - public Builder SetRepeatedDouble(int index, double value) { - PrepareBuilder(); - result.repeatedDouble_[index] = value; - return this; - } - public Builder AddRepeatedDouble(double value) { - PrepareBuilder(); - result.repeatedDouble_.Add(value); - return this; - } - public Builder AddRangeRepeatedDouble(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedDouble_.Add(values); - return this; - } - public Builder ClearRepeatedDouble() { - PrepareBuilder(); - result.repeatedDouble_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedBoolList { - get { return PrepareBuilder().repeatedBool_; } - } - public int RepeatedBoolCount { - get { return result.RepeatedBoolCount; } - } - public bool GetRepeatedBool(int index) { - return result.GetRepeatedBool(index); - } - public Builder SetRepeatedBool(int index, bool value) { - PrepareBuilder(); - result.repeatedBool_[index] = value; - return this; - } - public Builder AddRepeatedBool(bool value) { - PrepareBuilder(); - result.repeatedBool_.Add(value); - return this; - } - public Builder AddRangeRepeatedBool(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedBool_.Add(values); - return this; - } - public Builder ClearRepeatedBool() { - PrepareBuilder(); - result.repeatedBool_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedStringList { - get { return PrepareBuilder().repeatedString_; } - } - public int RepeatedStringCount { - get { return result.RepeatedStringCount; } - } - public string GetRepeatedString(int index) { - return result.GetRepeatedString(index); - } - public Builder SetRepeatedString(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedString_[index] = value; - return this; - } - public Builder AddRepeatedString(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedString_.Add(value); - return this; - } - public Builder AddRangeRepeatedString(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedString_.Add(values); - return this; - } - public Builder ClearRepeatedString() { - PrepareBuilder(); - result.repeatedString_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedBytesList { - get { return PrepareBuilder().repeatedBytes_; } - } - public int RepeatedBytesCount { - get { return result.RepeatedBytesCount; } - } - public pb::ByteString GetRepeatedBytes(int index) { - return result.GetRepeatedBytes(index); - } - public Builder SetRepeatedBytes(int index, pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedBytes_[index] = value; - return this; - } - public Builder AddRepeatedBytes(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedBytes_.Add(value); - return this; - } - public Builder AddRangeRepeatedBytes(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedBytes_.Add(values); - return this; - } - public Builder ClearRepeatedBytes() { - PrepareBuilder(); - result.repeatedBytes_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedGroupList { - get { return PrepareBuilder().repeatedGroup_; } - } - public int RepeatedGroupCount { - get { return result.RepeatedGroupCount; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup GetRepeatedGroup(int index) { - return result.GetRepeatedGroup(index); - } - public Builder SetRepeatedGroup(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedGroup_[index] = value; - return this; - } - public Builder SetRepeatedGroup(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedGroup_[index] = builderForValue.Build(); - return this; - } - public Builder AddRepeatedGroup(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedGroup_.Add(value); - return this; - } - public Builder AddRepeatedGroup(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedGroup_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeRepeatedGroup(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedGroup_.Add(values); - return this; - } - public Builder ClearRepeatedGroup() { - PrepareBuilder(); - result.repeatedGroup_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedNestedMessageList { - get { return PrepareBuilder().repeatedNestedMessage_; } - } - public int RepeatedNestedMessageCount { - get { return result.RepeatedNestedMessageCount; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage GetRepeatedNestedMessage(int index) { - return result.GetRepeatedNestedMessage(index); - } - public Builder SetRepeatedNestedMessage(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedNestedMessage_[index] = value; - return this; - } - public Builder SetRepeatedNestedMessage(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedNestedMessage_[index] = builderForValue.Build(); - return this; - } - public Builder AddRepeatedNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedNestedMessage_.Add(value); - return this; - } - public Builder AddRepeatedNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedNestedMessage_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeRepeatedNestedMessage(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedNestedMessage_.Add(values); - return this; - } - public Builder ClearRepeatedNestedMessage() { - PrepareBuilder(); - result.repeatedNestedMessage_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedForeignMessageList { - get { return PrepareBuilder().repeatedForeignMessage_; } - } - public int RepeatedForeignMessageCount { - get { return result.RepeatedForeignMessageCount; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage GetRepeatedForeignMessage(int index) { - return result.GetRepeatedForeignMessage(index); - } - public Builder SetRepeatedForeignMessage(int index, global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedForeignMessage_[index] = value; - return this; - } - public Builder SetRepeatedForeignMessage(int index, global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedForeignMessage_[index] = builderForValue.Build(); - return this; - } - public Builder AddRepeatedForeignMessage(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedForeignMessage_.Add(value); - return this; - } - public Builder AddRepeatedForeignMessage(global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedForeignMessage_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeRepeatedForeignMessage(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedForeignMessage_.Add(values); - return this; - } - public Builder ClearRepeatedForeignMessage() { - PrepareBuilder(); - result.repeatedForeignMessage_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedImportMessageList { - get { return PrepareBuilder().repeatedImportMessage_; } - } - public int RepeatedImportMessageCount { - get { return result.RepeatedImportMessageCount; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportMessage GetRepeatedImportMessage(int index) { - return result.GetRepeatedImportMessage(index); - } - public Builder SetRepeatedImportMessage(int index, global::Google.ProtocolBuffers.TestProtos.ImportMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedImportMessage_[index] = value; - return this; - } - public Builder SetRepeatedImportMessage(int index, global::Google.ProtocolBuffers.TestProtos.ImportMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedImportMessage_[index] = builderForValue.Build(); - return this; - } - public Builder AddRepeatedImportMessage(global::Google.ProtocolBuffers.TestProtos.ImportMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedImportMessage_.Add(value); - return this; - } - public Builder AddRepeatedImportMessage(global::Google.ProtocolBuffers.TestProtos.ImportMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedImportMessage_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeRepeatedImportMessage(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedImportMessage_.Add(values); - return this; - } - public Builder ClearRepeatedImportMessage() { - PrepareBuilder(); - result.repeatedImportMessage_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedNestedEnumList { - get { return PrepareBuilder().repeatedNestedEnum_; } - } - public int RepeatedNestedEnumCount { - get { return result.RepeatedNestedEnumCount; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum GetRepeatedNestedEnum(int index) { - return result.GetRepeatedNestedEnum(index); - } - public Builder SetRepeatedNestedEnum(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum value) { - PrepareBuilder(); - result.repeatedNestedEnum_[index] = value; - return this; - } - public Builder AddRepeatedNestedEnum(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum value) { - PrepareBuilder(); - result.repeatedNestedEnum_.Add(value); - return this; - } - public Builder AddRangeRepeatedNestedEnum(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedNestedEnum_.Add(values); - return this; - } - public Builder ClearRepeatedNestedEnum() { - PrepareBuilder(); - result.repeatedNestedEnum_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedForeignEnumList { - get { return PrepareBuilder().repeatedForeignEnum_; } - } - public int RepeatedForeignEnumCount { - get { return result.RepeatedForeignEnumCount; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum GetRepeatedForeignEnum(int index) { - return result.GetRepeatedForeignEnum(index); - } - public Builder SetRepeatedForeignEnum(int index, global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) { - PrepareBuilder(); - result.repeatedForeignEnum_[index] = value; - return this; - } - public Builder AddRepeatedForeignEnum(global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) { - PrepareBuilder(); - result.repeatedForeignEnum_.Add(value); - return this; - } - public Builder AddRangeRepeatedForeignEnum(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedForeignEnum_.Add(values); - return this; - } - public Builder ClearRepeatedForeignEnum() { - PrepareBuilder(); - result.repeatedForeignEnum_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedImportEnumList { - get { return PrepareBuilder().repeatedImportEnum_; } - } - public int RepeatedImportEnumCount { - get { return result.RepeatedImportEnumCount; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportEnum GetRepeatedImportEnum(int index) { - return result.GetRepeatedImportEnum(index); - } - public Builder SetRepeatedImportEnum(int index, global::Google.ProtocolBuffers.TestProtos.ImportEnum value) { - PrepareBuilder(); - result.repeatedImportEnum_[index] = value; - return this; - } - public Builder AddRepeatedImportEnum(global::Google.ProtocolBuffers.TestProtos.ImportEnum value) { - PrepareBuilder(); - result.repeatedImportEnum_.Add(value); - return this; - } - public Builder AddRangeRepeatedImportEnum(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedImportEnum_.Add(values); - return this; - } - public Builder ClearRepeatedImportEnum() { - PrepareBuilder(); - result.repeatedImportEnum_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedStringPieceList { - get { return PrepareBuilder().repeatedStringPiece_; } - } - public int RepeatedStringPieceCount { - get { return result.RepeatedStringPieceCount; } - } - public string GetRepeatedStringPiece(int index) { - return result.GetRepeatedStringPiece(index); - } - public Builder SetRepeatedStringPiece(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedStringPiece_[index] = value; - return this; - } - public Builder AddRepeatedStringPiece(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedStringPiece_.Add(value); - return this; - } - public Builder AddRangeRepeatedStringPiece(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedStringPiece_.Add(values); - return this; - } - public Builder ClearRepeatedStringPiece() { - PrepareBuilder(); - result.repeatedStringPiece_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedCordList { - get { return PrepareBuilder().repeatedCord_; } - } - public int RepeatedCordCount { - get { return result.RepeatedCordCount; } - } - public string GetRepeatedCord(int index) { - return result.GetRepeatedCord(index); - } - public Builder SetRepeatedCord(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedCord_[index] = value; - return this; - } - public Builder AddRepeatedCord(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedCord_.Add(value); - return this; - } - public Builder AddRangeRepeatedCord(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedCord_.Add(values); - return this; - } - public Builder ClearRepeatedCord() { - PrepareBuilder(); - result.repeatedCord_.Clear(); - return this; - } - - public bool HasDefaultInt32 { - get { return result.hasDefaultInt32; } - } - public int DefaultInt32 { - get { return result.DefaultInt32; } - set { SetDefaultInt32(value); } - } - public Builder SetDefaultInt32(int value) { - PrepareBuilder(); - result.hasDefaultInt32 = true; - result.defaultInt32_ = value; - return this; - } - public Builder ClearDefaultInt32() { - PrepareBuilder(); - result.hasDefaultInt32 = false; - result.defaultInt32_ = 41; - return this; - } - - public bool HasDefaultInt64 { - get { return result.hasDefaultInt64; } - } - public long DefaultInt64 { - get { return result.DefaultInt64; } - set { SetDefaultInt64(value); } - } - public Builder SetDefaultInt64(long value) { - PrepareBuilder(); - result.hasDefaultInt64 = true; - result.defaultInt64_ = value; - return this; - } - public Builder ClearDefaultInt64() { - PrepareBuilder(); - result.hasDefaultInt64 = false; - result.defaultInt64_ = 42L; - return this; - } - - public bool HasDefaultUint32 { - get { return result.hasDefaultUint32; } - } - [global::System.CLSCompliant(false)] - public uint DefaultUint32 { - get { return result.DefaultUint32; } - set { SetDefaultUint32(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetDefaultUint32(uint value) { - PrepareBuilder(); - result.hasDefaultUint32 = true; - result.defaultUint32_ = value; - return this; - } - public Builder ClearDefaultUint32() { - PrepareBuilder(); - result.hasDefaultUint32 = false; - result.defaultUint32_ = 43; - return this; - } - - public bool HasDefaultUint64 { - get { return result.hasDefaultUint64; } - } - [global::System.CLSCompliant(false)] - public ulong DefaultUint64 { - get { return result.DefaultUint64; } - set { SetDefaultUint64(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetDefaultUint64(ulong value) { - PrepareBuilder(); - result.hasDefaultUint64 = true; - result.defaultUint64_ = value; - return this; - } - public Builder ClearDefaultUint64() { - PrepareBuilder(); - result.hasDefaultUint64 = false; - result.defaultUint64_ = 44UL; - return this; - } - - public bool HasDefaultSint32 { - get { return result.hasDefaultSint32; } - } - public int DefaultSint32 { - get { return result.DefaultSint32; } - set { SetDefaultSint32(value); } - } - public Builder SetDefaultSint32(int value) { - PrepareBuilder(); - result.hasDefaultSint32 = true; - result.defaultSint32_ = value; - return this; - } - public Builder ClearDefaultSint32() { - PrepareBuilder(); - result.hasDefaultSint32 = false; - result.defaultSint32_ = -45; - return this; - } - - public bool HasDefaultSint64 { - get { return result.hasDefaultSint64; } - } - public long DefaultSint64 { - get { return result.DefaultSint64; } - set { SetDefaultSint64(value); } - } - public Builder SetDefaultSint64(long value) { - PrepareBuilder(); - result.hasDefaultSint64 = true; - result.defaultSint64_ = value; - return this; - } - public Builder ClearDefaultSint64() { - PrepareBuilder(); - result.hasDefaultSint64 = false; - result.defaultSint64_ = 46; - return this; - } - - public bool HasDefaultFixed32 { - get { return result.hasDefaultFixed32; } - } - [global::System.CLSCompliant(false)] - public uint DefaultFixed32 { - get { return result.DefaultFixed32; } - set { SetDefaultFixed32(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetDefaultFixed32(uint value) { - PrepareBuilder(); - result.hasDefaultFixed32 = true; - result.defaultFixed32_ = value; - return this; - } - public Builder ClearDefaultFixed32() { - PrepareBuilder(); - result.hasDefaultFixed32 = false; - result.defaultFixed32_ = 47; - return this; - } - - public bool HasDefaultFixed64 { - get { return result.hasDefaultFixed64; } - } - [global::System.CLSCompliant(false)] - public ulong DefaultFixed64 { - get { return result.DefaultFixed64; } - set { SetDefaultFixed64(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetDefaultFixed64(ulong value) { - PrepareBuilder(); - result.hasDefaultFixed64 = true; - result.defaultFixed64_ = value; - return this; - } - public Builder ClearDefaultFixed64() { - PrepareBuilder(); - result.hasDefaultFixed64 = false; - result.defaultFixed64_ = 48; - return this; - } - - public bool HasDefaultSfixed32 { - get { return result.hasDefaultSfixed32; } - } - public int DefaultSfixed32 { - get { return result.DefaultSfixed32; } - set { SetDefaultSfixed32(value); } - } - public Builder SetDefaultSfixed32(int value) { - PrepareBuilder(); - result.hasDefaultSfixed32 = true; - result.defaultSfixed32_ = value; - return this; - } - public Builder ClearDefaultSfixed32() { - PrepareBuilder(); - result.hasDefaultSfixed32 = false; - result.defaultSfixed32_ = 49; - return this; - } - - public bool HasDefaultSfixed64 { - get { return result.hasDefaultSfixed64; } - } - public long DefaultSfixed64 { - get { return result.DefaultSfixed64; } - set { SetDefaultSfixed64(value); } - } - public Builder SetDefaultSfixed64(long value) { - PrepareBuilder(); - result.hasDefaultSfixed64 = true; - result.defaultSfixed64_ = value; - return this; - } - public Builder ClearDefaultSfixed64() { - PrepareBuilder(); - result.hasDefaultSfixed64 = false; - result.defaultSfixed64_ = -50; - return this; - } - - public bool HasDefaultFloat { - get { return result.hasDefaultFloat; } - } - public float DefaultFloat { - get { return result.DefaultFloat; } - set { SetDefaultFloat(value); } - } - public Builder SetDefaultFloat(float value) { - PrepareBuilder(); - result.hasDefaultFloat = true; - result.defaultFloat_ = value; - return this; - } - public Builder ClearDefaultFloat() { - PrepareBuilder(); - result.hasDefaultFloat = false; - result.defaultFloat_ = 51.5F; - return this; - } - - public bool HasDefaultDouble { - get { return result.hasDefaultDouble; } - } - public double DefaultDouble { - get { return result.DefaultDouble; } - set { SetDefaultDouble(value); } - } - public Builder SetDefaultDouble(double value) { - PrepareBuilder(); - result.hasDefaultDouble = true; - result.defaultDouble_ = value; - return this; - } - public Builder ClearDefaultDouble() { - PrepareBuilder(); - result.hasDefaultDouble = false; - result.defaultDouble_ = 52000D; - return this; - } - - public bool HasDefaultBool { - get { return result.hasDefaultBool; } - } - public bool DefaultBool { - get { return result.DefaultBool; } - set { SetDefaultBool(value); } - } - public Builder SetDefaultBool(bool value) { - PrepareBuilder(); - result.hasDefaultBool = true; - result.defaultBool_ = value; - return this; - } - public Builder ClearDefaultBool() { - PrepareBuilder(); - result.hasDefaultBool = false; - result.defaultBool_ = true; - return this; - } - - public bool HasDefaultString { - get { return result.hasDefaultString; } - } - public string DefaultString { - get { return result.DefaultString; } - set { SetDefaultString(value); } - } - public Builder SetDefaultString(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasDefaultString = true; - result.defaultString_ = value; - return this; - } - public Builder ClearDefaultString() { - PrepareBuilder(); - result.hasDefaultString = false; - result.defaultString_ = "hello"; - return this; - } - - public bool HasDefaultBytes { - get { return result.hasDefaultBytes; } - } - public pb::ByteString DefaultBytes { - get { return result.DefaultBytes; } - set { SetDefaultBytes(value); } - } - public Builder SetDefaultBytes(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasDefaultBytes = true; - result.defaultBytes_ = value; - return this; - } - public Builder ClearDefaultBytes() { - PrepareBuilder(); - result.hasDefaultBytes = false; - result.defaultBytes_ = (pb::ByteString) global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Descriptor.Fields[62].DefaultValue; - return this; - } - - public bool HasDefaultNestedEnum { - get { return result.hasDefaultNestedEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum DefaultNestedEnum { - get { return result.DefaultNestedEnum; } - set { SetDefaultNestedEnum(value); } - } - public Builder SetDefaultNestedEnum(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum value) { - PrepareBuilder(); - result.hasDefaultNestedEnum = true; - result.defaultNestedEnum_ = value; - return this; - } - public Builder ClearDefaultNestedEnum() { - PrepareBuilder(); - result.hasDefaultNestedEnum = false; - result.defaultNestedEnum_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum.BAR; - return this; - } - - public bool HasDefaultForeignEnum { - get { return result.hasDefaultForeignEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum DefaultForeignEnum { - get { return result.DefaultForeignEnum; } - set { SetDefaultForeignEnum(value); } - } - public Builder SetDefaultForeignEnum(global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) { - PrepareBuilder(); - result.hasDefaultForeignEnum = true; - result.defaultForeignEnum_ = value; - return this; - } - public Builder ClearDefaultForeignEnum() { - PrepareBuilder(); - result.hasDefaultForeignEnum = false; - result.defaultForeignEnum_ = global::Google.ProtocolBuffers.TestProtos.ForeignEnum.FOREIGN_BAR; - return this; - } - - public bool HasDefaultImportEnum { - get { return result.hasDefaultImportEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportEnum DefaultImportEnum { - get { return result.DefaultImportEnum; } - set { SetDefaultImportEnum(value); } - } - public Builder SetDefaultImportEnum(global::Google.ProtocolBuffers.TestProtos.ImportEnum value) { - PrepareBuilder(); - result.hasDefaultImportEnum = true; - result.defaultImportEnum_ = value; - return this; - } - public Builder ClearDefaultImportEnum() { - PrepareBuilder(); - result.hasDefaultImportEnum = false; - result.defaultImportEnum_ = global::Google.ProtocolBuffers.TestProtos.ImportEnum.IMPORT_BAR; - return this; - } - - public bool HasDefaultStringPiece { - get { return result.hasDefaultStringPiece; } - } - public string DefaultStringPiece { - get { return result.DefaultStringPiece; } - set { SetDefaultStringPiece(value); } - } - public Builder SetDefaultStringPiece(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasDefaultStringPiece = true; - result.defaultStringPiece_ = value; - return this; - } - public Builder ClearDefaultStringPiece() { - PrepareBuilder(); - result.hasDefaultStringPiece = false; - result.defaultStringPiece_ = "abc"; - return this; - } - - public bool HasDefaultCord { - get { return result.hasDefaultCord; } - } - public string DefaultCord { - get { return result.DefaultCord; } - set { SetDefaultCord(value); } - } - public Builder SetDefaultCord(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasDefaultCord = true; - result.defaultCord_ = value; - return this; - } - public Builder ClearDefaultCord() { - PrepareBuilder(); - result.hasDefaultCord = false; - result.defaultCord_ = "123"; - return this; - } - } - static TestAllTypes() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestDeprecatedFields : pb::GeneratedMessage { - private TestDeprecatedFields() { } - private static readonly TestDeprecatedFields defaultInstance = new TestDeprecatedFields().MakeReadOnly(); - private static readonly string[] _testDeprecatedFieldsFieldNames = new string[] { "deprecated_int32" }; - private static readonly uint[] _testDeprecatedFieldsFieldTags = new uint[] { 8 }; - public static TestDeprecatedFields DefaultInstance { - get { return defaultInstance; } - } - - public override TestDeprecatedFields DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestDeprecatedFields ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDeprecatedFields__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDeprecatedFields__FieldAccessorTable; } - } - - public const int DeprecatedInt32FieldNumber = 1; - private bool hasDeprecatedInt32; - private int deprecatedInt32_; - [global::System.ObsoleteAttribute()] - public bool HasDeprecatedInt32 { - get { return hasDeprecatedInt32; } - } - [global::System.ObsoleteAttribute()] - public int DeprecatedInt32 { - get { return deprecatedInt32_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testDeprecatedFieldsFieldNames; - if (hasDeprecatedInt32) { - output.WriteInt32(1, field_names[0], DeprecatedInt32); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasDeprecatedInt32) { - size += pb::CodedOutputStream.ComputeInt32Size(1, DeprecatedInt32); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestDeprecatedFields ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestDeprecatedFields ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestDeprecatedFields ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestDeprecatedFields ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestDeprecatedFields ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestDeprecatedFields ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestDeprecatedFields ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestDeprecatedFields ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestDeprecatedFields ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestDeprecatedFields ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestDeprecatedFields MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestDeprecatedFields prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestDeprecatedFields cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestDeprecatedFields result; - - private TestDeprecatedFields PrepareBuilder() { - if (resultIsReadOnly) { - TestDeprecatedFields original = result; - result = new TestDeprecatedFields(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestDeprecatedFields MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestDeprecatedFields.Descriptor; } - } - - public override TestDeprecatedFields DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestDeprecatedFields.DefaultInstance; } - } - - public override TestDeprecatedFields BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestDeprecatedFields) { - return MergeFrom((TestDeprecatedFields) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestDeprecatedFields other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestDeprecatedFields.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasDeprecatedInt32) { - DeprecatedInt32 = other.DeprecatedInt32; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testDeprecatedFieldsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testDeprecatedFieldsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasDeprecatedInt32 = input.ReadInt32(ref result.deprecatedInt32_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - [global::System.ObsoleteAttribute()] - public bool HasDeprecatedInt32 { - get { return result.hasDeprecatedInt32; } - } - [global::System.ObsoleteAttribute()] - public int DeprecatedInt32 { - get { return result.DeprecatedInt32; } - set { SetDeprecatedInt32(value); } - } - [global::System.ObsoleteAttribute()] - public Builder SetDeprecatedInt32(int value) { - PrepareBuilder(); - result.hasDeprecatedInt32 = true; - result.deprecatedInt32_ = value; - return this; - } - [global::System.ObsoleteAttribute()] - public Builder ClearDeprecatedInt32() { - PrepareBuilder(); - result.hasDeprecatedInt32 = false; - result.deprecatedInt32_ = 0; - return this; - } - } - static TestDeprecatedFields() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class ForeignMessage : pb::GeneratedMessage { - private ForeignMessage() { } - private static readonly ForeignMessage defaultInstance = new ForeignMessage().MakeReadOnly(); - private static readonly string[] _foreignMessageFieldNames = new string[] { "c" }; - private static readonly uint[] _foreignMessageFieldTags = new uint[] { 8 }; - public static ForeignMessage DefaultInstance { - get { return defaultInstance; } - } - - public override ForeignMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override ForeignMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_ForeignMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_ForeignMessage__FieldAccessorTable; } - } - - public const int CFieldNumber = 1; - private bool hasC; - private int c_; - public bool HasC { - get { return hasC; } - } - public int C { - get { return c_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _foreignMessageFieldNames; - if (hasC) { - output.WriteInt32(1, field_names[0], C); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasC) { - size += pb::CodedOutputStream.ComputeInt32Size(1, C); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static ForeignMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ForeignMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ForeignMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ForeignMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ForeignMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ForeignMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ForeignMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ForeignMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ForeignMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ForeignMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private ForeignMessage MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ForeignMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(ForeignMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private ForeignMessage result; - - private ForeignMessage PrepareBuilder() { - if (resultIsReadOnly) { - ForeignMessage original = result; - result = new ForeignMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override ForeignMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Descriptor; } - } - - public override ForeignMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance; } - } - - public override ForeignMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ForeignMessage) { - return MergeFrom((ForeignMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ForeignMessage other) { - if (other == global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasC) { - C = other.C; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_foreignMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _foreignMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasC = input.ReadInt32(ref result.c_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasC { - get { return result.hasC; } - } - public int C { - get { return result.C; } - set { SetC(value); } - } - public Builder SetC(int value) { - PrepareBuilder(); - result.hasC = true; - result.c_ = value; - return this; - } - public Builder ClearC() { - PrepareBuilder(); - result.hasC = false; - result.c_ = 0; - return this; - } - } - static ForeignMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestAllExtensions : pb::ExtendableMessage { - private TestAllExtensions() { } - private static readonly TestAllExtensions defaultInstance = new TestAllExtensions().MakeReadOnly(); - private static readonly string[] _testAllExtensionsFieldNames = new string[] { }; - private static readonly uint[] _testAllExtensionsFieldTags = new uint[] { }; - public static TestAllExtensions DefaultInstance { - get { return defaultInstance; } - } - - public override TestAllExtensions DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestAllExtensions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllExtensions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllExtensions__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testAllExtensionsFieldNames; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - extensionWriter.WriteUntil(536870912, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestAllExtensions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestAllExtensions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestAllExtensions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestAllExtensions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestAllExtensions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestAllExtensions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestAllExtensions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestAllExtensions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestAllExtensions ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestAllExtensions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestAllExtensions MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestAllExtensions prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestAllExtensions cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestAllExtensions result; - - private TestAllExtensions PrepareBuilder() { - if (resultIsReadOnly) { - TestAllExtensions original = result; - result = new TestAllExtensions(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestAllExtensions MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestAllExtensions.Descriptor; } - } - - public override TestAllExtensions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestAllExtensions.DefaultInstance; } - } - - public override TestAllExtensions BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestAllExtensions) { - return MergeFrom((TestAllExtensions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestAllExtensions other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestAllExtensions.DefaultInstance) return this; - PrepareBuilder(); - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testAllExtensionsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testAllExtensionsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static TestAllExtensions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class OptionalGroup_extension : pb::GeneratedMessage { - private OptionalGroup_extension() { } - private static readonly OptionalGroup_extension defaultInstance = new OptionalGroup_extension().MakeReadOnly(); - private static readonly string[] _optionalGroupExtensionFieldNames = new string[] { "a" }; - private static readonly uint[] _optionalGroupExtensionFieldTags = new uint[] { 136 }; - public static OptionalGroup_extension DefaultInstance { - get { return defaultInstance; } - } - - public override OptionalGroup_extension DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override OptionalGroup_extension ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_OptionalGroup_extension__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_OptionalGroup_extension__FieldAccessorTable; } - } - - public const int AFieldNumber = 17; - private bool hasA; - private int a_; - public bool HasA { - get { return hasA; } - } - public int A { - get { return a_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _optionalGroupExtensionFieldNames; - if (hasA) { - output.WriteInt32(17, field_names[0], A); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA) { - size += pb::CodedOutputStream.ComputeInt32Size(17, A); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static OptionalGroup_extension ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OptionalGroup_extension ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OptionalGroup_extension ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OptionalGroup_extension ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OptionalGroup_extension ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OptionalGroup_extension ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static OptionalGroup_extension ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static OptionalGroup_extension ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static OptionalGroup_extension ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OptionalGroup_extension ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private OptionalGroup_extension MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(OptionalGroup_extension prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(OptionalGroup_extension cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private OptionalGroup_extension result; - - private OptionalGroup_extension PrepareBuilder() { - if (resultIsReadOnly) { - OptionalGroup_extension original = result; - result = new OptionalGroup_extension(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override OptionalGroup_extension MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension.Descriptor; } - } - - public override OptionalGroup_extension DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension.DefaultInstance; } - } - - public override OptionalGroup_extension BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is OptionalGroup_extension) { - return MergeFrom((OptionalGroup_extension) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(OptionalGroup_extension other) { - if (other == global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA) { - A = other.A; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_optionalGroupExtensionFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _optionalGroupExtensionFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 136: { - result.hasA = input.ReadInt32(ref result.a_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasA { - get { return result.hasA; } - } - public int A { - get { return result.A; } - set { SetA(value); } - } - public Builder SetA(int value) { - PrepareBuilder(); - result.hasA = true; - result.a_ = value; - return this; - } - public Builder ClearA() { - PrepareBuilder(); - result.hasA = false; - result.a_ = 0; - return this; - } - } - static OptionalGroup_extension() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class RepeatedGroup_extension : pb::GeneratedMessage { - private RepeatedGroup_extension() { } - private static readonly RepeatedGroup_extension defaultInstance = new RepeatedGroup_extension().MakeReadOnly(); - private static readonly string[] _repeatedGroupExtensionFieldNames = new string[] { "a" }; - private static readonly uint[] _repeatedGroupExtensionFieldTags = new uint[] { 376 }; - public static RepeatedGroup_extension DefaultInstance { - get { return defaultInstance; } - } - - public override RepeatedGroup_extension DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override RepeatedGroup_extension ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_RepeatedGroup_extension__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_RepeatedGroup_extension__FieldAccessorTable; } - } - - public const int AFieldNumber = 47; - private bool hasA; - private int a_; - public bool HasA { - get { return hasA; } - } - public int A { - get { return a_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _repeatedGroupExtensionFieldNames; - if (hasA) { - output.WriteInt32(47, field_names[0], A); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA) { - size += pb::CodedOutputStream.ComputeInt32Size(47, A); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static RepeatedGroup_extension ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RepeatedGroup_extension ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RepeatedGroup_extension ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RepeatedGroup_extension ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RepeatedGroup_extension ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RepeatedGroup_extension ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static RepeatedGroup_extension ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static RepeatedGroup_extension ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static RepeatedGroup_extension ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RepeatedGroup_extension ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private RepeatedGroup_extension MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(RepeatedGroup_extension prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(RepeatedGroup_extension cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private RepeatedGroup_extension result; - - private RepeatedGroup_extension PrepareBuilder() { - if (resultIsReadOnly) { - RepeatedGroup_extension original = result; - result = new RepeatedGroup_extension(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override RepeatedGroup_extension MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension.Descriptor; } - } - - public override RepeatedGroup_extension DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension.DefaultInstance; } - } - - public override RepeatedGroup_extension BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is RepeatedGroup_extension) { - return MergeFrom((RepeatedGroup_extension) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(RepeatedGroup_extension other) { - if (other == global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA) { - A = other.A; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_repeatedGroupExtensionFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _repeatedGroupExtensionFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 376: { - result.hasA = input.ReadInt32(ref result.a_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasA { - get { return result.hasA; } - } - public int A { - get { return result.A; } - set { SetA(value); } - } - public Builder SetA(int value) { - PrepareBuilder(); - result.hasA = true; - result.a_ = value; - return this; - } - public Builder ClearA() { - PrepareBuilder(); - result.hasA = false; - result.a_ = 0; - return this; - } - } - static RepeatedGroup_extension() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestNestedExtension : pb::GeneratedMessage { - private TestNestedExtension() { } - private static readonly TestNestedExtension defaultInstance = new TestNestedExtension().MakeReadOnly(); - private static readonly string[] _testNestedExtensionFieldNames = new string[] { }; - private static readonly uint[] _testNestedExtensionFieldTags = new uint[] { }; - public static TestNestedExtension DefaultInstance { - get { return defaultInstance; } - } - - public override TestNestedExtension DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestNestedExtension ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestNestedExtension__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestNestedExtension__FieldAccessorTable; } - } - - public const int TestFieldNumber = 1002; - public static pb::GeneratedExtensionBase Test; - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testNestedExtensionFieldNames; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestNestedExtension ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestNestedExtension ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestNestedExtension ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestNestedExtension ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestNestedExtension ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestNestedExtension ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestNestedExtension ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestNestedExtension ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestNestedExtension ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestNestedExtension ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestNestedExtension MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestNestedExtension prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestNestedExtension cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestNestedExtension result; - - private TestNestedExtension PrepareBuilder() { - if (resultIsReadOnly) { - TestNestedExtension original = result; - result = new TestNestedExtension(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestNestedExtension MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestNestedExtension.Descriptor; } - } - - public override TestNestedExtension DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestNestedExtension.DefaultInstance; } - } - - public override TestNestedExtension BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestNestedExtension) { - return MergeFrom((TestNestedExtension) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestNestedExtension other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestNestedExtension.DefaultInstance) return this; - PrepareBuilder(); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testNestedExtensionFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testNestedExtensionFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static TestNestedExtension() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestRequired : pb::GeneratedMessage { - private TestRequired() { } - private static readonly TestRequired defaultInstance = new TestRequired().MakeReadOnly(); - private static readonly string[] _testRequiredFieldNames = new string[] { "a", "b", "c", "dummy10", "dummy11", "dummy12", "dummy13", "dummy14", "dummy15", "dummy16", "dummy17", "dummy18", "dummy19", "dummy2", "dummy20", "dummy21", "dummy22", "dummy23", "dummy24", "dummy25", "dummy26", "dummy27", "dummy28", "dummy29", "dummy30", "dummy31", "dummy32", "dummy4", "dummy5", "dummy6", "dummy7", "dummy8", "dummy9" }; - private static readonly uint[] _testRequiredFieldTags = new uint[] { 8, 24, 264, 80, 88, 96, 104, 112, 120, 128, 136, 144, 152, 16, 160, 168, 176, 184, 192, 200, 208, 216, 224, 232, 240, 248, 256, 32, 40, 48, 56, 64, 72 }; - public static TestRequired DefaultInstance { - get { return defaultInstance; } - } - - public override TestRequired DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestRequired ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestRequired__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestRequired__FieldAccessorTable; } - } - - public const int SingleFieldNumber = 1000; - public static pb::GeneratedExtensionBase Single; - public const int MultiFieldNumber = 1001; - public static pb::GeneratedExtensionBase> Multi; - public const int AFieldNumber = 1; - private bool hasA; - private int a_; - public bool HasA { - get { return hasA; } - } - public int A { - get { return a_; } - } - - public const int Dummy2FieldNumber = 2; - private bool hasDummy2; - private int dummy2_; - public bool HasDummy2 { - get { return hasDummy2; } - } - public int Dummy2 { - get { return dummy2_; } - } - - public const int BFieldNumber = 3; - private bool hasB; - private int b_; - public bool HasB { - get { return hasB; } - } - public int B { - get { return b_; } - } - - public const int Dummy4FieldNumber = 4; - private bool hasDummy4; - private int dummy4_; - public bool HasDummy4 { - get { return hasDummy4; } - } - public int Dummy4 { - get { return dummy4_; } - } - - public const int Dummy5FieldNumber = 5; - private bool hasDummy5; - private int dummy5_; - public bool HasDummy5 { - get { return hasDummy5; } - } - public int Dummy5 { - get { return dummy5_; } - } - - public const int Dummy6FieldNumber = 6; - private bool hasDummy6; - private int dummy6_; - public bool HasDummy6 { - get { return hasDummy6; } - } - public int Dummy6 { - get { return dummy6_; } - } - - public const int Dummy7FieldNumber = 7; - private bool hasDummy7; - private int dummy7_; - public bool HasDummy7 { - get { return hasDummy7; } - } - public int Dummy7 { - get { return dummy7_; } - } - - public const int Dummy8FieldNumber = 8; - private bool hasDummy8; - private int dummy8_; - public bool HasDummy8 { - get { return hasDummy8; } - } - public int Dummy8 { - get { return dummy8_; } - } - - public const int Dummy9FieldNumber = 9; - private bool hasDummy9; - private int dummy9_; - public bool HasDummy9 { - get { return hasDummy9; } - } - public int Dummy9 { - get { return dummy9_; } - } - - public const int Dummy10FieldNumber = 10; - private bool hasDummy10; - private int dummy10_; - public bool HasDummy10 { - get { return hasDummy10; } - } - public int Dummy10 { - get { return dummy10_; } - } - - public const int Dummy11FieldNumber = 11; - private bool hasDummy11; - private int dummy11_; - public bool HasDummy11 { - get { return hasDummy11; } - } - public int Dummy11 { - get { return dummy11_; } - } - - public const int Dummy12FieldNumber = 12; - private bool hasDummy12; - private int dummy12_; - public bool HasDummy12 { - get { return hasDummy12; } - } - public int Dummy12 { - get { return dummy12_; } - } - - public const int Dummy13FieldNumber = 13; - private bool hasDummy13; - private int dummy13_; - public bool HasDummy13 { - get { return hasDummy13; } - } - public int Dummy13 { - get { return dummy13_; } - } - - public const int Dummy14FieldNumber = 14; - private bool hasDummy14; - private int dummy14_; - public bool HasDummy14 { - get { return hasDummy14; } - } - public int Dummy14 { - get { return dummy14_; } - } - - public const int Dummy15FieldNumber = 15; - private bool hasDummy15; - private int dummy15_; - public bool HasDummy15 { - get { return hasDummy15; } - } - public int Dummy15 { - get { return dummy15_; } - } - - public const int Dummy16FieldNumber = 16; - private bool hasDummy16; - private int dummy16_; - public bool HasDummy16 { - get { return hasDummy16; } - } - public int Dummy16 { - get { return dummy16_; } - } - - public const int Dummy17FieldNumber = 17; - private bool hasDummy17; - private int dummy17_; - public bool HasDummy17 { - get { return hasDummy17; } - } - public int Dummy17 { - get { return dummy17_; } - } - - public const int Dummy18FieldNumber = 18; - private bool hasDummy18; - private int dummy18_; - public bool HasDummy18 { - get { return hasDummy18; } - } - public int Dummy18 { - get { return dummy18_; } - } - - public const int Dummy19FieldNumber = 19; - private bool hasDummy19; - private int dummy19_; - public bool HasDummy19 { - get { return hasDummy19; } - } - public int Dummy19 { - get { return dummy19_; } - } - - public const int Dummy20FieldNumber = 20; - private bool hasDummy20; - private int dummy20_; - public bool HasDummy20 { - get { return hasDummy20; } - } - public int Dummy20 { - get { return dummy20_; } - } - - public const int Dummy21FieldNumber = 21; - private bool hasDummy21; - private int dummy21_; - public bool HasDummy21 { - get { return hasDummy21; } - } - public int Dummy21 { - get { return dummy21_; } - } - - public const int Dummy22FieldNumber = 22; - private bool hasDummy22; - private int dummy22_; - public bool HasDummy22 { - get { return hasDummy22; } - } - public int Dummy22 { - get { return dummy22_; } - } - - public const int Dummy23FieldNumber = 23; - private bool hasDummy23; - private int dummy23_; - public bool HasDummy23 { - get { return hasDummy23; } - } - public int Dummy23 { - get { return dummy23_; } - } - - public const int Dummy24FieldNumber = 24; - private bool hasDummy24; - private int dummy24_; - public bool HasDummy24 { - get { return hasDummy24; } - } - public int Dummy24 { - get { return dummy24_; } - } - - public const int Dummy25FieldNumber = 25; - private bool hasDummy25; - private int dummy25_; - public bool HasDummy25 { - get { return hasDummy25; } - } - public int Dummy25 { - get { return dummy25_; } - } - - public const int Dummy26FieldNumber = 26; - private bool hasDummy26; - private int dummy26_; - public bool HasDummy26 { - get { return hasDummy26; } - } - public int Dummy26 { - get { return dummy26_; } - } - - public const int Dummy27FieldNumber = 27; - private bool hasDummy27; - private int dummy27_; - public bool HasDummy27 { - get { return hasDummy27; } - } - public int Dummy27 { - get { return dummy27_; } - } - - public const int Dummy28FieldNumber = 28; - private bool hasDummy28; - private int dummy28_; - public bool HasDummy28 { - get { return hasDummy28; } - } - public int Dummy28 { - get { return dummy28_; } - } - - public const int Dummy29FieldNumber = 29; - private bool hasDummy29; - private int dummy29_; - public bool HasDummy29 { - get { return hasDummy29; } - } - public int Dummy29 { - get { return dummy29_; } - } - - public const int Dummy30FieldNumber = 30; - private bool hasDummy30; - private int dummy30_; - public bool HasDummy30 { - get { return hasDummy30; } - } - public int Dummy30 { - get { return dummy30_; } - } - - public const int Dummy31FieldNumber = 31; - private bool hasDummy31; - private int dummy31_; - public bool HasDummy31 { - get { return hasDummy31; } - } - public int Dummy31 { - get { return dummy31_; } - } - - public const int Dummy32FieldNumber = 32; - private bool hasDummy32; - private int dummy32_; - public bool HasDummy32 { - get { return hasDummy32; } - } - public int Dummy32 { - get { return dummy32_; } - } - - public const int CFieldNumber = 33; - private bool hasC; - private int c_; - public bool HasC { - get { return hasC; } - } - public int C { - get { return c_; } - } - - public override bool IsInitialized { - get { - if (!hasA) return false; - if (!hasB) return false; - if (!hasC) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testRequiredFieldNames; - if (hasA) { - output.WriteInt32(1, field_names[0], A); - } - if (hasDummy2) { - output.WriteInt32(2, field_names[13], Dummy2); - } - if (hasB) { - output.WriteInt32(3, field_names[1], B); - } - if (hasDummy4) { - output.WriteInt32(4, field_names[27], Dummy4); - } - if (hasDummy5) { - output.WriteInt32(5, field_names[28], Dummy5); - } - if (hasDummy6) { - output.WriteInt32(6, field_names[29], Dummy6); - } - if (hasDummy7) { - output.WriteInt32(7, field_names[30], Dummy7); - } - if (hasDummy8) { - output.WriteInt32(8, field_names[31], Dummy8); - } - if (hasDummy9) { - output.WriteInt32(9, field_names[32], Dummy9); - } - if (hasDummy10) { - output.WriteInt32(10, field_names[3], Dummy10); - } - if (hasDummy11) { - output.WriteInt32(11, field_names[4], Dummy11); - } - if (hasDummy12) { - output.WriteInt32(12, field_names[5], Dummy12); - } - if (hasDummy13) { - output.WriteInt32(13, field_names[6], Dummy13); - } - if (hasDummy14) { - output.WriteInt32(14, field_names[7], Dummy14); - } - if (hasDummy15) { - output.WriteInt32(15, field_names[8], Dummy15); - } - if (hasDummy16) { - output.WriteInt32(16, field_names[9], Dummy16); - } - if (hasDummy17) { - output.WriteInt32(17, field_names[10], Dummy17); - } - if (hasDummy18) { - output.WriteInt32(18, field_names[11], Dummy18); - } - if (hasDummy19) { - output.WriteInt32(19, field_names[12], Dummy19); - } - if (hasDummy20) { - output.WriteInt32(20, field_names[14], Dummy20); - } - if (hasDummy21) { - output.WriteInt32(21, field_names[15], Dummy21); - } - if (hasDummy22) { - output.WriteInt32(22, field_names[16], Dummy22); - } - if (hasDummy23) { - output.WriteInt32(23, field_names[17], Dummy23); - } - if (hasDummy24) { - output.WriteInt32(24, field_names[18], Dummy24); - } - if (hasDummy25) { - output.WriteInt32(25, field_names[19], Dummy25); - } - if (hasDummy26) { - output.WriteInt32(26, field_names[20], Dummy26); - } - if (hasDummy27) { - output.WriteInt32(27, field_names[21], Dummy27); - } - if (hasDummy28) { - output.WriteInt32(28, field_names[22], Dummy28); - } - if (hasDummy29) { - output.WriteInt32(29, field_names[23], Dummy29); - } - if (hasDummy30) { - output.WriteInt32(30, field_names[24], Dummy30); - } - if (hasDummy31) { - output.WriteInt32(31, field_names[25], Dummy31); - } - if (hasDummy32) { - output.WriteInt32(32, field_names[26], Dummy32); - } - if (hasC) { - output.WriteInt32(33, field_names[2], C); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA) { - size += pb::CodedOutputStream.ComputeInt32Size(1, A); - } - if (hasDummy2) { - size += pb::CodedOutputStream.ComputeInt32Size(2, Dummy2); - } - if (hasB) { - size += pb::CodedOutputStream.ComputeInt32Size(3, B); - } - if (hasDummy4) { - size += pb::CodedOutputStream.ComputeInt32Size(4, Dummy4); - } - if (hasDummy5) { - size += pb::CodedOutputStream.ComputeInt32Size(5, Dummy5); - } - if (hasDummy6) { - size += pb::CodedOutputStream.ComputeInt32Size(6, Dummy6); - } - if (hasDummy7) { - size += pb::CodedOutputStream.ComputeInt32Size(7, Dummy7); - } - if (hasDummy8) { - size += pb::CodedOutputStream.ComputeInt32Size(8, Dummy8); - } - if (hasDummy9) { - size += pb::CodedOutputStream.ComputeInt32Size(9, Dummy9); - } - if (hasDummy10) { - size += pb::CodedOutputStream.ComputeInt32Size(10, Dummy10); - } - if (hasDummy11) { - size += pb::CodedOutputStream.ComputeInt32Size(11, Dummy11); - } - if (hasDummy12) { - size += pb::CodedOutputStream.ComputeInt32Size(12, Dummy12); - } - if (hasDummy13) { - size += pb::CodedOutputStream.ComputeInt32Size(13, Dummy13); - } - if (hasDummy14) { - size += pb::CodedOutputStream.ComputeInt32Size(14, Dummy14); - } - if (hasDummy15) { - size += pb::CodedOutputStream.ComputeInt32Size(15, Dummy15); - } - if (hasDummy16) { - size += pb::CodedOutputStream.ComputeInt32Size(16, Dummy16); - } - if (hasDummy17) { - size += pb::CodedOutputStream.ComputeInt32Size(17, Dummy17); - } - if (hasDummy18) { - size += pb::CodedOutputStream.ComputeInt32Size(18, Dummy18); - } - if (hasDummy19) { - size += pb::CodedOutputStream.ComputeInt32Size(19, Dummy19); - } - if (hasDummy20) { - size += pb::CodedOutputStream.ComputeInt32Size(20, Dummy20); - } - if (hasDummy21) { - size += pb::CodedOutputStream.ComputeInt32Size(21, Dummy21); - } - if (hasDummy22) { - size += pb::CodedOutputStream.ComputeInt32Size(22, Dummy22); - } - if (hasDummy23) { - size += pb::CodedOutputStream.ComputeInt32Size(23, Dummy23); - } - if (hasDummy24) { - size += pb::CodedOutputStream.ComputeInt32Size(24, Dummy24); - } - if (hasDummy25) { - size += pb::CodedOutputStream.ComputeInt32Size(25, Dummy25); - } - if (hasDummy26) { - size += pb::CodedOutputStream.ComputeInt32Size(26, Dummy26); - } - if (hasDummy27) { - size += pb::CodedOutputStream.ComputeInt32Size(27, Dummy27); - } - if (hasDummy28) { - size += pb::CodedOutputStream.ComputeInt32Size(28, Dummy28); - } - if (hasDummy29) { - size += pb::CodedOutputStream.ComputeInt32Size(29, Dummy29); - } - if (hasDummy30) { - size += pb::CodedOutputStream.ComputeInt32Size(30, Dummy30); - } - if (hasDummy31) { - size += pb::CodedOutputStream.ComputeInt32Size(31, Dummy31); - } - if (hasDummy32) { - size += pb::CodedOutputStream.ComputeInt32Size(32, Dummy32); - } - if (hasC) { - size += pb::CodedOutputStream.ComputeInt32Size(33, C); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestRequired ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestRequired ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestRequired ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestRequired ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestRequired ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestRequired ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestRequired ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestRequired ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestRequired ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestRequired ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestRequired MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestRequired prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestRequired cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestRequired result; - - private TestRequired PrepareBuilder() { - if (resultIsReadOnly) { - TestRequired original = result; - result = new TestRequired(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestRequired MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestRequired.Descriptor; } - } - - public override TestRequired DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestRequired.DefaultInstance; } - } - - public override TestRequired BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestRequired) { - return MergeFrom((TestRequired) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestRequired other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestRequired.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA) { - A = other.A; - } - if (other.HasDummy2) { - Dummy2 = other.Dummy2; - } - if (other.HasB) { - B = other.B; - } - if (other.HasDummy4) { - Dummy4 = other.Dummy4; - } - if (other.HasDummy5) { - Dummy5 = other.Dummy5; - } - if (other.HasDummy6) { - Dummy6 = other.Dummy6; - } - if (other.HasDummy7) { - Dummy7 = other.Dummy7; - } - if (other.HasDummy8) { - Dummy8 = other.Dummy8; - } - if (other.HasDummy9) { - Dummy9 = other.Dummy9; - } - if (other.HasDummy10) { - Dummy10 = other.Dummy10; - } - if (other.HasDummy11) { - Dummy11 = other.Dummy11; - } - if (other.HasDummy12) { - Dummy12 = other.Dummy12; - } - if (other.HasDummy13) { - Dummy13 = other.Dummy13; - } - if (other.HasDummy14) { - Dummy14 = other.Dummy14; - } - if (other.HasDummy15) { - Dummy15 = other.Dummy15; - } - if (other.HasDummy16) { - Dummy16 = other.Dummy16; - } - if (other.HasDummy17) { - Dummy17 = other.Dummy17; - } - if (other.HasDummy18) { - Dummy18 = other.Dummy18; - } - if (other.HasDummy19) { - Dummy19 = other.Dummy19; - } - if (other.HasDummy20) { - Dummy20 = other.Dummy20; - } - if (other.HasDummy21) { - Dummy21 = other.Dummy21; - } - if (other.HasDummy22) { - Dummy22 = other.Dummy22; - } - if (other.HasDummy23) { - Dummy23 = other.Dummy23; - } - if (other.HasDummy24) { - Dummy24 = other.Dummy24; - } - if (other.HasDummy25) { - Dummy25 = other.Dummy25; - } - if (other.HasDummy26) { - Dummy26 = other.Dummy26; - } - if (other.HasDummy27) { - Dummy27 = other.Dummy27; - } - if (other.HasDummy28) { - Dummy28 = other.Dummy28; - } - if (other.HasDummy29) { - Dummy29 = other.Dummy29; - } - if (other.HasDummy30) { - Dummy30 = other.Dummy30; - } - if (other.HasDummy31) { - Dummy31 = other.Dummy31; - } - if (other.HasDummy32) { - Dummy32 = other.Dummy32; - } - if (other.HasC) { - C = other.C; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testRequiredFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testRequiredFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasA = input.ReadInt32(ref result.a_); - break; - } - case 16: { - result.hasDummy2 = input.ReadInt32(ref result.dummy2_); - break; - } - case 24: { - result.hasB = input.ReadInt32(ref result.b_); - break; - } - case 32: { - result.hasDummy4 = input.ReadInt32(ref result.dummy4_); - break; - } - case 40: { - result.hasDummy5 = input.ReadInt32(ref result.dummy5_); - break; - } - case 48: { - result.hasDummy6 = input.ReadInt32(ref result.dummy6_); - break; - } - case 56: { - result.hasDummy7 = input.ReadInt32(ref result.dummy7_); - break; - } - case 64: { - result.hasDummy8 = input.ReadInt32(ref result.dummy8_); - break; - } - case 72: { - result.hasDummy9 = input.ReadInt32(ref result.dummy9_); - break; - } - case 80: { - result.hasDummy10 = input.ReadInt32(ref result.dummy10_); - break; - } - case 88: { - result.hasDummy11 = input.ReadInt32(ref result.dummy11_); - break; - } - case 96: { - result.hasDummy12 = input.ReadInt32(ref result.dummy12_); - break; - } - case 104: { - result.hasDummy13 = input.ReadInt32(ref result.dummy13_); - break; - } - case 112: { - result.hasDummy14 = input.ReadInt32(ref result.dummy14_); - break; - } - case 120: { - result.hasDummy15 = input.ReadInt32(ref result.dummy15_); - break; - } - case 128: { - result.hasDummy16 = input.ReadInt32(ref result.dummy16_); - break; - } - case 136: { - result.hasDummy17 = input.ReadInt32(ref result.dummy17_); - break; - } - case 144: { - result.hasDummy18 = input.ReadInt32(ref result.dummy18_); - break; - } - case 152: { - result.hasDummy19 = input.ReadInt32(ref result.dummy19_); - break; - } - case 160: { - result.hasDummy20 = input.ReadInt32(ref result.dummy20_); - break; - } - case 168: { - result.hasDummy21 = input.ReadInt32(ref result.dummy21_); - break; - } - case 176: { - result.hasDummy22 = input.ReadInt32(ref result.dummy22_); - break; - } - case 184: { - result.hasDummy23 = input.ReadInt32(ref result.dummy23_); - break; - } - case 192: { - result.hasDummy24 = input.ReadInt32(ref result.dummy24_); - break; - } - case 200: { - result.hasDummy25 = input.ReadInt32(ref result.dummy25_); - break; - } - case 208: { - result.hasDummy26 = input.ReadInt32(ref result.dummy26_); - break; - } - case 216: { - result.hasDummy27 = input.ReadInt32(ref result.dummy27_); - break; - } - case 224: { - result.hasDummy28 = input.ReadInt32(ref result.dummy28_); - break; - } - case 232: { - result.hasDummy29 = input.ReadInt32(ref result.dummy29_); - break; - } - case 240: { - result.hasDummy30 = input.ReadInt32(ref result.dummy30_); - break; - } - case 248: { - result.hasDummy31 = input.ReadInt32(ref result.dummy31_); - break; - } - case 256: { - result.hasDummy32 = input.ReadInt32(ref result.dummy32_); - break; - } - case 264: { - result.hasC = input.ReadInt32(ref result.c_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasA { - get { return result.hasA; } - } - public int A { - get { return result.A; } - set { SetA(value); } - } - public Builder SetA(int value) { - PrepareBuilder(); - result.hasA = true; - result.a_ = value; - return this; - } - public Builder ClearA() { - PrepareBuilder(); - result.hasA = false; - result.a_ = 0; - return this; - } - - public bool HasDummy2 { - get { return result.hasDummy2; } - } - public int Dummy2 { - get { return result.Dummy2; } - set { SetDummy2(value); } - } - public Builder SetDummy2(int value) { - PrepareBuilder(); - result.hasDummy2 = true; - result.dummy2_ = value; - return this; - } - public Builder ClearDummy2() { - PrepareBuilder(); - result.hasDummy2 = false; - result.dummy2_ = 0; - return this; - } - - public bool HasB { - get { return result.hasB; } - } - public int B { - get { return result.B; } - set { SetB(value); } - } - public Builder SetB(int value) { - PrepareBuilder(); - result.hasB = true; - result.b_ = value; - return this; - } - public Builder ClearB() { - PrepareBuilder(); - result.hasB = false; - result.b_ = 0; - return this; - } - - public bool HasDummy4 { - get { return result.hasDummy4; } - } - public int Dummy4 { - get { return result.Dummy4; } - set { SetDummy4(value); } - } - public Builder SetDummy4(int value) { - PrepareBuilder(); - result.hasDummy4 = true; - result.dummy4_ = value; - return this; - } - public Builder ClearDummy4() { - PrepareBuilder(); - result.hasDummy4 = false; - result.dummy4_ = 0; - return this; - } - - public bool HasDummy5 { - get { return result.hasDummy5; } - } - public int Dummy5 { - get { return result.Dummy5; } - set { SetDummy5(value); } - } - public Builder SetDummy5(int value) { - PrepareBuilder(); - result.hasDummy5 = true; - result.dummy5_ = value; - return this; - } - public Builder ClearDummy5() { - PrepareBuilder(); - result.hasDummy5 = false; - result.dummy5_ = 0; - return this; - } - - public bool HasDummy6 { - get { return result.hasDummy6; } - } - public int Dummy6 { - get { return result.Dummy6; } - set { SetDummy6(value); } - } - public Builder SetDummy6(int value) { - PrepareBuilder(); - result.hasDummy6 = true; - result.dummy6_ = value; - return this; - } - public Builder ClearDummy6() { - PrepareBuilder(); - result.hasDummy6 = false; - result.dummy6_ = 0; - return this; - } - - public bool HasDummy7 { - get { return result.hasDummy7; } - } - public int Dummy7 { - get { return result.Dummy7; } - set { SetDummy7(value); } - } - public Builder SetDummy7(int value) { - PrepareBuilder(); - result.hasDummy7 = true; - result.dummy7_ = value; - return this; - } - public Builder ClearDummy7() { - PrepareBuilder(); - result.hasDummy7 = false; - result.dummy7_ = 0; - return this; - } - - public bool HasDummy8 { - get { return result.hasDummy8; } - } - public int Dummy8 { - get { return result.Dummy8; } - set { SetDummy8(value); } - } - public Builder SetDummy8(int value) { - PrepareBuilder(); - result.hasDummy8 = true; - result.dummy8_ = value; - return this; - } - public Builder ClearDummy8() { - PrepareBuilder(); - result.hasDummy8 = false; - result.dummy8_ = 0; - return this; - } - - public bool HasDummy9 { - get { return result.hasDummy9; } - } - public int Dummy9 { - get { return result.Dummy9; } - set { SetDummy9(value); } - } - public Builder SetDummy9(int value) { - PrepareBuilder(); - result.hasDummy9 = true; - result.dummy9_ = value; - return this; - } - public Builder ClearDummy9() { - PrepareBuilder(); - result.hasDummy9 = false; - result.dummy9_ = 0; - return this; - } - - public bool HasDummy10 { - get { return result.hasDummy10; } - } - public int Dummy10 { - get { return result.Dummy10; } - set { SetDummy10(value); } - } - public Builder SetDummy10(int value) { - PrepareBuilder(); - result.hasDummy10 = true; - result.dummy10_ = value; - return this; - } - public Builder ClearDummy10() { - PrepareBuilder(); - result.hasDummy10 = false; - result.dummy10_ = 0; - return this; - } - - public bool HasDummy11 { - get { return result.hasDummy11; } - } - public int Dummy11 { - get { return result.Dummy11; } - set { SetDummy11(value); } - } - public Builder SetDummy11(int value) { - PrepareBuilder(); - result.hasDummy11 = true; - result.dummy11_ = value; - return this; - } - public Builder ClearDummy11() { - PrepareBuilder(); - result.hasDummy11 = false; - result.dummy11_ = 0; - return this; - } - - public bool HasDummy12 { - get { return result.hasDummy12; } - } - public int Dummy12 { - get { return result.Dummy12; } - set { SetDummy12(value); } - } - public Builder SetDummy12(int value) { - PrepareBuilder(); - result.hasDummy12 = true; - result.dummy12_ = value; - return this; - } - public Builder ClearDummy12() { - PrepareBuilder(); - result.hasDummy12 = false; - result.dummy12_ = 0; - return this; - } - - public bool HasDummy13 { - get { return result.hasDummy13; } - } - public int Dummy13 { - get { return result.Dummy13; } - set { SetDummy13(value); } - } - public Builder SetDummy13(int value) { - PrepareBuilder(); - result.hasDummy13 = true; - result.dummy13_ = value; - return this; - } - public Builder ClearDummy13() { - PrepareBuilder(); - result.hasDummy13 = false; - result.dummy13_ = 0; - return this; - } - - public bool HasDummy14 { - get { return result.hasDummy14; } - } - public int Dummy14 { - get { return result.Dummy14; } - set { SetDummy14(value); } - } - public Builder SetDummy14(int value) { - PrepareBuilder(); - result.hasDummy14 = true; - result.dummy14_ = value; - return this; - } - public Builder ClearDummy14() { - PrepareBuilder(); - result.hasDummy14 = false; - result.dummy14_ = 0; - return this; - } - - public bool HasDummy15 { - get { return result.hasDummy15; } - } - public int Dummy15 { - get { return result.Dummy15; } - set { SetDummy15(value); } - } - public Builder SetDummy15(int value) { - PrepareBuilder(); - result.hasDummy15 = true; - result.dummy15_ = value; - return this; - } - public Builder ClearDummy15() { - PrepareBuilder(); - result.hasDummy15 = false; - result.dummy15_ = 0; - return this; - } - - public bool HasDummy16 { - get { return result.hasDummy16; } - } - public int Dummy16 { - get { return result.Dummy16; } - set { SetDummy16(value); } - } - public Builder SetDummy16(int value) { - PrepareBuilder(); - result.hasDummy16 = true; - result.dummy16_ = value; - return this; - } - public Builder ClearDummy16() { - PrepareBuilder(); - result.hasDummy16 = false; - result.dummy16_ = 0; - return this; - } - - public bool HasDummy17 { - get { return result.hasDummy17; } - } - public int Dummy17 { - get { return result.Dummy17; } - set { SetDummy17(value); } - } - public Builder SetDummy17(int value) { - PrepareBuilder(); - result.hasDummy17 = true; - result.dummy17_ = value; - return this; - } - public Builder ClearDummy17() { - PrepareBuilder(); - result.hasDummy17 = false; - result.dummy17_ = 0; - return this; - } - - public bool HasDummy18 { - get { return result.hasDummy18; } - } - public int Dummy18 { - get { return result.Dummy18; } - set { SetDummy18(value); } - } - public Builder SetDummy18(int value) { - PrepareBuilder(); - result.hasDummy18 = true; - result.dummy18_ = value; - return this; - } - public Builder ClearDummy18() { - PrepareBuilder(); - result.hasDummy18 = false; - result.dummy18_ = 0; - return this; - } - - public bool HasDummy19 { - get { return result.hasDummy19; } - } - public int Dummy19 { - get { return result.Dummy19; } - set { SetDummy19(value); } - } - public Builder SetDummy19(int value) { - PrepareBuilder(); - result.hasDummy19 = true; - result.dummy19_ = value; - return this; - } - public Builder ClearDummy19() { - PrepareBuilder(); - result.hasDummy19 = false; - result.dummy19_ = 0; - return this; - } - - public bool HasDummy20 { - get { return result.hasDummy20; } - } - public int Dummy20 { - get { return result.Dummy20; } - set { SetDummy20(value); } - } - public Builder SetDummy20(int value) { - PrepareBuilder(); - result.hasDummy20 = true; - result.dummy20_ = value; - return this; - } - public Builder ClearDummy20() { - PrepareBuilder(); - result.hasDummy20 = false; - result.dummy20_ = 0; - return this; - } - - public bool HasDummy21 { - get { return result.hasDummy21; } - } - public int Dummy21 { - get { return result.Dummy21; } - set { SetDummy21(value); } - } - public Builder SetDummy21(int value) { - PrepareBuilder(); - result.hasDummy21 = true; - result.dummy21_ = value; - return this; - } - public Builder ClearDummy21() { - PrepareBuilder(); - result.hasDummy21 = false; - result.dummy21_ = 0; - return this; - } - - public bool HasDummy22 { - get { return result.hasDummy22; } - } - public int Dummy22 { - get { return result.Dummy22; } - set { SetDummy22(value); } - } - public Builder SetDummy22(int value) { - PrepareBuilder(); - result.hasDummy22 = true; - result.dummy22_ = value; - return this; - } - public Builder ClearDummy22() { - PrepareBuilder(); - result.hasDummy22 = false; - result.dummy22_ = 0; - return this; - } - - public bool HasDummy23 { - get { return result.hasDummy23; } - } - public int Dummy23 { - get { return result.Dummy23; } - set { SetDummy23(value); } - } - public Builder SetDummy23(int value) { - PrepareBuilder(); - result.hasDummy23 = true; - result.dummy23_ = value; - return this; - } - public Builder ClearDummy23() { - PrepareBuilder(); - result.hasDummy23 = false; - result.dummy23_ = 0; - return this; - } - - public bool HasDummy24 { - get { return result.hasDummy24; } - } - public int Dummy24 { - get { return result.Dummy24; } - set { SetDummy24(value); } - } - public Builder SetDummy24(int value) { - PrepareBuilder(); - result.hasDummy24 = true; - result.dummy24_ = value; - return this; - } - public Builder ClearDummy24() { - PrepareBuilder(); - result.hasDummy24 = false; - result.dummy24_ = 0; - return this; - } - - public bool HasDummy25 { - get { return result.hasDummy25; } - } - public int Dummy25 { - get { return result.Dummy25; } - set { SetDummy25(value); } - } - public Builder SetDummy25(int value) { - PrepareBuilder(); - result.hasDummy25 = true; - result.dummy25_ = value; - return this; - } - public Builder ClearDummy25() { - PrepareBuilder(); - result.hasDummy25 = false; - result.dummy25_ = 0; - return this; - } - - public bool HasDummy26 { - get { return result.hasDummy26; } - } - public int Dummy26 { - get { return result.Dummy26; } - set { SetDummy26(value); } - } - public Builder SetDummy26(int value) { - PrepareBuilder(); - result.hasDummy26 = true; - result.dummy26_ = value; - return this; - } - public Builder ClearDummy26() { - PrepareBuilder(); - result.hasDummy26 = false; - result.dummy26_ = 0; - return this; - } - - public bool HasDummy27 { - get { return result.hasDummy27; } - } - public int Dummy27 { - get { return result.Dummy27; } - set { SetDummy27(value); } - } - public Builder SetDummy27(int value) { - PrepareBuilder(); - result.hasDummy27 = true; - result.dummy27_ = value; - return this; - } - public Builder ClearDummy27() { - PrepareBuilder(); - result.hasDummy27 = false; - result.dummy27_ = 0; - return this; - } - - public bool HasDummy28 { - get { return result.hasDummy28; } - } - public int Dummy28 { - get { return result.Dummy28; } - set { SetDummy28(value); } - } - public Builder SetDummy28(int value) { - PrepareBuilder(); - result.hasDummy28 = true; - result.dummy28_ = value; - return this; - } - public Builder ClearDummy28() { - PrepareBuilder(); - result.hasDummy28 = false; - result.dummy28_ = 0; - return this; - } - - public bool HasDummy29 { - get { return result.hasDummy29; } - } - public int Dummy29 { - get { return result.Dummy29; } - set { SetDummy29(value); } - } - public Builder SetDummy29(int value) { - PrepareBuilder(); - result.hasDummy29 = true; - result.dummy29_ = value; - return this; - } - public Builder ClearDummy29() { - PrepareBuilder(); - result.hasDummy29 = false; - result.dummy29_ = 0; - return this; - } - - public bool HasDummy30 { - get { return result.hasDummy30; } - } - public int Dummy30 { - get { return result.Dummy30; } - set { SetDummy30(value); } - } - public Builder SetDummy30(int value) { - PrepareBuilder(); - result.hasDummy30 = true; - result.dummy30_ = value; - return this; - } - public Builder ClearDummy30() { - PrepareBuilder(); - result.hasDummy30 = false; - result.dummy30_ = 0; - return this; - } - - public bool HasDummy31 { - get { return result.hasDummy31; } - } - public int Dummy31 { - get { return result.Dummy31; } - set { SetDummy31(value); } - } - public Builder SetDummy31(int value) { - PrepareBuilder(); - result.hasDummy31 = true; - result.dummy31_ = value; - return this; - } - public Builder ClearDummy31() { - PrepareBuilder(); - result.hasDummy31 = false; - result.dummy31_ = 0; - return this; - } - - public bool HasDummy32 { - get { return result.hasDummy32; } - } - public int Dummy32 { - get { return result.Dummy32; } - set { SetDummy32(value); } - } - public Builder SetDummy32(int value) { - PrepareBuilder(); - result.hasDummy32 = true; - result.dummy32_ = value; - return this; - } - public Builder ClearDummy32() { - PrepareBuilder(); - result.hasDummy32 = false; - result.dummy32_ = 0; - return this; - } - - public bool HasC { - get { return result.hasC; } - } - public int C { - get { return result.C; } - set { SetC(value); } - } - public Builder SetC(int value) { - PrepareBuilder(); - result.hasC = true; - result.c_ = value; - return this; - } - public Builder ClearC() { - PrepareBuilder(); - result.hasC = false; - result.c_ = 0; - return this; - } - } - static TestRequired() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestRequiredForeign : pb::GeneratedMessage { - private TestRequiredForeign() { } - private static readonly TestRequiredForeign defaultInstance = new TestRequiredForeign().MakeReadOnly(); - private static readonly string[] _testRequiredForeignFieldNames = new string[] { "dummy", "optional_message", "repeated_message" }; - private static readonly uint[] _testRequiredForeignFieldTags = new uint[] { 24, 10, 18 }; - public static TestRequiredForeign DefaultInstance { - get { return defaultInstance; } - } - - public override TestRequiredForeign DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestRequiredForeign ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestRequiredForeign__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestRequiredForeign__FieldAccessorTable; } - } - - public const int OptionalMessageFieldNumber = 1; - private bool hasOptionalMessage; - private global::Google.ProtocolBuffers.TestProtos.TestRequired optionalMessage_; - public bool HasOptionalMessage { - get { return hasOptionalMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.TestRequired OptionalMessage { - get { return optionalMessage_ ?? global::Google.ProtocolBuffers.TestProtos.TestRequired.DefaultInstance; } - } - - public const int RepeatedMessageFieldNumber = 2; - private pbc::PopsicleList repeatedMessage_ = new pbc::PopsicleList(); - public scg::IList RepeatedMessageList { - get { return repeatedMessage_; } - } - public int RepeatedMessageCount { - get { return repeatedMessage_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.TestRequired GetRepeatedMessage(int index) { - return repeatedMessage_[index]; - } - - public const int DummyFieldNumber = 3; - private bool hasDummy; - private int dummy_; - public bool HasDummy { - get { return hasDummy; } - } - public int Dummy { - get { return dummy_; } - } - - public override bool IsInitialized { - get { - if (HasOptionalMessage) { - if (!OptionalMessage.IsInitialized) return false; - } - foreach (global::Google.ProtocolBuffers.TestProtos.TestRequired element in RepeatedMessageList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testRequiredForeignFieldNames; - if (hasOptionalMessage) { - output.WriteMessage(1, field_names[1], OptionalMessage); - } - if (repeatedMessage_.Count > 0) { - output.WriteMessageArray(2, field_names[2], repeatedMessage_); - } - if (hasDummy) { - output.WriteInt32(3, field_names[0], Dummy); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasOptionalMessage) { - size += pb::CodedOutputStream.ComputeMessageSize(1, OptionalMessage); - } - foreach (global::Google.ProtocolBuffers.TestProtos.TestRequired element in RepeatedMessageList) { - size += pb::CodedOutputStream.ComputeMessageSize(2, element); - } - if (hasDummy) { - size += pb::CodedOutputStream.ComputeInt32Size(3, Dummy); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestRequiredForeign ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestRequiredForeign ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestRequiredForeign ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestRequiredForeign ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestRequiredForeign ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestRequiredForeign ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestRequiredForeign ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestRequiredForeign ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestRequiredForeign ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestRequiredForeign ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestRequiredForeign MakeReadOnly() { - repeatedMessage_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestRequiredForeign prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestRequiredForeign cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestRequiredForeign result; - - private TestRequiredForeign PrepareBuilder() { - if (resultIsReadOnly) { - TestRequiredForeign original = result; - result = new TestRequiredForeign(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestRequiredForeign MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestRequiredForeign.Descriptor; } - } - - public override TestRequiredForeign DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestRequiredForeign.DefaultInstance; } - } - - public override TestRequiredForeign BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestRequiredForeign) { - return MergeFrom((TestRequiredForeign) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestRequiredForeign other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestRequiredForeign.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasOptionalMessage) { - MergeOptionalMessage(other.OptionalMessage); - } - if (other.repeatedMessage_.Count != 0) { - result.repeatedMessage_.Add(other.repeatedMessage_); - } - if (other.HasDummy) { - Dummy = other.Dummy; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testRequiredForeignFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testRequiredForeignFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - global::Google.ProtocolBuffers.TestProtos.TestRequired.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestRequired.CreateBuilder(); - if (result.hasOptionalMessage) { - subBuilder.MergeFrom(OptionalMessage); - } - input.ReadMessage(subBuilder, extensionRegistry); - OptionalMessage = subBuilder.BuildPartial(); - break; - } - case 18: { - input.ReadMessageArray(tag, field_name, result.repeatedMessage_, global::Google.ProtocolBuffers.TestProtos.TestRequired.DefaultInstance, extensionRegistry); - break; - } - case 24: { - result.hasDummy = input.ReadInt32(ref result.dummy_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasOptionalMessage { - get { return result.hasOptionalMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.TestRequired OptionalMessage { - get { return result.OptionalMessage; } - set { SetOptionalMessage(value); } - } - public Builder SetOptionalMessage(global::Google.ProtocolBuffers.TestProtos.TestRequired value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalMessage = true; - result.optionalMessage_ = value; - return this; - } - public Builder SetOptionalMessage(global::Google.ProtocolBuffers.TestProtos.TestRequired.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptionalMessage = true; - result.optionalMessage_ = builderForValue.Build(); - return this; - } - public Builder MergeOptionalMessage(global::Google.ProtocolBuffers.TestProtos.TestRequired value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptionalMessage && - result.optionalMessage_ != global::Google.ProtocolBuffers.TestProtos.TestRequired.DefaultInstance) { - result.optionalMessage_ = global::Google.ProtocolBuffers.TestProtos.TestRequired.CreateBuilder(result.optionalMessage_).MergeFrom(value).BuildPartial(); - } else { - result.optionalMessage_ = value; - } - result.hasOptionalMessage = true; - return this; - } - public Builder ClearOptionalMessage() { - PrepareBuilder(); - result.hasOptionalMessage = false; - result.optionalMessage_ = null; - return this; - } - - public pbc::IPopsicleList RepeatedMessageList { - get { return PrepareBuilder().repeatedMessage_; } - } - public int RepeatedMessageCount { - get { return result.RepeatedMessageCount; } - } - public global::Google.ProtocolBuffers.TestProtos.TestRequired GetRepeatedMessage(int index) { - return result.GetRepeatedMessage(index); - } - public Builder SetRepeatedMessage(int index, global::Google.ProtocolBuffers.TestProtos.TestRequired value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedMessage_[index] = value; - return this; - } - public Builder SetRepeatedMessage(int index, global::Google.ProtocolBuffers.TestProtos.TestRequired.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedMessage_[index] = builderForValue.Build(); - return this; - } - public Builder AddRepeatedMessage(global::Google.ProtocolBuffers.TestProtos.TestRequired value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedMessage_.Add(value); - return this; - } - public Builder AddRepeatedMessage(global::Google.ProtocolBuffers.TestProtos.TestRequired.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedMessage_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeRepeatedMessage(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedMessage_.Add(values); - return this; - } - public Builder ClearRepeatedMessage() { - PrepareBuilder(); - result.repeatedMessage_.Clear(); - return this; - } - - public bool HasDummy { - get { return result.hasDummy; } - } - public int Dummy { - get { return result.Dummy; } - set { SetDummy(value); } - } - public Builder SetDummy(int value) { - PrepareBuilder(); - result.hasDummy = true; - result.dummy_ = value; - return this; - } - public Builder ClearDummy() { - PrepareBuilder(); - result.hasDummy = false; - result.dummy_ = 0; - return this; - } - } - static TestRequiredForeign() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestForeignNested : pb::GeneratedMessage { - private TestForeignNested() { } - private static readonly TestForeignNested defaultInstance = new TestForeignNested().MakeReadOnly(); - private static readonly string[] _testForeignNestedFieldNames = new string[] { "foreign_nested" }; - private static readonly uint[] _testForeignNestedFieldTags = new uint[] { 10 }; - public static TestForeignNested DefaultInstance { - get { return defaultInstance; } - } - - public override TestForeignNested DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestForeignNested ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestForeignNested__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestForeignNested__FieldAccessorTable; } - } - - public const int ForeignNestedFieldNumber = 1; - private bool hasForeignNested; - private global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage foreignNested_; - public bool HasForeignNested { - get { return hasForeignNested; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage ForeignNested { - get { return foreignNested_ ?? global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.DefaultInstance; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testForeignNestedFieldNames; - if (hasForeignNested) { - output.WriteMessage(1, field_names[0], ForeignNested); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasForeignNested) { - size += pb::CodedOutputStream.ComputeMessageSize(1, ForeignNested); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestForeignNested ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestForeignNested ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestForeignNested ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestForeignNested ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestForeignNested ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestForeignNested ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestForeignNested ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestForeignNested ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestForeignNested ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestForeignNested ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestForeignNested MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestForeignNested prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestForeignNested cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestForeignNested result; - - private TestForeignNested PrepareBuilder() { - if (resultIsReadOnly) { - TestForeignNested original = result; - result = new TestForeignNested(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestForeignNested MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestForeignNested.Descriptor; } - } - - public override TestForeignNested DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestForeignNested.DefaultInstance; } - } - - public override TestForeignNested BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestForeignNested) { - return MergeFrom((TestForeignNested) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestForeignNested other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestForeignNested.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasForeignNested) { - MergeForeignNested(other.ForeignNested); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testForeignNestedFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testForeignNestedFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.CreateBuilder(); - if (result.hasForeignNested) { - subBuilder.MergeFrom(ForeignNested); - } - input.ReadMessage(subBuilder, extensionRegistry); - ForeignNested = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasForeignNested { - get { return result.hasForeignNested; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage ForeignNested { - get { return result.ForeignNested; } - set { SetForeignNested(value); } - } - public Builder SetForeignNested(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasForeignNested = true; - result.foreignNested_ = value; - return this; - } - public Builder SetForeignNested(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasForeignNested = true; - result.foreignNested_ = builderForValue.Build(); - return this; - } - public Builder MergeForeignNested(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasForeignNested && - result.foreignNested_ != global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.DefaultInstance) { - result.foreignNested_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.CreateBuilder(result.foreignNested_).MergeFrom(value).BuildPartial(); - } else { - result.foreignNested_ = value; - } - result.hasForeignNested = true; - return this; - } - public Builder ClearForeignNested() { - PrepareBuilder(); - result.hasForeignNested = false; - result.foreignNested_ = null; - return this; - } - } - static TestForeignNested() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestEmptyMessage : pb::GeneratedMessage { - private TestEmptyMessage() { } - private static readonly TestEmptyMessage defaultInstance = new TestEmptyMessage().MakeReadOnly(); - private static readonly string[] _testEmptyMessageFieldNames = new string[] { }; - private static readonly uint[] _testEmptyMessageFieldTags = new uint[] { }; - public static TestEmptyMessage DefaultInstance { - get { return defaultInstance; } - } - - public override TestEmptyMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestEmptyMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestEmptyMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestEmptyMessage__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testEmptyMessageFieldNames; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestEmptyMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestEmptyMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestEmptyMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestEmptyMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestEmptyMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestEmptyMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestEmptyMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestEmptyMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestEmptyMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestEmptyMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestEmptyMessage MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestEmptyMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestEmptyMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestEmptyMessage result; - - private TestEmptyMessage PrepareBuilder() { - if (resultIsReadOnly) { - TestEmptyMessage original = result; - result = new TestEmptyMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestEmptyMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestEmptyMessage.Descriptor; } - } - - public override TestEmptyMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestEmptyMessage.DefaultInstance; } - } - - public override TestEmptyMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestEmptyMessage) { - return MergeFrom((TestEmptyMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestEmptyMessage other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestEmptyMessage.DefaultInstance) return this; - PrepareBuilder(); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testEmptyMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testEmptyMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static TestEmptyMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestEmptyMessageWithExtensions : pb::ExtendableMessage { - private TestEmptyMessageWithExtensions() { } - private static readonly TestEmptyMessageWithExtensions defaultInstance = new TestEmptyMessageWithExtensions().MakeReadOnly(); - private static readonly string[] _testEmptyMessageWithExtensionsFieldNames = new string[] { }; - private static readonly uint[] _testEmptyMessageWithExtensionsFieldTags = new uint[] { }; - public static TestEmptyMessageWithExtensions DefaultInstance { - get { return defaultInstance; } - } - - public override TestEmptyMessageWithExtensions DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestEmptyMessageWithExtensions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestEmptyMessageWithExtensions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestEmptyMessageWithExtensions__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testEmptyMessageWithExtensionsFieldNames; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - extensionWriter.WriteUntil(536870912, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestEmptyMessageWithExtensions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestEmptyMessageWithExtensions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestEmptyMessageWithExtensions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestEmptyMessageWithExtensions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestEmptyMessageWithExtensions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestEmptyMessageWithExtensions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestEmptyMessageWithExtensions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestEmptyMessageWithExtensions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestEmptyMessageWithExtensions ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestEmptyMessageWithExtensions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestEmptyMessageWithExtensions MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestEmptyMessageWithExtensions prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestEmptyMessageWithExtensions cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestEmptyMessageWithExtensions result; - - private TestEmptyMessageWithExtensions PrepareBuilder() { - if (resultIsReadOnly) { - TestEmptyMessageWithExtensions original = result; - result = new TestEmptyMessageWithExtensions(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestEmptyMessageWithExtensions MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestEmptyMessageWithExtensions.Descriptor; } - } - - public override TestEmptyMessageWithExtensions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestEmptyMessageWithExtensions.DefaultInstance; } - } - - public override TestEmptyMessageWithExtensions BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestEmptyMessageWithExtensions) { - return MergeFrom((TestEmptyMessageWithExtensions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestEmptyMessageWithExtensions other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestEmptyMessageWithExtensions.DefaultInstance) return this; - PrepareBuilder(); - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testEmptyMessageWithExtensionsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testEmptyMessageWithExtensionsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static TestEmptyMessageWithExtensions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestMultipleExtensionRanges : pb::ExtendableMessage { - private TestMultipleExtensionRanges() { } - private static readonly TestMultipleExtensionRanges defaultInstance = new TestMultipleExtensionRanges().MakeReadOnly(); - private static readonly string[] _testMultipleExtensionRangesFieldNames = new string[] { }; - private static readonly uint[] _testMultipleExtensionRangesFieldTags = new uint[] { }; - public static TestMultipleExtensionRanges DefaultInstance { - get { return defaultInstance; } - } - - public override TestMultipleExtensionRanges DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestMultipleExtensionRanges ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestMultipleExtensionRanges__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestMultipleExtensionRanges__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testMultipleExtensionRangesFieldNames; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - extensionWriter.WriteUntil(43, output); - extensionWriter.WriteUntil(4244, output); - extensionWriter.WriteUntil(536870912, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestMultipleExtensionRanges ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestMultipleExtensionRanges ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestMultipleExtensionRanges ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestMultipleExtensionRanges ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestMultipleExtensionRanges ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestMultipleExtensionRanges ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestMultipleExtensionRanges ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestMultipleExtensionRanges ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestMultipleExtensionRanges ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestMultipleExtensionRanges ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestMultipleExtensionRanges MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestMultipleExtensionRanges prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestMultipleExtensionRanges cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestMultipleExtensionRanges result; - - private TestMultipleExtensionRanges PrepareBuilder() { - if (resultIsReadOnly) { - TestMultipleExtensionRanges original = result; - result = new TestMultipleExtensionRanges(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestMultipleExtensionRanges MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestMultipleExtensionRanges.Descriptor; } - } - - public override TestMultipleExtensionRanges DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestMultipleExtensionRanges.DefaultInstance; } - } - - public override TestMultipleExtensionRanges BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestMultipleExtensionRanges) { - return MergeFrom((TestMultipleExtensionRanges) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestMultipleExtensionRanges other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestMultipleExtensionRanges.DefaultInstance) return this; - PrepareBuilder(); - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testMultipleExtensionRangesFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testMultipleExtensionRangesFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static TestMultipleExtensionRanges() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestReallyLargeTagNumber : pb::GeneratedMessage { - private TestReallyLargeTagNumber() { } - private static readonly TestReallyLargeTagNumber defaultInstance = new TestReallyLargeTagNumber().MakeReadOnly(); - private static readonly string[] _testReallyLargeTagNumberFieldNames = new string[] { "a", "bb" }; - private static readonly uint[] _testReallyLargeTagNumberFieldTags = new uint[] { 8, 2147483640 }; - public static TestReallyLargeTagNumber DefaultInstance { - get { return defaultInstance; } - } - - public override TestReallyLargeTagNumber DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestReallyLargeTagNumber ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestReallyLargeTagNumber__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestReallyLargeTagNumber__FieldAccessorTable; } - } - - public const int AFieldNumber = 1; - private bool hasA; - private int a_; - public bool HasA { - get { return hasA; } - } - public int A { - get { return a_; } - } - - public const int BbFieldNumber = 268435455; - private bool hasBb; - private int bb_; - public bool HasBb { - get { return hasBb; } - } - public int Bb { - get { return bb_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testReallyLargeTagNumberFieldNames; - if (hasA) { - output.WriteInt32(1, field_names[0], A); - } - if (hasBb) { - output.WriteInt32(268435455, field_names[1], Bb); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA) { - size += pb::CodedOutputStream.ComputeInt32Size(1, A); - } - if (hasBb) { - size += pb::CodedOutputStream.ComputeInt32Size(268435455, Bb); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestReallyLargeTagNumber ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestReallyLargeTagNumber ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestReallyLargeTagNumber ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestReallyLargeTagNumber ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestReallyLargeTagNumber ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestReallyLargeTagNumber ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestReallyLargeTagNumber ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestReallyLargeTagNumber ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestReallyLargeTagNumber ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestReallyLargeTagNumber ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestReallyLargeTagNumber MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestReallyLargeTagNumber prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestReallyLargeTagNumber cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestReallyLargeTagNumber result; - - private TestReallyLargeTagNumber PrepareBuilder() { - if (resultIsReadOnly) { - TestReallyLargeTagNumber original = result; - result = new TestReallyLargeTagNumber(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestReallyLargeTagNumber MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestReallyLargeTagNumber.Descriptor; } - } - - public override TestReallyLargeTagNumber DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestReallyLargeTagNumber.DefaultInstance; } - } - - public override TestReallyLargeTagNumber BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestReallyLargeTagNumber) { - return MergeFrom((TestReallyLargeTagNumber) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestReallyLargeTagNumber other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestReallyLargeTagNumber.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA) { - A = other.A; - } - if (other.HasBb) { - Bb = other.Bb; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testReallyLargeTagNumberFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testReallyLargeTagNumberFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasA = input.ReadInt32(ref result.a_); - break; - } - case 2147483640: { - result.hasBb = input.ReadInt32(ref result.bb_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasA { - get { return result.hasA; } - } - public int A { - get { return result.A; } - set { SetA(value); } - } - public Builder SetA(int value) { - PrepareBuilder(); - result.hasA = true; - result.a_ = value; - return this; - } - public Builder ClearA() { - PrepareBuilder(); - result.hasA = false; - result.a_ = 0; - return this; - } - - public bool HasBb { - get { return result.hasBb; } - } - public int Bb { - get { return result.Bb; } - set { SetBb(value); } - } - public Builder SetBb(int value) { - PrepareBuilder(); - result.hasBb = true; - result.bb_ = value; - return this; - } - public Builder ClearBb() { - PrepareBuilder(); - result.hasBb = false; - result.bb_ = 0; - return this; - } - } - static TestReallyLargeTagNumber() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestRecursiveMessage : pb::GeneratedMessage { - private TestRecursiveMessage() { } - private static readonly TestRecursiveMessage defaultInstance = new TestRecursiveMessage().MakeReadOnly(); - private static readonly string[] _testRecursiveMessageFieldNames = new string[] { "a", "i" }; - private static readonly uint[] _testRecursiveMessageFieldTags = new uint[] { 10, 16 }; - public static TestRecursiveMessage DefaultInstance { - get { return defaultInstance; } - } - - public override TestRecursiveMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestRecursiveMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestRecursiveMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestRecursiveMessage__FieldAccessorTable; } - } - - public const int AFieldNumber = 1; - private bool hasA; - private global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage a_; - public bool HasA { - get { return hasA; } - } - public global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage A { - get { return a_ ?? global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.DefaultInstance; } - } - - public const int IFieldNumber = 2; - private bool hasI; - private int i_; - public bool HasI { - get { return hasI; } - } - public int I { - get { return i_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testRecursiveMessageFieldNames; - if (hasA) { - output.WriteMessage(1, field_names[0], A); - } - if (hasI) { - output.WriteInt32(2, field_names[1], I); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA) { - size += pb::CodedOutputStream.ComputeMessageSize(1, A); - } - if (hasI) { - size += pb::CodedOutputStream.ComputeInt32Size(2, I); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestRecursiveMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestRecursiveMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestRecursiveMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestRecursiveMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestRecursiveMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestRecursiveMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestRecursiveMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestRecursiveMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestRecursiveMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestRecursiveMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestRecursiveMessage MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestRecursiveMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestRecursiveMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestRecursiveMessage result; - - private TestRecursiveMessage PrepareBuilder() { - if (resultIsReadOnly) { - TestRecursiveMessage original = result; - result = new TestRecursiveMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestRecursiveMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.Descriptor; } - } - - public override TestRecursiveMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.DefaultInstance; } - } - - public override TestRecursiveMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestRecursiveMessage) { - return MergeFrom((TestRecursiveMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestRecursiveMessage other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA) { - MergeA(other.A); - } - if (other.HasI) { - I = other.I; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testRecursiveMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testRecursiveMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.CreateBuilder(); - if (result.hasA) { - subBuilder.MergeFrom(A); - } - input.ReadMessage(subBuilder, extensionRegistry); - A = subBuilder.BuildPartial(); - break; - } - case 16: { - result.hasI = input.ReadInt32(ref result.i_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasA { - get { return result.hasA; } - } - public global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage A { - get { return result.A; } - set { SetA(value); } - } - public Builder SetA(global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasA = true; - result.a_ = value; - return this; - } - public Builder SetA(global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasA = true; - result.a_ = builderForValue.Build(); - return this; - } - public Builder MergeA(global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasA && - result.a_ != global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.DefaultInstance) { - result.a_ = global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.CreateBuilder(result.a_).MergeFrom(value).BuildPartial(); - } else { - result.a_ = value; - } - result.hasA = true; - return this; - } - public Builder ClearA() { - PrepareBuilder(); - result.hasA = false; - result.a_ = null; - return this; - } - - public bool HasI { - get { return result.hasI; } - } - public int I { - get { return result.I; } - set { SetI(value); } - } - public Builder SetI(int value) { - PrepareBuilder(); - result.hasI = true; - result.i_ = value; - return this; - } - public Builder ClearI() { - PrepareBuilder(); - result.hasI = false; - result.i_ = 0; - return this; - } - } - static TestRecursiveMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestMutualRecursionA : pb::GeneratedMessage { - private TestMutualRecursionA() { } - private static readonly TestMutualRecursionA defaultInstance = new TestMutualRecursionA().MakeReadOnly(); - private static readonly string[] _testMutualRecursionAFieldNames = new string[] { "bb" }; - private static readonly uint[] _testMutualRecursionAFieldTags = new uint[] { 10 }; - public static TestMutualRecursionA DefaultInstance { - get { return defaultInstance; } - } - - public override TestMutualRecursionA DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestMutualRecursionA ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestMutualRecursionA__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestMutualRecursionA__FieldAccessorTable; } - } - - public const int BbFieldNumber = 1; - private bool hasBb; - private global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB bb_; - public bool HasBb { - get { return hasBb; } - } - public global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB Bb { - get { return bb_ ?? global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.DefaultInstance; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testMutualRecursionAFieldNames; - if (hasBb) { - output.WriteMessage(1, field_names[0], Bb); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasBb) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Bb); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestMutualRecursionA ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestMutualRecursionA ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestMutualRecursionA ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestMutualRecursionA ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestMutualRecursionA ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestMutualRecursionA ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestMutualRecursionA ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestMutualRecursionA ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestMutualRecursionA ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestMutualRecursionA ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestMutualRecursionA MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestMutualRecursionA prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestMutualRecursionA cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestMutualRecursionA result; - - private TestMutualRecursionA PrepareBuilder() { - if (resultIsReadOnly) { - TestMutualRecursionA original = result; - result = new TestMutualRecursionA(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestMutualRecursionA MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.Descriptor; } - } - - public override TestMutualRecursionA DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.DefaultInstance; } - } - - public override TestMutualRecursionA BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestMutualRecursionA) { - return MergeFrom((TestMutualRecursionA) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestMutualRecursionA other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasBb) { - MergeBb(other.Bb); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testMutualRecursionAFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testMutualRecursionAFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.CreateBuilder(); - if (result.hasBb) { - subBuilder.MergeFrom(Bb); - } - input.ReadMessage(subBuilder, extensionRegistry); - Bb = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasBb { - get { return result.hasBb; } - } - public global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB Bb { - get { return result.Bb; } - set { SetBb(value); } - } - public Builder SetBb(global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasBb = true; - result.bb_ = value; - return this; - } - public Builder SetBb(global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasBb = true; - result.bb_ = builderForValue.Build(); - return this; - } - public Builder MergeBb(global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasBb && - result.bb_ != global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.DefaultInstance) { - result.bb_ = global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.CreateBuilder(result.bb_).MergeFrom(value).BuildPartial(); - } else { - result.bb_ = value; - } - result.hasBb = true; - return this; - } - public Builder ClearBb() { - PrepareBuilder(); - result.hasBb = false; - result.bb_ = null; - return this; - } - } - static TestMutualRecursionA() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestMutualRecursionB : pb::GeneratedMessage { - private TestMutualRecursionB() { } - private static readonly TestMutualRecursionB defaultInstance = new TestMutualRecursionB().MakeReadOnly(); - private static readonly string[] _testMutualRecursionBFieldNames = new string[] { "a", "optional_int32" }; - private static readonly uint[] _testMutualRecursionBFieldTags = new uint[] { 10, 16 }; - public static TestMutualRecursionB DefaultInstance { - get { return defaultInstance; } - } - - public override TestMutualRecursionB DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestMutualRecursionB ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestMutualRecursionB__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestMutualRecursionB__FieldAccessorTable; } - } - - public const int AFieldNumber = 1; - private bool hasA; - private global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA a_; - public bool HasA { - get { return hasA; } - } - public global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA A { - get { return a_ ?? global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.DefaultInstance; } - } - - public const int OptionalInt32FieldNumber = 2; - private bool hasOptionalInt32; - private int optionalInt32_; - public bool HasOptionalInt32 { - get { return hasOptionalInt32; } - } - public int OptionalInt32 { - get { return optionalInt32_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testMutualRecursionBFieldNames; - if (hasA) { - output.WriteMessage(1, field_names[0], A); - } - if (hasOptionalInt32) { - output.WriteInt32(2, field_names[1], OptionalInt32); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA) { - size += pb::CodedOutputStream.ComputeMessageSize(1, A); - } - if (hasOptionalInt32) { - size += pb::CodedOutputStream.ComputeInt32Size(2, OptionalInt32); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestMutualRecursionB ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestMutualRecursionB ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestMutualRecursionB ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestMutualRecursionB ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestMutualRecursionB ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestMutualRecursionB ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestMutualRecursionB ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestMutualRecursionB ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestMutualRecursionB ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestMutualRecursionB ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestMutualRecursionB MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestMutualRecursionB prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestMutualRecursionB cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestMutualRecursionB result; - - private TestMutualRecursionB PrepareBuilder() { - if (resultIsReadOnly) { - TestMutualRecursionB original = result; - result = new TestMutualRecursionB(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestMutualRecursionB MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.Descriptor; } - } - - public override TestMutualRecursionB DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.DefaultInstance; } - } - - public override TestMutualRecursionB BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestMutualRecursionB) { - return MergeFrom((TestMutualRecursionB) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestMutualRecursionB other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA) { - MergeA(other.A); - } - if (other.HasOptionalInt32) { - OptionalInt32 = other.OptionalInt32; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testMutualRecursionBFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testMutualRecursionBFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.CreateBuilder(); - if (result.hasA) { - subBuilder.MergeFrom(A); - } - input.ReadMessage(subBuilder, extensionRegistry); - A = subBuilder.BuildPartial(); - break; - } - case 16: { - result.hasOptionalInt32 = input.ReadInt32(ref result.optionalInt32_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasA { - get { return result.hasA; } - } - public global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA A { - get { return result.A; } - set { SetA(value); } - } - public Builder SetA(global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasA = true; - result.a_ = value; - return this; - } - public Builder SetA(global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasA = true; - result.a_ = builderForValue.Build(); - return this; - } - public Builder MergeA(global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasA && - result.a_ != global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.DefaultInstance) { - result.a_ = global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.CreateBuilder(result.a_).MergeFrom(value).BuildPartial(); - } else { - result.a_ = value; - } - result.hasA = true; - return this; - } - public Builder ClearA() { - PrepareBuilder(); - result.hasA = false; - result.a_ = null; - return this; - } - - public bool HasOptionalInt32 { - get { return result.hasOptionalInt32; } - } - public int OptionalInt32 { - get { return result.OptionalInt32; } - set { SetOptionalInt32(value); } - } - public Builder SetOptionalInt32(int value) { - PrepareBuilder(); - result.hasOptionalInt32 = true; - result.optionalInt32_ = value; - return this; - } - public Builder ClearOptionalInt32() { - PrepareBuilder(); - result.hasOptionalInt32 = false; - result.optionalInt32_ = 0; - return this; - } - } - static TestMutualRecursionB() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestDupFieldNumber : pb::GeneratedMessage { - private TestDupFieldNumber() { } - private static readonly TestDupFieldNumber defaultInstance = new TestDupFieldNumber().MakeReadOnly(); - private static readonly string[] _testDupFieldNumberFieldNames = new string[] { "a", "bar", "foo" }; - private static readonly uint[] _testDupFieldNumberFieldTags = new uint[] { 8, 27, 19 }; - public static TestDupFieldNumber DefaultInstance { - get { return defaultInstance; } - } - - public override TestDupFieldNumber DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestDupFieldNumber ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDupFieldNumber__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDupFieldNumber__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Foo : pb::GeneratedMessage { - private Foo() { } - private static readonly Foo defaultInstance = new Foo().MakeReadOnly(); - private static readonly string[] _fooFieldNames = new string[] { "a" }; - private static readonly uint[] _fooFieldTags = new uint[] { 8 }; - public static Foo DefaultInstance { - get { return defaultInstance; } - } - - public override Foo DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override Foo ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDupFieldNumber_Foo__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDupFieldNumber_Foo__FieldAccessorTable; } - } - - public const int AFieldNumber = 1; - private bool hasA; - private int a_; - public bool HasA { - get { return hasA; } - } - public int A { - get { return a_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _fooFieldNames; - if (hasA) { - output.WriteInt32(1, field_names[0], A); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA) { - size += pb::CodedOutputStream.ComputeInt32Size(1, A); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static Foo ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Foo ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Foo ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Foo ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Foo ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Foo ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Foo ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Foo ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Foo ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Foo ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private Foo MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Foo prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(Foo cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private Foo result; - - private Foo PrepareBuilder() { - if (resultIsReadOnly) { - Foo original = result; - result = new Foo(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override Foo MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.Descriptor; } - } - - public override Foo DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.DefaultInstance; } - } - - public override Foo BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Foo) { - return MergeFrom((Foo) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Foo other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA) { - A = other.A; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_fooFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _fooFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasA = input.ReadInt32(ref result.a_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasA { - get { return result.hasA; } - } - public int A { - get { return result.A; } - set { SetA(value); } - } - public Builder SetA(int value) { - PrepareBuilder(); - result.hasA = true; - result.a_ = value; - return this; - } - public Builder ClearA() { - PrepareBuilder(); - result.hasA = false; - result.a_ = 0; - return this; - } - } - static Foo() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Bar : pb::GeneratedMessage { - private Bar() { } - private static readonly Bar defaultInstance = new Bar().MakeReadOnly(); - private static readonly string[] _barFieldNames = new string[] { "a" }; - private static readonly uint[] _barFieldTags = new uint[] { 8 }; - public static Bar DefaultInstance { - get { return defaultInstance; } - } - - public override Bar DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override Bar ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDupFieldNumber_Bar__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDupFieldNumber_Bar__FieldAccessorTable; } - } - - public const int AFieldNumber = 1; - private bool hasA; - private int a_; - public bool HasA { - get { return hasA; } - } - public int A { - get { return a_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _barFieldNames; - if (hasA) { - output.WriteInt32(1, field_names[0], A); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA) { - size += pb::CodedOutputStream.ComputeInt32Size(1, A); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static Bar ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Bar ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Bar ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Bar ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Bar ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Bar ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Bar ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Bar ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Bar ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Bar ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private Bar MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Bar prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(Bar cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private Bar result; - - private Bar PrepareBuilder() { - if (resultIsReadOnly) { - Bar original = result; - result = new Bar(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override Bar MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.Descriptor; } - } - - public override Bar DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.DefaultInstance; } - } - - public override Bar BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Bar) { - return MergeFrom((Bar) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Bar other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA) { - A = other.A; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_barFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _barFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasA = input.ReadInt32(ref result.a_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasA { - get { return result.hasA; } - } - public int A { - get { return result.A; } - set { SetA(value); } - } - public Builder SetA(int value) { - PrepareBuilder(); - result.hasA = true; - result.a_ = value; - return this; - } - public Builder ClearA() { - PrepareBuilder(); - result.hasA = false; - result.a_ = 0; - return this; - } - } - static Bar() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - } - #endregion - - public const int AFieldNumber = 1; - private bool hasA; - private int a_; - public bool HasA { - get { return hasA; } - } - public int A { - get { return a_; } - } - - public const int FooFieldNumber = 2; - private bool hasFoo; - private global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo foo_; - public bool HasFoo { - get { return hasFoo; } - } - public global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo Foo { - get { return foo_ ?? global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.DefaultInstance; } - } - - public const int BarFieldNumber = 3; - private bool hasBar; - private global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar bar_; - public bool HasBar { - get { return hasBar; } - } - public global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar Bar { - get { return bar_ ?? global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.DefaultInstance; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testDupFieldNumberFieldNames; - if (hasA) { - output.WriteInt32(1, field_names[0], A); - } - if (hasFoo) { - output.WriteGroup(2, field_names[2], Foo); - } - if (hasBar) { - output.WriteGroup(3, field_names[1], Bar); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA) { - size += pb::CodedOutputStream.ComputeInt32Size(1, A); - } - if (hasFoo) { - size += pb::CodedOutputStream.ComputeGroupSize(2, Foo); - } - if (hasBar) { - size += pb::CodedOutputStream.ComputeGroupSize(3, Bar); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestDupFieldNumber ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestDupFieldNumber ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestDupFieldNumber ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestDupFieldNumber ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestDupFieldNumber ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestDupFieldNumber ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestDupFieldNumber ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestDupFieldNumber ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestDupFieldNumber ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestDupFieldNumber ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestDupFieldNumber MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestDupFieldNumber prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestDupFieldNumber cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestDupFieldNumber result; - - private TestDupFieldNumber PrepareBuilder() { - if (resultIsReadOnly) { - TestDupFieldNumber original = result; - result = new TestDupFieldNumber(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestDupFieldNumber MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Descriptor; } - } - - public override TestDupFieldNumber DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.DefaultInstance; } - } - - public override TestDupFieldNumber BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestDupFieldNumber) { - return MergeFrom((TestDupFieldNumber) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestDupFieldNumber other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA) { - A = other.A; - } - if (other.HasFoo) { - MergeFoo(other.Foo); - } - if (other.HasBar) { - MergeBar(other.Bar); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testDupFieldNumberFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testDupFieldNumberFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasA = input.ReadInt32(ref result.a_); - break; - } - case 19: { - global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.CreateBuilder(); - if (result.hasFoo) { - subBuilder.MergeFrom(Foo); - } - input.ReadGroup(2, subBuilder, extensionRegistry); - Foo = subBuilder.BuildPartial(); - break; - } - case 27: { - global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.CreateBuilder(); - if (result.hasBar) { - subBuilder.MergeFrom(Bar); - } - input.ReadGroup(3, subBuilder, extensionRegistry); - Bar = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasA { - get { return result.hasA; } - } - public int A { - get { return result.A; } - set { SetA(value); } - } - public Builder SetA(int value) { - PrepareBuilder(); - result.hasA = true; - result.a_ = value; - return this; - } - public Builder ClearA() { - PrepareBuilder(); - result.hasA = false; - result.a_ = 0; - return this; - } - - public bool HasFoo { - get { return result.hasFoo; } - } - public global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo Foo { - get { return result.Foo; } - set { SetFoo(value); } - } - public Builder SetFoo(global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasFoo = true; - result.foo_ = value; - return this; - } - public Builder SetFoo(global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasFoo = true; - result.foo_ = builderForValue.Build(); - return this; - } - public Builder MergeFoo(global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasFoo && - result.foo_ != global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.DefaultInstance) { - result.foo_ = global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.CreateBuilder(result.foo_).MergeFrom(value).BuildPartial(); - } else { - result.foo_ = value; - } - result.hasFoo = true; - return this; - } - public Builder ClearFoo() { - PrepareBuilder(); - result.hasFoo = false; - result.foo_ = null; - return this; - } - - public bool HasBar { - get { return result.hasBar; } - } - public global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar Bar { - get { return result.Bar; } - set { SetBar(value); } - } - public Builder SetBar(global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasBar = true; - result.bar_ = value; - return this; - } - public Builder SetBar(global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasBar = true; - result.bar_ = builderForValue.Build(); - return this; - } - public Builder MergeBar(global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasBar && - result.bar_ != global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.DefaultInstance) { - result.bar_ = global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.CreateBuilder(result.bar_).MergeFrom(value).BuildPartial(); - } else { - result.bar_ = value; - } - result.hasBar = true; - return this; - } - public Builder ClearBar() { - PrepareBuilder(); - result.hasBar = false; - result.bar_ = null; - return this; - } - } - static TestDupFieldNumber() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestNestedMessageHasBits : pb::GeneratedMessage { - private TestNestedMessageHasBits() { } - private static readonly TestNestedMessageHasBits defaultInstance = new TestNestedMessageHasBits().MakeReadOnly(); - private static readonly string[] _testNestedMessageHasBitsFieldNames = new string[] { "optional_nested_message" }; - private static readonly uint[] _testNestedMessageHasBitsFieldTags = new uint[] { 10 }; - public static TestNestedMessageHasBits DefaultInstance { - get { return defaultInstance; } - } - - public override TestNestedMessageHasBits DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestNestedMessageHasBits ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestNestedMessageHasBits__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestNestedMessageHasBits__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class NestedMessage : pb::GeneratedMessage { - private NestedMessage() { } - private static readonly NestedMessage defaultInstance = new NestedMessage().MakeReadOnly(); - private static readonly string[] _nestedMessageFieldNames = new string[] { "nestedmessage_repeated_foreignmessage", "nestedmessage_repeated_int32" }; - private static readonly uint[] _nestedMessageFieldTags = new uint[] { 18, 8 }; - public static NestedMessage DefaultInstance { - get { return defaultInstance; } - } - - public override NestedMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override NestedMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestNestedMessageHasBits_NestedMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestNestedMessageHasBits_NestedMessage__FieldAccessorTable; } - } - - public const int NestedmessageRepeatedInt32FieldNumber = 1; - private pbc::PopsicleList nestedmessageRepeatedInt32_ = new pbc::PopsicleList(); - public scg::IList NestedmessageRepeatedInt32List { - get { return pbc::Lists.AsReadOnly(nestedmessageRepeatedInt32_); } - } - public int NestedmessageRepeatedInt32Count { - get { return nestedmessageRepeatedInt32_.Count; } - } - public int GetNestedmessageRepeatedInt32(int index) { - return nestedmessageRepeatedInt32_[index]; - } - - public const int NestedmessageRepeatedForeignmessageFieldNumber = 2; - private pbc::PopsicleList nestedmessageRepeatedForeignmessage_ = new pbc::PopsicleList(); - public scg::IList NestedmessageRepeatedForeignmessageList { - get { return nestedmessageRepeatedForeignmessage_; } - } - public int NestedmessageRepeatedForeignmessageCount { - get { return nestedmessageRepeatedForeignmessage_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage GetNestedmessageRepeatedForeignmessage(int index) { - return nestedmessageRepeatedForeignmessage_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _nestedMessageFieldNames; - if (nestedmessageRepeatedInt32_.Count > 0) { - output.WriteInt32Array(1, field_names[1], nestedmessageRepeatedInt32_); - } - if (nestedmessageRepeatedForeignmessage_.Count > 0) { - output.WriteMessageArray(2, field_names[0], nestedmessageRepeatedForeignmessage_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - foreach (int element in NestedmessageRepeatedInt32List) { - dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); - } - size += dataSize; - size += 1 * nestedmessageRepeatedInt32_.Count; - } - foreach (global::Google.ProtocolBuffers.TestProtos.ForeignMessage element in NestedmessageRepeatedForeignmessageList) { - size += pb::CodedOutputStream.ComputeMessageSize(2, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static NestedMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NestedMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NestedMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NestedMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NestedMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NestedMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static NestedMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NestedMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private NestedMessage MakeReadOnly() { - nestedmessageRepeatedInt32_.MakeReadOnly(); - nestedmessageRepeatedForeignmessage_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(NestedMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(NestedMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private NestedMessage result; - - private NestedMessage PrepareBuilder() { - if (resultIsReadOnly) { - NestedMessage original = result; - result = new NestedMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override NestedMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.Descriptor; } - } - - public override NestedMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.DefaultInstance; } - } - - public override NestedMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is NestedMessage) { - return MergeFrom((NestedMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(NestedMessage other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.nestedmessageRepeatedInt32_.Count != 0) { - result.nestedmessageRepeatedInt32_.Add(other.nestedmessageRepeatedInt32_); - } - if (other.nestedmessageRepeatedForeignmessage_.Count != 0) { - result.nestedmessageRepeatedForeignmessage_.Add(other.nestedmessageRepeatedForeignmessage_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_nestedMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _nestedMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: - case 8: { - input.ReadInt32Array(tag, field_name, result.nestedmessageRepeatedInt32_); - break; - } - case 18: { - input.ReadMessageArray(tag, field_name, result.nestedmessageRepeatedForeignmessage_, global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance, extensionRegistry); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public pbc::IPopsicleList NestedmessageRepeatedInt32List { - get { return PrepareBuilder().nestedmessageRepeatedInt32_; } - } - public int NestedmessageRepeatedInt32Count { - get { return result.NestedmessageRepeatedInt32Count; } - } - public int GetNestedmessageRepeatedInt32(int index) { - return result.GetNestedmessageRepeatedInt32(index); - } - public Builder SetNestedmessageRepeatedInt32(int index, int value) { - PrepareBuilder(); - result.nestedmessageRepeatedInt32_[index] = value; - return this; - } - public Builder AddNestedmessageRepeatedInt32(int value) { - PrepareBuilder(); - result.nestedmessageRepeatedInt32_.Add(value); - return this; - } - public Builder AddRangeNestedmessageRepeatedInt32(scg::IEnumerable values) { - PrepareBuilder(); - result.nestedmessageRepeatedInt32_.Add(values); - return this; - } - public Builder ClearNestedmessageRepeatedInt32() { - PrepareBuilder(); - result.nestedmessageRepeatedInt32_.Clear(); - return this; - } - - public pbc::IPopsicleList NestedmessageRepeatedForeignmessageList { - get { return PrepareBuilder().nestedmessageRepeatedForeignmessage_; } - } - public int NestedmessageRepeatedForeignmessageCount { - get { return result.NestedmessageRepeatedForeignmessageCount; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage GetNestedmessageRepeatedForeignmessage(int index) { - return result.GetNestedmessageRepeatedForeignmessage(index); - } - public Builder SetNestedmessageRepeatedForeignmessage(int index, global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.nestedmessageRepeatedForeignmessage_[index] = value; - return this; - } - public Builder SetNestedmessageRepeatedForeignmessage(int index, global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.nestedmessageRepeatedForeignmessage_[index] = builderForValue.Build(); - return this; - } - public Builder AddNestedmessageRepeatedForeignmessage(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.nestedmessageRepeatedForeignmessage_.Add(value); - return this; - } - public Builder AddNestedmessageRepeatedForeignmessage(global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.nestedmessageRepeatedForeignmessage_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeNestedmessageRepeatedForeignmessage(scg::IEnumerable values) { - PrepareBuilder(); - result.nestedmessageRepeatedForeignmessage_.Add(values); - return this; - } - public Builder ClearNestedmessageRepeatedForeignmessage() { - PrepareBuilder(); - result.nestedmessageRepeatedForeignmessage_.Clear(); - return this; - } - } - static NestedMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - } - #endregion - - public const int OptionalNestedMessageFieldNumber = 1; - private bool hasOptionalNestedMessage; - private global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage optionalNestedMessage_; - public bool HasOptionalNestedMessage { - get { return hasOptionalNestedMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage OptionalNestedMessage { - get { return optionalNestedMessage_ ?? global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.DefaultInstance; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testNestedMessageHasBitsFieldNames; - if (hasOptionalNestedMessage) { - output.WriteMessage(1, field_names[0], OptionalNestedMessage); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasOptionalNestedMessage) { - size += pb::CodedOutputStream.ComputeMessageSize(1, OptionalNestedMessage); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestNestedMessageHasBits ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestNestedMessageHasBits ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestNestedMessageHasBits ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestNestedMessageHasBits ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestNestedMessageHasBits ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestNestedMessageHasBits ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestNestedMessageHasBits ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestNestedMessageHasBits ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestNestedMessageHasBits ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestNestedMessageHasBits ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestNestedMessageHasBits MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestNestedMessageHasBits prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestNestedMessageHasBits cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestNestedMessageHasBits result; - - private TestNestedMessageHasBits PrepareBuilder() { - if (resultIsReadOnly) { - TestNestedMessageHasBits original = result; - result = new TestNestedMessageHasBits(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestNestedMessageHasBits MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Descriptor; } - } - - public override TestNestedMessageHasBits DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.DefaultInstance; } - } - - public override TestNestedMessageHasBits BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestNestedMessageHasBits) { - return MergeFrom((TestNestedMessageHasBits) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestNestedMessageHasBits other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasOptionalNestedMessage) { - MergeOptionalNestedMessage(other.OptionalNestedMessage); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testNestedMessageHasBitsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testNestedMessageHasBitsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.CreateBuilder(); - if (result.hasOptionalNestedMessage) { - subBuilder.MergeFrom(OptionalNestedMessage); - } - input.ReadMessage(subBuilder, extensionRegistry); - OptionalNestedMessage = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasOptionalNestedMessage { - get { return result.hasOptionalNestedMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage OptionalNestedMessage { - get { return result.OptionalNestedMessage; } - set { SetOptionalNestedMessage(value); } - } - public Builder SetOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalNestedMessage = true; - result.optionalNestedMessage_ = value; - return this; - } - public Builder SetOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptionalNestedMessage = true; - result.optionalNestedMessage_ = builderForValue.Build(); - return this; - } - public Builder MergeOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptionalNestedMessage && - result.optionalNestedMessage_ != global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.DefaultInstance) { - result.optionalNestedMessage_ = global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.CreateBuilder(result.optionalNestedMessage_).MergeFrom(value).BuildPartial(); - } else { - result.optionalNestedMessage_ = value; - } - result.hasOptionalNestedMessage = true; - return this; - } - public Builder ClearOptionalNestedMessage() { - PrepareBuilder(); - result.hasOptionalNestedMessage = false; - result.optionalNestedMessage_ = null; - return this; - } - } - static TestNestedMessageHasBits() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestCamelCaseFieldNames : pb::GeneratedMessage { - private TestCamelCaseFieldNames() { } - private static readonly TestCamelCaseFieldNames defaultInstance = new TestCamelCaseFieldNames().MakeReadOnly(); - private static readonly string[] _testCamelCaseFieldNamesFieldNames = new string[] { "CordField", "EnumField", "MessageField", "PrimitiveField", "RepeatedCordField", "RepeatedEnumField", "RepeatedMessageField", "RepeatedPrimitiveField", "RepeatedStringField", "RepeatedStringPieceField", "StringField", "StringPieceField" }; - private static readonly uint[] _testCamelCaseFieldNamesFieldTags = new uint[] { 50, 24, 34, 8, 98, 72, 82, 56, 66, 90, 18, 42 }; - public static TestCamelCaseFieldNames DefaultInstance { - get { return defaultInstance; } - } - - public override TestCamelCaseFieldNames DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestCamelCaseFieldNames ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestCamelCaseFieldNames__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestCamelCaseFieldNames__FieldAccessorTable; } - } - - public const int PrimitiveFieldFieldNumber = 1; - private bool hasPrimitiveField; - private int primitiveField_; - public bool HasPrimitiveField { - get { return hasPrimitiveField; } - } - public int PrimitiveField { - get { return primitiveField_; } - } - - public const int StringFieldFieldNumber = 2; - private bool hasStringField; - private string stringField_ = ""; - public bool HasStringField { - get { return hasStringField; } - } - public string StringField { - get { return stringField_; } - } - - public const int EnumFieldFieldNumber = 3; - private bool hasEnumField; - private global::Google.ProtocolBuffers.TestProtos.ForeignEnum enumField_ = global::Google.ProtocolBuffers.TestProtos.ForeignEnum.FOREIGN_FOO; - public bool HasEnumField { - get { return hasEnumField; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum EnumField { - get { return enumField_; } - } - - public const int MessageFieldFieldNumber = 4; - private bool hasMessageField; - private global::Google.ProtocolBuffers.TestProtos.ForeignMessage messageField_; - public bool HasMessageField { - get { return hasMessageField; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage MessageField { - get { return messageField_ ?? global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance; } - } - - public const int StringPieceFieldFieldNumber = 5; - private bool hasStringPieceField; - private string stringPieceField_ = ""; - public bool HasStringPieceField { - get { return hasStringPieceField; } - } - public string StringPieceField { - get { return stringPieceField_; } - } - - public const int CordFieldFieldNumber = 6; - private bool hasCordField; - private string cordField_ = ""; - public bool HasCordField { - get { return hasCordField; } - } - public string CordField { - get { return cordField_; } - } - - public const int RepeatedPrimitiveFieldFieldNumber = 7; - private pbc::PopsicleList repeatedPrimitiveField_ = new pbc::PopsicleList(); - public scg::IList RepeatedPrimitiveFieldList { - get { return pbc::Lists.AsReadOnly(repeatedPrimitiveField_); } - } - public int RepeatedPrimitiveFieldCount { - get { return repeatedPrimitiveField_.Count; } - } - public int GetRepeatedPrimitiveField(int index) { - return repeatedPrimitiveField_[index]; - } - - public const int RepeatedStringFieldFieldNumber = 8; - private pbc::PopsicleList repeatedStringField_ = new pbc::PopsicleList(); - public scg::IList RepeatedStringFieldList { - get { return pbc::Lists.AsReadOnly(repeatedStringField_); } - } - public int RepeatedStringFieldCount { - get { return repeatedStringField_.Count; } - } - public string GetRepeatedStringField(int index) { - return repeatedStringField_[index]; - } - - public const int RepeatedEnumFieldFieldNumber = 9; - private pbc::PopsicleList repeatedEnumField_ = new pbc::PopsicleList(); - public scg::IList RepeatedEnumFieldList { - get { return pbc::Lists.AsReadOnly(repeatedEnumField_); } - } - public int RepeatedEnumFieldCount { - get { return repeatedEnumField_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum GetRepeatedEnumField(int index) { - return repeatedEnumField_[index]; - } - - public const int RepeatedMessageFieldFieldNumber = 10; - private pbc::PopsicleList repeatedMessageField_ = new pbc::PopsicleList(); - public scg::IList RepeatedMessageFieldList { - get { return repeatedMessageField_; } - } - public int RepeatedMessageFieldCount { - get { return repeatedMessageField_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage GetRepeatedMessageField(int index) { - return repeatedMessageField_[index]; - } - - public const int RepeatedStringPieceFieldFieldNumber = 11; - private pbc::PopsicleList repeatedStringPieceField_ = new pbc::PopsicleList(); - public scg::IList RepeatedStringPieceFieldList { - get { return pbc::Lists.AsReadOnly(repeatedStringPieceField_); } - } - public int RepeatedStringPieceFieldCount { - get { return repeatedStringPieceField_.Count; } - } - public string GetRepeatedStringPieceField(int index) { - return repeatedStringPieceField_[index]; - } - - public const int RepeatedCordFieldFieldNumber = 12; - private pbc::PopsicleList repeatedCordField_ = new pbc::PopsicleList(); - public scg::IList RepeatedCordFieldList { - get { return pbc::Lists.AsReadOnly(repeatedCordField_); } - } - public int RepeatedCordFieldCount { - get { return repeatedCordField_.Count; } - } - public string GetRepeatedCordField(int index) { - return repeatedCordField_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testCamelCaseFieldNamesFieldNames; - if (hasPrimitiveField) { - output.WriteInt32(1, field_names[3], PrimitiveField); - } - if (hasStringField) { - output.WriteString(2, field_names[10], StringField); - } - if (hasEnumField) { - output.WriteEnum(3, field_names[1], (int) EnumField, EnumField); - } - if (hasMessageField) { - output.WriteMessage(4, field_names[2], MessageField); - } - if (hasStringPieceField) { - output.WriteString(5, field_names[11], StringPieceField); - } - if (hasCordField) { - output.WriteString(6, field_names[0], CordField); - } - if (repeatedPrimitiveField_.Count > 0) { - output.WriteInt32Array(7, field_names[7], repeatedPrimitiveField_); - } - if (repeatedStringField_.Count > 0) { - output.WriteStringArray(8, field_names[8], repeatedStringField_); - } - if (repeatedEnumField_.Count > 0) { - output.WriteEnumArray(9, field_names[5], repeatedEnumField_); - } - if (repeatedMessageField_.Count > 0) { - output.WriteMessageArray(10, field_names[6], repeatedMessageField_); - } - if (repeatedStringPieceField_.Count > 0) { - output.WriteStringArray(11, field_names[9], repeatedStringPieceField_); - } - if (repeatedCordField_.Count > 0) { - output.WriteStringArray(12, field_names[4], repeatedCordField_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasPrimitiveField) { - size += pb::CodedOutputStream.ComputeInt32Size(1, PrimitiveField); - } - if (hasStringField) { - size += pb::CodedOutputStream.ComputeStringSize(2, StringField); - } - if (hasEnumField) { - size += pb::CodedOutputStream.ComputeEnumSize(3, (int) EnumField); - } - if (hasMessageField) { - size += pb::CodedOutputStream.ComputeMessageSize(4, MessageField); - } - if (hasStringPieceField) { - size += pb::CodedOutputStream.ComputeStringSize(5, StringPieceField); - } - if (hasCordField) { - size += pb::CodedOutputStream.ComputeStringSize(6, CordField); - } - { - int dataSize = 0; - foreach (int element in RepeatedPrimitiveFieldList) { - dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); - } - size += dataSize; - size += 1 * repeatedPrimitiveField_.Count; - } - { - int dataSize = 0; - foreach (string element in RepeatedStringFieldList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 1 * repeatedStringField_.Count; - } - { - int dataSize = 0; - if (repeatedEnumField_.Count > 0) { - foreach (global::Google.ProtocolBuffers.TestProtos.ForeignEnum element in repeatedEnumField_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 1 * repeatedEnumField_.Count; - } - } - foreach (global::Google.ProtocolBuffers.TestProtos.ForeignMessage element in RepeatedMessageFieldList) { - size += pb::CodedOutputStream.ComputeMessageSize(10, element); - } - { - int dataSize = 0; - foreach (string element in RepeatedStringPieceFieldList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 1 * repeatedStringPieceField_.Count; - } - { - int dataSize = 0; - foreach (string element in RepeatedCordFieldList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 1 * repeatedCordField_.Count; - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestCamelCaseFieldNames ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestCamelCaseFieldNames ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestCamelCaseFieldNames ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestCamelCaseFieldNames ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestCamelCaseFieldNames ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestCamelCaseFieldNames ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestCamelCaseFieldNames ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestCamelCaseFieldNames ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestCamelCaseFieldNames ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestCamelCaseFieldNames ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestCamelCaseFieldNames MakeReadOnly() { - repeatedPrimitiveField_.MakeReadOnly(); - repeatedStringField_.MakeReadOnly(); - repeatedEnumField_.MakeReadOnly(); - repeatedMessageField_.MakeReadOnly(); - repeatedStringPieceField_.MakeReadOnly(); - repeatedCordField_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestCamelCaseFieldNames prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestCamelCaseFieldNames cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestCamelCaseFieldNames result; - - private TestCamelCaseFieldNames PrepareBuilder() { - if (resultIsReadOnly) { - TestCamelCaseFieldNames original = result; - result = new TestCamelCaseFieldNames(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestCamelCaseFieldNames MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestCamelCaseFieldNames.Descriptor; } - } - - public override TestCamelCaseFieldNames DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestCamelCaseFieldNames.DefaultInstance; } - } - - public override TestCamelCaseFieldNames BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestCamelCaseFieldNames) { - return MergeFrom((TestCamelCaseFieldNames) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestCamelCaseFieldNames other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestCamelCaseFieldNames.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasPrimitiveField) { - PrimitiveField = other.PrimitiveField; - } - if (other.HasStringField) { - StringField = other.StringField; - } - if (other.HasEnumField) { - EnumField = other.EnumField; - } - if (other.HasMessageField) { - MergeMessageField(other.MessageField); - } - if (other.HasStringPieceField) { - StringPieceField = other.StringPieceField; - } - if (other.HasCordField) { - CordField = other.CordField; - } - if (other.repeatedPrimitiveField_.Count != 0) { - result.repeatedPrimitiveField_.Add(other.repeatedPrimitiveField_); - } - if (other.repeatedStringField_.Count != 0) { - result.repeatedStringField_.Add(other.repeatedStringField_); - } - if (other.repeatedEnumField_.Count != 0) { - result.repeatedEnumField_.Add(other.repeatedEnumField_); - } - if (other.repeatedMessageField_.Count != 0) { - result.repeatedMessageField_.Add(other.repeatedMessageField_); - } - if (other.repeatedStringPieceField_.Count != 0) { - result.repeatedStringPieceField_.Add(other.repeatedStringPieceField_); - } - if (other.repeatedCordField_.Count != 0) { - result.repeatedCordField_.Add(other.repeatedCordField_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testCamelCaseFieldNamesFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testCamelCaseFieldNamesFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasPrimitiveField = input.ReadInt32(ref result.primitiveField_); - break; - } - case 18: { - result.hasStringField = input.ReadString(ref result.stringField_); - break; - } - case 24: { - object unknown; - if(input.ReadEnum(ref result.enumField_, out unknown)) { - result.hasEnumField = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(3, (ulong)(int)unknown); - } - break; - } - case 34: { - global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.ForeignMessage.CreateBuilder(); - if (result.hasMessageField) { - subBuilder.MergeFrom(MessageField); - } - input.ReadMessage(subBuilder, extensionRegistry); - MessageField = subBuilder.BuildPartial(); - break; - } - case 42: { - result.hasStringPieceField = input.ReadString(ref result.stringPieceField_); - break; - } - case 50: { - result.hasCordField = input.ReadString(ref result.cordField_); - break; - } - case 58: - case 56: { - input.ReadInt32Array(tag, field_name, result.repeatedPrimitiveField_); - break; - } - case 66: { - input.ReadStringArray(tag, field_name, result.repeatedStringField_); - break; - } - case 74: - case 72: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.repeatedEnumField_, out unknownItems); - if (unknownItems != null) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - foreach (object rawValue in unknownItems) - if (rawValue is int) - unknownFields.MergeVarintField(9, (ulong)(int)rawValue); - } - break; - } - case 82: { - input.ReadMessageArray(tag, field_name, result.repeatedMessageField_, global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance, extensionRegistry); - break; - } - case 90: { - input.ReadStringArray(tag, field_name, result.repeatedStringPieceField_); - break; - } - case 98: { - input.ReadStringArray(tag, field_name, result.repeatedCordField_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasPrimitiveField { - get { return result.hasPrimitiveField; } - } - public int PrimitiveField { - get { return result.PrimitiveField; } - set { SetPrimitiveField(value); } - } - public Builder SetPrimitiveField(int value) { - PrepareBuilder(); - result.hasPrimitiveField = true; - result.primitiveField_ = value; - return this; - } - public Builder ClearPrimitiveField() { - PrepareBuilder(); - result.hasPrimitiveField = false; - result.primitiveField_ = 0; - return this; - } - - public bool HasStringField { - get { return result.hasStringField; } - } - public string StringField { - get { return result.StringField; } - set { SetStringField(value); } - } - public Builder SetStringField(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasStringField = true; - result.stringField_ = value; - return this; - } - public Builder ClearStringField() { - PrepareBuilder(); - result.hasStringField = false; - result.stringField_ = ""; - return this; - } - - public bool HasEnumField { - get { return result.hasEnumField; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum EnumField { - get { return result.EnumField; } - set { SetEnumField(value); } - } - public Builder SetEnumField(global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) { - PrepareBuilder(); - result.hasEnumField = true; - result.enumField_ = value; - return this; - } - public Builder ClearEnumField() { - PrepareBuilder(); - result.hasEnumField = false; - result.enumField_ = global::Google.ProtocolBuffers.TestProtos.ForeignEnum.FOREIGN_FOO; - return this; - } - - public bool HasMessageField { - get { return result.hasMessageField; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage MessageField { - get { return result.MessageField; } - set { SetMessageField(value); } - } - public Builder SetMessageField(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasMessageField = true; - result.messageField_ = value; - return this; - } - public Builder SetMessageField(global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasMessageField = true; - result.messageField_ = builderForValue.Build(); - return this; - } - public Builder MergeMessageField(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasMessageField && - result.messageField_ != global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance) { - result.messageField_ = global::Google.ProtocolBuffers.TestProtos.ForeignMessage.CreateBuilder(result.messageField_).MergeFrom(value).BuildPartial(); - } else { - result.messageField_ = value; - } - result.hasMessageField = true; - return this; - } - public Builder ClearMessageField() { - PrepareBuilder(); - result.hasMessageField = false; - result.messageField_ = null; - return this; - } - - public bool HasStringPieceField { - get { return result.hasStringPieceField; } - } - public string StringPieceField { - get { return result.StringPieceField; } - set { SetStringPieceField(value); } - } - public Builder SetStringPieceField(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasStringPieceField = true; - result.stringPieceField_ = value; - return this; - } - public Builder ClearStringPieceField() { - PrepareBuilder(); - result.hasStringPieceField = false; - result.stringPieceField_ = ""; - return this; - } - - public bool HasCordField { - get { return result.hasCordField; } - } - public string CordField { - get { return result.CordField; } - set { SetCordField(value); } - } - public Builder SetCordField(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasCordField = true; - result.cordField_ = value; - return this; - } - public Builder ClearCordField() { - PrepareBuilder(); - result.hasCordField = false; - result.cordField_ = ""; - return this; - } - - public pbc::IPopsicleList RepeatedPrimitiveFieldList { - get { return PrepareBuilder().repeatedPrimitiveField_; } - } - public int RepeatedPrimitiveFieldCount { - get { return result.RepeatedPrimitiveFieldCount; } - } - public int GetRepeatedPrimitiveField(int index) { - return result.GetRepeatedPrimitiveField(index); - } - public Builder SetRepeatedPrimitiveField(int index, int value) { - PrepareBuilder(); - result.repeatedPrimitiveField_[index] = value; - return this; - } - public Builder AddRepeatedPrimitiveField(int value) { - PrepareBuilder(); - result.repeatedPrimitiveField_.Add(value); - return this; - } - public Builder AddRangeRepeatedPrimitiveField(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedPrimitiveField_.Add(values); - return this; - } - public Builder ClearRepeatedPrimitiveField() { - PrepareBuilder(); - result.repeatedPrimitiveField_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedStringFieldList { - get { return PrepareBuilder().repeatedStringField_; } - } - public int RepeatedStringFieldCount { - get { return result.RepeatedStringFieldCount; } - } - public string GetRepeatedStringField(int index) { - return result.GetRepeatedStringField(index); - } - public Builder SetRepeatedStringField(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedStringField_[index] = value; - return this; - } - public Builder AddRepeatedStringField(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedStringField_.Add(value); - return this; - } - public Builder AddRangeRepeatedStringField(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedStringField_.Add(values); - return this; - } - public Builder ClearRepeatedStringField() { - PrepareBuilder(); - result.repeatedStringField_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedEnumFieldList { - get { return PrepareBuilder().repeatedEnumField_; } - } - public int RepeatedEnumFieldCount { - get { return result.RepeatedEnumFieldCount; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum GetRepeatedEnumField(int index) { - return result.GetRepeatedEnumField(index); - } - public Builder SetRepeatedEnumField(int index, global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) { - PrepareBuilder(); - result.repeatedEnumField_[index] = value; - return this; - } - public Builder AddRepeatedEnumField(global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) { - PrepareBuilder(); - result.repeatedEnumField_.Add(value); - return this; - } - public Builder AddRangeRepeatedEnumField(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedEnumField_.Add(values); - return this; - } - public Builder ClearRepeatedEnumField() { - PrepareBuilder(); - result.repeatedEnumField_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedMessageFieldList { - get { return PrepareBuilder().repeatedMessageField_; } - } - public int RepeatedMessageFieldCount { - get { return result.RepeatedMessageFieldCount; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage GetRepeatedMessageField(int index) { - return result.GetRepeatedMessageField(index); - } - public Builder SetRepeatedMessageField(int index, global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedMessageField_[index] = value; - return this; - } - public Builder SetRepeatedMessageField(int index, global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedMessageField_[index] = builderForValue.Build(); - return this; - } - public Builder AddRepeatedMessageField(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedMessageField_.Add(value); - return this; - } - public Builder AddRepeatedMessageField(global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedMessageField_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeRepeatedMessageField(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedMessageField_.Add(values); - return this; - } - public Builder ClearRepeatedMessageField() { - PrepareBuilder(); - result.repeatedMessageField_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedStringPieceFieldList { - get { return PrepareBuilder().repeatedStringPieceField_; } - } - public int RepeatedStringPieceFieldCount { - get { return result.RepeatedStringPieceFieldCount; } - } - public string GetRepeatedStringPieceField(int index) { - return result.GetRepeatedStringPieceField(index); - } - public Builder SetRepeatedStringPieceField(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedStringPieceField_[index] = value; - return this; - } - public Builder AddRepeatedStringPieceField(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedStringPieceField_.Add(value); - return this; - } - public Builder AddRangeRepeatedStringPieceField(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedStringPieceField_.Add(values); - return this; - } - public Builder ClearRepeatedStringPieceField() { - PrepareBuilder(); - result.repeatedStringPieceField_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedCordFieldList { - get { return PrepareBuilder().repeatedCordField_; } - } - public int RepeatedCordFieldCount { - get { return result.RepeatedCordFieldCount; } - } - public string GetRepeatedCordField(int index) { - return result.GetRepeatedCordField(index); - } - public Builder SetRepeatedCordField(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedCordField_[index] = value; - return this; - } - public Builder AddRepeatedCordField(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedCordField_.Add(value); - return this; - } - public Builder AddRangeRepeatedCordField(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedCordField_.Add(values); - return this; - } - public Builder ClearRepeatedCordField() { - PrepareBuilder(); - result.repeatedCordField_.Clear(); - return this; - } - } - static TestCamelCaseFieldNames() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestFieldOrderings : pb::ExtendableMessage { - private TestFieldOrderings() { } - private static readonly TestFieldOrderings defaultInstance = new TestFieldOrderings().MakeReadOnly(); - private static readonly string[] _testFieldOrderingsFieldNames = new string[] { "my_float", "my_int", "my_string" }; - private static readonly uint[] _testFieldOrderingsFieldTags = new uint[] { 813, 8, 90 }; - public static TestFieldOrderings DefaultInstance { - get { return defaultInstance; } - } - - public override TestFieldOrderings DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestFieldOrderings ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestFieldOrderings__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestFieldOrderings__FieldAccessorTable; } - } - - public const int MyStringFieldNumber = 11; - private bool hasMyString; - private string myString_ = ""; - public bool HasMyString { - get { return hasMyString; } - } - public string MyString { - get { return myString_; } - } - - public const int MyIntFieldNumber = 1; - private bool hasMyInt; - private long myInt_; - public bool HasMyInt { - get { return hasMyInt; } - } - public long MyInt { - get { return myInt_; } - } - - public const int MyFloatFieldNumber = 101; - private bool hasMyFloat; - private float myFloat_; - public bool HasMyFloat { - get { return hasMyFloat; } - } - public float MyFloat { - get { return myFloat_; } - } - - public override bool IsInitialized { - get { - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testFieldOrderingsFieldNames; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - if (hasMyInt) { - output.WriteInt64(1, field_names[1], MyInt); - } - extensionWriter.WriteUntil(11, output); - if (hasMyString) { - output.WriteString(11, field_names[2], MyString); - } - extensionWriter.WriteUntil(101, output); - if (hasMyFloat) { - output.WriteFloat(101, field_names[0], MyFloat); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasMyString) { - size += pb::CodedOutputStream.ComputeStringSize(11, MyString); - } - if (hasMyInt) { - size += pb::CodedOutputStream.ComputeInt64Size(1, MyInt); - } - if (hasMyFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(101, MyFloat); - } - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestFieldOrderings ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestFieldOrderings ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestFieldOrderings ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestFieldOrderings ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestFieldOrderings ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestFieldOrderings ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestFieldOrderings ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestFieldOrderings ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestFieldOrderings ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestFieldOrderings ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestFieldOrderings MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestFieldOrderings prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestFieldOrderings cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestFieldOrderings result; - - private TestFieldOrderings PrepareBuilder() { - if (resultIsReadOnly) { - TestFieldOrderings original = result; - result = new TestFieldOrderings(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestFieldOrderings MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestFieldOrderings.Descriptor; } - } - - public override TestFieldOrderings DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestFieldOrderings.DefaultInstance; } - } - - public override TestFieldOrderings BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestFieldOrderings) { - return MergeFrom((TestFieldOrderings) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestFieldOrderings other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestFieldOrderings.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasMyString) { - MyString = other.MyString; - } - if (other.HasMyInt) { - MyInt = other.MyInt; - } - if (other.HasMyFloat) { - MyFloat = other.MyFloat; - } - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testFieldOrderingsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testFieldOrderingsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasMyInt = input.ReadInt64(ref result.myInt_); - break; - } - case 90: { - result.hasMyString = input.ReadString(ref result.myString_); - break; - } - case 813: { - result.hasMyFloat = input.ReadFloat(ref result.myFloat_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasMyString { - get { return result.hasMyString; } - } - public string MyString { - get { return result.MyString; } - set { SetMyString(value); } - } - public Builder SetMyString(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasMyString = true; - result.myString_ = value; - return this; - } - public Builder ClearMyString() { - PrepareBuilder(); - result.hasMyString = false; - result.myString_ = ""; - return this; - } - - public bool HasMyInt { - get { return result.hasMyInt; } - } - public long MyInt { - get { return result.MyInt; } - set { SetMyInt(value); } - } - public Builder SetMyInt(long value) { - PrepareBuilder(); - result.hasMyInt = true; - result.myInt_ = value; - return this; - } - public Builder ClearMyInt() { - PrepareBuilder(); - result.hasMyInt = false; - result.myInt_ = 0L; - return this; - } - - public bool HasMyFloat { - get { return result.hasMyFloat; } - } - public float MyFloat { - get { return result.MyFloat; } - set { SetMyFloat(value); } - } - public Builder SetMyFloat(float value) { - PrepareBuilder(); - result.hasMyFloat = true; - result.myFloat_ = value; - return this; - } - public Builder ClearMyFloat() { - PrepareBuilder(); - result.hasMyFloat = false; - result.myFloat_ = 0F; - return this; - } - } - static TestFieldOrderings() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestExtremeDefaultValues : pb::GeneratedMessage { - private TestExtremeDefaultValues() { } - private static readonly TestExtremeDefaultValues defaultInstance = new TestExtremeDefaultValues().MakeReadOnly(); - private static readonly string[] _testExtremeDefaultValuesFieldNames = new string[] { "cpp_trigraph", "escaped_bytes", "inf_double", "inf_float", "large_float", "large_uint32", "large_uint64", "nan_double", "nan_float", "neg_inf_double", "neg_inf_float", "negative_float", "negative_one_float", "one_float", "small_float", "small_int32", "small_int64", "small_negative_float", "utf8_string", "zero_float" }; - private static readonly uint[] _testExtremeDefaultValuesFieldTags = new uint[] { 162, 10, 113, 141, 101, 16, 24, 129, 157, 121, 149, 93, 85, 69, 77, 32, 40, 109, 50, 61 }; - public static TestExtremeDefaultValues DefaultInstance { - get { return defaultInstance; } - } - - public override TestExtremeDefaultValues DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestExtremeDefaultValues ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestExtremeDefaultValues__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestExtremeDefaultValues__FieldAccessorTable; } - } - - public const int EscapedBytesFieldNumber = 1; - private bool hasEscapedBytes; - private pb::ByteString escapedBytes_ = (pb::ByteString) global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues.Descriptor.Fields[0].DefaultValue; - public bool HasEscapedBytes { - get { return hasEscapedBytes; } - } - public pb::ByteString EscapedBytes { - get { return escapedBytes_; } - } - - public const int LargeUint32FieldNumber = 2; - private bool hasLargeUint32; - private uint largeUint32_ = 4294967295; - public bool HasLargeUint32 { - get { return hasLargeUint32; } - } - [global::System.CLSCompliant(false)] - public uint LargeUint32 { - get { return largeUint32_; } - } - - public const int LargeUint64FieldNumber = 3; - private bool hasLargeUint64; - private ulong largeUint64_ = 18446744073709551615UL; - public bool HasLargeUint64 { - get { return hasLargeUint64; } - } - [global::System.CLSCompliant(false)] - public ulong LargeUint64 { - get { return largeUint64_; } - } - - public const int SmallInt32FieldNumber = 4; - private bool hasSmallInt32; - private int smallInt32_ = -2147483647; - public bool HasSmallInt32 { - get { return hasSmallInt32; } - } - public int SmallInt32 { - get { return smallInt32_; } - } - - public const int SmallInt64FieldNumber = 5; - private bool hasSmallInt64; - private long smallInt64_ = -9223372036854775807L; - public bool HasSmallInt64 { - get { return hasSmallInt64; } - } - public long SmallInt64 { - get { return smallInt64_; } - } - - public const int Utf8StringFieldNumber = 6; - private bool hasUtf8String; - private string utf8String_ = (string) global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues.Descriptor.Fields[5].DefaultValue; - public bool HasUtf8String { - get { return hasUtf8String; } - } - public string Utf8String { - get { return utf8String_; } - } - - public const int ZeroFloatFieldNumber = 7; - private bool hasZeroFloat; - private float zeroFloat_; - public bool HasZeroFloat { - get { return hasZeroFloat; } - } - public float ZeroFloat { - get { return zeroFloat_; } - } - - public const int OneFloatFieldNumber = 8; - private bool hasOneFloat; - private float oneFloat_ = 1F; - public bool HasOneFloat { - get { return hasOneFloat; } - } - public float OneFloat { - get { return oneFloat_; } - } - - public const int SmallFloatFieldNumber = 9; - private bool hasSmallFloat; - private float smallFloat_ = 1.5F; - public bool HasSmallFloat { - get { return hasSmallFloat; } - } - public float SmallFloat { - get { return smallFloat_; } - } - - public const int NegativeOneFloatFieldNumber = 10; - private bool hasNegativeOneFloat; - private float negativeOneFloat_ = -1F; - public bool HasNegativeOneFloat { - get { return hasNegativeOneFloat; } - } - public float NegativeOneFloat { - get { return negativeOneFloat_; } - } - - public const int NegativeFloatFieldNumber = 11; - private bool hasNegativeFloat; - private float negativeFloat_ = -1.5F; - public bool HasNegativeFloat { - get { return hasNegativeFloat; } - } - public float NegativeFloat { - get { return negativeFloat_; } - } - - public const int LargeFloatFieldNumber = 12; - private bool hasLargeFloat; - private float largeFloat_ = 2E+08F; - public bool HasLargeFloat { - get { return hasLargeFloat; } - } - public float LargeFloat { - get { return largeFloat_; } - } - - public const int SmallNegativeFloatFieldNumber = 13; - private bool hasSmallNegativeFloat; - private float smallNegativeFloat_ = -8E-28F; - public bool HasSmallNegativeFloat { - get { return hasSmallNegativeFloat; } - } - public float SmallNegativeFloat { - get { return smallNegativeFloat_; } - } - - public const int InfDoubleFieldNumber = 14; - private bool hasInfDouble; - private double infDouble_ = double.PositiveInfinity; - public bool HasInfDouble { - get { return hasInfDouble; } - } - public double InfDouble { - get { return infDouble_; } - } - - public const int NegInfDoubleFieldNumber = 15; - private bool hasNegInfDouble; - private double negInfDouble_ = double.NegativeInfinity; - public bool HasNegInfDouble { - get { return hasNegInfDouble; } - } - public double NegInfDouble { - get { return negInfDouble_; } - } - - public const int NanDoubleFieldNumber = 16; - private bool hasNanDouble; - private double nanDouble_ = double.NaN; - public bool HasNanDouble { - get { return hasNanDouble; } - } - public double NanDouble { - get { return nanDouble_; } - } - - public const int InfFloatFieldNumber = 17; - private bool hasInfFloat; - private float infFloat_ = float.PositiveInfinity; - public bool HasInfFloat { - get { return hasInfFloat; } - } - public float InfFloat { - get { return infFloat_; } - } - - public const int NegInfFloatFieldNumber = 18; - private bool hasNegInfFloat; - private float negInfFloat_ = float.NegativeInfinity; - public bool HasNegInfFloat { - get { return hasNegInfFloat; } - } - public float NegInfFloat { - get { return negInfFloat_; } - } - - public const int NanFloatFieldNumber = 19; - private bool hasNanFloat; - private float nanFloat_ = float.NaN; - public bool HasNanFloat { - get { return hasNanFloat; } - } - public float NanFloat { - get { return nanFloat_; } - } - - public const int CppTrigraphFieldNumber = 20; - private bool hasCppTrigraph; - private string cppTrigraph_ = "? ? ?? ?? ??? ??/ ??-"; - public bool HasCppTrigraph { - get { return hasCppTrigraph; } - } - public string CppTrigraph { - get { return cppTrigraph_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testExtremeDefaultValuesFieldNames; - if (hasEscapedBytes) { - output.WriteBytes(1, field_names[1], EscapedBytes); - } - if (hasLargeUint32) { - output.WriteUInt32(2, field_names[5], LargeUint32); - } - if (hasLargeUint64) { - output.WriteUInt64(3, field_names[6], LargeUint64); - } - if (hasSmallInt32) { - output.WriteInt32(4, field_names[15], SmallInt32); - } - if (hasSmallInt64) { - output.WriteInt64(5, field_names[16], SmallInt64); - } - if (hasUtf8String) { - output.WriteString(6, field_names[18], Utf8String); - } - if (hasZeroFloat) { - output.WriteFloat(7, field_names[19], ZeroFloat); - } - if (hasOneFloat) { - output.WriteFloat(8, field_names[13], OneFloat); - } - if (hasSmallFloat) { - output.WriteFloat(9, field_names[14], SmallFloat); - } - if (hasNegativeOneFloat) { - output.WriteFloat(10, field_names[12], NegativeOneFloat); - } - if (hasNegativeFloat) { - output.WriteFloat(11, field_names[11], NegativeFloat); - } - if (hasLargeFloat) { - output.WriteFloat(12, field_names[4], LargeFloat); - } - if (hasSmallNegativeFloat) { - output.WriteFloat(13, field_names[17], SmallNegativeFloat); - } - if (hasInfDouble) { - output.WriteDouble(14, field_names[2], InfDouble); - } - if (hasNegInfDouble) { - output.WriteDouble(15, field_names[9], NegInfDouble); - } - if (hasNanDouble) { - output.WriteDouble(16, field_names[7], NanDouble); - } - if (hasInfFloat) { - output.WriteFloat(17, field_names[3], InfFloat); - } - if (hasNegInfFloat) { - output.WriteFloat(18, field_names[10], NegInfFloat); - } - if (hasNanFloat) { - output.WriteFloat(19, field_names[8], NanFloat); - } - if (hasCppTrigraph) { - output.WriteString(20, field_names[0], CppTrigraph); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasEscapedBytes) { - size += pb::CodedOutputStream.ComputeBytesSize(1, EscapedBytes); - } - if (hasLargeUint32) { - size += pb::CodedOutputStream.ComputeUInt32Size(2, LargeUint32); - } - if (hasLargeUint64) { - size += pb::CodedOutputStream.ComputeUInt64Size(3, LargeUint64); - } - if (hasSmallInt32) { - size += pb::CodedOutputStream.ComputeInt32Size(4, SmallInt32); - } - if (hasSmallInt64) { - size += pb::CodedOutputStream.ComputeInt64Size(5, SmallInt64); - } - if (hasUtf8String) { - size += pb::CodedOutputStream.ComputeStringSize(6, Utf8String); - } - if (hasZeroFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(7, ZeroFloat); - } - if (hasOneFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(8, OneFloat); - } - if (hasSmallFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(9, SmallFloat); - } - if (hasNegativeOneFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(10, NegativeOneFloat); - } - if (hasNegativeFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(11, NegativeFloat); - } - if (hasLargeFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(12, LargeFloat); - } - if (hasSmallNegativeFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(13, SmallNegativeFloat); - } - if (hasInfDouble) { - size += pb::CodedOutputStream.ComputeDoubleSize(14, InfDouble); - } - if (hasNegInfDouble) { - size += pb::CodedOutputStream.ComputeDoubleSize(15, NegInfDouble); - } - if (hasNanDouble) { - size += pb::CodedOutputStream.ComputeDoubleSize(16, NanDouble); - } - if (hasInfFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(17, InfFloat); - } - if (hasNegInfFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(18, NegInfFloat); - } - if (hasNanFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(19, NanFloat); - } - if (hasCppTrigraph) { - size += pb::CodedOutputStream.ComputeStringSize(20, CppTrigraph); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestExtremeDefaultValues ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestExtremeDefaultValues ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestExtremeDefaultValues ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestExtremeDefaultValues ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestExtremeDefaultValues ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestExtremeDefaultValues ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestExtremeDefaultValues ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestExtremeDefaultValues ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestExtremeDefaultValues ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestExtremeDefaultValues ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestExtremeDefaultValues MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestExtremeDefaultValues prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestExtremeDefaultValues cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestExtremeDefaultValues result; - - private TestExtremeDefaultValues PrepareBuilder() { - if (resultIsReadOnly) { - TestExtremeDefaultValues original = result; - result = new TestExtremeDefaultValues(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestExtremeDefaultValues MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues.Descriptor; } - } - - public override TestExtremeDefaultValues DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues.DefaultInstance; } - } - - public override TestExtremeDefaultValues BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestExtremeDefaultValues) { - return MergeFrom((TestExtremeDefaultValues) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestExtremeDefaultValues other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasEscapedBytes) { - EscapedBytes = other.EscapedBytes; - } - if (other.HasLargeUint32) { - LargeUint32 = other.LargeUint32; - } - if (other.HasLargeUint64) { - LargeUint64 = other.LargeUint64; - } - if (other.HasSmallInt32) { - SmallInt32 = other.SmallInt32; - } - if (other.HasSmallInt64) { - SmallInt64 = other.SmallInt64; - } - if (other.HasUtf8String) { - Utf8String = other.Utf8String; - } - if (other.HasZeroFloat) { - ZeroFloat = other.ZeroFloat; - } - if (other.HasOneFloat) { - OneFloat = other.OneFloat; - } - if (other.HasSmallFloat) { - SmallFloat = other.SmallFloat; - } - if (other.HasNegativeOneFloat) { - NegativeOneFloat = other.NegativeOneFloat; - } - if (other.HasNegativeFloat) { - NegativeFloat = other.NegativeFloat; - } - if (other.HasLargeFloat) { - LargeFloat = other.LargeFloat; - } - if (other.HasSmallNegativeFloat) { - SmallNegativeFloat = other.SmallNegativeFloat; - } - if (other.HasInfDouble) { - InfDouble = other.InfDouble; - } - if (other.HasNegInfDouble) { - NegInfDouble = other.NegInfDouble; - } - if (other.HasNanDouble) { - NanDouble = other.NanDouble; - } - if (other.HasInfFloat) { - InfFloat = other.InfFloat; - } - if (other.HasNegInfFloat) { - NegInfFloat = other.NegInfFloat; - } - if (other.HasNanFloat) { - NanFloat = other.NanFloat; - } - if (other.HasCppTrigraph) { - CppTrigraph = other.CppTrigraph; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testExtremeDefaultValuesFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testExtremeDefaultValuesFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasEscapedBytes = input.ReadBytes(ref result.escapedBytes_); - break; - } - case 16: { - result.hasLargeUint32 = input.ReadUInt32(ref result.largeUint32_); - break; - } - case 24: { - result.hasLargeUint64 = input.ReadUInt64(ref result.largeUint64_); - break; - } - case 32: { - result.hasSmallInt32 = input.ReadInt32(ref result.smallInt32_); - break; - } - case 40: { - result.hasSmallInt64 = input.ReadInt64(ref result.smallInt64_); - break; - } - case 50: { - result.hasUtf8String = input.ReadString(ref result.utf8String_); - break; - } - case 61: { - result.hasZeroFloat = input.ReadFloat(ref result.zeroFloat_); - break; - } - case 69: { - result.hasOneFloat = input.ReadFloat(ref result.oneFloat_); - break; - } - case 77: { - result.hasSmallFloat = input.ReadFloat(ref result.smallFloat_); - break; - } - case 85: { - result.hasNegativeOneFloat = input.ReadFloat(ref result.negativeOneFloat_); - break; - } - case 93: { - result.hasNegativeFloat = input.ReadFloat(ref result.negativeFloat_); - break; - } - case 101: { - result.hasLargeFloat = input.ReadFloat(ref result.largeFloat_); - break; - } - case 109: { - result.hasSmallNegativeFloat = input.ReadFloat(ref result.smallNegativeFloat_); - break; - } - case 113: { - result.hasInfDouble = input.ReadDouble(ref result.infDouble_); - break; - } - case 121: { - result.hasNegInfDouble = input.ReadDouble(ref result.negInfDouble_); - break; - } - case 129: { - result.hasNanDouble = input.ReadDouble(ref result.nanDouble_); - break; - } - case 141: { - result.hasInfFloat = input.ReadFloat(ref result.infFloat_); - break; - } - case 149: { - result.hasNegInfFloat = input.ReadFloat(ref result.negInfFloat_); - break; - } - case 157: { - result.hasNanFloat = input.ReadFloat(ref result.nanFloat_); - break; - } - case 162: { - result.hasCppTrigraph = input.ReadString(ref result.cppTrigraph_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasEscapedBytes { - get { return result.hasEscapedBytes; } - } - public pb::ByteString EscapedBytes { - get { return result.EscapedBytes; } - set { SetEscapedBytes(value); } - } - public Builder SetEscapedBytes(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasEscapedBytes = true; - result.escapedBytes_ = value; - return this; - } - public Builder ClearEscapedBytes() { - PrepareBuilder(); - result.hasEscapedBytes = false; - result.escapedBytes_ = (pb::ByteString) global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues.Descriptor.Fields[0].DefaultValue; - return this; - } - - public bool HasLargeUint32 { - get { return result.hasLargeUint32; } - } - [global::System.CLSCompliant(false)] - public uint LargeUint32 { - get { return result.LargeUint32; } - set { SetLargeUint32(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetLargeUint32(uint value) { - PrepareBuilder(); - result.hasLargeUint32 = true; - result.largeUint32_ = value; - return this; - } - public Builder ClearLargeUint32() { - PrepareBuilder(); - result.hasLargeUint32 = false; - result.largeUint32_ = 4294967295; - return this; - } - - public bool HasLargeUint64 { - get { return result.hasLargeUint64; } - } - [global::System.CLSCompliant(false)] - public ulong LargeUint64 { - get { return result.LargeUint64; } - set { SetLargeUint64(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetLargeUint64(ulong value) { - PrepareBuilder(); - result.hasLargeUint64 = true; - result.largeUint64_ = value; - return this; - } - public Builder ClearLargeUint64() { - PrepareBuilder(); - result.hasLargeUint64 = false; - result.largeUint64_ = 18446744073709551615UL; - return this; - } - - public bool HasSmallInt32 { - get { return result.hasSmallInt32; } - } - public int SmallInt32 { - get { return result.SmallInt32; } - set { SetSmallInt32(value); } - } - public Builder SetSmallInt32(int value) { - PrepareBuilder(); - result.hasSmallInt32 = true; - result.smallInt32_ = value; - return this; - } - public Builder ClearSmallInt32() { - PrepareBuilder(); - result.hasSmallInt32 = false; - result.smallInt32_ = -2147483647; - return this; - } - - public bool HasSmallInt64 { - get { return result.hasSmallInt64; } - } - public long SmallInt64 { - get { return result.SmallInt64; } - set { SetSmallInt64(value); } - } - public Builder SetSmallInt64(long value) { - PrepareBuilder(); - result.hasSmallInt64 = true; - result.smallInt64_ = value; - return this; - } - public Builder ClearSmallInt64() { - PrepareBuilder(); - result.hasSmallInt64 = false; - result.smallInt64_ = -9223372036854775807L; - return this; - } - - public bool HasUtf8String { - get { return result.hasUtf8String; } - } - public string Utf8String { - get { return result.Utf8String; } - set { SetUtf8String(value); } - } - public Builder SetUtf8String(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasUtf8String = true; - result.utf8String_ = value; - return this; - } - public Builder ClearUtf8String() { - PrepareBuilder(); - result.hasUtf8String = false; - result.utf8String_ = (string) global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues.Descriptor.Fields[5].DefaultValue; - return this; - } - - public bool HasZeroFloat { - get { return result.hasZeroFloat; } - } - public float ZeroFloat { - get { return result.ZeroFloat; } - set { SetZeroFloat(value); } - } - public Builder SetZeroFloat(float value) { - PrepareBuilder(); - result.hasZeroFloat = true; - result.zeroFloat_ = value; - return this; - } - public Builder ClearZeroFloat() { - PrepareBuilder(); - result.hasZeroFloat = false; - result.zeroFloat_ = 0F; - return this; - } - - public bool HasOneFloat { - get { return result.hasOneFloat; } - } - public float OneFloat { - get { return result.OneFloat; } - set { SetOneFloat(value); } - } - public Builder SetOneFloat(float value) { - PrepareBuilder(); - result.hasOneFloat = true; - result.oneFloat_ = value; - return this; - } - public Builder ClearOneFloat() { - PrepareBuilder(); - result.hasOneFloat = false; - result.oneFloat_ = 1F; - return this; - } - - public bool HasSmallFloat { - get { return result.hasSmallFloat; } - } - public float SmallFloat { - get { return result.SmallFloat; } - set { SetSmallFloat(value); } - } - public Builder SetSmallFloat(float value) { - PrepareBuilder(); - result.hasSmallFloat = true; - result.smallFloat_ = value; - return this; - } - public Builder ClearSmallFloat() { - PrepareBuilder(); - result.hasSmallFloat = false; - result.smallFloat_ = 1.5F; - return this; - } - - public bool HasNegativeOneFloat { - get { return result.hasNegativeOneFloat; } - } - public float NegativeOneFloat { - get { return result.NegativeOneFloat; } - set { SetNegativeOneFloat(value); } - } - public Builder SetNegativeOneFloat(float value) { - PrepareBuilder(); - result.hasNegativeOneFloat = true; - result.negativeOneFloat_ = value; - return this; - } - public Builder ClearNegativeOneFloat() { - PrepareBuilder(); - result.hasNegativeOneFloat = false; - result.negativeOneFloat_ = -1F; - return this; - } - - public bool HasNegativeFloat { - get { return result.hasNegativeFloat; } - } - public float NegativeFloat { - get { return result.NegativeFloat; } - set { SetNegativeFloat(value); } - } - public Builder SetNegativeFloat(float value) { - PrepareBuilder(); - result.hasNegativeFloat = true; - result.negativeFloat_ = value; - return this; - } - public Builder ClearNegativeFloat() { - PrepareBuilder(); - result.hasNegativeFloat = false; - result.negativeFloat_ = -1.5F; - return this; - } - - public bool HasLargeFloat { - get { return result.hasLargeFloat; } - } - public float LargeFloat { - get { return result.LargeFloat; } - set { SetLargeFloat(value); } - } - public Builder SetLargeFloat(float value) { - PrepareBuilder(); - result.hasLargeFloat = true; - result.largeFloat_ = value; - return this; - } - public Builder ClearLargeFloat() { - PrepareBuilder(); - result.hasLargeFloat = false; - result.largeFloat_ = 2E+08F; - return this; - } - - public bool HasSmallNegativeFloat { - get { return result.hasSmallNegativeFloat; } - } - public float SmallNegativeFloat { - get { return result.SmallNegativeFloat; } - set { SetSmallNegativeFloat(value); } - } - public Builder SetSmallNegativeFloat(float value) { - PrepareBuilder(); - result.hasSmallNegativeFloat = true; - result.smallNegativeFloat_ = value; - return this; - } - public Builder ClearSmallNegativeFloat() { - PrepareBuilder(); - result.hasSmallNegativeFloat = false; - result.smallNegativeFloat_ = -8E-28F; - return this; - } - - public bool HasInfDouble { - get { return result.hasInfDouble; } - } - public double InfDouble { - get { return result.InfDouble; } - set { SetInfDouble(value); } - } - public Builder SetInfDouble(double value) { - PrepareBuilder(); - result.hasInfDouble = true; - result.infDouble_ = value; - return this; - } - public Builder ClearInfDouble() { - PrepareBuilder(); - result.hasInfDouble = false; - result.infDouble_ = double.PositiveInfinity; - return this; - } - - public bool HasNegInfDouble { - get { return result.hasNegInfDouble; } - } - public double NegInfDouble { - get { return result.NegInfDouble; } - set { SetNegInfDouble(value); } - } - public Builder SetNegInfDouble(double value) { - PrepareBuilder(); - result.hasNegInfDouble = true; - result.negInfDouble_ = value; - return this; - } - public Builder ClearNegInfDouble() { - PrepareBuilder(); - result.hasNegInfDouble = false; - result.negInfDouble_ = double.NegativeInfinity; - return this; - } - - public bool HasNanDouble { - get { return result.hasNanDouble; } - } - public double NanDouble { - get { return result.NanDouble; } - set { SetNanDouble(value); } - } - public Builder SetNanDouble(double value) { - PrepareBuilder(); - result.hasNanDouble = true; - result.nanDouble_ = value; - return this; - } - public Builder ClearNanDouble() { - PrepareBuilder(); - result.hasNanDouble = false; - result.nanDouble_ = double.NaN; - return this; - } - - public bool HasInfFloat { - get { return result.hasInfFloat; } - } - public float InfFloat { - get { return result.InfFloat; } - set { SetInfFloat(value); } - } - public Builder SetInfFloat(float value) { - PrepareBuilder(); - result.hasInfFloat = true; - result.infFloat_ = value; - return this; - } - public Builder ClearInfFloat() { - PrepareBuilder(); - result.hasInfFloat = false; - result.infFloat_ = float.PositiveInfinity; - return this; - } - - public bool HasNegInfFloat { - get { return result.hasNegInfFloat; } - } - public float NegInfFloat { - get { return result.NegInfFloat; } - set { SetNegInfFloat(value); } - } - public Builder SetNegInfFloat(float value) { - PrepareBuilder(); - result.hasNegInfFloat = true; - result.negInfFloat_ = value; - return this; - } - public Builder ClearNegInfFloat() { - PrepareBuilder(); - result.hasNegInfFloat = false; - result.negInfFloat_ = float.NegativeInfinity; - return this; - } - - public bool HasNanFloat { - get { return result.hasNanFloat; } - } - public float NanFloat { - get { return result.NanFloat; } - set { SetNanFloat(value); } - } - public Builder SetNanFloat(float value) { - PrepareBuilder(); - result.hasNanFloat = true; - result.nanFloat_ = value; - return this; - } - public Builder ClearNanFloat() { - PrepareBuilder(); - result.hasNanFloat = false; - result.nanFloat_ = float.NaN; - return this; - } - - public bool HasCppTrigraph { - get { return result.hasCppTrigraph; } - } - public string CppTrigraph { - get { return result.CppTrigraph; } - set { SetCppTrigraph(value); } - } - public Builder SetCppTrigraph(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasCppTrigraph = true; - result.cppTrigraph_ = value; - return this; - } - public Builder ClearCppTrigraph() { - PrepareBuilder(); - result.hasCppTrigraph = false; - result.cppTrigraph_ = "? ? ?? ?? ??? ??/ ??-"; - return this; - } - } - static TestExtremeDefaultValues() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class SparseEnumMessage : pb::GeneratedMessage { - private SparseEnumMessage() { } - private static readonly SparseEnumMessage defaultInstance = new SparseEnumMessage().MakeReadOnly(); - private static readonly string[] _sparseEnumMessageFieldNames = new string[] { "sparse_enum" }; - private static readonly uint[] _sparseEnumMessageFieldTags = new uint[] { 8 }; - public static SparseEnumMessage DefaultInstance { - get { return defaultInstance; } - } - - public override SparseEnumMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override SparseEnumMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_SparseEnumMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_SparseEnumMessage__FieldAccessorTable; } - } - - public const int SparseEnumFieldNumber = 1; - private bool hasSparseEnum; - private global::Google.ProtocolBuffers.TestProtos.TestSparseEnum sparseEnum_ = global::Google.ProtocolBuffers.TestProtos.TestSparseEnum.SPARSE_A; - public bool HasSparseEnum { - get { return hasSparseEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.TestSparseEnum SparseEnum { - get { return sparseEnum_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _sparseEnumMessageFieldNames; - if (hasSparseEnum) { - output.WriteEnum(1, field_names[0], (int) SparseEnum, SparseEnum); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasSparseEnum) { - size += pb::CodedOutputStream.ComputeEnumSize(1, (int) SparseEnum); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static SparseEnumMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SparseEnumMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SparseEnumMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SparseEnumMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SparseEnumMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SparseEnumMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SparseEnumMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SparseEnumMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SparseEnumMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SparseEnumMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private SparseEnumMessage MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SparseEnumMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(SparseEnumMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private SparseEnumMessage result; - - private SparseEnumMessage PrepareBuilder() { - if (resultIsReadOnly) { - SparseEnumMessage original = result; - result = new SparseEnumMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override SparseEnumMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.SparseEnumMessage.Descriptor; } - } - - public override SparseEnumMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.SparseEnumMessage.DefaultInstance; } - } - - public override SparseEnumMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SparseEnumMessage) { - return MergeFrom((SparseEnumMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SparseEnumMessage other) { - if (other == global::Google.ProtocolBuffers.TestProtos.SparseEnumMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasSparseEnum) { - SparseEnum = other.SparseEnum; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_sparseEnumMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _sparseEnumMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - object unknown; - if(input.ReadEnum(ref result.sparseEnum_, out unknown)) { - result.hasSparseEnum = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(1, (ulong)(int)unknown); - } - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasSparseEnum { - get { return result.hasSparseEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.TestSparseEnum SparseEnum { - get { return result.SparseEnum; } - set { SetSparseEnum(value); } - } - public Builder SetSparseEnum(global::Google.ProtocolBuffers.TestProtos.TestSparseEnum value) { - PrepareBuilder(); - result.hasSparseEnum = true; - result.sparseEnum_ = value; - return this; - } - public Builder ClearSparseEnum() { - PrepareBuilder(); - result.hasSparseEnum = false; - result.sparseEnum_ = global::Google.ProtocolBuffers.TestProtos.TestSparseEnum.SPARSE_A; - return this; - } - } - static SparseEnumMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class OneString : pb::GeneratedMessage { - private OneString() { } - private static readonly OneString defaultInstance = new OneString().MakeReadOnly(); - private static readonly string[] _oneStringFieldNames = new string[] { "data" }; - private static readonly uint[] _oneStringFieldTags = new uint[] { 10 }; - public static OneString DefaultInstance { - get { return defaultInstance; } - } - - public override OneString DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override OneString ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_OneString__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_OneString__FieldAccessorTable; } - } - - public const int DataFieldNumber = 1; - private bool hasData; - private string data_ = ""; - public bool HasData { - get { return hasData; } - } - public string Data { - get { return data_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _oneStringFieldNames; - if (hasData) { - output.WriteString(1, field_names[0], Data); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasData) { - size += pb::CodedOutputStream.ComputeStringSize(1, Data); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static OneString ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OneString ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OneString ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OneString ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OneString ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OneString ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static OneString ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static OneString ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static OneString ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OneString ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private OneString MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(OneString prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(OneString cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private OneString result; - - private OneString PrepareBuilder() { - if (resultIsReadOnly) { - OneString original = result; - result = new OneString(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override OneString MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.OneString.Descriptor; } - } - - public override OneString DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.OneString.DefaultInstance; } - } - - public override OneString BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is OneString) { - return MergeFrom((OneString) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(OneString other) { - if (other == global::Google.ProtocolBuffers.TestProtos.OneString.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasData) { - Data = other.Data; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_oneStringFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _oneStringFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasData = input.ReadString(ref result.data_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasData { - get { return result.hasData; } - } - public string Data { - get { return result.Data; } - set { SetData(value); } - } - public Builder SetData(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasData = true; - result.data_ = value; - return this; - } - public Builder ClearData() { - PrepareBuilder(); - result.hasData = false; - result.data_ = ""; - return this; - } - } - static OneString() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class OneBytes : pb::GeneratedMessage { - private OneBytes() { } - private static readonly OneBytes defaultInstance = new OneBytes().MakeReadOnly(); - private static readonly string[] _oneBytesFieldNames = new string[] { "data" }; - private static readonly uint[] _oneBytesFieldTags = new uint[] { 10 }; - public static OneBytes DefaultInstance { - get { return defaultInstance; } - } - - public override OneBytes DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override OneBytes ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_OneBytes__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_OneBytes__FieldAccessorTable; } - } - - public const int DataFieldNumber = 1; - private bool hasData; - private pb::ByteString data_ = pb::ByteString.Empty; - public bool HasData { - get { return hasData; } - } - public pb::ByteString Data { - get { return data_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _oneBytesFieldNames; - if (hasData) { - output.WriteBytes(1, field_names[0], Data); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasData) { - size += pb::CodedOutputStream.ComputeBytesSize(1, Data); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static OneBytes ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OneBytes ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OneBytes ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OneBytes ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OneBytes ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OneBytes ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static OneBytes ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static OneBytes ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static OneBytes ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OneBytes ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private OneBytes MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(OneBytes prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(OneBytes cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private OneBytes result; - - private OneBytes PrepareBuilder() { - if (resultIsReadOnly) { - OneBytes original = result; - result = new OneBytes(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override OneBytes MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.OneBytes.Descriptor; } - } - - public override OneBytes DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.OneBytes.DefaultInstance; } - } - - public override OneBytes BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is OneBytes) { - return MergeFrom((OneBytes) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(OneBytes other) { - if (other == global::Google.ProtocolBuffers.TestProtos.OneBytes.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasData) { - Data = other.Data; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_oneBytesFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _oneBytesFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasData = input.ReadBytes(ref result.data_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasData { - get { return result.hasData; } - } - public pb::ByteString Data { - get { return result.Data; } - set { SetData(value); } - } - public Builder SetData(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasData = true; - result.data_ = value; - return this; - } - public Builder ClearData() { - PrepareBuilder(); - result.hasData = false; - result.data_ = pb::ByteString.Empty; - return this; - } - } - static OneBytes() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestPackedTypes : pb::GeneratedMessage { - private TestPackedTypes() { } - private static readonly TestPackedTypes defaultInstance = new TestPackedTypes().MakeReadOnly(); - private static readonly string[] _testPackedTypesFieldNames = new string[] { "packed_bool", "packed_double", "packed_enum", "packed_fixed32", "packed_fixed64", "packed_float", "packed_int32", "packed_int64", "packed_sfixed32", "packed_sfixed64", "packed_sint32", "packed_sint64", "packed_uint32", "packed_uint64" }; - private static readonly uint[] _testPackedTypesFieldTags = new uint[] { 818, 810, 826, 770, 778, 802, 722, 730, 786, 794, 754, 762, 738, 746 }; - public static TestPackedTypes DefaultInstance { - get { return defaultInstance; } - } - - public override TestPackedTypes DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestPackedTypes ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestPackedTypes__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestPackedTypes__FieldAccessorTable; } - } - - public const int PackedInt32FieldNumber = 90; - private int packedInt32MemoizedSerializedSize; - private pbc::PopsicleList packedInt32_ = new pbc::PopsicleList(); - public scg::IList PackedInt32List { - get { return pbc::Lists.AsReadOnly(packedInt32_); } - } - public int PackedInt32Count { - get { return packedInt32_.Count; } - } - public int GetPackedInt32(int index) { - return packedInt32_[index]; - } - - public const int PackedInt64FieldNumber = 91; - private int packedInt64MemoizedSerializedSize; - private pbc::PopsicleList packedInt64_ = new pbc::PopsicleList(); - public scg::IList PackedInt64List { - get { return pbc::Lists.AsReadOnly(packedInt64_); } - } - public int PackedInt64Count { - get { return packedInt64_.Count; } - } - public long GetPackedInt64(int index) { - return packedInt64_[index]; - } - - public const int PackedUint32FieldNumber = 92; - private int packedUint32MemoizedSerializedSize; - private pbc::PopsicleList packedUint32_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList PackedUint32List { - get { return pbc::Lists.AsReadOnly(packedUint32_); } - } - public int PackedUint32Count { - get { return packedUint32_.Count; } - } - [global::System.CLSCompliant(false)] - public uint GetPackedUint32(int index) { - return packedUint32_[index]; - } - - public const int PackedUint64FieldNumber = 93; - private int packedUint64MemoizedSerializedSize; - private pbc::PopsicleList packedUint64_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList PackedUint64List { - get { return pbc::Lists.AsReadOnly(packedUint64_); } - } - public int PackedUint64Count { - get { return packedUint64_.Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetPackedUint64(int index) { - return packedUint64_[index]; - } - - public const int PackedSint32FieldNumber = 94; - private int packedSint32MemoizedSerializedSize; - private pbc::PopsicleList packedSint32_ = new pbc::PopsicleList(); - public scg::IList PackedSint32List { - get { return pbc::Lists.AsReadOnly(packedSint32_); } - } - public int PackedSint32Count { - get { return packedSint32_.Count; } - } - public int GetPackedSint32(int index) { - return packedSint32_[index]; - } - - public const int PackedSint64FieldNumber = 95; - private int packedSint64MemoizedSerializedSize; - private pbc::PopsicleList packedSint64_ = new pbc::PopsicleList(); - public scg::IList PackedSint64List { - get { return pbc::Lists.AsReadOnly(packedSint64_); } - } - public int PackedSint64Count { - get { return packedSint64_.Count; } - } - public long GetPackedSint64(int index) { - return packedSint64_[index]; - } - - public const int PackedFixed32FieldNumber = 96; - private int packedFixed32MemoizedSerializedSize; - private pbc::PopsicleList packedFixed32_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList PackedFixed32List { - get { return pbc::Lists.AsReadOnly(packedFixed32_); } - } - public int PackedFixed32Count { - get { return packedFixed32_.Count; } - } - [global::System.CLSCompliant(false)] - public uint GetPackedFixed32(int index) { - return packedFixed32_[index]; - } - - public const int PackedFixed64FieldNumber = 97; - private int packedFixed64MemoizedSerializedSize; - private pbc::PopsicleList packedFixed64_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList PackedFixed64List { - get { return pbc::Lists.AsReadOnly(packedFixed64_); } - } - public int PackedFixed64Count { - get { return packedFixed64_.Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetPackedFixed64(int index) { - return packedFixed64_[index]; - } - - public const int PackedSfixed32FieldNumber = 98; - private int packedSfixed32MemoizedSerializedSize; - private pbc::PopsicleList packedSfixed32_ = new pbc::PopsicleList(); - public scg::IList PackedSfixed32List { - get { return pbc::Lists.AsReadOnly(packedSfixed32_); } - } - public int PackedSfixed32Count { - get { return packedSfixed32_.Count; } - } - public int GetPackedSfixed32(int index) { - return packedSfixed32_[index]; - } - - public const int PackedSfixed64FieldNumber = 99; - private int packedSfixed64MemoizedSerializedSize; - private pbc::PopsicleList packedSfixed64_ = new pbc::PopsicleList(); - public scg::IList PackedSfixed64List { - get { return pbc::Lists.AsReadOnly(packedSfixed64_); } - } - public int PackedSfixed64Count { - get { return packedSfixed64_.Count; } - } - public long GetPackedSfixed64(int index) { - return packedSfixed64_[index]; - } - - public const int PackedFloatFieldNumber = 100; - private int packedFloatMemoizedSerializedSize; - private pbc::PopsicleList packedFloat_ = new pbc::PopsicleList(); - public scg::IList PackedFloatList { - get { return pbc::Lists.AsReadOnly(packedFloat_); } - } - public int PackedFloatCount { - get { return packedFloat_.Count; } - } - public float GetPackedFloat(int index) { - return packedFloat_[index]; - } - - public const int PackedDoubleFieldNumber = 101; - private int packedDoubleMemoizedSerializedSize; - private pbc::PopsicleList packedDouble_ = new pbc::PopsicleList(); - public scg::IList PackedDoubleList { - get { return pbc::Lists.AsReadOnly(packedDouble_); } - } - public int PackedDoubleCount { - get { return packedDouble_.Count; } - } - public double GetPackedDouble(int index) { - return packedDouble_[index]; - } - - public const int PackedBoolFieldNumber = 102; - private int packedBoolMemoizedSerializedSize; - private pbc::PopsicleList packedBool_ = new pbc::PopsicleList(); - public scg::IList PackedBoolList { - get { return pbc::Lists.AsReadOnly(packedBool_); } - } - public int PackedBoolCount { - get { return packedBool_.Count; } - } - public bool GetPackedBool(int index) { - return packedBool_[index]; - } - - public const int PackedEnumFieldNumber = 103; - private int packedEnumMemoizedSerializedSize; - private pbc::PopsicleList packedEnum_ = new pbc::PopsicleList(); - public scg::IList PackedEnumList { - get { return pbc::Lists.AsReadOnly(packedEnum_); } - } - public int PackedEnumCount { - get { return packedEnum_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum GetPackedEnum(int index) { - return packedEnum_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testPackedTypesFieldNames; - if (packedInt32_.Count > 0) { - output.WritePackedInt32Array(90, field_names[6], packedInt32MemoizedSerializedSize, packedInt32_); - } - if (packedInt64_.Count > 0) { - output.WritePackedInt64Array(91, field_names[7], packedInt64MemoizedSerializedSize, packedInt64_); - } - if (packedUint32_.Count > 0) { - output.WritePackedUInt32Array(92, field_names[12], packedUint32MemoizedSerializedSize, packedUint32_); - } - if (packedUint64_.Count > 0) { - output.WritePackedUInt64Array(93, field_names[13], packedUint64MemoizedSerializedSize, packedUint64_); - } - if (packedSint32_.Count > 0) { - output.WritePackedSInt32Array(94, field_names[10], packedSint32MemoizedSerializedSize, packedSint32_); - } - if (packedSint64_.Count > 0) { - output.WritePackedSInt64Array(95, field_names[11], packedSint64MemoizedSerializedSize, packedSint64_); - } - if (packedFixed32_.Count > 0) { - output.WritePackedFixed32Array(96, field_names[3], packedFixed32MemoizedSerializedSize, packedFixed32_); - } - if (packedFixed64_.Count > 0) { - output.WritePackedFixed64Array(97, field_names[4], packedFixed64MemoizedSerializedSize, packedFixed64_); - } - if (packedSfixed32_.Count > 0) { - output.WritePackedSFixed32Array(98, field_names[8], packedSfixed32MemoizedSerializedSize, packedSfixed32_); - } - if (packedSfixed64_.Count > 0) { - output.WritePackedSFixed64Array(99, field_names[9], packedSfixed64MemoizedSerializedSize, packedSfixed64_); - } - if (packedFloat_.Count > 0) { - output.WritePackedFloatArray(100, field_names[5], packedFloatMemoizedSerializedSize, packedFloat_); - } - if (packedDouble_.Count > 0) { - output.WritePackedDoubleArray(101, field_names[1], packedDoubleMemoizedSerializedSize, packedDouble_); - } - if (packedBool_.Count > 0) { - output.WritePackedBoolArray(102, field_names[0], packedBoolMemoizedSerializedSize, packedBool_); - } - if (packedEnum_.Count > 0) { - output.WritePackedEnumArray(103, field_names[2], packedEnumMemoizedSerializedSize, packedEnum_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - foreach (int element in PackedInt32List) { - dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); - } - size += dataSize; - if (packedInt32_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedInt32MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - foreach (long element in PackedInt64List) { - dataSize += pb::CodedOutputStream.ComputeInt64SizeNoTag(element); - } - size += dataSize; - if (packedInt64_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedInt64MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - foreach (uint element in PackedUint32List) { - dataSize += pb::CodedOutputStream.ComputeUInt32SizeNoTag(element); - } - size += dataSize; - if (packedUint32_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedUint32MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - foreach (ulong element in PackedUint64List) { - dataSize += pb::CodedOutputStream.ComputeUInt64SizeNoTag(element); - } - size += dataSize; - if (packedUint64_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedUint64MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - foreach (int element in PackedSint32List) { - dataSize += pb::CodedOutputStream.ComputeSInt32SizeNoTag(element); - } - size += dataSize; - if (packedSint32_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedSint32MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - foreach (long element in PackedSint64List) { - dataSize += pb::CodedOutputStream.ComputeSInt64SizeNoTag(element); - } - size += dataSize; - if (packedSint64_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedSint64MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 4 * packedFixed32_.Count; - size += dataSize; - if (packedFixed32_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedFixed32MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 8 * packedFixed64_.Count; - size += dataSize; - if (packedFixed64_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedFixed64MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 4 * packedSfixed32_.Count; - size += dataSize; - if (packedSfixed32_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedSfixed32MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 8 * packedSfixed64_.Count; - size += dataSize; - if (packedSfixed64_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedSfixed64MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 4 * packedFloat_.Count; - size += dataSize; - if (packedFloat_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedFloatMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 8 * packedDouble_.Count; - size += dataSize; - if (packedDouble_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedDoubleMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 1 * packedBool_.Count; - size += dataSize; - if (packedBool_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedBoolMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - if (packedEnum_.Count > 0) { - foreach (global::Google.ProtocolBuffers.TestProtos.ForeignEnum element in packedEnum_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 2; - size += pb::CodedOutputStream.ComputeRawVarint32Size((uint) dataSize); - } - packedEnumMemoizedSerializedSize = dataSize; - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestPackedTypes ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestPackedTypes ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestPackedTypes ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestPackedTypes ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestPackedTypes ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestPackedTypes ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestPackedTypes ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestPackedTypes ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestPackedTypes ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestPackedTypes ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestPackedTypes MakeReadOnly() { - packedInt32_.MakeReadOnly(); - packedInt64_.MakeReadOnly(); - packedUint32_.MakeReadOnly(); - packedUint64_.MakeReadOnly(); - packedSint32_.MakeReadOnly(); - packedSint64_.MakeReadOnly(); - packedFixed32_.MakeReadOnly(); - packedFixed64_.MakeReadOnly(); - packedSfixed32_.MakeReadOnly(); - packedSfixed64_.MakeReadOnly(); - packedFloat_.MakeReadOnly(); - packedDouble_.MakeReadOnly(); - packedBool_.MakeReadOnly(); - packedEnum_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestPackedTypes prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestPackedTypes cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestPackedTypes result; - - private TestPackedTypes PrepareBuilder() { - if (resultIsReadOnly) { - TestPackedTypes original = result; - result = new TestPackedTypes(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestPackedTypes MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestPackedTypes.Descriptor; } - } - - public override TestPackedTypes DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestPackedTypes.DefaultInstance; } - } - - public override TestPackedTypes BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestPackedTypes) { - return MergeFrom((TestPackedTypes) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestPackedTypes other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestPackedTypes.DefaultInstance) return this; - PrepareBuilder(); - if (other.packedInt32_.Count != 0) { - result.packedInt32_.Add(other.packedInt32_); - } - if (other.packedInt64_.Count != 0) { - result.packedInt64_.Add(other.packedInt64_); - } - if (other.packedUint32_.Count != 0) { - result.packedUint32_.Add(other.packedUint32_); - } - if (other.packedUint64_.Count != 0) { - result.packedUint64_.Add(other.packedUint64_); - } - if (other.packedSint32_.Count != 0) { - result.packedSint32_.Add(other.packedSint32_); - } - if (other.packedSint64_.Count != 0) { - result.packedSint64_.Add(other.packedSint64_); - } - if (other.packedFixed32_.Count != 0) { - result.packedFixed32_.Add(other.packedFixed32_); - } - if (other.packedFixed64_.Count != 0) { - result.packedFixed64_.Add(other.packedFixed64_); - } - if (other.packedSfixed32_.Count != 0) { - result.packedSfixed32_.Add(other.packedSfixed32_); - } - if (other.packedSfixed64_.Count != 0) { - result.packedSfixed64_.Add(other.packedSfixed64_); - } - if (other.packedFloat_.Count != 0) { - result.packedFloat_.Add(other.packedFloat_); - } - if (other.packedDouble_.Count != 0) { - result.packedDouble_.Add(other.packedDouble_); - } - if (other.packedBool_.Count != 0) { - result.packedBool_.Add(other.packedBool_); - } - if (other.packedEnum_.Count != 0) { - result.packedEnum_.Add(other.packedEnum_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testPackedTypesFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testPackedTypesFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 722: - case 720: { - input.ReadInt32Array(tag, field_name, result.packedInt32_); - break; - } - case 730: - case 728: { - input.ReadInt64Array(tag, field_name, result.packedInt64_); - break; - } - case 738: - case 736: { - input.ReadUInt32Array(tag, field_name, result.packedUint32_); - break; - } - case 746: - case 744: { - input.ReadUInt64Array(tag, field_name, result.packedUint64_); - break; - } - case 754: - case 752: { - input.ReadSInt32Array(tag, field_name, result.packedSint32_); - break; - } - case 762: - case 760: { - input.ReadSInt64Array(tag, field_name, result.packedSint64_); - break; - } - case 770: - case 773: { - input.ReadFixed32Array(tag, field_name, result.packedFixed32_); - break; - } - case 778: - case 777: { - input.ReadFixed64Array(tag, field_name, result.packedFixed64_); - break; - } - case 786: - case 789: { - input.ReadSFixed32Array(tag, field_name, result.packedSfixed32_); - break; - } - case 794: - case 793: { - input.ReadSFixed64Array(tag, field_name, result.packedSfixed64_); - break; - } - case 802: - case 805: { - input.ReadFloatArray(tag, field_name, result.packedFloat_); - break; - } - case 810: - case 809: { - input.ReadDoubleArray(tag, field_name, result.packedDouble_); - break; - } - case 818: - case 816: { - input.ReadBoolArray(tag, field_name, result.packedBool_); - break; - } - case 826: - case 824: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.packedEnum_, out unknownItems); - if (unknownItems != null) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - foreach (object rawValue in unknownItems) - if (rawValue is int) - unknownFields.MergeVarintField(103, (ulong)(int)rawValue); - } - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public pbc::IPopsicleList PackedInt32List { - get { return PrepareBuilder().packedInt32_; } - } - public int PackedInt32Count { - get { return result.PackedInt32Count; } - } - public int GetPackedInt32(int index) { - return result.GetPackedInt32(index); - } - public Builder SetPackedInt32(int index, int value) { - PrepareBuilder(); - result.packedInt32_[index] = value; - return this; - } - public Builder AddPackedInt32(int value) { - PrepareBuilder(); - result.packedInt32_.Add(value); - return this; - } - public Builder AddRangePackedInt32(scg::IEnumerable values) { - PrepareBuilder(); - result.packedInt32_.Add(values); - return this; - } - public Builder ClearPackedInt32() { - PrepareBuilder(); - result.packedInt32_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedInt64List { - get { return PrepareBuilder().packedInt64_; } - } - public int PackedInt64Count { - get { return result.PackedInt64Count; } - } - public long GetPackedInt64(int index) { - return result.GetPackedInt64(index); - } - public Builder SetPackedInt64(int index, long value) { - PrepareBuilder(); - result.packedInt64_[index] = value; - return this; - } - public Builder AddPackedInt64(long value) { - PrepareBuilder(); - result.packedInt64_.Add(value); - return this; - } - public Builder AddRangePackedInt64(scg::IEnumerable values) { - PrepareBuilder(); - result.packedInt64_.Add(values); - return this; - } - public Builder ClearPackedInt64() { - PrepareBuilder(); - result.packedInt64_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList PackedUint32List { - get { return PrepareBuilder().packedUint32_; } - } - public int PackedUint32Count { - get { return result.PackedUint32Count; } - } - [global::System.CLSCompliant(false)] - public uint GetPackedUint32(int index) { - return result.GetPackedUint32(index); - } - [global::System.CLSCompliant(false)] - public Builder SetPackedUint32(int index, uint value) { - PrepareBuilder(); - result.packedUint32_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddPackedUint32(uint value) { - PrepareBuilder(); - result.packedUint32_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangePackedUint32(scg::IEnumerable values) { - PrepareBuilder(); - result.packedUint32_.Add(values); - return this; - } - public Builder ClearPackedUint32() { - PrepareBuilder(); - result.packedUint32_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList PackedUint64List { - get { return PrepareBuilder().packedUint64_; } - } - public int PackedUint64Count { - get { return result.PackedUint64Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetPackedUint64(int index) { - return result.GetPackedUint64(index); - } - [global::System.CLSCompliant(false)] - public Builder SetPackedUint64(int index, ulong value) { - PrepareBuilder(); - result.packedUint64_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddPackedUint64(ulong value) { - PrepareBuilder(); - result.packedUint64_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangePackedUint64(scg::IEnumerable values) { - PrepareBuilder(); - result.packedUint64_.Add(values); - return this; - } - public Builder ClearPackedUint64() { - PrepareBuilder(); - result.packedUint64_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedSint32List { - get { return PrepareBuilder().packedSint32_; } - } - public int PackedSint32Count { - get { return result.PackedSint32Count; } - } - public int GetPackedSint32(int index) { - return result.GetPackedSint32(index); - } - public Builder SetPackedSint32(int index, int value) { - PrepareBuilder(); - result.packedSint32_[index] = value; - return this; - } - public Builder AddPackedSint32(int value) { - PrepareBuilder(); - result.packedSint32_.Add(value); - return this; - } - public Builder AddRangePackedSint32(scg::IEnumerable values) { - PrepareBuilder(); - result.packedSint32_.Add(values); - return this; - } - public Builder ClearPackedSint32() { - PrepareBuilder(); - result.packedSint32_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedSint64List { - get { return PrepareBuilder().packedSint64_; } - } - public int PackedSint64Count { - get { return result.PackedSint64Count; } - } - public long GetPackedSint64(int index) { - return result.GetPackedSint64(index); - } - public Builder SetPackedSint64(int index, long value) { - PrepareBuilder(); - result.packedSint64_[index] = value; - return this; - } - public Builder AddPackedSint64(long value) { - PrepareBuilder(); - result.packedSint64_.Add(value); - return this; - } - public Builder AddRangePackedSint64(scg::IEnumerable values) { - PrepareBuilder(); - result.packedSint64_.Add(values); - return this; - } - public Builder ClearPackedSint64() { - PrepareBuilder(); - result.packedSint64_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList PackedFixed32List { - get { return PrepareBuilder().packedFixed32_; } - } - public int PackedFixed32Count { - get { return result.PackedFixed32Count; } - } - [global::System.CLSCompliant(false)] - public uint GetPackedFixed32(int index) { - return result.GetPackedFixed32(index); - } - [global::System.CLSCompliant(false)] - public Builder SetPackedFixed32(int index, uint value) { - PrepareBuilder(); - result.packedFixed32_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddPackedFixed32(uint value) { - PrepareBuilder(); - result.packedFixed32_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangePackedFixed32(scg::IEnumerable values) { - PrepareBuilder(); - result.packedFixed32_.Add(values); - return this; - } - public Builder ClearPackedFixed32() { - PrepareBuilder(); - result.packedFixed32_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList PackedFixed64List { - get { return PrepareBuilder().packedFixed64_; } - } - public int PackedFixed64Count { - get { return result.PackedFixed64Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetPackedFixed64(int index) { - return result.GetPackedFixed64(index); - } - [global::System.CLSCompliant(false)] - public Builder SetPackedFixed64(int index, ulong value) { - PrepareBuilder(); - result.packedFixed64_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddPackedFixed64(ulong value) { - PrepareBuilder(); - result.packedFixed64_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangePackedFixed64(scg::IEnumerable values) { - PrepareBuilder(); - result.packedFixed64_.Add(values); - return this; - } - public Builder ClearPackedFixed64() { - PrepareBuilder(); - result.packedFixed64_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedSfixed32List { - get { return PrepareBuilder().packedSfixed32_; } - } - public int PackedSfixed32Count { - get { return result.PackedSfixed32Count; } - } - public int GetPackedSfixed32(int index) { - return result.GetPackedSfixed32(index); - } - public Builder SetPackedSfixed32(int index, int value) { - PrepareBuilder(); - result.packedSfixed32_[index] = value; - return this; - } - public Builder AddPackedSfixed32(int value) { - PrepareBuilder(); - result.packedSfixed32_.Add(value); - return this; - } - public Builder AddRangePackedSfixed32(scg::IEnumerable values) { - PrepareBuilder(); - result.packedSfixed32_.Add(values); - return this; - } - public Builder ClearPackedSfixed32() { - PrepareBuilder(); - result.packedSfixed32_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedSfixed64List { - get { return PrepareBuilder().packedSfixed64_; } - } - public int PackedSfixed64Count { - get { return result.PackedSfixed64Count; } - } - public long GetPackedSfixed64(int index) { - return result.GetPackedSfixed64(index); - } - public Builder SetPackedSfixed64(int index, long value) { - PrepareBuilder(); - result.packedSfixed64_[index] = value; - return this; - } - public Builder AddPackedSfixed64(long value) { - PrepareBuilder(); - result.packedSfixed64_.Add(value); - return this; - } - public Builder AddRangePackedSfixed64(scg::IEnumerable values) { - PrepareBuilder(); - result.packedSfixed64_.Add(values); - return this; - } - public Builder ClearPackedSfixed64() { - PrepareBuilder(); - result.packedSfixed64_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedFloatList { - get { return PrepareBuilder().packedFloat_; } - } - public int PackedFloatCount { - get { return result.PackedFloatCount; } - } - public float GetPackedFloat(int index) { - return result.GetPackedFloat(index); - } - public Builder SetPackedFloat(int index, float value) { - PrepareBuilder(); - result.packedFloat_[index] = value; - return this; - } - public Builder AddPackedFloat(float value) { - PrepareBuilder(); - result.packedFloat_.Add(value); - return this; - } - public Builder AddRangePackedFloat(scg::IEnumerable values) { - PrepareBuilder(); - result.packedFloat_.Add(values); - return this; - } - public Builder ClearPackedFloat() { - PrepareBuilder(); - result.packedFloat_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedDoubleList { - get { return PrepareBuilder().packedDouble_; } - } - public int PackedDoubleCount { - get { return result.PackedDoubleCount; } - } - public double GetPackedDouble(int index) { - return result.GetPackedDouble(index); - } - public Builder SetPackedDouble(int index, double value) { - PrepareBuilder(); - result.packedDouble_[index] = value; - return this; - } - public Builder AddPackedDouble(double value) { - PrepareBuilder(); - result.packedDouble_.Add(value); - return this; - } - public Builder AddRangePackedDouble(scg::IEnumerable values) { - PrepareBuilder(); - result.packedDouble_.Add(values); - return this; - } - public Builder ClearPackedDouble() { - PrepareBuilder(); - result.packedDouble_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedBoolList { - get { return PrepareBuilder().packedBool_; } - } - public int PackedBoolCount { - get { return result.PackedBoolCount; } - } - public bool GetPackedBool(int index) { - return result.GetPackedBool(index); - } - public Builder SetPackedBool(int index, bool value) { - PrepareBuilder(); - result.packedBool_[index] = value; - return this; - } - public Builder AddPackedBool(bool value) { - PrepareBuilder(); - result.packedBool_.Add(value); - return this; - } - public Builder AddRangePackedBool(scg::IEnumerable values) { - PrepareBuilder(); - result.packedBool_.Add(values); - return this; - } - public Builder ClearPackedBool() { - PrepareBuilder(); - result.packedBool_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedEnumList { - get { return PrepareBuilder().packedEnum_; } - } - public int PackedEnumCount { - get { return result.PackedEnumCount; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum GetPackedEnum(int index) { - return result.GetPackedEnum(index); - } - public Builder SetPackedEnum(int index, global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) { - PrepareBuilder(); - result.packedEnum_[index] = value; - return this; - } - public Builder AddPackedEnum(global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) { - PrepareBuilder(); - result.packedEnum_.Add(value); - return this; - } - public Builder AddRangePackedEnum(scg::IEnumerable values) { - PrepareBuilder(); - result.packedEnum_.Add(values); - return this; - } - public Builder ClearPackedEnum() { - PrepareBuilder(); - result.packedEnum_.Clear(); - return this; - } - } - static TestPackedTypes() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestUnpackedTypes : pb::GeneratedMessage { - private TestUnpackedTypes() { } - private static readonly TestUnpackedTypes defaultInstance = new TestUnpackedTypes().MakeReadOnly(); - private static readonly string[] _testUnpackedTypesFieldNames = new string[] { "unpacked_bool", "unpacked_double", "unpacked_enum", "unpacked_fixed32", "unpacked_fixed64", "unpacked_float", "unpacked_int32", "unpacked_int64", "unpacked_sfixed32", "unpacked_sfixed64", "unpacked_sint32", "unpacked_sint64", "unpacked_uint32", "unpacked_uint64" }; - private static readonly uint[] _testUnpackedTypesFieldTags = new uint[] { 816, 809, 824, 773, 777, 805, 720, 728, 789, 793, 752, 760, 736, 744 }; - public static TestUnpackedTypes DefaultInstance { - get { return defaultInstance; } - } - - public override TestUnpackedTypes DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestUnpackedTypes ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestUnpackedTypes__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestUnpackedTypes__FieldAccessorTable; } - } - - public const int UnpackedInt32FieldNumber = 90; - private pbc::PopsicleList unpackedInt32_ = new pbc::PopsicleList(); - public scg::IList UnpackedInt32List { - get { return pbc::Lists.AsReadOnly(unpackedInt32_); } - } - public int UnpackedInt32Count { - get { return unpackedInt32_.Count; } - } - public int GetUnpackedInt32(int index) { - return unpackedInt32_[index]; - } - - public const int UnpackedInt64FieldNumber = 91; - private pbc::PopsicleList unpackedInt64_ = new pbc::PopsicleList(); - public scg::IList UnpackedInt64List { - get { return pbc::Lists.AsReadOnly(unpackedInt64_); } - } - public int UnpackedInt64Count { - get { return unpackedInt64_.Count; } - } - public long GetUnpackedInt64(int index) { - return unpackedInt64_[index]; - } - - public const int UnpackedUint32FieldNumber = 92; - private pbc::PopsicleList unpackedUint32_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList UnpackedUint32List { - get { return pbc::Lists.AsReadOnly(unpackedUint32_); } - } - public int UnpackedUint32Count { - get { return unpackedUint32_.Count; } - } - [global::System.CLSCompliant(false)] - public uint GetUnpackedUint32(int index) { - return unpackedUint32_[index]; - } - - public const int UnpackedUint64FieldNumber = 93; - private pbc::PopsicleList unpackedUint64_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList UnpackedUint64List { - get { return pbc::Lists.AsReadOnly(unpackedUint64_); } - } - public int UnpackedUint64Count { - get { return unpackedUint64_.Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetUnpackedUint64(int index) { - return unpackedUint64_[index]; - } - - public const int UnpackedSint32FieldNumber = 94; - private pbc::PopsicleList unpackedSint32_ = new pbc::PopsicleList(); - public scg::IList UnpackedSint32List { - get { return pbc::Lists.AsReadOnly(unpackedSint32_); } - } - public int UnpackedSint32Count { - get { return unpackedSint32_.Count; } - } - public int GetUnpackedSint32(int index) { - return unpackedSint32_[index]; - } - - public const int UnpackedSint64FieldNumber = 95; - private pbc::PopsicleList unpackedSint64_ = new pbc::PopsicleList(); - public scg::IList UnpackedSint64List { - get { return pbc::Lists.AsReadOnly(unpackedSint64_); } - } - public int UnpackedSint64Count { - get { return unpackedSint64_.Count; } - } - public long GetUnpackedSint64(int index) { - return unpackedSint64_[index]; - } - - public const int UnpackedFixed32FieldNumber = 96; - private pbc::PopsicleList unpackedFixed32_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList UnpackedFixed32List { - get { return pbc::Lists.AsReadOnly(unpackedFixed32_); } - } - public int UnpackedFixed32Count { - get { return unpackedFixed32_.Count; } - } - [global::System.CLSCompliant(false)] - public uint GetUnpackedFixed32(int index) { - return unpackedFixed32_[index]; - } - - public const int UnpackedFixed64FieldNumber = 97; - private pbc::PopsicleList unpackedFixed64_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList UnpackedFixed64List { - get { return pbc::Lists.AsReadOnly(unpackedFixed64_); } - } - public int UnpackedFixed64Count { - get { return unpackedFixed64_.Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetUnpackedFixed64(int index) { - return unpackedFixed64_[index]; - } - - public const int UnpackedSfixed32FieldNumber = 98; - private pbc::PopsicleList unpackedSfixed32_ = new pbc::PopsicleList(); - public scg::IList UnpackedSfixed32List { - get { return pbc::Lists.AsReadOnly(unpackedSfixed32_); } - } - public int UnpackedSfixed32Count { - get { return unpackedSfixed32_.Count; } - } - public int GetUnpackedSfixed32(int index) { - return unpackedSfixed32_[index]; - } - - public const int UnpackedSfixed64FieldNumber = 99; - private pbc::PopsicleList unpackedSfixed64_ = new pbc::PopsicleList(); - public scg::IList UnpackedSfixed64List { - get { return pbc::Lists.AsReadOnly(unpackedSfixed64_); } - } - public int UnpackedSfixed64Count { - get { return unpackedSfixed64_.Count; } - } - public long GetUnpackedSfixed64(int index) { - return unpackedSfixed64_[index]; - } - - public const int UnpackedFloatFieldNumber = 100; - private pbc::PopsicleList unpackedFloat_ = new pbc::PopsicleList(); - public scg::IList UnpackedFloatList { - get { return pbc::Lists.AsReadOnly(unpackedFloat_); } - } - public int UnpackedFloatCount { - get { return unpackedFloat_.Count; } - } - public float GetUnpackedFloat(int index) { - return unpackedFloat_[index]; - } - - public const int UnpackedDoubleFieldNumber = 101; - private pbc::PopsicleList unpackedDouble_ = new pbc::PopsicleList(); - public scg::IList UnpackedDoubleList { - get { return pbc::Lists.AsReadOnly(unpackedDouble_); } - } - public int UnpackedDoubleCount { - get { return unpackedDouble_.Count; } - } - public double GetUnpackedDouble(int index) { - return unpackedDouble_[index]; - } - - public const int UnpackedBoolFieldNumber = 102; - private pbc::PopsicleList unpackedBool_ = new pbc::PopsicleList(); - public scg::IList UnpackedBoolList { - get { return pbc::Lists.AsReadOnly(unpackedBool_); } - } - public int UnpackedBoolCount { - get { return unpackedBool_.Count; } - } - public bool GetUnpackedBool(int index) { - return unpackedBool_[index]; - } - - public const int UnpackedEnumFieldNumber = 103; - private pbc::PopsicleList unpackedEnum_ = new pbc::PopsicleList(); - public scg::IList UnpackedEnumList { - get { return pbc::Lists.AsReadOnly(unpackedEnum_); } - } - public int UnpackedEnumCount { - get { return unpackedEnum_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum GetUnpackedEnum(int index) { - return unpackedEnum_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testUnpackedTypesFieldNames; - if (unpackedInt32_.Count > 0) { - output.WriteInt32Array(90, field_names[6], unpackedInt32_); - } - if (unpackedInt64_.Count > 0) { - output.WriteInt64Array(91, field_names[7], unpackedInt64_); - } - if (unpackedUint32_.Count > 0) { - output.WriteUInt32Array(92, field_names[12], unpackedUint32_); - } - if (unpackedUint64_.Count > 0) { - output.WriteUInt64Array(93, field_names[13], unpackedUint64_); - } - if (unpackedSint32_.Count > 0) { - output.WriteSInt32Array(94, field_names[10], unpackedSint32_); - } - if (unpackedSint64_.Count > 0) { - output.WriteSInt64Array(95, field_names[11], unpackedSint64_); - } - if (unpackedFixed32_.Count > 0) { - output.WriteFixed32Array(96, field_names[3], unpackedFixed32_); - } - if (unpackedFixed64_.Count > 0) { - output.WriteFixed64Array(97, field_names[4], unpackedFixed64_); - } - if (unpackedSfixed32_.Count > 0) { - output.WriteSFixed32Array(98, field_names[8], unpackedSfixed32_); - } - if (unpackedSfixed64_.Count > 0) { - output.WriteSFixed64Array(99, field_names[9], unpackedSfixed64_); - } - if (unpackedFloat_.Count > 0) { - output.WriteFloatArray(100, field_names[5], unpackedFloat_); - } - if (unpackedDouble_.Count > 0) { - output.WriteDoubleArray(101, field_names[1], unpackedDouble_); - } - if (unpackedBool_.Count > 0) { - output.WriteBoolArray(102, field_names[0], unpackedBool_); - } - if (unpackedEnum_.Count > 0) { - output.WriteEnumArray(103, field_names[2], unpackedEnum_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - foreach (int element in UnpackedInt32List) { - dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); - } - size += dataSize; - size += 2 * unpackedInt32_.Count; - } - { - int dataSize = 0; - foreach (long element in UnpackedInt64List) { - dataSize += pb::CodedOutputStream.ComputeInt64SizeNoTag(element); - } - size += dataSize; - size += 2 * unpackedInt64_.Count; - } - { - int dataSize = 0; - foreach (uint element in UnpackedUint32List) { - dataSize += pb::CodedOutputStream.ComputeUInt32SizeNoTag(element); - } - size += dataSize; - size += 2 * unpackedUint32_.Count; - } - { - int dataSize = 0; - foreach (ulong element in UnpackedUint64List) { - dataSize += pb::CodedOutputStream.ComputeUInt64SizeNoTag(element); - } - size += dataSize; - size += 2 * unpackedUint64_.Count; - } - { - int dataSize = 0; - foreach (int element in UnpackedSint32List) { - dataSize += pb::CodedOutputStream.ComputeSInt32SizeNoTag(element); - } - size += dataSize; - size += 2 * unpackedSint32_.Count; - } - { - int dataSize = 0; - foreach (long element in UnpackedSint64List) { - dataSize += pb::CodedOutputStream.ComputeSInt64SizeNoTag(element); - } - size += dataSize; - size += 2 * unpackedSint64_.Count; - } - { - int dataSize = 0; - dataSize = 4 * unpackedFixed32_.Count; - size += dataSize; - size += 2 * unpackedFixed32_.Count; - } - { - int dataSize = 0; - dataSize = 8 * unpackedFixed64_.Count; - size += dataSize; - size += 2 * unpackedFixed64_.Count; - } - { - int dataSize = 0; - dataSize = 4 * unpackedSfixed32_.Count; - size += dataSize; - size += 2 * unpackedSfixed32_.Count; - } - { - int dataSize = 0; - dataSize = 8 * unpackedSfixed64_.Count; - size += dataSize; - size += 2 * unpackedSfixed64_.Count; - } - { - int dataSize = 0; - dataSize = 4 * unpackedFloat_.Count; - size += dataSize; - size += 2 * unpackedFloat_.Count; - } - { - int dataSize = 0; - dataSize = 8 * unpackedDouble_.Count; - size += dataSize; - size += 2 * unpackedDouble_.Count; - } - { - int dataSize = 0; - dataSize = 1 * unpackedBool_.Count; - size += dataSize; - size += 2 * unpackedBool_.Count; - } - { - int dataSize = 0; - if (unpackedEnum_.Count > 0) { - foreach (global::Google.ProtocolBuffers.TestProtos.ForeignEnum element in unpackedEnum_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 2 * unpackedEnum_.Count; - } - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestUnpackedTypes ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestUnpackedTypes ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestUnpackedTypes ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestUnpackedTypes ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestUnpackedTypes ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestUnpackedTypes ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestUnpackedTypes ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestUnpackedTypes ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestUnpackedTypes ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestUnpackedTypes ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestUnpackedTypes MakeReadOnly() { - unpackedInt32_.MakeReadOnly(); - unpackedInt64_.MakeReadOnly(); - unpackedUint32_.MakeReadOnly(); - unpackedUint64_.MakeReadOnly(); - unpackedSint32_.MakeReadOnly(); - unpackedSint64_.MakeReadOnly(); - unpackedFixed32_.MakeReadOnly(); - unpackedFixed64_.MakeReadOnly(); - unpackedSfixed32_.MakeReadOnly(); - unpackedSfixed64_.MakeReadOnly(); - unpackedFloat_.MakeReadOnly(); - unpackedDouble_.MakeReadOnly(); - unpackedBool_.MakeReadOnly(); - unpackedEnum_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestUnpackedTypes prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestUnpackedTypes cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestUnpackedTypes result; - - private TestUnpackedTypes PrepareBuilder() { - if (resultIsReadOnly) { - TestUnpackedTypes original = result; - result = new TestUnpackedTypes(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestUnpackedTypes MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestUnpackedTypes.Descriptor; } - } - - public override TestUnpackedTypes DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestUnpackedTypes.DefaultInstance; } - } - - public override TestUnpackedTypes BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestUnpackedTypes) { - return MergeFrom((TestUnpackedTypes) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestUnpackedTypes other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestUnpackedTypes.DefaultInstance) return this; - PrepareBuilder(); - if (other.unpackedInt32_.Count != 0) { - result.unpackedInt32_.Add(other.unpackedInt32_); - } - if (other.unpackedInt64_.Count != 0) { - result.unpackedInt64_.Add(other.unpackedInt64_); - } - if (other.unpackedUint32_.Count != 0) { - result.unpackedUint32_.Add(other.unpackedUint32_); - } - if (other.unpackedUint64_.Count != 0) { - result.unpackedUint64_.Add(other.unpackedUint64_); - } - if (other.unpackedSint32_.Count != 0) { - result.unpackedSint32_.Add(other.unpackedSint32_); - } - if (other.unpackedSint64_.Count != 0) { - result.unpackedSint64_.Add(other.unpackedSint64_); - } - if (other.unpackedFixed32_.Count != 0) { - result.unpackedFixed32_.Add(other.unpackedFixed32_); - } - if (other.unpackedFixed64_.Count != 0) { - result.unpackedFixed64_.Add(other.unpackedFixed64_); - } - if (other.unpackedSfixed32_.Count != 0) { - result.unpackedSfixed32_.Add(other.unpackedSfixed32_); - } - if (other.unpackedSfixed64_.Count != 0) { - result.unpackedSfixed64_.Add(other.unpackedSfixed64_); - } - if (other.unpackedFloat_.Count != 0) { - result.unpackedFloat_.Add(other.unpackedFloat_); - } - if (other.unpackedDouble_.Count != 0) { - result.unpackedDouble_.Add(other.unpackedDouble_); - } - if (other.unpackedBool_.Count != 0) { - result.unpackedBool_.Add(other.unpackedBool_); - } - if (other.unpackedEnum_.Count != 0) { - result.unpackedEnum_.Add(other.unpackedEnum_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testUnpackedTypesFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testUnpackedTypesFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 722: - case 720: { - input.ReadInt32Array(tag, field_name, result.unpackedInt32_); - break; - } - case 730: - case 728: { - input.ReadInt64Array(tag, field_name, result.unpackedInt64_); - break; - } - case 738: - case 736: { - input.ReadUInt32Array(tag, field_name, result.unpackedUint32_); - break; - } - case 746: - case 744: { - input.ReadUInt64Array(tag, field_name, result.unpackedUint64_); - break; - } - case 754: - case 752: { - input.ReadSInt32Array(tag, field_name, result.unpackedSint32_); - break; - } - case 762: - case 760: { - input.ReadSInt64Array(tag, field_name, result.unpackedSint64_); - break; - } - case 770: - case 773: { - input.ReadFixed32Array(tag, field_name, result.unpackedFixed32_); - break; - } - case 778: - case 777: { - input.ReadFixed64Array(tag, field_name, result.unpackedFixed64_); - break; - } - case 786: - case 789: { - input.ReadSFixed32Array(tag, field_name, result.unpackedSfixed32_); - break; - } - case 794: - case 793: { - input.ReadSFixed64Array(tag, field_name, result.unpackedSfixed64_); - break; - } - case 802: - case 805: { - input.ReadFloatArray(tag, field_name, result.unpackedFloat_); - break; - } - case 810: - case 809: { - input.ReadDoubleArray(tag, field_name, result.unpackedDouble_); - break; - } - case 818: - case 816: { - input.ReadBoolArray(tag, field_name, result.unpackedBool_); - break; - } - case 826: - case 824: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.unpackedEnum_, out unknownItems); - if (unknownItems != null) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - foreach (object rawValue in unknownItems) - if (rawValue is int) - unknownFields.MergeVarintField(103, (ulong)(int)rawValue); - } - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public pbc::IPopsicleList UnpackedInt32List { - get { return PrepareBuilder().unpackedInt32_; } - } - public int UnpackedInt32Count { - get { return result.UnpackedInt32Count; } - } - public int GetUnpackedInt32(int index) { - return result.GetUnpackedInt32(index); - } - public Builder SetUnpackedInt32(int index, int value) { - PrepareBuilder(); - result.unpackedInt32_[index] = value; - return this; - } - public Builder AddUnpackedInt32(int value) { - PrepareBuilder(); - result.unpackedInt32_.Add(value); - return this; - } - public Builder AddRangeUnpackedInt32(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedInt32_.Add(values); - return this; - } - public Builder ClearUnpackedInt32() { - PrepareBuilder(); - result.unpackedInt32_.Clear(); - return this; - } - - public pbc::IPopsicleList UnpackedInt64List { - get { return PrepareBuilder().unpackedInt64_; } - } - public int UnpackedInt64Count { - get { return result.UnpackedInt64Count; } - } - public long GetUnpackedInt64(int index) { - return result.GetUnpackedInt64(index); - } - public Builder SetUnpackedInt64(int index, long value) { - PrepareBuilder(); - result.unpackedInt64_[index] = value; - return this; - } - public Builder AddUnpackedInt64(long value) { - PrepareBuilder(); - result.unpackedInt64_.Add(value); - return this; - } - public Builder AddRangeUnpackedInt64(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedInt64_.Add(values); - return this; - } - public Builder ClearUnpackedInt64() { - PrepareBuilder(); - result.unpackedInt64_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList UnpackedUint32List { - get { return PrepareBuilder().unpackedUint32_; } - } - public int UnpackedUint32Count { - get { return result.UnpackedUint32Count; } - } - [global::System.CLSCompliant(false)] - public uint GetUnpackedUint32(int index) { - return result.GetUnpackedUint32(index); - } - [global::System.CLSCompliant(false)] - public Builder SetUnpackedUint32(int index, uint value) { - PrepareBuilder(); - result.unpackedUint32_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddUnpackedUint32(uint value) { - PrepareBuilder(); - result.unpackedUint32_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeUnpackedUint32(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedUint32_.Add(values); - return this; - } - public Builder ClearUnpackedUint32() { - PrepareBuilder(); - result.unpackedUint32_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList UnpackedUint64List { - get { return PrepareBuilder().unpackedUint64_; } - } - public int UnpackedUint64Count { - get { return result.UnpackedUint64Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetUnpackedUint64(int index) { - return result.GetUnpackedUint64(index); - } - [global::System.CLSCompliant(false)] - public Builder SetUnpackedUint64(int index, ulong value) { - PrepareBuilder(); - result.unpackedUint64_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddUnpackedUint64(ulong value) { - PrepareBuilder(); - result.unpackedUint64_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeUnpackedUint64(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedUint64_.Add(values); - return this; - } - public Builder ClearUnpackedUint64() { - PrepareBuilder(); - result.unpackedUint64_.Clear(); - return this; - } - - public pbc::IPopsicleList UnpackedSint32List { - get { return PrepareBuilder().unpackedSint32_; } - } - public int UnpackedSint32Count { - get { return result.UnpackedSint32Count; } - } - public int GetUnpackedSint32(int index) { - return result.GetUnpackedSint32(index); - } - public Builder SetUnpackedSint32(int index, int value) { - PrepareBuilder(); - result.unpackedSint32_[index] = value; - return this; - } - public Builder AddUnpackedSint32(int value) { - PrepareBuilder(); - result.unpackedSint32_.Add(value); - return this; - } - public Builder AddRangeUnpackedSint32(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedSint32_.Add(values); - return this; - } - public Builder ClearUnpackedSint32() { - PrepareBuilder(); - result.unpackedSint32_.Clear(); - return this; - } - - public pbc::IPopsicleList UnpackedSint64List { - get { return PrepareBuilder().unpackedSint64_; } - } - public int UnpackedSint64Count { - get { return result.UnpackedSint64Count; } - } - public long GetUnpackedSint64(int index) { - return result.GetUnpackedSint64(index); - } - public Builder SetUnpackedSint64(int index, long value) { - PrepareBuilder(); - result.unpackedSint64_[index] = value; - return this; - } - public Builder AddUnpackedSint64(long value) { - PrepareBuilder(); - result.unpackedSint64_.Add(value); - return this; - } - public Builder AddRangeUnpackedSint64(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedSint64_.Add(values); - return this; - } - public Builder ClearUnpackedSint64() { - PrepareBuilder(); - result.unpackedSint64_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList UnpackedFixed32List { - get { return PrepareBuilder().unpackedFixed32_; } - } - public int UnpackedFixed32Count { - get { return result.UnpackedFixed32Count; } - } - [global::System.CLSCompliant(false)] - public uint GetUnpackedFixed32(int index) { - return result.GetUnpackedFixed32(index); - } - [global::System.CLSCompliant(false)] - public Builder SetUnpackedFixed32(int index, uint value) { - PrepareBuilder(); - result.unpackedFixed32_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddUnpackedFixed32(uint value) { - PrepareBuilder(); - result.unpackedFixed32_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeUnpackedFixed32(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedFixed32_.Add(values); - return this; - } - public Builder ClearUnpackedFixed32() { - PrepareBuilder(); - result.unpackedFixed32_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList UnpackedFixed64List { - get { return PrepareBuilder().unpackedFixed64_; } - } - public int UnpackedFixed64Count { - get { return result.UnpackedFixed64Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetUnpackedFixed64(int index) { - return result.GetUnpackedFixed64(index); - } - [global::System.CLSCompliant(false)] - public Builder SetUnpackedFixed64(int index, ulong value) { - PrepareBuilder(); - result.unpackedFixed64_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddUnpackedFixed64(ulong value) { - PrepareBuilder(); - result.unpackedFixed64_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeUnpackedFixed64(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedFixed64_.Add(values); - return this; - } - public Builder ClearUnpackedFixed64() { - PrepareBuilder(); - result.unpackedFixed64_.Clear(); - return this; - } - - public pbc::IPopsicleList UnpackedSfixed32List { - get { return PrepareBuilder().unpackedSfixed32_; } - } - public int UnpackedSfixed32Count { - get { return result.UnpackedSfixed32Count; } - } - public int GetUnpackedSfixed32(int index) { - return result.GetUnpackedSfixed32(index); - } - public Builder SetUnpackedSfixed32(int index, int value) { - PrepareBuilder(); - result.unpackedSfixed32_[index] = value; - return this; - } - public Builder AddUnpackedSfixed32(int value) { - PrepareBuilder(); - result.unpackedSfixed32_.Add(value); - return this; - } - public Builder AddRangeUnpackedSfixed32(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedSfixed32_.Add(values); - return this; - } - public Builder ClearUnpackedSfixed32() { - PrepareBuilder(); - result.unpackedSfixed32_.Clear(); - return this; - } - - public pbc::IPopsicleList UnpackedSfixed64List { - get { return PrepareBuilder().unpackedSfixed64_; } - } - public int UnpackedSfixed64Count { - get { return result.UnpackedSfixed64Count; } - } - public long GetUnpackedSfixed64(int index) { - return result.GetUnpackedSfixed64(index); - } - public Builder SetUnpackedSfixed64(int index, long value) { - PrepareBuilder(); - result.unpackedSfixed64_[index] = value; - return this; - } - public Builder AddUnpackedSfixed64(long value) { - PrepareBuilder(); - result.unpackedSfixed64_.Add(value); - return this; - } - public Builder AddRangeUnpackedSfixed64(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedSfixed64_.Add(values); - return this; - } - public Builder ClearUnpackedSfixed64() { - PrepareBuilder(); - result.unpackedSfixed64_.Clear(); - return this; - } - - public pbc::IPopsicleList UnpackedFloatList { - get { return PrepareBuilder().unpackedFloat_; } - } - public int UnpackedFloatCount { - get { return result.UnpackedFloatCount; } - } - public float GetUnpackedFloat(int index) { - return result.GetUnpackedFloat(index); - } - public Builder SetUnpackedFloat(int index, float value) { - PrepareBuilder(); - result.unpackedFloat_[index] = value; - return this; - } - public Builder AddUnpackedFloat(float value) { - PrepareBuilder(); - result.unpackedFloat_.Add(value); - return this; - } - public Builder AddRangeUnpackedFloat(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedFloat_.Add(values); - return this; - } - public Builder ClearUnpackedFloat() { - PrepareBuilder(); - result.unpackedFloat_.Clear(); - return this; - } - - public pbc::IPopsicleList UnpackedDoubleList { - get { return PrepareBuilder().unpackedDouble_; } - } - public int UnpackedDoubleCount { - get { return result.UnpackedDoubleCount; } - } - public double GetUnpackedDouble(int index) { - return result.GetUnpackedDouble(index); - } - public Builder SetUnpackedDouble(int index, double value) { - PrepareBuilder(); - result.unpackedDouble_[index] = value; - return this; - } - public Builder AddUnpackedDouble(double value) { - PrepareBuilder(); - result.unpackedDouble_.Add(value); - return this; - } - public Builder AddRangeUnpackedDouble(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedDouble_.Add(values); - return this; - } - public Builder ClearUnpackedDouble() { - PrepareBuilder(); - result.unpackedDouble_.Clear(); - return this; - } - - public pbc::IPopsicleList UnpackedBoolList { - get { return PrepareBuilder().unpackedBool_; } - } - public int UnpackedBoolCount { - get { return result.UnpackedBoolCount; } - } - public bool GetUnpackedBool(int index) { - return result.GetUnpackedBool(index); - } - public Builder SetUnpackedBool(int index, bool value) { - PrepareBuilder(); - result.unpackedBool_[index] = value; - return this; - } - public Builder AddUnpackedBool(bool value) { - PrepareBuilder(); - result.unpackedBool_.Add(value); - return this; - } - public Builder AddRangeUnpackedBool(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedBool_.Add(values); - return this; - } - public Builder ClearUnpackedBool() { - PrepareBuilder(); - result.unpackedBool_.Clear(); - return this; - } - - public pbc::IPopsicleList UnpackedEnumList { - get { return PrepareBuilder().unpackedEnum_; } - } - public int UnpackedEnumCount { - get { return result.UnpackedEnumCount; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum GetUnpackedEnum(int index) { - return result.GetUnpackedEnum(index); - } - public Builder SetUnpackedEnum(int index, global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) { - PrepareBuilder(); - result.unpackedEnum_[index] = value; - return this; - } - public Builder AddUnpackedEnum(global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) { - PrepareBuilder(); - result.unpackedEnum_.Add(value); - return this; - } - public Builder AddRangeUnpackedEnum(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedEnum_.Add(values); - return this; - } - public Builder ClearUnpackedEnum() { - PrepareBuilder(); - result.unpackedEnum_.Clear(); - return this; - } - } - static TestUnpackedTypes() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestPackedExtensions : pb::ExtendableMessage { - private TestPackedExtensions() { } - private static readonly TestPackedExtensions defaultInstance = new TestPackedExtensions().MakeReadOnly(); - private static readonly string[] _testPackedExtensionsFieldNames = new string[] { }; - private static readonly uint[] _testPackedExtensionsFieldTags = new uint[] { }; - public static TestPackedExtensions DefaultInstance { - get { return defaultInstance; } - } - - public override TestPackedExtensions DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestPackedExtensions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestPackedExtensions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestPackedExtensions__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testPackedExtensionsFieldNames; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - extensionWriter.WriteUntil(536870912, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestPackedExtensions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestPackedExtensions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestPackedExtensions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestPackedExtensions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestPackedExtensions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestPackedExtensions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestPackedExtensions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestPackedExtensions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestPackedExtensions ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestPackedExtensions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestPackedExtensions MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestPackedExtensions prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestPackedExtensions cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestPackedExtensions result; - - private TestPackedExtensions PrepareBuilder() { - if (resultIsReadOnly) { - TestPackedExtensions original = result; - result = new TestPackedExtensions(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestPackedExtensions MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestPackedExtensions.Descriptor; } - } - - public override TestPackedExtensions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestPackedExtensions.DefaultInstance; } - } - - public override TestPackedExtensions BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestPackedExtensions) { - return MergeFrom((TestPackedExtensions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestPackedExtensions other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestPackedExtensions.DefaultInstance) return this; - PrepareBuilder(); - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testPackedExtensionsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testPackedExtensionsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static TestPackedExtensions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestDynamicExtensions : pb::GeneratedMessage { - private TestDynamicExtensions() { } - private static readonly TestDynamicExtensions defaultInstance = new TestDynamicExtensions().MakeReadOnly(); - private static readonly string[] _testDynamicExtensionsFieldNames = new string[] { "dynamic_enum_extension", "dynamic_message_extension", "enum_extension", "message_extension", "packed_extension", "repeated_extension", "scalar_extension" }; - private static readonly uint[] _testDynamicExtensionsFieldTags = new uint[] { 16016, 16034, 16008, 16026, 16050, 16042, 16005 }; - public static TestDynamicExtensions DefaultInstance { - get { return defaultInstance; } - } - - public override TestDynamicExtensions DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestDynamicExtensions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDynamicExtensions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDynamicExtensions__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - public enum DynamicEnumType { - DYNAMIC_FOO = 2200, - DYNAMIC_BAR = 2201, - DYNAMIC_BAZ = 2202, - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class DynamicMessageType : pb::GeneratedMessage { - private DynamicMessageType() { } - private static readonly DynamicMessageType defaultInstance = new DynamicMessageType().MakeReadOnly(); - private static readonly string[] _dynamicMessageTypeFieldNames = new string[] { "dynamic_field" }; - private static readonly uint[] _dynamicMessageTypeFieldTags = new uint[] { 16800 }; - public static DynamicMessageType DefaultInstance { - get { return defaultInstance; } - } - - public override DynamicMessageType DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override DynamicMessageType ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDynamicExtensions_DynamicMessageType__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDynamicExtensions_DynamicMessageType__FieldAccessorTable; } - } - - public const int DynamicFieldFieldNumber = 2100; - private bool hasDynamicField; - private int dynamicField_; - public bool HasDynamicField { - get { return hasDynamicField; } - } - public int DynamicField { - get { return dynamicField_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _dynamicMessageTypeFieldNames; - if (hasDynamicField) { - output.WriteInt32(2100, field_names[0], DynamicField); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasDynamicField) { - size += pb::CodedOutputStream.ComputeInt32Size(2100, DynamicField); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static DynamicMessageType ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static DynamicMessageType ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static DynamicMessageType ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static DynamicMessageType ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static DynamicMessageType ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static DynamicMessageType ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static DynamicMessageType ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static DynamicMessageType ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static DynamicMessageType ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static DynamicMessageType ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private DynamicMessageType MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(DynamicMessageType prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(DynamicMessageType cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private DynamicMessageType result; - - private DynamicMessageType PrepareBuilder() { - if (resultIsReadOnly) { - DynamicMessageType original = result; - result = new DynamicMessageType(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override DynamicMessageType MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType.Descriptor; } - } - - public override DynamicMessageType DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType.DefaultInstance; } - } - - public override DynamicMessageType BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is DynamicMessageType) { - return MergeFrom((DynamicMessageType) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(DynamicMessageType other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasDynamicField) { - DynamicField = other.DynamicField; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_dynamicMessageTypeFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _dynamicMessageTypeFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 16800: { - result.hasDynamicField = input.ReadInt32(ref result.dynamicField_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasDynamicField { - get { return result.hasDynamicField; } - } - public int DynamicField { - get { return result.DynamicField; } - set { SetDynamicField(value); } - } - public Builder SetDynamicField(int value) { - PrepareBuilder(); - result.hasDynamicField = true; - result.dynamicField_ = value; - return this; - } - public Builder ClearDynamicField() { - PrepareBuilder(); - result.hasDynamicField = false; - result.dynamicField_ = 0; - return this; - } - } - static DynamicMessageType() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - } - #endregion - - public const int ScalarExtensionFieldNumber = 2000; - private bool hasScalarExtension; - private uint scalarExtension_; - public bool HasScalarExtension { - get { return hasScalarExtension; } - } - [global::System.CLSCompliant(false)] - public uint ScalarExtension { - get { return scalarExtension_; } - } - - public const int EnumExtensionFieldNumber = 2001; - private bool hasEnumExtension; - private global::Google.ProtocolBuffers.TestProtos.ForeignEnum enumExtension_ = global::Google.ProtocolBuffers.TestProtos.ForeignEnum.FOREIGN_FOO; - public bool HasEnumExtension { - get { return hasEnumExtension; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum EnumExtension { - get { return enumExtension_; } - } - - public const int DynamicEnumExtensionFieldNumber = 2002; - private bool hasDynamicEnumExtension; - private global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicEnumType dynamicEnumExtension_ = global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicEnumType.DYNAMIC_FOO; - public bool HasDynamicEnumExtension { - get { return hasDynamicEnumExtension; } - } - public global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicEnumType DynamicEnumExtension { - get { return dynamicEnumExtension_; } - } - - public const int MessageExtensionFieldNumber = 2003; - private bool hasMessageExtension; - private global::Google.ProtocolBuffers.TestProtos.ForeignMessage messageExtension_; - public bool HasMessageExtension { - get { return hasMessageExtension; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage MessageExtension { - get { return messageExtension_ ?? global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance; } - } - - public const int DynamicMessageExtensionFieldNumber = 2004; - private bool hasDynamicMessageExtension; - private global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType dynamicMessageExtension_; - public bool HasDynamicMessageExtension { - get { return hasDynamicMessageExtension; } - } - public global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType DynamicMessageExtension { - get { return dynamicMessageExtension_ ?? global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType.DefaultInstance; } - } - - public const int RepeatedExtensionFieldNumber = 2005; - private pbc::PopsicleList repeatedExtension_ = new pbc::PopsicleList(); - public scg::IList RepeatedExtensionList { - get { return pbc::Lists.AsReadOnly(repeatedExtension_); } - } - public int RepeatedExtensionCount { - get { return repeatedExtension_.Count; } - } - public string GetRepeatedExtension(int index) { - return repeatedExtension_[index]; - } - - public const int PackedExtensionFieldNumber = 2006; - private int packedExtensionMemoizedSerializedSize; - private pbc::PopsicleList packedExtension_ = new pbc::PopsicleList(); - public scg::IList PackedExtensionList { - get { return pbc::Lists.AsReadOnly(packedExtension_); } - } - public int PackedExtensionCount { - get { return packedExtension_.Count; } - } - public int GetPackedExtension(int index) { - return packedExtension_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testDynamicExtensionsFieldNames; - if (hasScalarExtension) { - output.WriteFixed32(2000, field_names[6], ScalarExtension); - } - if (hasEnumExtension) { - output.WriteEnum(2001, field_names[2], (int) EnumExtension, EnumExtension); - } - if (hasDynamicEnumExtension) { - output.WriteEnum(2002, field_names[0], (int) DynamicEnumExtension, DynamicEnumExtension); - } - if (hasMessageExtension) { - output.WriteMessage(2003, field_names[3], MessageExtension); - } - if (hasDynamicMessageExtension) { - output.WriteMessage(2004, field_names[1], DynamicMessageExtension); - } - if (repeatedExtension_.Count > 0) { - output.WriteStringArray(2005, field_names[5], repeatedExtension_); - } - if (packedExtension_.Count > 0) { - output.WritePackedSInt32Array(2006, field_names[4], packedExtensionMemoizedSerializedSize, packedExtension_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasScalarExtension) { - size += pb::CodedOutputStream.ComputeFixed32Size(2000, ScalarExtension); - } - if (hasEnumExtension) { - size += pb::CodedOutputStream.ComputeEnumSize(2001, (int) EnumExtension); - } - if (hasDynamicEnumExtension) { - size += pb::CodedOutputStream.ComputeEnumSize(2002, (int) DynamicEnumExtension); - } - if (hasMessageExtension) { - size += pb::CodedOutputStream.ComputeMessageSize(2003, MessageExtension); - } - if (hasDynamicMessageExtension) { - size += pb::CodedOutputStream.ComputeMessageSize(2004, DynamicMessageExtension); - } - { - int dataSize = 0; - foreach (string element in RepeatedExtensionList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedExtension_.Count; - } - { - int dataSize = 0; - foreach (int element in PackedExtensionList) { - dataSize += pb::CodedOutputStream.ComputeSInt32SizeNoTag(element); - } - size += dataSize; - if (packedExtension_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedExtensionMemoizedSerializedSize = dataSize; - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestDynamicExtensions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestDynamicExtensions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestDynamicExtensions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestDynamicExtensions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestDynamicExtensions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestDynamicExtensions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestDynamicExtensions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestDynamicExtensions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestDynamicExtensions ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestDynamicExtensions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestDynamicExtensions MakeReadOnly() { - repeatedExtension_.MakeReadOnly(); - packedExtension_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestDynamicExtensions prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestDynamicExtensions cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestDynamicExtensions result; - - private TestDynamicExtensions PrepareBuilder() { - if (resultIsReadOnly) { - TestDynamicExtensions original = result; - result = new TestDynamicExtensions(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestDynamicExtensions MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Descriptor; } - } - - public override TestDynamicExtensions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.DefaultInstance; } - } - - public override TestDynamicExtensions BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestDynamicExtensions) { - return MergeFrom((TestDynamicExtensions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestDynamicExtensions other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasScalarExtension) { - ScalarExtension = other.ScalarExtension; - } - if (other.HasEnumExtension) { - EnumExtension = other.EnumExtension; - } - if (other.HasDynamicEnumExtension) { - DynamicEnumExtension = other.DynamicEnumExtension; - } - if (other.HasMessageExtension) { - MergeMessageExtension(other.MessageExtension); - } - if (other.HasDynamicMessageExtension) { - MergeDynamicMessageExtension(other.DynamicMessageExtension); - } - if (other.repeatedExtension_.Count != 0) { - result.repeatedExtension_.Add(other.repeatedExtension_); - } - if (other.packedExtension_.Count != 0) { - result.packedExtension_.Add(other.packedExtension_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testDynamicExtensionsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testDynamicExtensionsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 16005: { - result.hasScalarExtension = input.ReadFixed32(ref result.scalarExtension_); - break; - } - case 16008: { - object unknown; - if(input.ReadEnum(ref result.enumExtension_, out unknown)) { - result.hasEnumExtension = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(2001, (ulong)(int)unknown); - } - break; - } - case 16016: { - object unknown; - if(input.ReadEnum(ref result.dynamicEnumExtension_, out unknown)) { - result.hasDynamicEnumExtension = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(2002, (ulong)(int)unknown); - } - break; - } - case 16026: { - global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.ForeignMessage.CreateBuilder(); - if (result.hasMessageExtension) { - subBuilder.MergeFrom(MessageExtension); - } - input.ReadMessage(subBuilder, extensionRegistry); - MessageExtension = subBuilder.BuildPartial(); - break; - } - case 16034: { - global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType.CreateBuilder(); - if (result.hasDynamicMessageExtension) { - subBuilder.MergeFrom(DynamicMessageExtension); - } - input.ReadMessage(subBuilder, extensionRegistry); - DynamicMessageExtension = subBuilder.BuildPartial(); - break; - } - case 16042: { - input.ReadStringArray(tag, field_name, result.repeatedExtension_); - break; - } - case 16050: - case 16048: { - input.ReadSInt32Array(tag, field_name, result.packedExtension_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasScalarExtension { - get { return result.hasScalarExtension; } - } - [global::System.CLSCompliant(false)] - public uint ScalarExtension { - get { return result.ScalarExtension; } - set { SetScalarExtension(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetScalarExtension(uint value) { - PrepareBuilder(); - result.hasScalarExtension = true; - result.scalarExtension_ = value; - return this; - } - public Builder ClearScalarExtension() { - PrepareBuilder(); - result.hasScalarExtension = false; - result.scalarExtension_ = 0; - return this; - } - - public bool HasEnumExtension { - get { return result.hasEnumExtension; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum EnumExtension { - get { return result.EnumExtension; } - set { SetEnumExtension(value); } - } - public Builder SetEnumExtension(global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) { - PrepareBuilder(); - result.hasEnumExtension = true; - result.enumExtension_ = value; - return this; - } - public Builder ClearEnumExtension() { - PrepareBuilder(); - result.hasEnumExtension = false; - result.enumExtension_ = global::Google.ProtocolBuffers.TestProtos.ForeignEnum.FOREIGN_FOO; - return this; - } - - public bool HasDynamicEnumExtension { - get { return result.hasDynamicEnumExtension; } - } - public global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicEnumType DynamicEnumExtension { - get { return result.DynamicEnumExtension; } - set { SetDynamicEnumExtension(value); } - } - public Builder SetDynamicEnumExtension(global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicEnumType value) { - PrepareBuilder(); - result.hasDynamicEnumExtension = true; - result.dynamicEnumExtension_ = value; - return this; - } - public Builder ClearDynamicEnumExtension() { - PrepareBuilder(); - result.hasDynamicEnumExtension = false; - result.dynamicEnumExtension_ = global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicEnumType.DYNAMIC_FOO; - return this; - } - - public bool HasMessageExtension { - get { return result.hasMessageExtension; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage MessageExtension { - get { return result.MessageExtension; } - set { SetMessageExtension(value); } - } - public Builder SetMessageExtension(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasMessageExtension = true; - result.messageExtension_ = value; - return this; - } - public Builder SetMessageExtension(global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasMessageExtension = true; - result.messageExtension_ = builderForValue.Build(); - return this; - } - public Builder MergeMessageExtension(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasMessageExtension && - result.messageExtension_ != global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance) { - result.messageExtension_ = global::Google.ProtocolBuffers.TestProtos.ForeignMessage.CreateBuilder(result.messageExtension_).MergeFrom(value).BuildPartial(); - } else { - result.messageExtension_ = value; - } - result.hasMessageExtension = true; - return this; - } - public Builder ClearMessageExtension() { - PrepareBuilder(); - result.hasMessageExtension = false; - result.messageExtension_ = null; - return this; - } - - public bool HasDynamicMessageExtension { - get { return result.hasDynamicMessageExtension; } - } - public global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType DynamicMessageExtension { - get { return result.DynamicMessageExtension; } - set { SetDynamicMessageExtension(value); } - } - public Builder SetDynamicMessageExtension(global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasDynamicMessageExtension = true; - result.dynamicMessageExtension_ = value; - return this; - } - public Builder SetDynamicMessageExtension(global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasDynamicMessageExtension = true; - result.dynamicMessageExtension_ = builderForValue.Build(); - return this; - } - public Builder MergeDynamicMessageExtension(global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasDynamicMessageExtension && - result.dynamicMessageExtension_ != global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType.DefaultInstance) { - result.dynamicMessageExtension_ = global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType.CreateBuilder(result.dynamicMessageExtension_).MergeFrom(value).BuildPartial(); - } else { - result.dynamicMessageExtension_ = value; - } - result.hasDynamicMessageExtension = true; - return this; - } - public Builder ClearDynamicMessageExtension() { - PrepareBuilder(); - result.hasDynamicMessageExtension = false; - result.dynamicMessageExtension_ = null; - return this; - } - - public pbc::IPopsicleList RepeatedExtensionList { - get { return PrepareBuilder().repeatedExtension_; } - } - public int RepeatedExtensionCount { - get { return result.RepeatedExtensionCount; } - } - public string GetRepeatedExtension(int index) { - return result.GetRepeatedExtension(index); - } - public Builder SetRepeatedExtension(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedExtension_[index] = value; - return this; - } - public Builder AddRepeatedExtension(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedExtension_.Add(value); - return this; - } - public Builder AddRangeRepeatedExtension(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedExtension_.Add(values); - return this; - } - public Builder ClearRepeatedExtension() { - PrepareBuilder(); - result.repeatedExtension_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedExtensionList { - get { return PrepareBuilder().packedExtension_; } - } - public int PackedExtensionCount { - get { return result.PackedExtensionCount; } - } - public int GetPackedExtension(int index) { - return result.GetPackedExtension(index); - } - public Builder SetPackedExtension(int index, int value) { - PrepareBuilder(); - result.packedExtension_[index] = value; - return this; - } - public Builder AddPackedExtension(int value) { - PrepareBuilder(); - result.packedExtension_.Add(value); - return this; - } - public Builder AddRangePackedExtension(scg::IEnumerable values) { - PrepareBuilder(); - result.packedExtension_.Add(values); - return this; - } - public Builder ClearPackedExtension() { - PrepareBuilder(); - result.packedExtension_.Clear(); - return this; - } - } - static TestDynamicExtensions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestRepeatedScalarDifferentTagSizes : pb::GeneratedMessage { - private TestRepeatedScalarDifferentTagSizes() { } - private static readonly TestRepeatedScalarDifferentTagSizes defaultInstance = new TestRepeatedScalarDifferentTagSizes().MakeReadOnly(); - private static readonly string[] _testRepeatedScalarDifferentTagSizesFieldNames = new string[] { "repeated_fixed32", "repeated_fixed64", "repeated_float", "repeated_int32", "repeated_int64", "repeated_uint64" }; - private static readonly uint[] _testRepeatedScalarDifferentTagSizesFieldTags = new uint[] { 101, 16369, 2097141, 104, 16376, 2097144 }; - public static TestRepeatedScalarDifferentTagSizes DefaultInstance { - get { return defaultInstance; } - } - - public override TestRepeatedScalarDifferentTagSizes DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestRepeatedScalarDifferentTagSizes ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestRepeatedScalarDifferentTagSizes__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestRepeatedScalarDifferentTagSizes__FieldAccessorTable; } - } - - public const int RepeatedFixed32FieldNumber = 12; - private pbc::PopsicleList repeatedFixed32_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList RepeatedFixed32List { - get { return pbc::Lists.AsReadOnly(repeatedFixed32_); } - } - public int RepeatedFixed32Count { - get { return repeatedFixed32_.Count; } - } - [global::System.CLSCompliant(false)] - public uint GetRepeatedFixed32(int index) { - return repeatedFixed32_[index]; - } - - public const int RepeatedInt32FieldNumber = 13; - private pbc::PopsicleList repeatedInt32_ = new pbc::PopsicleList(); - public scg::IList RepeatedInt32List { - get { return pbc::Lists.AsReadOnly(repeatedInt32_); } - } - public int RepeatedInt32Count { - get { return repeatedInt32_.Count; } - } - public int GetRepeatedInt32(int index) { - return repeatedInt32_[index]; - } - - public const int RepeatedFixed64FieldNumber = 2046; - private pbc::PopsicleList repeatedFixed64_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList RepeatedFixed64List { - get { return pbc::Lists.AsReadOnly(repeatedFixed64_); } - } - public int RepeatedFixed64Count { - get { return repeatedFixed64_.Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetRepeatedFixed64(int index) { - return repeatedFixed64_[index]; - } - - public const int RepeatedInt64FieldNumber = 2047; - private pbc::PopsicleList repeatedInt64_ = new pbc::PopsicleList(); - public scg::IList RepeatedInt64List { - get { return pbc::Lists.AsReadOnly(repeatedInt64_); } - } - public int RepeatedInt64Count { - get { return repeatedInt64_.Count; } - } - public long GetRepeatedInt64(int index) { - return repeatedInt64_[index]; - } - - public const int RepeatedFloatFieldNumber = 262142; - private pbc::PopsicleList repeatedFloat_ = new pbc::PopsicleList(); - public scg::IList RepeatedFloatList { - get { return pbc::Lists.AsReadOnly(repeatedFloat_); } - } - public int RepeatedFloatCount { - get { return repeatedFloat_.Count; } - } - public float GetRepeatedFloat(int index) { - return repeatedFloat_[index]; - } - - public const int RepeatedUint64FieldNumber = 262143; - private pbc::PopsicleList repeatedUint64_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList RepeatedUint64List { - get { return pbc::Lists.AsReadOnly(repeatedUint64_); } - } - public int RepeatedUint64Count { - get { return repeatedUint64_.Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetRepeatedUint64(int index) { - return repeatedUint64_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testRepeatedScalarDifferentTagSizesFieldNames; - if (repeatedFixed32_.Count > 0) { - output.WriteFixed32Array(12, field_names[0], repeatedFixed32_); - } - if (repeatedInt32_.Count > 0) { - output.WriteInt32Array(13, field_names[3], repeatedInt32_); - } - if (repeatedFixed64_.Count > 0) { - output.WriteFixed64Array(2046, field_names[1], repeatedFixed64_); - } - if (repeatedInt64_.Count > 0) { - output.WriteInt64Array(2047, field_names[4], repeatedInt64_); - } - if (repeatedFloat_.Count > 0) { - output.WriteFloatArray(262142, field_names[2], repeatedFloat_); - } - if (repeatedUint64_.Count > 0) { - output.WriteUInt64Array(262143, field_names[5], repeatedUint64_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - dataSize = 4 * repeatedFixed32_.Count; - size += dataSize; - size += 1 * repeatedFixed32_.Count; - } - { - int dataSize = 0; - foreach (int element in RepeatedInt32List) { - dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); - } - size += dataSize; - size += 1 * repeatedInt32_.Count; - } - { - int dataSize = 0; - dataSize = 8 * repeatedFixed64_.Count; - size += dataSize; - size += 2 * repeatedFixed64_.Count; - } - { - int dataSize = 0; - foreach (long element in RepeatedInt64List) { - dataSize += pb::CodedOutputStream.ComputeInt64SizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedInt64_.Count; - } - { - int dataSize = 0; - dataSize = 4 * repeatedFloat_.Count; - size += dataSize; - size += 3 * repeatedFloat_.Count; - } - { - int dataSize = 0; - foreach (ulong element in RepeatedUint64List) { - dataSize += pb::CodedOutputStream.ComputeUInt64SizeNoTag(element); - } - size += dataSize; - size += 3 * repeatedUint64_.Count; - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestRepeatedScalarDifferentTagSizes ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestRepeatedScalarDifferentTagSizes ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestRepeatedScalarDifferentTagSizes ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestRepeatedScalarDifferentTagSizes ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestRepeatedScalarDifferentTagSizes ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestRepeatedScalarDifferentTagSizes ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestRepeatedScalarDifferentTagSizes ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestRepeatedScalarDifferentTagSizes ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestRepeatedScalarDifferentTagSizes ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestRepeatedScalarDifferentTagSizes ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestRepeatedScalarDifferentTagSizes MakeReadOnly() { - repeatedFixed32_.MakeReadOnly(); - repeatedInt32_.MakeReadOnly(); - repeatedFixed64_.MakeReadOnly(); - repeatedInt64_.MakeReadOnly(); - repeatedFloat_.MakeReadOnly(); - repeatedUint64_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestRepeatedScalarDifferentTagSizes prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestRepeatedScalarDifferentTagSizes cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestRepeatedScalarDifferentTagSizes result; - - private TestRepeatedScalarDifferentTagSizes PrepareBuilder() { - if (resultIsReadOnly) { - TestRepeatedScalarDifferentTagSizes original = result; - result = new TestRepeatedScalarDifferentTagSizes(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestRepeatedScalarDifferentTagSizes MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestRepeatedScalarDifferentTagSizes.Descriptor; } - } - - public override TestRepeatedScalarDifferentTagSizes DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestRepeatedScalarDifferentTagSizes.DefaultInstance; } - } - - public override TestRepeatedScalarDifferentTagSizes BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestRepeatedScalarDifferentTagSizes) { - return MergeFrom((TestRepeatedScalarDifferentTagSizes) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestRepeatedScalarDifferentTagSizes other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestRepeatedScalarDifferentTagSizes.DefaultInstance) return this; - PrepareBuilder(); - if (other.repeatedFixed32_.Count != 0) { - result.repeatedFixed32_.Add(other.repeatedFixed32_); - } - if (other.repeatedInt32_.Count != 0) { - result.repeatedInt32_.Add(other.repeatedInt32_); - } - if (other.repeatedFixed64_.Count != 0) { - result.repeatedFixed64_.Add(other.repeatedFixed64_); - } - if (other.repeatedInt64_.Count != 0) { - result.repeatedInt64_.Add(other.repeatedInt64_); - } - if (other.repeatedFloat_.Count != 0) { - result.repeatedFloat_.Add(other.repeatedFloat_); - } - if (other.repeatedUint64_.Count != 0) { - result.repeatedUint64_.Add(other.repeatedUint64_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testRepeatedScalarDifferentTagSizesFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testRepeatedScalarDifferentTagSizesFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 98: - case 101: { - input.ReadFixed32Array(tag, field_name, result.repeatedFixed32_); - break; - } - case 106: - case 104: { - input.ReadInt32Array(tag, field_name, result.repeatedInt32_); - break; - } - case 16370: - case 16369: { - input.ReadFixed64Array(tag, field_name, result.repeatedFixed64_); - break; - } - case 16378: - case 16376: { - input.ReadInt64Array(tag, field_name, result.repeatedInt64_); - break; - } - case 2097138: - case 2097141: { - input.ReadFloatArray(tag, field_name, result.repeatedFloat_); - break; - } - case 2097146: - case 2097144: { - input.ReadUInt64Array(tag, field_name, result.repeatedUint64_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList RepeatedFixed32List { - get { return PrepareBuilder().repeatedFixed32_; } - } - public int RepeatedFixed32Count { - get { return result.RepeatedFixed32Count; } - } - [global::System.CLSCompliant(false)] - public uint GetRepeatedFixed32(int index) { - return result.GetRepeatedFixed32(index); - } - [global::System.CLSCompliant(false)] - public Builder SetRepeatedFixed32(int index, uint value) { - PrepareBuilder(); - result.repeatedFixed32_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRepeatedFixed32(uint value) { - PrepareBuilder(); - result.repeatedFixed32_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeRepeatedFixed32(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedFixed32_.Add(values); - return this; - } - public Builder ClearRepeatedFixed32() { - PrepareBuilder(); - result.repeatedFixed32_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedInt32List { - get { return PrepareBuilder().repeatedInt32_; } - } - public int RepeatedInt32Count { - get { return result.RepeatedInt32Count; } - } - public int GetRepeatedInt32(int index) { - return result.GetRepeatedInt32(index); - } - public Builder SetRepeatedInt32(int index, int value) { - PrepareBuilder(); - result.repeatedInt32_[index] = value; - return this; - } - public Builder AddRepeatedInt32(int value) { - PrepareBuilder(); - result.repeatedInt32_.Add(value); - return this; - } - public Builder AddRangeRepeatedInt32(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedInt32_.Add(values); - return this; - } - public Builder ClearRepeatedInt32() { - PrepareBuilder(); - result.repeatedInt32_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList RepeatedFixed64List { - get { return PrepareBuilder().repeatedFixed64_; } - } - public int RepeatedFixed64Count { - get { return result.RepeatedFixed64Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetRepeatedFixed64(int index) { - return result.GetRepeatedFixed64(index); - } - [global::System.CLSCompliant(false)] - public Builder SetRepeatedFixed64(int index, ulong value) { - PrepareBuilder(); - result.repeatedFixed64_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRepeatedFixed64(ulong value) { - PrepareBuilder(); - result.repeatedFixed64_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeRepeatedFixed64(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedFixed64_.Add(values); - return this; - } - public Builder ClearRepeatedFixed64() { - PrepareBuilder(); - result.repeatedFixed64_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedInt64List { - get { return PrepareBuilder().repeatedInt64_; } - } - public int RepeatedInt64Count { - get { return result.RepeatedInt64Count; } - } - public long GetRepeatedInt64(int index) { - return result.GetRepeatedInt64(index); - } - public Builder SetRepeatedInt64(int index, long value) { - PrepareBuilder(); - result.repeatedInt64_[index] = value; - return this; - } - public Builder AddRepeatedInt64(long value) { - PrepareBuilder(); - result.repeatedInt64_.Add(value); - return this; - } - public Builder AddRangeRepeatedInt64(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedInt64_.Add(values); - return this; - } - public Builder ClearRepeatedInt64() { - PrepareBuilder(); - result.repeatedInt64_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedFloatList { - get { return PrepareBuilder().repeatedFloat_; } - } - public int RepeatedFloatCount { - get { return result.RepeatedFloatCount; } - } - public float GetRepeatedFloat(int index) { - return result.GetRepeatedFloat(index); - } - public Builder SetRepeatedFloat(int index, float value) { - PrepareBuilder(); - result.repeatedFloat_[index] = value; - return this; - } - public Builder AddRepeatedFloat(float value) { - PrepareBuilder(); - result.repeatedFloat_.Add(value); - return this; - } - public Builder AddRangeRepeatedFloat(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedFloat_.Add(values); - return this; - } - public Builder ClearRepeatedFloat() { - PrepareBuilder(); - result.repeatedFloat_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList RepeatedUint64List { - get { return PrepareBuilder().repeatedUint64_; } - } - public int RepeatedUint64Count { - get { return result.RepeatedUint64Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetRepeatedUint64(int index) { - return result.GetRepeatedUint64(index); - } - [global::System.CLSCompliant(false)] - public Builder SetRepeatedUint64(int index, ulong value) { - PrepareBuilder(); - result.repeatedUint64_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRepeatedUint64(ulong value) { - PrepareBuilder(); - result.repeatedUint64_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeRepeatedUint64(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedUint64_.Add(values); - return this; - } - public Builder ClearRepeatedUint64() { - PrepareBuilder(); - result.repeatedUint64_.Clear(); - return this; - } - } - static TestRepeatedScalarDifferentTagSizes() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class FooRequest : pb::GeneratedMessage { - private FooRequest() { } - private static readonly FooRequest defaultInstance = new FooRequest().MakeReadOnly(); - private static readonly string[] _fooRequestFieldNames = new string[] { }; - private static readonly uint[] _fooRequestFieldTags = new uint[] { }; - public static FooRequest DefaultInstance { - get { return defaultInstance; } - } - - public override FooRequest DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override FooRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_FooRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_FooRequest__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _fooRequestFieldNames; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static FooRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FooRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FooRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FooRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FooRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FooRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static FooRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static FooRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static FooRequest ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FooRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private FooRequest MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(FooRequest prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(FooRequest cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private FooRequest result; - - private FooRequest PrepareBuilder() { - if (resultIsReadOnly) { - FooRequest original = result; - result = new FooRequest(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override FooRequest MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.FooRequest.Descriptor; } - } - - public override FooRequest DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.FooRequest.DefaultInstance; } - } - - public override FooRequest BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is FooRequest) { - return MergeFrom((FooRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(FooRequest other) { - if (other == global::Google.ProtocolBuffers.TestProtos.FooRequest.DefaultInstance) return this; - PrepareBuilder(); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_fooRequestFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _fooRequestFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static FooRequest() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class FooResponse : pb::GeneratedMessage { - private FooResponse() { } - private static readonly FooResponse defaultInstance = new FooResponse().MakeReadOnly(); - private static readonly string[] _fooResponseFieldNames = new string[] { }; - private static readonly uint[] _fooResponseFieldTags = new uint[] { }; - public static FooResponse DefaultInstance { - get { return defaultInstance; } - } - - public override FooResponse DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override FooResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_FooResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_FooResponse__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _fooResponseFieldNames; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static FooResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FooResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FooResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FooResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FooResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FooResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static FooResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static FooResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static FooResponse ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FooResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private FooResponse MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(FooResponse prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(FooResponse cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private FooResponse result; - - private FooResponse PrepareBuilder() { - if (resultIsReadOnly) { - FooResponse original = result; - result = new FooResponse(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override FooResponse MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.FooResponse.Descriptor; } - } - - public override FooResponse DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.FooResponse.DefaultInstance; } - } - - public override FooResponse BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is FooResponse) { - return MergeFrom((FooResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(FooResponse other) { - if (other == global::Google.ProtocolBuffers.TestProtos.FooResponse.DefaultInstance) return this; - PrepareBuilder(); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_fooResponseFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _fooResponseFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static FooResponse() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class BarRequest : pb::GeneratedMessage { - private BarRequest() { } - private static readonly BarRequest defaultInstance = new BarRequest().MakeReadOnly(); - private static readonly string[] _barRequestFieldNames = new string[] { }; - private static readonly uint[] _barRequestFieldTags = new uint[] { }; - public static BarRequest DefaultInstance { - get { return defaultInstance; } - } - - public override BarRequest DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override BarRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_BarRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_BarRequest__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _barRequestFieldNames; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static BarRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static BarRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static BarRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static BarRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static BarRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static BarRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static BarRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static BarRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static BarRequest ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static BarRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private BarRequest MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(BarRequest prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(BarRequest cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private BarRequest result; - - private BarRequest PrepareBuilder() { - if (resultIsReadOnly) { - BarRequest original = result; - result = new BarRequest(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override BarRequest MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.BarRequest.Descriptor; } - } - - public override BarRequest DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.BarRequest.DefaultInstance; } - } - - public override BarRequest BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is BarRequest) { - return MergeFrom((BarRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(BarRequest other) { - if (other == global::Google.ProtocolBuffers.TestProtos.BarRequest.DefaultInstance) return this; - PrepareBuilder(); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_barRequestFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _barRequestFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static BarRequest() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class BarResponse : pb::GeneratedMessage { - private BarResponse() { } - private static readonly BarResponse defaultInstance = new BarResponse().MakeReadOnly(); - private static readonly string[] _barResponseFieldNames = new string[] { }; - private static readonly uint[] _barResponseFieldTags = new uint[] { }; - public static BarResponse DefaultInstance { - get { return defaultInstance; } - } - - public override BarResponse DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override BarResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_BarResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_BarResponse__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _barResponseFieldNames; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static BarResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static BarResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static BarResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static BarResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static BarResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static BarResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static BarResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static BarResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static BarResponse ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static BarResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private BarResponse MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(BarResponse prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(BarResponse cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private BarResponse result; - - private BarResponse PrepareBuilder() { - if (resultIsReadOnly) { - BarResponse original = result; - result = new BarResponse(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override BarResponse MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.BarResponse.Descriptor; } - } - - public override BarResponse DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.BarResponse.DefaultInstance; } - } - - public override BarResponse BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is BarResponse) { - return MergeFrom((BarResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(BarResponse other) { - if (other == global::Google.ProtocolBuffers.TestProtos.BarResponse.DefaultInstance) return this; - PrepareBuilder(); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_barResponseFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _barResponseFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static BarResponse() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - #endregion - - #region Services - /* - * Service generation is now disabled by default, use the following option to enable: - * option (google.protobuf.csharp_file_options).service_generator_type = GENERIC; - */ - #endregion - -} - -#endregion Designer generated code diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestRpcInterop.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestRpcInterop.cs deleted file mode 100644 index 8c6dcf6..0000000 --- a/src/ProtocolBuffers.Test/TestProtos/UnitTestRpcInterop.cs +++ /dev/null @@ -1,1467 +0,0 @@ -// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.TestProtos { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class UnitTestRpcInterop { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_SearchRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_SearchRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_SearchResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_SearchResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_SearchResponse_ResultItem__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_SearchResponse_ResultItem__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_RefineSearchRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_RefineSearchRequest__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static UnitTestRpcInterop() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CiFleHRlc3QvdW5pdHRlc3RfcnBjX2ludGVyb3AucHJvdG8aJGdvb2dsZS9w", - "cm90b2J1Zi9jc2hhcnBfb3B0aW9ucy5wcm90byIhCg1TZWFyY2hSZXF1ZXN0", - "EhAKCENyaXRlcmlhGAEgAygJImYKDlNlYXJjaFJlc3BvbnNlEisKB3Jlc3Vs", - "dHMYASADKAsyGi5TZWFyY2hSZXNwb25zZS5SZXN1bHRJdGVtGicKClJlc3Vs", - "dEl0ZW0SCwoDdXJsGAEgAigJEgwKBG5hbWUYAiABKAkiUgoTUmVmaW5lU2Vh", - "cmNoUmVxdWVzdBIQCghDcml0ZXJpYRgBIAMoCRIpChBwcmV2aW91c19yZXN1", - "bHRzGAIgAigLMg8uU2VhcmNoUmVzcG9uc2UycQoNU2VhcmNoU2VydmljZRIp", - "CgZTZWFyY2gSDi5TZWFyY2hSZXF1ZXN0Gg8uU2VhcmNoUmVzcG9uc2USNQoM", - "UmVmaW5lU2VhcmNoEhQuUmVmaW5lU2VhcmNoUmVxdWVzdBoPLlNlYXJjaFJl", - "c3BvbnNlQj9IAcI+OgohR29vZ2xlLlByb3RvY29sQnVmZmVycy5UZXN0UHJv", - "dG9zEhJVbml0VGVzdFJwY0ludGVyb3CIDgM=")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_SearchRequest__Descriptor = Descriptor.MessageTypes[0]; - internal__static_SearchRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_SearchRequest__Descriptor, - new string[] { "Criteria", }); - internal__static_SearchResponse__Descriptor = Descriptor.MessageTypes[1]; - internal__static_SearchResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_SearchResponse__Descriptor, - new string[] { "Results", }); - internal__static_SearchResponse_ResultItem__Descriptor = internal__static_SearchResponse__Descriptor.NestedTypes[0]; - internal__static_SearchResponse_ResultItem__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_SearchResponse_ResultItem__Descriptor, - new string[] { "Url", "Name", }); - internal__static_RefineSearchRequest__Descriptor = Descriptor.MessageTypes[2]; - internal__static_RefineSearchRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_RefineSearchRequest__Descriptor, - new string[] { "Criteria", "PreviousResults", }); - pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); - RegisterAllExtensions(registry); - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.RegisterAllExtensions(registry); - return registry; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, - }, assigner); - } - #endregion - - } - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class SearchRequest : pb::GeneratedMessage { - private SearchRequest() { } - private static readonly SearchRequest defaultInstance = new SearchRequest().MakeReadOnly(); - private static readonly string[] _searchRequestFieldNames = new string[] { "Criteria" }; - private static readonly uint[] _searchRequestFieldTags = new uint[] { 10 }; - public static SearchRequest DefaultInstance { - get { return defaultInstance; } - } - - public override SearchRequest DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override SearchRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestRpcInterop.internal__static_SearchRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestRpcInterop.internal__static_SearchRequest__FieldAccessorTable; } - } - - public const int CriteriaFieldNumber = 1; - private pbc::PopsicleList criteria_ = new pbc::PopsicleList(); - public scg::IList CriteriaList { - get { return pbc::Lists.AsReadOnly(criteria_); } - } - public int CriteriaCount { - get { return criteria_.Count; } - } - public string GetCriteria(int index) { - return criteria_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _searchRequestFieldNames; - if (criteria_.Count > 0) { - output.WriteStringArray(1, field_names[0], criteria_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - foreach (string element in CriteriaList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 1 * criteria_.Count; - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static SearchRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SearchRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SearchRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SearchRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SearchRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SearchRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SearchRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SearchRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SearchRequest ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SearchRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private SearchRequest MakeReadOnly() { - criteria_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SearchRequest prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(SearchRequest cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private SearchRequest result; - - private SearchRequest PrepareBuilder() { - if (resultIsReadOnly) { - SearchRequest original = result; - result = new SearchRequest(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override SearchRequest MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.SearchRequest.Descriptor; } - } - - public override SearchRequest DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.SearchRequest.DefaultInstance; } - } - - public override SearchRequest BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SearchRequest) { - return MergeFrom((SearchRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SearchRequest other) { - if (other == global::Google.ProtocolBuffers.TestProtos.SearchRequest.DefaultInstance) return this; - PrepareBuilder(); - if (other.criteria_.Count != 0) { - result.criteria_.Add(other.criteria_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_searchRequestFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _searchRequestFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - input.ReadStringArray(tag, field_name, result.criteria_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public pbc::IPopsicleList CriteriaList { - get { return PrepareBuilder().criteria_; } - } - public int CriteriaCount { - get { return result.CriteriaCount; } - } - public string GetCriteria(int index) { - return result.GetCriteria(index); - } - public Builder SetCriteria(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.criteria_[index] = value; - return this; - } - public Builder AddCriteria(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.criteria_.Add(value); - return this; - } - public Builder AddRangeCriteria(scg::IEnumerable values) { - PrepareBuilder(); - result.criteria_.Add(values); - return this; - } - public Builder ClearCriteria() { - PrepareBuilder(); - result.criteria_.Clear(); - return this; - } - } - static SearchRequest() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestRpcInterop.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class SearchResponse : pb::GeneratedMessage { - private SearchResponse() { } - private static readonly SearchResponse defaultInstance = new SearchResponse().MakeReadOnly(); - private static readonly string[] _searchResponseFieldNames = new string[] { "results" }; - private static readonly uint[] _searchResponseFieldTags = new uint[] { 10 }; - public static SearchResponse DefaultInstance { - get { return defaultInstance; } - } - - public override SearchResponse DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override SearchResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestRpcInterop.internal__static_SearchResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestRpcInterop.internal__static_SearchResponse__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class ResultItem : pb::GeneratedMessage { - private ResultItem() { } - private static readonly ResultItem defaultInstance = new ResultItem().MakeReadOnly(); - private static readonly string[] _resultItemFieldNames = new string[] { "name", "url" }; - private static readonly uint[] _resultItemFieldTags = new uint[] { 18, 10 }; - public static ResultItem DefaultInstance { - get { return defaultInstance; } - } - - public override ResultItem DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override ResultItem ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestRpcInterop.internal__static_SearchResponse_ResultItem__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestRpcInterop.internal__static_SearchResponse_ResultItem__FieldAccessorTable; } - } - - public const int UrlFieldNumber = 1; - private bool hasUrl; - private string url_ = ""; - public bool HasUrl { - get { return hasUrl; } - } - public string Url { - get { return url_; } - } - - public const int NameFieldNumber = 2; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public override bool IsInitialized { - get { - if (!hasUrl) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _resultItemFieldNames; - if (hasUrl) { - output.WriteString(1, field_names[1], Url); - } - if (hasName) { - output.WriteString(2, field_names[0], Name); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasUrl) { - size += pb::CodedOutputStream.ComputeStringSize(1, Url); - } - if (hasName) { - size += pb::CodedOutputStream.ComputeStringSize(2, Name); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static ResultItem ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ResultItem ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ResultItem ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ResultItem ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ResultItem ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ResultItem ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ResultItem ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ResultItem ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ResultItem ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ResultItem ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private ResultItem MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ResultItem prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(ResultItem cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private ResultItem result; - - private ResultItem PrepareBuilder() { - if (resultIsReadOnly) { - ResultItem original = result; - result = new ResultItem(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override ResultItem MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.SearchResponse.Types.ResultItem.Descriptor; } - } - - public override ResultItem DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.SearchResponse.Types.ResultItem.DefaultInstance; } - } - - public override ResultItem BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ResultItem) { - return MergeFrom((ResultItem) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ResultItem other) { - if (other == global::Google.ProtocolBuffers.TestProtos.SearchResponse.Types.ResultItem.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasUrl) { - Url = other.Url; - } - if (other.HasName) { - Name = other.Name; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_resultItemFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _resultItemFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasUrl = input.ReadString(ref result.url_); - break; - } - case 18: { - result.hasName = input.ReadString(ref result.name_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasUrl { - get { return result.hasUrl; } - } - public string Url { - get { return result.Url; } - set { SetUrl(value); } - } - public Builder SetUrl(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasUrl = true; - result.url_ = value; - return this; - } - public Builder ClearUrl() { - PrepareBuilder(); - result.hasUrl = false; - result.url_ = ""; - return this; - } - - public bool HasName { - get { return result.hasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - PrepareBuilder(); - result.hasName = false; - result.name_ = ""; - return this; - } - } - static ResultItem() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestRpcInterop.Descriptor, null); - } - } - - } - #endregion - - public const int ResultsFieldNumber = 1; - private pbc::PopsicleList results_ = new pbc::PopsicleList(); - public scg::IList ResultsList { - get { return results_; } - } - public int ResultsCount { - get { return results_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.SearchResponse.Types.ResultItem GetResults(int index) { - return results_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.TestProtos.SearchResponse.Types.ResultItem element in ResultsList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _searchResponseFieldNames; - if (results_.Count > 0) { - output.WriteMessageArray(1, field_names[0], results_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::Google.ProtocolBuffers.TestProtos.SearchResponse.Types.ResultItem element in ResultsList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static SearchResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SearchResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SearchResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SearchResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SearchResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SearchResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SearchResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SearchResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SearchResponse ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SearchResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private SearchResponse MakeReadOnly() { - results_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SearchResponse prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(SearchResponse cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private SearchResponse result; - - private SearchResponse PrepareBuilder() { - if (resultIsReadOnly) { - SearchResponse original = result; - result = new SearchResponse(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override SearchResponse MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.SearchResponse.Descriptor; } - } - - public override SearchResponse DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.SearchResponse.DefaultInstance; } - } - - public override SearchResponse BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SearchResponse) { - return MergeFrom((SearchResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SearchResponse other) { - if (other == global::Google.ProtocolBuffers.TestProtos.SearchResponse.DefaultInstance) return this; - PrepareBuilder(); - if (other.results_.Count != 0) { - result.results_.Add(other.results_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_searchResponseFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _searchResponseFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - input.ReadMessageArray(tag, field_name, result.results_, global::Google.ProtocolBuffers.TestProtos.SearchResponse.Types.ResultItem.DefaultInstance, extensionRegistry); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public pbc::IPopsicleList ResultsList { - get { return PrepareBuilder().results_; } - } - public int ResultsCount { - get { return result.ResultsCount; } - } - public global::Google.ProtocolBuffers.TestProtos.SearchResponse.Types.ResultItem GetResults(int index) { - return result.GetResults(index); - } - public Builder SetResults(int index, global::Google.ProtocolBuffers.TestProtos.SearchResponse.Types.ResultItem value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.results_[index] = value; - return this; - } - public Builder SetResults(int index, global::Google.ProtocolBuffers.TestProtos.SearchResponse.Types.ResultItem.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.results_[index] = builderForValue.Build(); - return this; - } - public Builder AddResults(global::Google.ProtocolBuffers.TestProtos.SearchResponse.Types.ResultItem value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.results_.Add(value); - return this; - } - public Builder AddResults(global::Google.ProtocolBuffers.TestProtos.SearchResponse.Types.ResultItem.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.results_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeResults(scg::IEnumerable values) { - PrepareBuilder(); - result.results_.Add(values); - return this; - } - public Builder ClearResults() { - PrepareBuilder(); - result.results_.Clear(); - return this; - } - } - static SearchResponse() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestRpcInterop.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class RefineSearchRequest : pb::GeneratedMessage { - private RefineSearchRequest() { } - private static readonly RefineSearchRequest defaultInstance = new RefineSearchRequest().MakeReadOnly(); - private static readonly string[] _refineSearchRequestFieldNames = new string[] { "Criteria", "previous_results" }; - private static readonly uint[] _refineSearchRequestFieldTags = new uint[] { 10, 18 }; - public static RefineSearchRequest DefaultInstance { - get { return defaultInstance; } - } - - public override RefineSearchRequest DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override RefineSearchRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestRpcInterop.internal__static_RefineSearchRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestRpcInterop.internal__static_RefineSearchRequest__FieldAccessorTable; } - } - - public const int CriteriaFieldNumber = 1; - private pbc::PopsicleList criteria_ = new pbc::PopsicleList(); - public scg::IList CriteriaList { - get { return pbc::Lists.AsReadOnly(criteria_); } - } - public int CriteriaCount { - get { return criteria_.Count; } - } - public string GetCriteria(int index) { - return criteria_[index]; - } - - public const int PreviousResultsFieldNumber = 2; - private bool hasPreviousResults; - private global::Google.ProtocolBuffers.TestProtos.SearchResponse previousResults_; - public bool HasPreviousResults { - get { return hasPreviousResults; } - } - public global::Google.ProtocolBuffers.TestProtos.SearchResponse PreviousResults { - get { return previousResults_ ?? global::Google.ProtocolBuffers.TestProtos.SearchResponse.DefaultInstance; } - } - - public override bool IsInitialized { - get { - if (!hasPreviousResults) return false; - if (!PreviousResults.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _refineSearchRequestFieldNames; - if (criteria_.Count > 0) { - output.WriteStringArray(1, field_names[0], criteria_); - } - if (hasPreviousResults) { - output.WriteMessage(2, field_names[1], PreviousResults); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - foreach (string element in CriteriaList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 1 * criteria_.Count; - } - if (hasPreviousResults) { - size += pb::CodedOutputStream.ComputeMessageSize(2, PreviousResults); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static RefineSearchRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RefineSearchRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RefineSearchRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RefineSearchRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RefineSearchRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RefineSearchRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static RefineSearchRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static RefineSearchRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static RefineSearchRequest ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RefineSearchRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private RefineSearchRequest MakeReadOnly() { - criteria_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(RefineSearchRequest prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(RefineSearchRequest cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private RefineSearchRequest result; - - private RefineSearchRequest PrepareBuilder() { - if (resultIsReadOnly) { - RefineSearchRequest original = result; - result = new RefineSearchRequest(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override RefineSearchRequest MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.RefineSearchRequest.Descriptor; } - } - - public override RefineSearchRequest DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.RefineSearchRequest.DefaultInstance; } - } - - public override RefineSearchRequest BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is RefineSearchRequest) { - return MergeFrom((RefineSearchRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(RefineSearchRequest other) { - if (other == global::Google.ProtocolBuffers.TestProtos.RefineSearchRequest.DefaultInstance) return this; - PrepareBuilder(); - if (other.criteria_.Count != 0) { - result.criteria_.Add(other.criteria_); - } - if (other.HasPreviousResults) { - MergePreviousResults(other.PreviousResults); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_refineSearchRequestFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _refineSearchRequestFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - input.ReadStringArray(tag, field_name, result.criteria_); - break; - } - case 18: { - global::Google.ProtocolBuffers.TestProtos.SearchResponse.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.SearchResponse.CreateBuilder(); - if (result.hasPreviousResults) { - subBuilder.MergeFrom(PreviousResults); - } - input.ReadMessage(subBuilder, extensionRegistry); - PreviousResults = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public pbc::IPopsicleList CriteriaList { - get { return PrepareBuilder().criteria_; } - } - public int CriteriaCount { - get { return result.CriteriaCount; } - } - public string GetCriteria(int index) { - return result.GetCriteria(index); - } - public Builder SetCriteria(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.criteria_[index] = value; - return this; - } - public Builder AddCriteria(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.criteria_.Add(value); - return this; - } - public Builder AddRangeCriteria(scg::IEnumerable values) { - PrepareBuilder(); - result.criteria_.Add(values); - return this; - } - public Builder ClearCriteria() { - PrepareBuilder(); - result.criteria_.Clear(); - return this; - } - - public bool HasPreviousResults { - get { return result.hasPreviousResults; } - } - public global::Google.ProtocolBuffers.TestProtos.SearchResponse PreviousResults { - get { return result.PreviousResults; } - set { SetPreviousResults(value); } - } - public Builder SetPreviousResults(global::Google.ProtocolBuffers.TestProtos.SearchResponse value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasPreviousResults = true; - result.previousResults_ = value; - return this; - } - public Builder SetPreviousResults(global::Google.ProtocolBuffers.TestProtos.SearchResponse.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasPreviousResults = true; - result.previousResults_ = builderForValue.Build(); - return this; - } - public Builder MergePreviousResults(global::Google.ProtocolBuffers.TestProtos.SearchResponse value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasPreviousResults && - result.previousResults_ != global::Google.ProtocolBuffers.TestProtos.SearchResponse.DefaultInstance) { - result.previousResults_ = global::Google.ProtocolBuffers.TestProtos.SearchResponse.CreateBuilder(result.previousResults_).MergeFrom(value).BuildPartial(); - } else { - result.previousResults_ = value; - } - result.hasPreviousResults = true; - return this; - } - public Builder ClearPreviousResults() { - PrepareBuilder(); - result.hasPreviousResults = false; - result.previousResults_ = null; - return this; - } - } - static RefineSearchRequest() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestRpcInterop.Descriptor, null); - } - } - - #endregion - - #region Services - public partial interface ISearchService { - global::Google.ProtocolBuffers.TestProtos.SearchResponse Search(global::Google.ProtocolBuffers.TestProtos.SearchRequest searchRequest); - global::Google.ProtocolBuffers.TestProtos.SearchResponse RefineSearch(global::Google.ProtocolBuffers.TestProtos.RefineSearchRequest refineSearchRequest); - } - - [global::System.CLSCompliant(false)] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public partial class SearchService : ISearchService, pb::IRpcDispatch, global::System.IDisposable { - private readonly bool dispose; - private readonly pb::IRpcDispatch dispatch; - public SearchService(pb::IRpcDispatch dispatch) : this(dispatch, true) { - } - public SearchService(pb::IRpcDispatch dispatch, bool dispose) { - pb::ThrowHelper.ThrowIfNull(this.dispatch = dispatch, "dispatch"); - this.dispose = dispose && dispatch is global::System.IDisposable; - } - - public void Dispose() { - if (dispose) ((global::System.IDisposable)dispatch).Dispose(); - } - - TMessage pb::IRpcDispatch.CallMethod(string method, pb::IMessageLite request, pb::IBuilderLite response) { - return dispatch.CallMethod(method, request, response); - } - - public global::Google.ProtocolBuffers.TestProtos.SearchResponse Search(global::Google.ProtocolBuffers.TestProtos.SearchRequest searchRequest) { - return dispatch.CallMethod("Search", searchRequest, global::Google.ProtocolBuffers.TestProtos.SearchResponse.CreateBuilder()); - } - - public global::Google.ProtocolBuffers.TestProtos.SearchResponse RefineSearch(global::Google.ProtocolBuffers.TestProtos.RefineSearchRequest refineSearchRequest) { - return dispatch.CallMethod("RefineSearch", refineSearchRequest, global::Google.ProtocolBuffers.TestProtos.SearchResponse.CreateBuilder()); - } - - [global::System.CLSCompliant(false)] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public partial class Dispatch : pb::IRpcDispatch, global::System.IDisposable { - private readonly bool dispose; - private readonly ISearchService implementation; - public Dispatch(ISearchService implementation) : this(implementation, true) { - } - public Dispatch(ISearchService implementation, bool dispose) { - pb::ThrowHelper.ThrowIfNull(this.implementation = implementation, "implementation"); - this.dispose = dispose && implementation is global::System.IDisposable; - } - - public void Dispose() { - if (dispose) ((global::System.IDisposable)implementation).Dispose(); - } - - public TMessage CallMethod(string methodName, pb::IMessageLite request, pb::IBuilderLite response) - where TMessage : pb::IMessageLite - where TBuilder : pb::IBuilderLite { - switch(methodName) { - case "Search": return response.MergeFrom(implementation.Search((global::Google.ProtocolBuffers.TestProtos.SearchRequest)request)).Build(); - case "RefineSearch": return response.MergeFrom(implementation.RefineSearch((global::Google.ProtocolBuffers.TestProtos.RefineSearchRequest)request)).Build(); - default: throw pb::ThrowHelper.CreateMissingMethod(typeof(ISearchService), methodName); - } - } - } - [global::System.CLSCompliant(false)] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public partial class ServerStub : pb::IRpcServerStub, global::System.IDisposable { - private readonly bool dispose; - private readonly pb::IRpcDispatch implementation; - public ServerStub(ISearchService implementation) : this(implementation, true) { - } - public ServerStub(ISearchService implementation, bool dispose) : this(new Dispatch(implementation, dispose), dispose) { - } - public ServerStub(pb::IRpcDispatch implementation) : this(implementation, true) { - } - public ServerStub(pb::IRpcDispatch implementation, bool dispose) { - pb::ThrowHelper.ThrowIfNull(this.implementation = implementation, "implementation"); - this.dispose = dispose && implementation is global::System.IDisposable; - } - - public void Dispose() { - if (dispose) ((global::System.IDisposable)implementation).Dispose(); - } - - public pb::IMessageLite CallMethod(string methodName, pb::ICodedInputStream input, pb::ExtensionRegistry registry) { - switch(methodName) { - case "Search": return implementation.CallMethod(methodName, global::Google.ProtocolBuffers.TestProtos.SearchRequest.ParseFrom(input, registry), global::Google.ProtocolBuffers.TestProtos.SearchResponse.CreateBuilder()); - case "RefineSearch": return implementation.CallMethod(methodName, global::Google.ProtocolBuffers.TestProtos.RefineSearchRequest.ParseFrom(input, registry), global::Google.ProtocolBuffers.TestProtos.SearchResponse.CreateBuilder()); - default: throw pb::ThrowHelper.CreateMissingMethod(typeof(ISearchService), methodName); - } - } - } - } - #endregion - -} - -#endregion Designer generated code diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestXmlSerializerTestProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestXmlSerializerTestProtoFile.cs deleted file mode 100644 index fe35c91..0000000 --- a/src/ProtocolBuffers.Test/TestProtos/UnitTestXmlSerializerTestProtoFile.cs +++ /dev/null @@ -1,2292 +0,0 @@ -// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.TestProtos { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class UnitTestXmlSerializerTestProtoFile { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.ExtensionEnum); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.ExtensionText); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.ExtensionNumber); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.ExtensionMessage); - } - #endregion - #region Extensions - public const int ExtensionEnumFieldNumber = 101; - public static pb::GeneratedExtensionBase ExtensionEnum; - public const int ExtensionTextFieldNumber = 102; - public static pb::GeneratedExtensionBase ExtensionText; - public const int ExtensionNumberFieldNumber = 103; - public static pb::GeneratedExtensionBase> ExtensionNumber; - public const int ExtensionMessageFieldNumber = 199; - public static pb::GeneratedExtensionBase ExtensionMessage; - #endregion - - #region Static variables - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_extra_TestXmlChild__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_extra_TestXmlChild__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_extra_TestXmlNoFields__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_extra_TestXmlNoFields__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_extra_TestXmlRescursive__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_extra_TestXmlRescursive__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_extra_TestXmlMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_extra_TestXmlMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_extra_TestXmlMessage_Children__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_extra_TestXmlMessage_Children__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_extra_TestXmlExtension__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_extra_TestXmlExtension__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static UnitTestXmlSerializerTestProtoFile() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CiRleHRlc3QvdW5pdHRlc3RfZXh0cmFzX3htbHRlc3QucHJvdG8SF3Byb3Rv", - "YnVmX3VuaXR0ZXN0X2V4dHJhGiRnb29nbGUvcHJvdG9idWYvY3NoYXJwX29w", - "dGlvbnMucHJvdG8iVQoMVGVzdFhtbENoaWxkEjUKB29wdGlvbnMYAyADKA4y", - "JC5wcm90b2J1Zl91bml0dGVzdF9leHRyYS5FbnVtT3B0aW9ucxIOCgZiaW5h", - "cnkYBCABKAwiEQoPVGVzdFhtbE5vRmllbGRzIk4KEVRlc3RYbWxSZXNjdXJz", - "aXZlEjkKBWNoaWxkGAEgASgLMioucHJvdG9idWZfdW5pdHRlc3RfZXh0cmEu", - "VGVzdFhtbFJlc2N1cnNpdmUitwIKDlRlc3RYbWxNZXNzYWdlEg4KBm51bWJl", - "chgGIAEoAxIPCgdudW1iZXJzGAIgAygFEgwKBHRleHQYAyABKAkSEgoJdGV4", - "dGxpbmVzGLwFIAMoCRINCgV2YWxpZBgFIAEoCBI0CgVjaGlsZBgBIAEoCzIl", - "LnByb3RvYnVmX3VuaXR0ZXN0X2V4dHJhLlRlc3RYbWxDaGlsZBJDCghjaGls", - "ZHJlbhiRAyADKAoyMC5wcm90b2J1Zl91bml0dGVzdF9leHRyYS5UZXN0WG1s", - "TWVzc2FnZS5DaGlsZHJlbhpRCghDaGlsZHJlbhI1CgdvcHRpb25zGAMgAygO", - "MiQucHJvdG9idWZfdW5pdHRlc3RfZXh0cmEuRW51bU9wdGlvbnMSDgoGYmlu", - "YXJ5GAQgASgMKgUIZBDIASIiChBUZXN0WG1sRXh0ZW5zaW9uEg4KBm51bWJl", - "chgBIAIoBSoqCgtFbnVtT3B0aW9ucxIHCgNPTkUQABIHCgNUV08QARIJCgVU", - "SFJFRRACOmUKDmV4dGVuc2lvbl9lbnVtEicucHJvdG9idWZfdW5pdHRlc3Rf", - "ZXh0cmEuVGVzdFhtbE1lc3NhZ2UYZSABKA4yJC5wcm90b2J1Zl91bml0dGVz", - "dF9leHRyYS5FbnVtT3B0aW9uczo/Cg5leHRlbnNpb25fdGV4dBInLnByb3Rv", - "YnVmX3VuaXR0ZXN0X2V4dHJhLlRlc3RYbWxNZXNzYWdlGGYgASgJOkUKEGV4", - "dGVuc2lvbl9udW1iZXISJy5wcm90b2J1Zl91bml0dGVzdF9leHRyYS5UZXN0", - "WG1sTWVzc2FnZRhnIAMoBUICEAE6bgoRZXh0ZW5zaW9uX21lc3NhZ2USJy5w", - "cm90b2J1Zl91bml0dGVzdF9leHRyYS5UZXN0WG1sTWVzc2FnZRjHASABKAsy", - "KS5wcm90b2J1Zl91bml0dGVzdF9leHRyYS5UZXN0WG1sRXh0ZW5zaW9uQk5I", - "AcI+SQohR29vZ2xlLlByb3RvY29sQnVmZmVycy5UZXN0UHJvdG9zEiJVbml0", - "VGVzdFhtbFNlcmlhbGl6ZXJUZXN0UHJvdG9GaWxlSAE=")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_protobuf_unittest_extra_TestXmlChild__Descriptor = Descriptor.MessageTypes[0]; - internal__static_protobuf_unittest_extra_TestXmlChild__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_extra_TestXmlChild__Descriptor, - new string[] { "Options", "Binary", }); - internal__static_protobuf_unittest_extra_TestXmlNoFields__Descriptor = Descriptor.MessageTypes[1]; - internal__static_protobuf_unittest_extra_TestXmlNoFields__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_extra_TestXmlNoFields__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_extra_TestXmlRescursive__Descriptor = Descriptor.MessageTypes[2]; - internal__static_protobuf_unittest_extra_TestXmlRescursive__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_extra_TestXmlRescursive__Descriptor, - new string[] { "Child", }); - internal__static_protobuf_unittest_extra_TestXmlMessage__Descriptor = Descriptor.MessageTypes[3]; - internal__static_protobuf_unittest_extra_TestXmlMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_extra_TestXmlMessage__Descriptor, - new string[] { "Number", "Numbers", "Text", "Textlines", "Valid", "Child", "Children", }); - internal__static_protobuf_unittest_extra_TestXmlMessage_Children__Descriptor = internal__static_protobuf_unittest_extra_TestXmlMessage__Descriptor.NestedTypes[0]; - internal__static_protobuf_unittest_extra_TestXmlMessage_Children__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_extra_TestXmlMessage_Children__Descriptor, - new string[] { "Options", "Binary", }); - internal__static_protobuf_unittest_extra_TestXmlExtension__Descriptor = Descriptor.MessageTypes[4]; - internal__static_protobuf_unittest_extra_TestXmlExtension__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_extra_TestXmlExtension__Descriptor, - new string[] { "Number", }); - global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.ExtensionEnum = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.Descriptor.Extensions[0]); - global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.ExtensionText = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.Descriptor.Extensions[1]); - global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.ExtensionNumber = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.Descriptor.Extensions[2]); - global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.ExtensionMessage = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.Descriptor.Extensions[3]); - pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); - RegisterAllExtensions(registry); - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.RegisterAllExtensions(registry); - return registry; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, - }, assigner); - } - #endregion - - } - #region Enums - public enum EnumOptions { - ONE = 0, - TWO = 1, - THREE = 2, - } - - #endregion - - #region Messages - [global::System.SerializableAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestXmlChild : pb::GeneratedMessage { - private TestXmlChild() { } - private static readonly TestXmlChild defaultInstance = new TestXmlChild().MakeReadOnly(); - private static readonly string[] _testXmlChildFieldNames = new string[] { "binary", "options" }; - private static readonly uint[] _testXmlChildFieldTags = new uint[] { 34, 24 }; - public static TestXmlChild DefaultInstance { - get { return defaultInstance; } - } - - public override TestXmlChild DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestXmlChild ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.internal__static_protobuf_unittest_extra_TestXmlChild__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.internal__static_protobuf_unittest_extra_TestXmlChild__FieldAccessorTable; } - } - - public const int OptionsFieldNumber = 3; - private pbc::PopsicleList options_ = new pbc::PopsicleList(); - public scg::IList OptionsList { - get { return pbc::Lists.AsReadOnly(options_); } - } - public int OptionsCount { - get { return options_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.EnumOptions GetOptions(int index) { - return options_[index]; - } - - public const int BinaryFieldNumber = 4; - private bool hasBinary; - private pb::ByteString binary_ = pb::ByteString.Empty; - public bool HasBinary { - get { return hasBinary; } - } - public pb::ByteString Binary { - get { return binary_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testXmlChildFieldNames; - if (options_.Count > 0) { - output.WriteEnumArray(3, field_names[1], options_); - } - if (hasBinary) { - output.WriteBytes(4, field_names[0], Binary); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - if (options_.Count > 0) { - foreach (global::Google.ProtocolBuffers.TestProtos.EnumOptions element in options_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 1 * options_.Count; - } - } - if (hasBinary) { - size += pb::CodedOutputStream.ComputeBytesSize(4, Binary); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestXmlChild ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestXmlChild ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestXmlChild ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestXmlChild ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestXmlChild ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestXmlChild ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestXmlChild ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestXmlChild ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestXmlChild ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestXmlChild ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestXmlChild MakeReadOnly() { - options_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestXmlChild prototype) { - return new Builder(prototype); - } - - [global::System.SerializableAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestXmlChild cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestXmlChild result; - - private TestXmlChild PrepareBuilder() { - if (resultIsReadOnly) { - TestXmlChild original = result; - result = new TestXmlChild(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestXmlChild MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestXmlChild.Descriptor; } - } - - public override TestXmlChild DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestXmlChild.DefaultInstance; } - } - - public override TestXmlChild BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestXmlChild) { - return MergeFrom((TestXmlChild) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestXmlChild other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestXmlChild.DefaultInstance) return this; - PrepareBuilder(); - if (other.options_.Count != 0) { - result.options_.Add(other.options_); - } - if (other.HasBinary) { - Binary = other.Binary; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testXmlChildFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testXmlChildFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 26: - case 24: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.options_, out unknownItems); - if (unknownItems != null) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - foreach (object rawValue in unknownItems) - if (rawValue is int) - unknownFields.MergeVarintField(3, (ulong)(int)rawValue); - } - break; - } - case 34: { - result.hasBinary = input.ReadBytes(ref result.binary_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public pbc::IPopsicleList OptionsList { - get { return PrepareBuilder().options_; } - } - public int OptionsCount { - get { return result.OptionsCount; } - } - public global::Google.ProtocolBuffers.TestProtos.EnumOptions GetOptions(int index) { - return result.GetOptions(index); - } - public Builder SetOptions(int index, global::Google.ProtocolBuffers.TestProtos.EnumOptions value) { - PrepareBuilder(); - result.options_[index] = value; - return this; - } - public Builder AddOptions(global::Google.ProtocolBuffers.TestProtos.EnumOptions value) { - PrepareBuilder(); - result.options_.Add(value); - return this; - } - public Builder AddRangeOptions(scg::IEnumerable values) { - PrepareBuilder(); - result.options_.Add(values); - return this; - } - public Builder ClearOptions() { - PrepareBuilder(); - result.options_.Clear(); - return this; - } - - public bool HasBinary { - get { return result.hasBinary; } - } - public pb::ByteString Binary { - get { return result.Binary; } - set { SetBinary(value); } - } - public Builder SetBinary(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasBinary = true; - result.binary_ = value; - return this; - } - public Builder ClearBinary() { - PrepareBuilder(); - result.hasBinary = false; - result.binary_ = pb::ByteString.Empty; - return this; - } - } - static TestXmlChild() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.Descriptor, null); - } - } - - [global::System.SerializableAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestXmlNoFields : pb::GeneratedMessage { - private TestXmlNoFields() { } - private static readonly TestXmlNoFields defaultInstance = new TestXmlNoFields().MakeReadOnly(); - private static readonly string[] _testXmlNoFieldsFieldNames = new string[] { }; - private static readonly uint[] _testXmlNoFieldsFieldTags = new uint[] { }; - public static TestXmlNoFields DefaultInstance { - get { return defaultInstance; } - } - - public override TestXmlNoFields DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestXmlNoFields ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.internal__static_protobuf_unittest_extra_TestXmlNoFields__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.internal__static_protobuf_unittest_extra_TestXmlNoFields__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testXmlNoFieldsFieldNames; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestXmlNoFields ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestXmlNoFields ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestXmlNoFields ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestXmlNoFields ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestXmlNoFields ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestXmlNoFields ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestXmlNoFields ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestXmlNoFields ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestXmlNoFields ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestXmlNoFields ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestXmlNoFields MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestXmlNoFields prototype) { - return new Builder(prototype); - } - - [global::System.SerializableAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestXmlNoFields cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestXmlNoFields result; - - private TestXmlNoFields PrepareBuilder() { - if (resultIsReadOnly) { - TestXmlNoFields original = result; - result = new TestXmlNoFields(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestXmlNoFields MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestXmlNoFields.Descriptor; } - } - - public override TestXmlNoFields DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestXmlNoFields.DefaultInstance; } - } - - public override TestXmlNoFields BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestXmlNoFields) { - return MergeFrom((TestXmlNoFields) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestXmlNoFields other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestXmlNoFields.DefaultInstance) return this; - PrepareBuilder(); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testXmlNoFieldsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testXmlNoFieldsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static TestXmlNoFields() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.Descriptor, null); - } - } - - [global::System.SerializableAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestXmlRescursive : pb::GeneratedMessage { - private TestXmlRescursive() { } - private static readonly TestXmlRescursive defaultInstance = new TestXmlRescursive().MakeReadOnly(); - private static readonly string[] _testXmlRescursiveFieldNames = new string[] { "child" }; - private static readonly uint[] _testXmlRescursiveFieldTags = new uint[] { 10 }; - public static TestXmlRescursive DefaultInstance { - get { return defaultInstance; } - } - - public override TestXmlRescursive DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestXmlRescursive ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.internal__static_protobuf_unittest_extra_TestXmlRescursive__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.internal__static_protobuf_unittest_extra_TestXmlRescursive__FieldAccessorTable; } - } - - public const int ChildFieldNumber = 1; - private bool hasChild; - private global::Google.ProtocolBuffers.TestProtos.TestXmlRescursive child_; - public bool HasChild { - get { return hasChild; } - } - public global::Google.ProtocolBuffers.TestProtos.TestXmlRescursive Child { - get { return child_ ?? global::Google.ProtocolBuffers.TestProtos.TestXmlRescursive.DefaultInstance; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testXmlRescursiveFieldNames; - if (hasChild) { - output.WriteMessage(1, field_names[0], Child); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasChild) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Child); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestXmlRescursive ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestXmlRescursive ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestXmlRescursive ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestXmlRescursive ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestXmlRescursive ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestXmlRescursive ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestXmlRescursive ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestXmlRescursive ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestXmlRescursive ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestXmlRescursive ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestXmlRescursive MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestXmlRescursive prototype) { - return new Builder(prototype); - } - - [global::System.SerializableAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestXmlRescursive cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestXmlRescursive result; - - private TestXmlRescursive PrepareBuilder() { - if (resultIsReadOnly) { - TestXmlRescursive original = result; - result = new TestXmlRescursive(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestXmlRescursive MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestXmlRescursive.Descriptor; } - } - - public override TestXmlRescursive DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestXmlRescursive.DefaultInstance; } - } - - public override TestXmlRescursive BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestXmlRescursive) { - return MergeFrom((TestXmlRescursive) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestXmlRescursive other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestXmlRescursive.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasChild) { - MergeChild(other.Child); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testXmlRescursiveFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testXmlRescursiveFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - global::Google.ProtocolBuffers.TestProtos.TestXmlRescursive.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestXmlRescursive.CreateBuilder(); - if (result.hasChild) { - subBuilder.MergeFrom(Child); - } - input.ReadMessage(subBuilder, extensionRegistry); - Child = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasChild { - get { return result.hasChild; } - } - public global::Google.ProtocolBuffers.TestProtos.TestXmlRescursive Child { - get { return result.Child; } - set { SetChild(value); } - } - public Builder SetChild(global::Google.ProtocolBuffers.TestProtos.TestXmlRescursive value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasChild = true; - result.child_ = value; - return this; - } - public Builder SetChild(global::Google.ProtocolBuffers.TestProtos.TestXmlRescursive.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasChild = true; - result.child_ = builderForValue.Build(); - return this; - } - public Builder MergeChild(global::Google.ProtocolBuffers.TestProtos.TestXmlRescursive value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasChild && - result.child_ != global::Google.ProtocolBuffers.TestProtos.TestXmlRescursive.DefaultInstance) { - result.child_ = global::Google.ProtocolBuffers.TestProtos.TestXmlRescursive.CreateBuilder(result.child_).MergeFrom(value).BuildPartial(); - } else { - result.child_ = value; - } - result.hasChild = true; - return this; - } - public Builder ClearChild() { - PrepareBuilder(); - result.hasChild = false; - result.child_ = null; - return this; - } - } - static TestXmlRescursive() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.Descriptor, null); - } - } - - [global::System.SerializableAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestXmlMessage : pb::ExtendableMessage { - private TestXmlMessage() { } - private static readonly TestXmlMessage defaultInstance = new TestXmlMessage().MakeReadOnly(); - private static readonly string[] _testXmlMessageFieldNames = new string[] { "child", "children", "number", "numbers", "text", "textlines", "valid" }; - private static readonly uint[] _testXmlMessageFieldTags = new uint[] { 10, 3211, 48, 16, 26, 5602, 40 }; - public static TestXmlMessage DefaultInstance { - get { return defaultInstance; } - } - - public override TestXmlMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestXmlMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.internal__static_protobuf_unittest_extra_TestXmlMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.internal__static_protobuf_unittest_extra_TestXmlMessage__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - [global::System.SerializableAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Children : pb::GeneratedMessage { - private Children() { } - private static readonly Children defaultInstance = new Children().MakeReadOnly(); - private static readonly string[] _childrenFieldNames = new string[] { "binary", "options" }; - private static readonly uint[] _childrenFieldTags = new uint[] { 34, 24 }; - public static Children DefaultInstance { - get { return defaultInstance; } - } - - public override Children DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override Children ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.internal__static_protobuf_unittest_extra_TestXmlMessage_Children__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.internal__static_protobuf_unittest_extra_TestXmlMessage_Children__FieldAccessorTable; } - } - - public const int OptionsFieldNumber = 3; - private pbc::PopsicleList options_ = new pbc::PopsicleList(); - public scg::IList OptionsList { - get { return pbc::Lists.AsReadOnly(options_); } - } - public int OptionsCount { - get { return options_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.EnumOptions GetOptions(int index) { - return options_[index]; - } - - public const int BinaryFieldNumber = 4; - private bool hasBinary; - private pb::ByteString binary_ = pb::ByteString.Empty; - public bool HasBinary { - get { return hasBinary; } - } - public pb::ByteString Binary { - get { return binary_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _childrenFieldNames; - if (options_.Count > 0) { - output.WriteEnumArray(3, field_names[1], options_); - } - if (hasBinary) { - output.WriteBytes(4, field_names[0], Binary); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - if (options_.Count > 0) { - foreach (global::Google.ProtocolBuffers.TestProtos.EnumOptions element in options_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 1 * options_.Count; - } - } - if (hasBinary) { - size += pb::CodedOutputStream.ComputeBytesSize(4, Binary); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static Children ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Children ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Children ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Children ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Children ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Children ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Children ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Children ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Children ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Children ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private Children MakeReadOnly() { - options_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Children prototype) { - return new Builder(prototype); - } - - [global::System.SerializableAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(Children cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private Children result; - - private Children PrepareBuilder() { - if (resultIsReadOnly) { - Children original = result; - result = new Children(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override Children MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children.Descriptor; } - } - - public override Children DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children.DefaultInstance; } - } - - public override Children BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Children) { - return MergeFrom((Children) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Children other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children.DefaultInstance) return this; - PrepareBuilder(); - if (other.options_.Count != 0) { - result.options_.Add(other.options_); - } - if (other.HasBinary) { - Binary = other.Binary; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_childrenFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _childrenFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 26: - case 24: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.options_, out unknownItems); - if (unknownItems != null) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - foreach (object rawValue in unknownItems) - if (rawValue is int) - unknownFields.MergeVarintField(3, (ulong)(int)rawValue); - } - break; - } - case 34: { - result.hasBinary = input.ReadBytes(ref result.binary_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public pbc::IPopsicleList OptionsList { - get { return PrepareBuilder().options_; } - } - public int OptionsCount { - get { return result.OptionsCount; } - } - public global::Google.ProtocolBuffers.TestProtos.EnumOptions GetOptions(int index) { - return result.GetOptions(index); - } - public Builder SetOptions(int index, global::Google.ProtocolBuffers.TestProtos.EnumOptions value) { - PrepareBuilder(); - result.options_[index] = value; - return this; - } - public Builder AddOptions(global::Google.ProtocolBuffers.TestProtos.EnumOptions value) { - PrepareBuilder(); - result.options_.Add(value); - return this; - } - public Builder AddRangeOptions(scg::IEnumerable values) { - PrepareBuilder(); - result.options_.Add(values); - return this; - } - public Builder ClearOptions() { - PrepareBuilder(); - result.options_.Clear(); - return this; - } - - public bool HasBinary { - get { return result.hasBinary; } - } - public pb::ByteString Binary { - get { return result.Binary; } - set { SetBinary(value); } - } - public Builder SetBinary(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasBinary = true; - result.binary_ = value; - return this; - } - public Builder ClearBinary() { - PrepareBuilder(); - result.hasBinary = false; - result.binary_ = pb::ByteString.Empty; - return this; - } - } - static Children() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.Descriptor, null); - } - } - - } - #endregion - - public const int NumberFieldNumber = 6; - private bool hasNumber; - private long number_; - public bool HasNumber { - get { return hasNumber; } - } - public long Number { - get { return number_; } - } - - public const int NumbersFieldNumber = 2; - private pbc::PopsicleList numbers_ = new pbc::PopsicleList(); - public scg::IList NumbersList { - get { return pbc::Lists.AsReadOnly(numbers_); } - } - public int NumbersCount { - get { return numbers_.Count; } - } - public int GetNumbers(int index) { - return numbers_[index]; - } - - public const int TextFieldNumber = 3; - private bool hasText; - private string text_ = ""; - public bool HasText { - get { return hasText; } - } - public string Text { - get { return text_; } - } - - public const int TextlinesFieldNumber = 700; - private pbc::PopsicleList textlines_ = new pbc::PopsicleList(); - public scg::IList TextlinesList { - get { return pbc::Lists.AsReadOnly(textlines_); } - } - public int TextlinesCount { - get { return textlines_.Count; } - } - public string GetTextlines(int index) { - return textlines_[index]; - } - - public const int ValidFieldNumber = 5; - private bool hasValid; - private bool valid_; - public bool HasValid { - get { return hasValid; } - } - public bool Valid { - get { return valid_; } - } - - public const int ChildFieldNumber = 1; - private bool hasChild; - private global::Google.ProtocolBuffers.TestProtos.TestXmlChild child_; - public bool HasChild { - get { return hasChild; } - } - public global::Google.ProtocolBuffers.TestProtos.TestXmlChild Child { - get { return child_ ?? global::Google.ProtocolBuffers.TestProtos.TestXmlChild.DefaultInstance; } - } - - public const int ChildrenFieldNumber = 401; - private pbc::PopsicleList children_ = new pbc::PopsicleList(); - public scg::IList ChildrenList { - get { return children_; } - } - public int ChildrenCount { - get { return children_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children GetChildren(int index) { - return children_[index]; - } - - public override bool IsInitialized { - get { - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testXmlMessageFieldNames; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - if (hasChild) { - output.WriteMessage(1, field_names[0], Child); - } - if (numbers_.Count > 0) { - output.WriteInt32Array(2, field_names[3], numbers_); - } - if (hasText) { - output.WriteString(3, field_names[4], Text); - } - if (hasValid) { - output.WriteBool(5, field_names[6], Valid); - } - if (hasNumber) { - output.WriteInt64(6, field_names[2], Number); - } - extensionWriter.WriteUntil(200, output); - if (children_.Count > 0) { - output.WriteGroupArray(401, field_names[1], children_); - } - if (textlines_.Count > 0) { - output.WriteStringArray(700, field_names[5], textlines_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasNumber) { - size += pb::CodedOutputStream.ComputeInt64Size(6, Number); - } - { - int dataSize = 0; - foreach (int element in NumbersList) { - dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); - } - size += dataSize; - size += 1 * numbers_.Count; - } - if (hasText) { - size += pb::CodedOutputStream.ComputeStringSize(3, Text); - } - { - int dataSize = 0; - foreach (string element in TextlinesList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 2 * textlines_.Count; - } - if (hasValid) { - size += pb::CodedOutputStream.ComputeBoolSize(5, Valid); - } - if (hasChild) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Child); - } - foreach (global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children element in ChildrenList) { - size += pb::CodedOutputStream.ComputeGroupSize(401, element); - } - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestXmlMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestXmlMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestXmlMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestXmlMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestXmlMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestXmlMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestXmlMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestXmlMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestXmlMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestXmlMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestXmlMessage MakeReadOnly() { - numbers_.MakeReadOnly(); - textlines_.MakeReadOnly(); - children_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestXmlMessage prototype) { - return new Builder(prototype); - } - - [global::System.SerializableAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestXmlMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestXmlMessage result; - - private TestXmlMessage PrepareBuilder() { - if (resultIsReadOnly) { - TestXmlMessage original = result; - result = new TestXmlMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestXmlMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Descriptor; } - } - - public override TestXmlMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.DefaultInstance; } - } - - public override TestXmlMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestXmlMessage) { - return MergeFrom((TestXmlMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestXmlMessage other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasNumber) { - Number = other.Number; - } - if (other.numbers_.Count != 0) { - result.numbers_.Add(other.numbers_); - } - if (other.HasText) { - Text = other.Text; - } - if (other.textlines_.Count != 0) { - result.textlines_.Add(other.textlines_); - } - if (other.HasValid) { - Valid = other.Valid; - } - if (other.HasChild) { - MergeChild(other.Child); - } - if (other.children_.Count != 0) { - result.children_.Add(other.children_); - } - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testXmlMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testXmlMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - global::Google.ProtocolBuffers.TestProtos.TestXmlChild.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestXmlChild.CreateBuilder(); - if (result.hasChild) { - subBuilder.MergeFrom(Child); - } - input.ReadMessage(subBuilder, extensionRegistry); - Child = subBuilder.BuildPartial(); - break; - } - case 18: - case 16: { - input.ReadInt32Array(tag, field_name, result.numbers_); - break; - } - case 26: { - result.hasText = input.ReadString(ref result.text_); - break; - } - case 40: { - result.hasValid = input.ReadBool(ref result.valid_); - break; - } - case 48: { - result.hasNumber = input.ReadInt64(ref result.number_); - break; - } - case 3211: { - input.ReadGroupArray(tag, field_name, result.children_, global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children.DefaultInstance, extensionRegistry); - break; - } - case 5602: { - input.ReadStringArray(tag, field_name, result.textlines_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasNumber { - get { return result.hasNumber; } - } - public long Number { - get { return result.Number; } - set { SetNumber(value); } - } - public Builder SetNumber(long value) { - PrepareBuilder(); - result.hasNumber = true; - result.number_ = value; - return this; - } - public Builder ClearNumber() { - PrepareBuilder(); - result.hasNumber = false; - result.number_ = 0L; - return this; - } - - public pbc::IPopsicleList NumbersList { - get { return PrepareBuilder().numbers_; } - } - public int NumbersCount { - get { return result.NumbersCount; } - } - public int GetNumbers(int index) { - return result.GetNumbers(index); - } - public Builder SetNumbers(int index, int value) { - PrepareBuilder(); - result.numbers_[index] = value; - return this; - } - public Builder AddNumbers(int value) { - PrepareBuilder(); - result.numbers_.Add(value); - return this; - } - public Builder AddRangeNumbers(scg::IEnumerable values) { - PrepareBuilder(); - result.numbers_.Add(values); - return this; - } - public Builder ClearNumbers() { - PrepareBuilder(); - result.numbers_.Clear(); - return this; - } - - public bool HasText { - get { return result.hasText; } - } - public string Text { - get { return result.Text; } - set { SetText(value); } - } - public Builder SetText(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasText = true; - result.text_ = value; - return this; - } - public Builder ClearText() { - PrepareBuilder(); - result.hasText = false; - result.text_ = ""; - return this; - } - - public pbc::IPopsicleList TextlinesList { - get { return PrepareBuilder().textlines_; } - } - public int TextlinesCount { - get { return result.TextlinesCount; } - } - public string GetTextlines(int index) { - return result.GetTextlines(index); - } - public Builder SetTextlines(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.textlines_[index] = value; - return this; - } - public Builder AddTextlines(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.textlines_.Add(value); - return this; - } - public Builder AddRangeTextlines(scg::IEnumerable values) { - PrepareBuilder(); - result.textlines_.Add(values); - return this; - } - public Builder ClearTextlines() { - PrepareBuilder(); - result.textlines_.Clear(); - return this; - } - - public bool HasValid { - get { return result.hasValid; } - } - public bool Valid { - get { return result.Valid; } - set { SetValid(value); } - } - public Builder SetValid(bool value) { - PrepareBuilder(); - result.hasValid = true; - result.valid_ = value; - return this; - } - public Builder ClearValid() { - PrepareBuilder(); - result.hasValid = false; - result.valid_ = false; - return this; - } - - public bool HasChild { - get { return result.hasChild; } - } - public global::Google.ProtocolBuffers.TestProtos.TestXmlChild Child { - get { return result.Child; } - set { SetChild(value); } - } - public Builder SetChild(global::Google.ProtocolBuffers.TestProtos.TestXmlChild value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasChild = true; - result.child_ = value; - return this; - } - public Builder SetChild(global::Google.ProtocolBuffers.TestProtos.TestXmlChild.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasChild = true; - result.child_ = builderForValue.Build(); - return this; - } - public Builder MergeChild(global::Google.ProtocolBuffers.TestProtos.TestXmlChild value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasChild && - result.child_ != global::Google.ProtocolBuffers.TestProtos.TestXmlChild.DefaultInstance) { - result.child_ = global::Google.ProtocolBuffers.TestProtos.TestXmlChild.CreateBuilder(result.child_).MergeFrom(value).BuildPartial(); - } else { - result.child_ = value; - } - result.hasChild = true; - return this; - } - public Builder ClearChild() { - PrepareBuilder(); - result.hasChild = false; - result.child_ = null; - return this; - } - - public pbc::IPopsicleList ChildrenList { - get { return PrepareBuilder().children_; } - } - public int ChildrenCount { - get { return result.ChildrenCount; } - } - public global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children GetChildren(int index) { - return result.GetChildren(index); - } - public Builder SetChildren(int index, global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.children_[index] = value; - return this; - } - public Builder SetChildren(int index, global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.children_[index] = builderForValue.Build(); - return this; - } - public Builder AddChildren(global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.children_.Add(value); - return this; - } - public Builder AddChildren(global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.children_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeChildren(scg::IEnumerable values) { - PrepareBuilder(); - result.children_.Add(values); - return this; - } - public Builder ClearChildren() { - PrepareBuilder(); - result.children_.Clear(); - return this; - } - } - static TestXmlMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.Descriptor, null); - } - } - - [global::System.SerializableAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestXmlExtension : pb::GeneratedMessage { - private TestXmlExtension() { } - private static readonly TestXmlExtension defaultInstance = new TestXmlExtension().MakeReadOnly(); - private static readonly string[] _testXmlExtensionFieldNames = new string[] { "number" }; - private static readonly uint[] _testXmlExtensionFieldTags = new uint[] { 8 }; - public static TestXmlExtension DefaultInstance { - get { return defaultInstance; } - } - - public override TestXmlExtension DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestXmlExtension ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.internal__static_protobuf_unittest_extra_TestXmlExtension__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.internal__static_protobuf_unittest_extra_TestXmlExtension__FieldAccessorTable; } - } - - public const int NumberFieldNumber = 1; - private bool hasNumber; - private int number_; - public bool HasNumber { - get { return hasNumber; } - } - public int Number { - get { return number_; } - } - - public override bool IsInitialized { - get { - if (!hasNumber) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testXmlExtensionFieldNames; - if (hasNumber) { - output.WriteInt32(1, field_names[0], Number); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasNumber) { - size += pb::CodedOutputStream.ComputeInt32Size(1, Number); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestXmlExtension ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestXmlExtension ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestXmlExtension ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestXmlExtension ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestXmlExtension ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestXmlExtension ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestXmlExtension ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestXmlExtension ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestXmlExtension ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestXmlExtension ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestXmlExtension MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestXmlExtension prototype) { - return new Builder(prototype); - } - - [global::System.SerializableAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestXmlExtension cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestXmlExtension result; - - private TestXmlExtension PrepareBuilder() { - if (resultIsReadOnly) { - TestXmlExtension original = result; - result = new TestXmlExtension(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestXmlExtension MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestXmlExtension.Descriptor; } - } - - public override TestXmlExtension DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestXmlExtension.DefaultInstance; } - } - - public override TestXmlExtension BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestXmlExtension) { - return MergeFrom((TestXmlExtension) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestXmlExtension other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestXmlExtension.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasNumber) { - Number = other.Number; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testXmlExtensionFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testXmlExtensionFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasNumber = input.ReadInt32(ref result.number_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasNumber { - get { return result.hasNumber; } - } - public int Number { - get { return result.Number; } - set { SetNumber(value); } - } - public Builder SetNumber(int value) { - PrepareBuilder(); - result.hasNumber = true; - result.number_ = value; - return this; - } - public Builder ClearNumber() { - PrepareBuilder(); - result.hasNumber = false; - result.number_ = 0; - return this; - } - } - static TestXmlExtension() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.Descriptor, null); - } - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/ProtocolBuffers.Test/TestReaderForUrlEncoded.cs b/src/ProtocolBuffers.Test/TestReaderForUrlEncoded.cs deleted file mode 100644 index 1c43e24..0000000 --- a/src/ProtocolBuffers.Test/TestReaderForUrlEncoded.cs +++ /dev/null @@ -1,84 +0,0 @@ -using System; -using System.IO; -using System.Text; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Google.ProtocolBuffers.TestProtos; -using Google.ProtocolBuffers.Serialization.Http; - -namespace Google.ProtocolBuffers -{ - [TestClass] - public class TestReaderForUrlEncoded - { - [TestMethod] - public void Example_FromQueryString() - { - Uri sampleUri = new Uri("http://sample.com/Path/File.ext?text=two+three%20four&valid=true&numbers=1&numbers=2", UriKind.Absolute); - - ICodedInputStream input = FormUrlEncodedReader.CreateInstance(sampleUri.Query); - - TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); - builder.MergeFrom(input); - - TestXmlMessage message = builder.Build(); - Assert.AreEqual(true, message.Valid); - Assert.AreEqual("two three four", message.Text); - Assert.AreEqual(2, message.NumbersCount); - Assert.AreEqual(1, message.NumbersList[0]); - Assert.AreEqual(2, message.NumbersList[1]); - } - - [TestMethod] - public void Example_FromFormData() - { - Stream rawPost = new MemoryStream(Encoding.UTF8.GetBytes("text=two+three%20four&valid=true&numbers=1&numbers=2"), false); - - ICodedInputStream input = FormUrlEncodedReader.CreateInstance(rawPost); - - TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); - builder.MergeFrom(input); - - TestXmlMessage message = builder.Build(); - Assert.AreEqual(true, message.Valid); - Assert.AreEqual("two three four", message.Text); - Assert.AreEqual(2, message.NumbersCount); - Assert.AreEqual(1, message.NumbersList[0]); - Assert.AreEqual(2, message.NumbersList[1]); - } - - [TestMethod] - public void TestEmptyValues() - { - ICodedInputStream input = FormUrlEncodedReader.CreateInstance("valid=true&text=&numbers=1"); - TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); - builder.MergeFrom(input); - - Assert.IsTrue(builder.Valid); - Assert.IsTrue(builder.HasText); - Assert.AreEqual("", builder.Text); - Assert.AreEqual(1, builder.NumbersCount); - Assert.AreEqual(1, builder.NumbersList[0]); - } - - [TestMethod] - public void TestNoValue() - { - ICodedInputStream input = FormUrlEncodedReader.CreateInstance("valid=true&text&numbers=1"); - TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); - builder.MergeFrom(input); - - Assert.IsTrue(builder.Valid); - Assert.IsTrue(builder.HasText); - Assert.AreEqual("", builder.Text); - Assert.AreEqual(1, builder.NumbersCount); - Assert.AreEqual(1, builder.NumbersList[0]); - } - - [TestMethod, ExpectedException(typeof(NotSupportedException))] - public void FormUrlEncodedReaderDoesNotSupportChildren() - { - ICodedInputStream input = FormUrlEncodedReader.CreateInstance("child=uh0"); - TestXmlMessage.CreateBuilder().MergeFrom(input); - } - } -} diff --git a/src/ProtocolBuffers.Test/TestResources.cs b/src/ProtocolBuffers.Test/TestResources.cs deleted file mode 100644 index c978ca6..0000000 --- a/src/ProtocolBuffers.Test/TestResources.cs +++ /dev/null @@ -1,294 +0,0 @@ -namespace Google.ProtocolBuffers -{ - internal class TestResources - { - #region golden_message - internal static byte[] golden_message - { - get - { - return System.Convert.FromBase64String(@" -CGUQZhhnIGgo0gEw1AE9awAAAEFsAAAAAAAAAE1tAAAAUW4AAAAAAAAAXQAA3kJhAAAAAAAAXEBo -AXIDMTE1egMxMTaDAYgBdYQBkgECCHaaAQIId6IBAgh4qAEDsAEGuAEJwgEDMTI0ygEDMTI1+AHJ -AfgBrQKAAsoBgAKuAogCywGIAq8CkALMAZACsAKYApoDmALiBKACnAOgAuQErQLPAAAArQIzAQAA -sQLQAAAAAAAAALECNAEAAAAAAAC9AtEAAAC9AjUBAADBAtIAAAAAAAAAwQI2AQAAAAAAAM0CAABT -Q80CAICbQ9ECAAAAAACAakDRAgAAAAAAgHNA2AIB2AIA4gIDMjE14gIDMzE16gIDMjE26gIDMzE2 -8wL4AtkB9ALzAvgCvQL0AoIDAwjaAYIDAwi+AooDAwjbAYoDAwi/ApIDAwjcAZIDAwjAApgDApgD -A6ADBaADBqgDCKgDCbIDAzIyNLIDAzMyNLoDAzIyNboDAzMyNegDkQPwA5ID+AOTA4AElAOIBKoG -kASsBp0ElwEAAKEEmAEAAAAAAACtBJkBAACxBJoBAAAAAAAAvQQAgM1DwQQAAAAAAMB5QMgEANIE -AzQxNdoEAzQxNogFAZAFBJgFB6IFAzQyNKoFAzQyNQ== -"); - } - } - #endregion - - #region golden_packed_fields_message - internal static byte[] golden_packed_fields_message - { - get - { - return System.Convert.FromBase64String(@" -0gUE2QS9BdoFBNoEvgXiBQTbBL8F6gUE3ATABfIFBLoJggv6BQS8CYQLggYIXwIAAMMCAACKBhBg -AgAAAAAAAMQCAAAAAAAAkgYIYQIAAMUCAACaBhBiAgAAAAAAAMYCAAAAAAAAogYIAMAYRADAMUSq -BhAAAAAAACCDQAAAAAAAQIZAsgYCAQC6BgIFBg== -"); - } - } - #endregion - - #region text_format_unittest_data - internal static string text_format_unittest_data - { - get - { - return @" -optional_int32: 101 -optional_int64: 102 -optional_uint32: 103 -optional_uint64: 104 -optional_sint32: 105 -optional_sint64: 106 -optional_fixed32: 107 -optional_fixed64: 108 -optional_sfixed32: 109 -optional_sfixed64: 110 -optional_float: 111 -optional_double: 112 -optional_bool: true -optional_string: ""115"" -optional_bytes: ""116"" -OptionalGroup { - a: 117 -} -optional_nested_message { - bb: 118 -} -optional_foreign_message { - c: 119 -} -optional_import_message { - d: 120 -} -optional_nested_enum: BAZ -optional_foreign_enum: FOREIGN_BAZ -optional_import_enum: IMPORT_BAZ -optional_string_piece: ""124"" -optional_cord: ""125"" -repeated_int32: 201 -repeated_int32: 301 -repeated_int64: 202 -repeated_int64: 302 -repeated_uint32: 203 -repeated_uint32: 303 -repeated_uint64: 204 -repeated_uint64: 304 -repeated_sint32: 205 -repeated_sint32: 305 -repeated_sint64: 206 -repeated_sint64: 306 -repeated_fixed32: 207 -repeated_fixed32: 307 -repeated_fixed64: 208 -repeated_fixed64: 308 -repeated_sfixed32: 209 -repeated_sfixed32: 309 -repeated_sfixed64: 210 -repeated_sfixed64: 310 -repeated_float: 211 -repeated_float: 311 -repeated_double: 212 -repeated_double: 312 -repeated_bool: true -repeated_bool: false -repeated_string: ""215"" -repeated_string: ""315"" -repeated_bytes: ""216"" -repeated_bytes: ""316"" -RepeatedGroup { - a: 217 -} -RepeatedGroup { - a: 317 -} -repeated_nested_message { - bb: 218 -} -repeated_nested_message { - bb: 318 -} -repeated_foreign_message { - c: 219 -} -repeated_foreign_message { - c: 319 -} -repeated_import_message { - d: 220 -} -repeated_import_message { - d: 320 -} -repeated_nested_enum: BAR -repeated_nested_enum: BAZ -repeated_foreign_enum: FOREIGN_BAR -repeated_foreign_enum: FOREIGN_BAZ -repeated_import_enum: IMPORT_BAR -repeated_import_enum: IMPORT_BAZ -repeated_string_piece: ""224"" -repeated_string_piece: ""324"" -repeated_cord: ""225"" -repeated_cord: ""325"" -default_int32: 401 -default_int64: 402 -default_uint32: 403 -default_uint64: 404 -default_sint32: 405 -default_sint64: 406 -default_fixed32: 407 -default_fixed64: 408 -default_sfixed32: 409 -default_sfixed64: 410 -default_float: 411 -default_double: 412 -default_bool: false -default_string: ""415"" -default_bytes: ""416"" -default_nested_enum: FOO -default_foreign_enum: FOREIGN_FOO -default_import_enum: IMPORT_FOO -default_string_piece: ""424"" -default_cord: ""425"" - -"; - } - } - #endregion - - #region text_format_unittest_extensions_data - internal static string text_format_unittest_extensions_data - { - get - { - return @" -[protobuf_unittest.optional_int32_extension]: 101 -[protobuf_unittest.optional_int64_extension]: 102 -[protobuf_unittest.optional_uint32_extension]: 103 -[protobuf_unittest.optional_uint64_extension]: 104 -[protobuf_unittest.optional_sint32_extension]: 105 -[protobuf_unittest.optional_sint64_extension]: 106 -[protobuf_unittest.optional_fixed32_extension]: 107 -[protobuf_unittest.optional_fixed64_extension]: 108 -[protobuf_unittest.optional_sfixed32_extension]: 109 -[protobuf_unittest.optional_sfixed64_extension]: 110 -[protobuf_unittest.optional_float_extension]: 111 -[protobuf_unittest.optional_double_extension]: 112 -[protobuf_unittest.optional_bool_extension]: true -[protobuf_unittest.optional_string_extension]: ""115"" -[protobuf_unittest.optional_bytes_extension]: ""116"" -[protobuf_unittest.optionalgroup_extension] { - a: 117 -} -[protobuf_unittest.optional_nested_message_extension] { - bb: 118 -} -[protobuf_unittest.optional_foreign_message_extension] { - c: 119 -} -[protobuf_unittest.optional_import_message_extension] { - d: 120 -} -[protobuf_unittest.optional_nested_enum_extension]: BAZ -[protobuf_unittest.optional_foreign_enum_extension]: FOREIGN_BAZ -[protobuf_unittest.optional_import_enum_extension]: IMPORT_BAZ -[protobuf_unittest.optional_string_piece_extension]: ""124"" -[protobuf_unittest.optional_cord_extension]: ""125"" -[protobuf_unittest.repeated_int32_extension]: 201 -[protobuf_unittest.repeated_int32_extension]: 301 -[protobuf_unittest.repeated_int64_extension]: 202 -[protobuf_unittest.repeated_int64_extension]: 302 -[protobuf_unittest.repeated_uint32_extension]: 203 -[protobuf_unittest.repeated_uint32_extension]: 303 -[protobuf_unittest.repeated_uint64_extension]: 204 -[protobuf_unittest.repeated_uint64_extension]: 304 -[protobuf_unittest.repeated_sint32_extension]: 205 -[protobuf_unittest.repeated_sint32_extension]: 305 -[protobuf_unittest.repeated_sint64_extension]: 206 -[protobuf_unittest.repeated_sint64_extension]: 306 -[protobuf_unittest.repeated_fixed32_extension]: 207 -[protobuf_unittest.repeated_fixed32_extension]: 307 -[protobuf_unittest.repeated_fixed64_extension]: 208 -[protobuf_unittest.repeated_fixed64_extension]: 308 -[protobuf_unittest.repeated_sfixed32_extension]: 209 -[protobuf_unittest.repeated_sfixed32_extension]: 309 -[protobuf_unittest.repeated_sfixed64_extension]: 210 -[protobuf_unittest.repeated_sfixed64_extension]: 310 -[protobuf_unittest.repeated_float_extension]: 211 -[protobuf_unittest.repeated_float_extension]: 311 -[protobuf_unittest.repeated_double_extension]: 212 -[protobuf_unittest.repeated_double_extension]: 312 -[protobuf_unittest.repeated_bool_extension]: true -[protobuf_unittest.repeated_bool_extension]: false -[protobuf_unittest.repeated_string_extension]: ""215"" -[protobuf_unittest.repeated_string_extension]: ""315"" -[protobuf_unittest.repeated_bytes_extension]: ""216"" -[protobuf_unittest.repeated_bytes_extension]: ""316"" -[protobuf_unittest.repeatedgroup_extension] { - a: 217 -} -[protobuf_unittest.repeatedgroup_extension] { - a: 317 -} -[protobuf_unittest.repeated_nested_message_extension] { - bb: 218 -} -[protobuf_unittest.repeated_nested_message_extension] { - bb: 318 -} -[protobuf_unittest.repeated_foreign_message_extension] { - c: 219 -} -[protobuf_unittest.repeated_foreign_message_extension] { - c: 319 -} -[protobuf_unittest.repeated_import_message_extension] { - d: 220 -} -[protobuf_unittest.repeated_import_message_extension] { - d: 320 -} -[protobuf_unittest.repeated_nested_enum_extension]: BAR -[protobuf_unittest.repeated_nested_enum_extension]: BAZ -[protobuf_unittest.repeated_foreign_enum_extension]: FOREIGN_BAR -[protobuf_unittest.repeated_foreign_enum_extension]: FOREIGN_BAZ -[protobuf_unittest.repeated_import_enum_extension]: IMPORT_BAR -[protobuf_unittest.repeated_import_enum_extension]: IMPORT_BAZ -[protobuf_unittest.repeated_string_piece_extension]: ""224"" -[protobuf_unittest.repeated_string_piece_extension]: ""324"" -[protobuf_unittest.repeated_cord_extension]: ""225"" -[protobuf_unittest.repeated_cord_extension]: ""325"" -[protobuf_unittest.default_int32_extension]: 401 -[protobuf_unittest.default_int64_extension]: 402 -[protobuf_unittest.default_uint32_extension]: 403 -[protobuf_unittest.default_uint64_extension]: 404 -[protobuf_unittest.default_sint32_extension]: 405 -[protobuf_unittest.default_sint64_extension]: 406 -[protobuf_unittest.default_fixed32_extension]: 407 -[protobuf_unittest.default_fixed64_extension]: 408 -[protobuf_unittest.default_sfixed32_extension]: 409 -[protobuf_unittest.default_sfixed64_extension]: 410 -[protobuf_unittest.default_float_extension]: 411 -[protobuf_unittest.default_double_extension]: 412 -[protobuf_unittest.default_bool_extension]: false -[protobuf_unittest.default_string_extension]: ""415"" -[protobuf_unittest.default_bytes_extension]: ""416"" -[protobuf_unittest.default_nested_enum_extension]: FOO -[protobuf_unittest.default_foreign_enum_extension]: FOREIGN_FOO -[protobuf_unittest.default_import_enum_extension]: IMPORT_FOO -[protobuf_unittest.default_string_piece_extension]: ""424"" -[protobuf_unittest.default_cord_extension]: ""425"" -"; - } - } - #endregion - } -} diff --git a/src/ProtocolBuffers.Test/TestRpcForMimeTypes.cs b/src/ProtocolBuffers.Test/TestRpcForMimeTypes.cs deleted file mode 100644 index 68cb93d..0000000 --- a/src/ProtocolBuffers.Test/TestRpcForMimeTypes.cs +++ /dev/null @@ -1,386 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using Google.ProtocolBuffers; -using Google.ProtocolBuffers.Serialization.Http; -using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.IO; -using Google.ProtocolBuffers.Serialization; -using System.Text; - -namespace Google.ProtocolBuffers -{ - /// - /// This class verifies the correct code is generated from unittest_rpc_interop.proto and provides a small demonstration - /// of using the new IRpcDispatch to write a client/server - /// - [TestClass] - public class TestRpcForMimeTypes - { - /// - /// A sample implementation of the ISearchService for testing - /// - private class ExampleSearchImpl : ISearchService - { - SearchResponse ISearchService.Search(SearchRequest searchRequest) - { - if (searchRequest.CriteriaCount == 0) - { - throw new ArgumentException("No criteria specified.", new InvalidOperationException()); - } - SearchResponse.Builder resp = SearchResponse.CreateBuilder(); - foreach (string criteria in searchRequest.CriteriaList) - { - resp.AddResults( - SearchResponse.Types.ResultItem.CreateBuilder().SetName(criteria).SetUrl("http://search.com"). - Build()); - } - return resp.Build(); - } - - SearchResponse ISearchService.RefineSearch(RefineSearchRequest refineSearchRequest) - { - SearchResponse.Builder resp = refineSearchRequest.PreviousResults.ToBuilder(); - foreach (string criteria in refineSearchRequest.CriteriaList) - { - resp.AddResults( - SearchResponse.Types.ResultItem.CreateBuilder().SetName(criteria).SetUrl("http://refine.com"). - Build()); - } - return resp.Build(); - } - } - - /// - /// An example extraction of the wire protocol - /// - private interface IHttpTransfer - { - void Execute(string method, string contentType, Stream input, string acceptType, Stream output); - } - - /// - /// An example of a server responding to a web/http request - /// - private class ExampleHttpServer : IHttpTransfer - { - public readonly MessageFormatOptions Options = - new MessageFormatOptions - { - ExtensionRegistry = ExtensionRegistry.Empty, - FormattedOutput = true, - XmlReaderOptions = XmlReaderOptions.ReadNestedArrays, - XmlReaderRootElementName = "request", - XmlWriterOptions = XmlWriterOptions.OutputNestedArrays, - XmlWriterRootElementName = "response" - }; - - private readonly IRpcServerStub _stub; - - public ExampleHttpServer(ISearchService implementation) - { - //on the server, we create a dispatch to call the appropriate method by name - IRpcDispatch dispatch = new SearchService.Dispatch(implementation); - //we then wrap that dispatch in a server stub which will deserialize the wire bytes to the message - //type appropriate for the method name being invoked. - _stub = new SearchService.ServerStub(dispatch); - } - - void IHttpTransfer.Execute(string method, string contentType, Stream input, string acceptType, Stream output) - { - //3.5: _stub.HttpCallMethod( - Extensions.HttpCallMethod(_stub, - method, Options, - contentType, input, - acceptType, output - ); - } - } - - /// - /// An example of a client sending a wire request - /// - private class ExampleClient : IRpcDispatch - { - public readonly MessageFormatOptions Options = - new MessageFormatOptions - { - ExtensionRegistry = ExtensionRegistry.Empty, - FormattedOutput = true, - XmlReaderOptions = XmlReaderOptions.ReadNestedArrays, - XmlReaderRootElementName = "response", - XmlWriterOptions = XmlWriterOptions.OutputNestedArrays, - XmlWriterRootElementName = "request" - }; - - - private readonly IHttpTransfer _wire; - private readonly string _mimeType; - - public ExampleClient(IHttpTransfer wire, string mimeType) - { - _wire = wire; - _mimeType = mimeType; - } - - TMessage IRpcDispatch.CallMethod(string method, IMessageLite request, - IBuilderLite response) - { - MemoryStream input = new MemoryStream(); - MemoryStream output = new MemoryStream(); - - //Write to _mimeType format - Extensions.WriteTo(request, Options, _mimeType, input); - - input.Position = 0; - _wire.Execute(method, _mimeType, input, _mimeType, output); - - //Read from _mimeType format - output.Position = 0; - Extensions.MergeFrom(response, Options, _mimeType, output); - - return response.Build(); - } - } - - /// - /// Test sending and recieving messages via text/json - /// - [TestMethod] - public void TestClientServerWithJsonFormat() - { - ExampleHttpServer server = new ExampleHttpServer(new ExampleSearchImpl()); - //obviously if this was a 'real' transport we would not use the server, rather the server would be listening, the client transmitting - IHttpTransfer wire = server; - - ISearchService client = new SearchService(new ExampleClient(wire, "text/json")); - //now the client has a real, typed, interface to work with: - SearchResponse result = client.Search(SearchRequest.CreateBuilder().AddCriteria("Test").Build()); - Assert.AreEqual(1, result.ResultsCount); - Assert.AreEqual("Test", result.ResultsList[0].Name); - Assert.AreEqual("http://search.com", result.ResultsList[0].Url); - - //The test part of this, call the only other method - result = - client.RefineSearch( - RefineSearchRequest.CreateBuilder().SetPreviousResults(result).AddCriteria("Refine").Build()); - Assert.AreEqual(2, result.ResultsCount); - Assert.AreEqual("Test", result.ResultsList[0].Name); - Assert.AreEqual("http://search.com", result.ResultsList[0].Url); - - Assert.AreEqual("Refine", result.ResultsList[1].Name); - Assert.AreEqual("http://refine.com", result.ResultsList[1].Url); - } - - /// - /// Test sending and recieving messages via text/json - /// - [TestMethod] - public void TestClientServerWithXmlFormat() - { - ExampleHttpServer server = new ExampleHttpServer(new ExampleSearchImpl()); - //obviously if this was a 'real' transport we would not use the server, rather the server would be listening, the client transmitting - IHttpTransfer wire = server; - - ISearchService client = new SearchService(new ExampleClient(wire, "text/xml")); - //now the client has a real, typed, interface to work with: - SearchResponse result = client.Search(SearchRequest.CreateBuilder().AddCriteria("Test").Build()); - Assert.AreEqual(1, result.ResultsCount); - Assert.AreEqual("Test", result.ResultsList[0].Name); - Assert.AreEqual("http://search.com", result.ResultsList[0].Url); - - //The test part of this, call the only other method - result = - client.RefineSearch( - RefineSearchRequest.CreateBuilder().SetPreviousResults(result).AddCriteria("Refine").Build()); - Assert.AreEqual(2, result.ResultsCount); - Assert.AreEqual("Test", result.ResultsList[0].Name); - Assert.AreEqual("http://search.com", result.ResultsList[0].Url); - - Assert.AreEqual("Refine", result.ResultsList[1].Name); - Assert.AreEqual("http://refine.com", result.ResultsList[1].Url); - } - - /// - /// Test sending and recieving messages via text/json - /// - [TestMethod] - public void TestClientServerWithProtoFormat() - { - ExampleHttpServer server = new ExampleHttpServer(new ExampleSearchImpl()); - //obviously if this was a 'real' transport we would not use the server, rather the server would be listening, the client transmitting - IHttpTransfer wire = server; - - ISearchService client = new SearchService(new ExampleClient(wire, "application/x-protobuf")); - //now the client has a real, typed, interface to work with: - SearchResponse result = client.Search(SearchRequest.CreateBuilder().AddCriteria("Test").Build()); - Assert.AreEqual(1, result.ResultsCount); - Assert.AreEqual("Test", result.ResultsList[0].Name); - Assert.AreEqual("http://search.com", result.ResultsList[0].Url); - - //The test part of this, call the only other method - result = - client.RefineSearch( - RefineSearchRequest.CreateBuilder().SetPreviousResults(result).AddCriteria("Refine").Build()); - Assert.AreEqual(2, result.ResultsCount); - Assert.AreEqual("Test", result.ResultsList[0].Name); - Assert.AreEqual("http://search.com", result.ResultsList[0].Url); - - Assert.AreEqual("Refine", result.ResultsList[1].Name); - Assert.AreEqual("http://refine.com", result.ResultsList[1].Url); - } - - /// - /// Test sending and recieving messages via text/json - /// - [TestMethod] - public void TestClientServerWithCustomFormat() - { - ExampleHttpServer server = new ExampleHttpServer(new ExampleSearchImpl()); - //Setup our custom mime-type format as the only format supported: - server.Options.MimeInputTypes.Clear(); - server.Options.MimeInputTypes.Add("foo/bar", CodedInputStream.CreateInstance); - server.Options.MimeOutputTypes.Clear(); - server.Options.MimeOutputTypes.Add("foo/bar", CodedOutputStream.CreateInstance); - - //obviously if this was a 'real' transport we would not use the server, rather the server would be listening, the client transmitting - IHttpTransfer wire = server; - - ExampleClient exclient = new ExampleClient(wire, "foo/bar"); - //Add our custom mime-type format - exclient.Options.MimeInputTypes.Add("foo/bar", CodedInputStream.CreateInstance); - exclient.Options.MimeOutputTypes.Add("foo/bar", CodedOutputStream.CreateInstance); - ISearchService client = new SearchService(exclient); - - //now the client has a real, typed, interface to work with: - SearchResponse result = client.Search(SearchRequest.CreateBuilder().AddCriteria("Test").Build()); - Assert.AreEqual(1, result.ResultsCount); - Assert.AreEqual("Test", result.ResultsList[0].Name); - Assert.AreEqual("http://search.com", result.ResultsList[0].Url); - - //The test part of this, call the only other method - result = - client.RefineSearch( - RefineSearchRequest.CreateBuilder().SetPreviousResults(result).AddCriteria("Refine").Build()); - Assert.AreEqual(2, result.ResultsCount); - Assert.AreEqual("Test", result.ResultsList[0].Name); - Assert.AreEqual("http://search.com", result.ResultsList[0].Url); - - Assert.AreEqual("Refine", result.ResultsList[1].Name); - Assert.AreEqual("http://refine.com", result.ResultsList[1].Url); - } - - /// - /// Test sending and recieving messages via text/json - /// - [TestMethod] - public void TestServerWithUriFormat() - { - ExampleHttpServer server = new ExampleHttpServer(new ExampleSearchImpl()); - //obviously if this was a 'real' transport we would not use the server, rather the server would be listening, the client transmitting - IHttpTransfer wire = server; - - MemoryStream input = new MemoryStream(Encoding.UTF8.GetBytes("?Criteria=Test&Criteria=Test+of%20URI")); - MemoryStream output = new MemoryStream(); - - //Call the server - wire.Execute("Search", - MessageFormatOptions.ContentFormUrlEncoded, input, - MessageFormatOptions.ContentTypeProtoBuffer, output - ); - - SearchResponse result = SearchResponse.ParseFrom(output.ToArray()); - Assert.AreEqual(2, result.ResultsCount); - Assert.AreEqual("Test", result.ResultsList[0].Name); - Assert.AreEqual("http://search.com", result.ResultsList[0].Url); - - Assert.AreEqual("Test of URI", result.ResultsList[1].Name); - Assert.AreEqual("http://search.com", result.ResultsList[1].Url); - } - - /// - /// Test sending and recieving messages via text/json - /// - [TestMethod, ExpectedException(typeof(ArgumentOutOfRangeException))] - public void TestInvalidMimeType() - { - ExampleHttpServer server = new ExampleHttpServer(new ExampleSearchImpl()); - //obviously if this was a 'real' transport we would not use the server, rather the server would be listening, the client transmitting - IHttpTransfer wire = server; - - MemoryStream input = new MemoryStream(); - MemoryStream output = new MemoryStream(); - - //Call the server - wire.Execute("Search", - "bad/mime", input, - MessageFormatOptions.ContentTypeProtoBuffer, output - ); - Assert.Fail(); - } - - /// - /// Test sending and recieving messages via text/json - /// - [TestMethod] - public void TestDefaultMimeType() - { - ExampleHttpServer server = new ExampleHttpServer(new ExampleSearchImpl()); - - //obviously if this was a 'real' transport we would not use the server, rather the server would be listening, the client transmitting - IHttpTransfer wire = server; - - - MemoryStream input = new MemoryStream(new SearchRequest.Builder().AddCriteria("Test").Build().ToByteArray()); - MemoryStream output = new MemoryStream(); - - //With this default set, any invalid/unknown mime-type will be mapped to use that format - server.Options.DefaultContentType = MessageFormatOptions.ContentTypeProtoBuffer; - - wire.Execute("Search", - "foo", input, - "bar", output - ); - - SearchResponse result = SearchResponse.ParseFrom(output.ToArray()); - Assert.AreEqual(1, result.ResultsCount); - Assert.AreEqual("Test", result.ResultsList[0].Name); - Assert.AreEqual("http://search.com", result.ResultsList[0].Url); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/TestRpcGenerator.cs b/src/ProtocolBuffers.Test/TestRpcGenerator.cs deleted file mode 100644 index 18532d6..0000000 --- a/src/ProtocolBuffers.Test/TestRpcGenerator.cs +++ /dev/null @@ -1,171 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using Google.ProtocolBuffers; -using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers -{ - /// - /// This class verifies the correct code is generated from unittest_rpc_interop.proto and provides a small demonstration - /// of using the new IRpcDispatch to write a client/server - /// - [TestClass] - public class TestRpcGenerator - { - /// - /// A sample implementation of the ISearchService for testing - /// - private class ExampleSearchImpl : ISearchService - { - SearchResponse ISearchService.Search(SearchRequest searchRequest) - { - if (searchRequest.CriteriaCount == 0) - { - throw new ArgumentException("No criteria specified.", new InvalidOperationException()); - } - SearchResponse.Builder resp = SearchResponse.CreateBuilder(); - foreach (string criteria in searchRequest.CriteriaList) - { - resp.AddResults( - SearchResponse.Types.ResultItem.CreateBuilder().SetName(criteria).SetUrl("http://search.com"). - Build()); - } - return resp.Build(); - } - - SearchResponse ISearchService.RefineSearch(RefineSearchRequest refineSearchRequest) - { - SearchResponse.Builder resp = refineSearchRequest.PreviousResults.ToBuilder(); - foreach (string criteria in refineSearchRequest.CriteriaList) - { - resp.AddResults( - SearchResponse.Types.ResultItem.CreateBuilder().SetName(criteria).SetUrl("http://refine.com"). - Build()); - } - return resp.Build(); - } - } - - /// - /// An example extraction of the wire protocol - /// - private interface IWireTransfer - { - byte[] Execute(string method, byte[] message); - } - - /// - /// An example of a server responding to a wire request - /// - private class ExampleServerHost : IWireTransfer - { - private readonly IRpcServerStub _stub; - - public ExampleServerHost(ISearchService implementation) - { - //on the server, we create a dispatch to call the appropriate method by name - IRpcDispatch dispatch = new SearchService.Dispatch(implementation); - //we then wrap that dispatch in a server stub which will deserialize the wire bytes to the message - //type appropriate for the method name being invoked. - _stub = new SearchService.ServerStub(dispatch); - } - - byte[] IWireTransfer.Execute(string method, byte[] message) - { - //now when we recieve a wire transmission to invoke a method by name with a byte[] or stream payload - //we just simply call the sub: - IMessageLite response = _stub.CallMethod(method, CodedInputStream.CreateInstance(message), - ExtensionRegistry.Empty); - //now we return the expected response message: - return response.ToByteArray(); - } - } - - /// - /// An example of a client sending a wire request - /// - private class ExampleClient : IRpcDispatch - { - private readonly IWireTransfer _wire; - - public ExampleClient(IWireTransfer wire) - { - _wire = wire; - } - - TMessage IRpcDispatch.CallMethod(string method, IMessageLite request, - IBuilderLite response) - { - byte[] rawResponse = _wire.Execute(method, request.ToByteArray()); - response.MergeFrom(rawResponse); - return response.Build(); - } - } - - /// - /// Put it all together to create one seamless client/server experience full of rich-type goodness ;) - /// All you need to do is send/recieve the method name and message bytes across the wire. - /// - [TestMethod] - public void TestClientServerDispatch() - { - ExampleServerHost server = new ExampleServerHost(new ExampleSearchImpl()); - //obviously if this was a 'real' transport we would not use the server, rather the server would be listening, the client transmitting - IWireTransfer wire = server; - - ISearchService client = new SearchService(new ExampleClient(wire)); - //now the client has a real, typed, interface to work with: - SearchResponse result = client.Search(SearchRequest.CreateBuilder().AddCriteria("Test").Build()); - Assert.AreEqual(1, result.ResultsCount); - Assert.AreEqual("Test", result.ResultsList[0].Name); - Assert.AreEqual("http://search.com", result.ResultsList[0].Url); - - //The test part of this, call the only other method - result = - client.RefineSearch( - RefineSearchRequest.CreateBuilder().SetPreviousResults(result).AddCriteria("Refine").Build()); - Assert.AreEqual(2, result.ResultsCount); - Assert.AreEqual("Test", result.ResultsList[0].Name); - Assert.AreEqual("http://search.com", result.ResultsList[0].Url); - - Assert.AreEqual("Refine", result.ResultsList[1].Name); - Assert.AreEqual("http://refine.com", result.ResultsList[1].Url); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/TestUtil.cs b/src/ProtocolBuffers.Test/TestUtil.cs deleted file mode 100644 index 19c0df3..0000000 --- a/src/ProtocolBuffers.Test/TestUtil.cs +++ /dev/null @@ -1,1812 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Text; -using System.Threading; -using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers -{ - internal static class TestUtil - { - private static ByteString goldenMessage = null; - - internal static ByteString GoldenMessage - { - get - { - if (goldenMessage == null) - { - goldenMessage = ByteString.CopyFrom(TestResources.golden_message); - } - return goldenMessage; - } - } - - private static ByteString goldenPackedFieldsMessage = null; - - /// - /// Get the bytes of the "golden packed fields message". This is a serialized - /// TestPackedTypes with all fields set as they would be by SetPackedFields, - /// but it is loaded from a file on disk rather than generated dynamically. - /// The file is actually generated by C++ code, so testing against it verifies compatibility - /// with C++. - /// - public static ByteString GetGoldenPackedFieldsMessage() - { - if (goldenPackedFieldsMessage == null) - { - goldenPackedFieldsMessage = ByteString.CopyFrom(TestResources.golden_packed_fields_message); - } - return goldenPackedFieldsMessage; - } - - /// - /// Creates an unmodifiable ExtensionRegistry containing all the extensions - /// of TestAllExtensions. - /// - /// - internal static ExtensionRegistry CreateExtensionRegistry() - { - ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); - RegisterAllExtensions(registry); - return registry.AsReadOnly(); - } - - /// - /// Registers all of the extensions in TestAllExtensions with the given - /// ExtensionRegistry. - /// - internal static void RegisterAllExtensions(ExtensionRegistry registry) - { - registry.Add(UnitTestProtoFile.OptionalInt32Extension); - registry.Add(UnitTestProtoFile.OptionalInt64Extension); - registry.Add(UnitTestProtoFile.OptionalUint32Extension); - registry.Add(UnitTestProtoFile.OptionalUint64Extension); - registry.Add(UnitTestProtoFile.OptionalSint32Extension); - registry.Add(UnitTestProtoFile.OptionalSint64Extension); - registry.Add(UnitTestProtoFile.OptionalFixed32Extension); - registry.Add(UnitTestProtoFile.OptionalFixed64Extension); - registry.Add(UnitTestProtoFile.OptionalSfixed32Extension); - registry.Add(UnitTestProtoFile.OptionalSfixed64Extension); - registry.Add(UnitTestProtoFile.OptionalFloatExtension); - registry.Add(UnitTestProtoFile.OptionalDoubleExtension); - registry.Add(UnitTestProtoFile.OptionalBoolExtension); - registry.Add(UnitTestProtoFile.OptionalStringExtension); - registry.Add(UnitTestProtoFile.OptionalBytesExtension); - registry.Add(UnitTestProtoFile.OptionalGroupExtension); - registry.Add(UnitTestProtoFile.OptionalNestedMessageExtension); - registry.Add(UnitTestProtoFile.OptionalForeignMessageExtension); - registry.Add(UnitTestProtoFile.OptionalImportMessageExtension); - registry.Add(UnitTestProtoFile.OptionalNestedEnumExtension); - registry.Add(UnitTestProtoFile.OptionalForeignEnumExtension); - registry.Add(UnitTestProtoFile.OptionalImportEnumExtension); - registry.Add(UnitTestProtoFile.OptionalStringPieceExtension); - registry.Add(UnitTestProtoFile.OptionalCordExtension); - - registry.Add(UnitTestProtoFile.RepeatedInt32Extension); - registry.Add(UnitTestProtoFile.RepeatedInt64Extension); - registry.Add(UnitTestProtoFile.RepeatedUint32Extension); - registry.Add(UnitTestProtoFile.RepeatedUint64Extension); - registry.Add(UnitTestProtoFile.RepeatedSint32Extension); - registry.Add(UnitTestProtoFile.RepeatedSint64Extension); - registry.Add(UnitTestProtoFile.RepeatedFixed32Extension); - registry.Add(UnitTestProtoFile.RepeatedFixed64Extension); - registry.Add(UnitTestProtoFile.RepeatedSfixed32Extension); - registry.Add(UnitTestProtoFile.RepeatedSfixed64Extension); - registry.Add(UnitTestProtoFile.RepeatedFloatExtension); - registry.Add(UnitTestProtoFile.RepeatedDoubleExtension); - registry.Add(UnitTestProtoFile.RepeatedBoolExtension); - registry.Add(UnitTestProtoFile.RepeatedStringExtension); - registry.Add(UnitTestProtoFile.RepeatedBytesExtension); - registry.Add(UnitTestProtoFile.RepeatedGroupExtension); - registry.Add(UnitTestProtoFile.RepeatedNestedMessageExtension); - registry.Add(UnitTestProtoFile.RepeatedForeignMessageExtension); - registry.Add(UnitTestProtoFile.RepeatedImportMessageExtension); - registry.Add(UnitTestProtoFile.RepeatedNestedEnumExtension); - registry.Add(UnitTestProtoFile.RepeatedForeignEnumExtension); - registry.Add(UnitTestProtoFile.RepeatedImportEnumExtension); - registry.Add(UnitTestProtoFile.RepeatedStringPieceExtension); - registry.Add(UnitTestProtoFile.RepeatedCordExtension); - - registry.Add(UnitTestProtoFile.DefaultInt32Extension); - registry.Add(UnitTestProtoFile.DefaultInt64Extension); - registry.Add(UnitTestProtoFile.DefaultUint32Extension); - registry.Add(UnitTestProtoFile.DefaultUint64Extension); - registry.Add(UnitTestProtoFile.DefaultSint32Extension); - registry.Add(UnitTestProtoFile.DefaultSint64Extension); - registry.Add(UnitTestProtoFile.DefaultFixed32Extension); - registry.Add(UnitTestProtoFile.DefaultFixed64Extension); - registry.Add(UnitTestProtoFile.DefaultSfixed32Extension); - registry.Add(UnitTestProtoFile.DefaultSfixed64Extension); - registry.Add(UnitTestProtoFile.DefaultFloatExtension); - registry.Add(UnitTestProtoFile.DefaultDoubleExtension); - registry.Add(UnitTestProtoFile.DefaultBoolExtension); - registry.Add(UnitTestProtoFile.DefaultStringExtension); - registry.Add(UnitTestProtoFile.DefaultBytesExtension); - registry.Add(UnitTestProtoFile.DefaultNestedEnumExtension); - registry.Add(UnitTestProtoFile.DefaultForeignEnumExtension); - registry.Add(UnitTestProtoFile.DefaultImportEnumExtension); - registry.Add(UnitTestProtoFile.DefaultStringPieceExtension); - registry.Add(UnitTestProtoFile.DefaultCordExtension); - - registry.Add(UnitTestProtoFile.PackedInt32Extension); - registry.Add(UnitTestProtoFile.PackedInt64Extension); - registry.Add(UnitTestProtoFile.PackedUint32Extension); - registry.Add(UnitTestProtoFile.PackedUint64Extension); - registry.Add(UnitTestProtoFile.PackedSint32Extension); - registry.Add(UnitTestProtoFile.PackedSint64Extension); - registry.Add(UnitTestProtoFile.PackedFixed32Extension); - registry.Add(UnitTestProtoFile.PackedFixed64Extension); - registry.Add(UnitTestProtoFile.PackedSfixed32Extension); - registry.Add(UnitTestProtoFile.PackedSfixed64Extension); - registry.Add(UnitTestProtoFile.PackedFloatExtension); - registry.Add(UnitTestProtoFile.PackedDoubleExtension); - registry.Add(UnitTestProtoFile.PackedBoolExtension); - registry.Add(UnitTestProtoFile.PackedEnumExtension); - } - - /// - /// Helper to convert a String to ByteString. - /// - internal static ByteString ToBytes(String str) - { - return ByteString.CopyFrom(Encoding.UTF8.GetBytes(str)); - } - - internal static TestAllTypes GetAllSet() - { - TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); - SetAllFields(builder); - return builder.Build(); - } - - /// - /// Sets every field of the specified message to the values expected by - /// AssertAllFieldsSet. - /// - internal static void SetAllFields(TestAllTypes.Builder message) - { - message.SetOptionalInt32(101); - message.SetOptionalInt64(102); - message.SetOptionalUint32(103); - message.SetOptionalUint64(104); - message.SetOptionalSint32(105); - message.SetOptionalSint64(106); - message.SetOptionalFixed32(107); - message.SetOptionalFixed64(108); - message.SetOptionalSfixed32(109); - message.SetOptionalSfixed64(110); - message.SetOptionalFloat(111); - message.SetOptionalDouble(112); - message.SetOptionalBool(true); - message.SetOptionalString("115"); - message.SetOptionalBytes(ToBytes("116")); - - message.SetOptionalGroup(TestAllTypes.Types.OptionalGroup.CreateBuilder().SetA(117).Build()); - message.SetOptionalNestedMessage(TestAllTypes.Types.NestedMessage.CreateBuilder().SetBb(118).Build()); - message.SetOptionalForeignMessage(ForeignMessage.CreateBuilder().SetC(119).Build()); - message.SetOptionalImportMessage(ImportMessage.CreateBuilder().SetD(120).Build()); - - message.SetOptionalNestedEnum(TestAllTypes.Types.NestedEnum.BAZ); - message.SetOptionalForeignEnum(ForeignEnum.FOREIGN_BAZ); - message.SetOptionalImportEnum(ImportEnum.IMPORT_BAZ); - - message.SetOptionalStringPiece("124"); - message.SetOptionalCord("125"); - - // ----------------------------------------------------------------- - - message.AddRepeatedInt32(201); - message.AddRepeatedInt64(202); - message.AddRepeatedUint32(203); - message.AddRepeatedUint64(204); - message.AddRepeatedSint32(205); - message.AddRepeatedSint64(206); - message.AddRepeatedFixed32(207); - message.AddRepeatedFixed64(208); - message.AddRepeatedSfixed32(209); - message.AddRepeatedSfixed64(210); - message.AddRepeatedFloat(211); - message.AddRepeatedDouble(212); - message.AddRepeatedBool(true); - message.AddRepeatedString("215"); - message.AddRepeatedBytes(ToBytes("216")); - - message.AddRepeatedGroup(TestAllTypes.Types.RepeatedGroup.CreateBuilder().SetA(217).Build()); - message.AddRepeatedNestedMessage(TestAllTypes.Types.NestedMessage.CreateBuilder().SetBb(218).Build()); - message.AddRepeatedForeignMessage(ForeignMessage.CreateBuilder().SetC(219).Build()); - message.AddRepeatedImportMessage(ImportMessage.CreateBuilder().SetD(220).Build()); - - message.AddRepeatedNestedEnum(TestAllTypes.Types.NestedEnum.BAR); - message.AddRepeatedForeignEnum(ForeignEnum.FOREIGN_BAR); - message.AddRepeatedImportEnum(ImportEnum.IMPORT_BAR); - - message.AddRepeatedStringPiece("224"); - message.AddRepeatedCord("225"); - - // Add a second one of each field. - message.AddRepeatedInt32(301); - message.AddRepeatedInt64(302); - message.AddRepeatedUint32(303); - message.AddRepeatedUint64(304); - message.AddRepeatedSint32(305); - message.AddRepeatedSint64(306); - message.AddRepeatedFixed32(307); - message.AddRepeatedFixed64(308); - message.AddRepeatedSfixed32(309); - message.AddRepeatedSfixed64(310); - message.AddRepeatedFloat(311); - message.AddRepeatedDouble(312); - message.AddRepeatedBool(false); - message.AddRepeatedString("315"); - message.AddRepeatedBytes(ToBytes("316")); - - message.AddRepeatedGroup(TestAllTypes.Types.RepeatedGroup.CreateBuilder().SetA(317).Build()); - message.AddRepeatedNestedMessage(TestAllTypes.Types.NestedMessage.CreateBuilder().SetBb(318).Build()); - message.AddRepeatedForeignMessage(ForeignMessage.CreateBuilder().SetC(319).Build()); - message.AddRepeatedImportMessage(ImportMessage.CreateBuilder().SetD(320).Build()); - - message.AddRepeatedNestedEnum(TestAllTypes.Types.NestedEnum.BAZ); - message.AddRepeatedForeignEnum(ForeignEnum.FOREIGN_BAZ); - message.AddRepeatedImportEnum(ImportEnum.IMPORT_BAZ); - - message.AddRepeatedStringPiece("324"); - message.AddRepeatedCord("325"); - - // ----------------------------------------------------------------- - - message.SetDefaultInt32(401); - message.SetDefaultInt64(402); - message.SetDefaultUint32(403); - message.SetDefaultUint64(404); - message.SetDefaultSint32(405); - message.SetDefaultSint64(406); - message.SetDefaultFixed32(407); - message.SetDefaultFixed64(408); - message.SetDefaultSfixed32(409); - message.SetDefaultSfixed64(410); - message.SetDefaultFloat(411); - message.SetDefaultDouble(412); - message.SetDefaultBool(false); - message.SetDefaultString("415"); - message.SetDefaultBytes(ToBytes("416")); - - message.SetDefaultNestedEnum(TestAllTypes.Types.NestedEnum.FOO); - message.SetDefaultForeignEnum(ForeignEnum.FOREIGN_FOO); - message.SetDefaultImportEnum(ImportEnum.IMPORT_FOO); - - message.SetDefaultStringPiece("424"); - message.SetDefaultCord("425"); - } - - /// - /// Asserts that all fields of the specified message are set to the values - /// assigned by SetAllFields. - /// - internal static void AssertAllFieldsSet(TestAllTypes message) - { - Assert.IsTrue(message.HasOptionalInt32); - Assert.IsTrue(message.HasOptionalInt64); - Assert.IsTrue(message.HasOptionalUint32); - Assert.IsTrue(message.HasOptionalUint64); - Assert.IsTrue(message.HasOptionalSint32); - Assert.IsTrue(message.HasOptionalSint64); - Assert.IsTrue(message.HasOptionalFixed32); - Assert.IsTrue(message.HasOptionalFixed64); - Assert.IsTrue(message.HasOptionalSfixed32); - Assert.IsTrue(message.HasOptionalSfixed64); - Assert.IsTrue(message.HasOptionalFloat); - Assert.IsTrue(message.HasOptionalDouble); - Assert.IsTrue(message.HasOptionalBool); - Assert.IsTrue(message.HasOptionalString); - Assert.IsTrue(message.HasOptionalBytes); - - Assert.IsTrue(message.HasOptionalGroup); - Assert.IsTrue(message.HasOptionalNestedMessage); - Assert.IsTrue(message.HasOptionalForeignMessage); - Assert.IsTrue(message.HasOptionalImportMessage); - - Assert.IsTrue(message.OptionalGroup.HasA); - Assert.IsTrue(message.OptionalNestedMessage.HasBb); - Assert.IsTrue(message.OptionalForeignMessage.HasC); - Assert.IsTrue(message.OptionalImportMessage.HasD); - - Assert.IsTrue(message.HasOptionalNestedEnum); - Assert.IsTrue(message.HasOptionalForeignEnum); - Assert.IsTrue(message.HasOptionalImportEnum); - - Assert.IsTrue(message.HasOptionalStringPiece); - Assert.IsTrue(message.HasOptionalCord); - - Assert.AreEqual(101, message.OptionalInt32); - Assert.AreEqual(102, message.OptionalInt64); - Assert.AreEqual(103u, message.OptionalUint32); - Assert.AreEqual(104u, message.OptionalUint64); - Assert.AreEqual(105, message.OptionalSint32); - Assert.AreEqual(106, message.OptionalSint64); - Assert.AreEqual(107u, message.OptionalFixed32); - Assert.AreEqual(108u, message.OptionalFixed64); - Assert.AreEqual(109, message.OptionalSfixed32); - Assert.AreEqual(110, message.OptionalSfixed64); - Assert.AreEqual(111, message.OptionalFloat); - Assert.AreEqual(112, message.OptionalDouble); - Assert.AreEqual(true, message.OptionalBool); - Assert.AreEqual("115", message.OptionalString); - Assert.AreEqual(ToBytes("116"), message.OptionalBytes); - - Assert.AreEqual(117, message.OptionalGroup.A); - Assert.AreEqual(118, message.OptionalNestedMessage.Bb); - Assert.AreEqual(119, message.OptionalForeignMessage.C); - Assert.AreEqual(120, message.OptionalImportMessage.D); - - Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAZ, message.OptionalNestedEnum); - Assert.AreEqual(ForeignEnum.FOREIGN_BAZ, message.OptionalForeignEnum); - Assert.AreEqual(ImportEnum.IMPORT_BAZ, message.OptionalImportEnum); - - Assert.AreEqual("124", message.OptionalStringPiece); - Assert.AreEqual("125", message.OptionalCord); - - // ----------------------------------------------------------------- - - Assert.AreEqual(2, message.RepeatedInt32Count); - Assert.AreEqual(2, message.RepeatedInt64Count); - Assert.AreEqual(2, message.RepeatedUint32Count); - Assert.AreEqual(2, message.RepeatedUint64Count); - Assert.AreEqual(2, message.RepeatedSint32Count); - Assert.AreEqual(2, message.RepeatedSint64Count); - Assert.AreEqual(2, message.RepeatedFixed32Count); - Assert.AreEqual(2, message.RepeatedFixed64Count); - Assert.AreEqual(2, message.RepeatedSfixed32Count); - Assert.AreEqual(2, message.RepeatedSfixed64Count); - Assert.AreEqual(2, message.RepeatedFloatCount); - Assert.AreEqual(2, message.RepeatedDoubleCount); - Assert.AreEqual(2, message.RepeatedBoolCount); - Assert.AreEqual(2, message.RepeatedStringCount); - Assert.AreEqual(2, message.RepeatedBytesCount); - - Assert.AreEqual(2, message.RepeatedGroupCount); - Assert.AreEqual(2, message.RepeatedNestedMessageCount); - Assert.AreEqual(2, message.RepeatedForeignMessageCount); - Assert.AreEqual(2, message.RepeatedImportMessageCount); - Assert.AreEqual(2, message.RepeatedNestedEnumCount); - Assert.AreEqual(2, message.RepeatedForeignEnumCount); - Assert.AreEqual(2, message.RepeatedImportEnumCount); - - Assert.AreEqual(2, message.RepeatedStringPieceCount); - Assert.AreEqual(2, message.RepeatedCordCount); - - Assert.AreEqual(201, message.GetRepeatedInt32(0)); - Assert.AreEqual(202, message.GetRepeatedInt64(0)); - Assert.AreEqual(203u, message.GetRepeatedUint32(0)); - Assert.AreEqual(204u, message.GetRepeatedUint64(0)); - Assert.AreEqual(205, message.GetRepeatedSint32(0)); - Assert.AreEqual(206, message.GetRepeatedSint64(0)); - Assert.AreEqual(207u, message.GetRepeatedFixed32(0)); - Assert.AreEqual(208u, message.GetRepeatedFixed64(0)); - Assert.AreEqual(209, message.GetRepeatedSfixed32(0)); - Assert.AreEqual(210, message.GetRepeatedSfixed64(0)); - Assert.AreEqual(211, message.GetRepeatedFloat(0)); - Assert.AreEqual(212, message.GetRepeatedDouble(0)); - Assert.AreEqual(true, message.GetRepeatedBool(0)); - Assert.AreEqual("215", message.GetRepeatedString(0)); - Assert.AreEqual(ToBytes("216"), message.GetRepeatedBytes(0)); - - Assert.AreEqual(217, message.GetRepeatedGroup(0).A); - Assert.AreEqual(218, message.GetRepeatedNestedMessage(0).Bb); - Assert.AreEqual(219, message.GetRepeatedForeignMessage(0).C); - Assert.AreEqual(220, message.GetRepeatedImportMessage(0).D); - - Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR, message.GetRepeatedNestedEnum(0)); - Assert.AreEqual(ForeignEnum.FOREIGN_BAR, message.GetRepeatedForeignEnum(0)); - Assert.AreEqual(ImportEnum.IMPORT_BAR, message.GetRepeatedImportEnum(0)); - - Assert.AreEqual("224", message.GetRepeatedStringPiece(0)); - Assert.AreEqual("225", message.GetRepeatedCord(0)); - - Assert.AreEqual(301, message.GetRepeatedInt32(1)); - Assert.AreEqual(302, message.GetRepeatedInt64(1)); - Assert.AreEqual(303u, message.GetRepeatedUint32(1)); - Assert.AreEqual(304u, message.GetRepeatedUint64(1)); - Assert.AreEqual(305, message.GetRepeatedSint32(1)); - Assert.AreEqual(306, message.GetRepeatedSint64(1)); - Assert.AreEqual(307u, message.GetRepeatedFixed32(1)); - Assert.AreEqual(308u, message.GetRepeatedFixed64(1)); - Assert.AreEqual(309, message.GetRepeatedSfixed32(1)); - Assert.AreEqual(310, message.GetRepeatedSfixed64(1)); - Assert.AreEqual(311, message.GetRepeatedFloat(1), 0.0); - Assert.AreEqual(312, message.GetRepeatedDouble(1), 0.0); - Assert.AreEqual(false, message.GetRepeatedBool(1)); - Assert.AreEqual("315", message.GetRepeatedString(1)); - Assert.AreEqual(ToBytes("316"), message.GetRepeatedBytes(1)); - - Assert.AreEqual(317, message.GetRepeatedGroup(1).A); - Assert.AreEqual(318, message.GetRepeatedNestedMessage(1).Bb); - Assert.AreEqual(319, message.GetRepeatedForeignMessage(1).C); - Assert.AreEqual(320, message.GetRepeatedImportMessage(1).D); - - Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAZ, message.GetRepeatedNestedEnum(1)); - Assert.AreEqual(ForeignEnum.FOREIGN_BAZ, message.GetRepeatedForeignEnum(1)); - Assert.AreEqual(ImportEnum.IMPORT_BAZ, message.GetRepeatedImportEnum(1)); - - Assert.AreEqual("324", message.GetRepeatedStringPiece(1)); - Assert.AreEqual("325", message.GetRepeatedCord(1)); - - // ----------------------------------------------------------------- - - Assert.IsTrue(message.HasDefaultInt32); - Assert.IsTrue(message.HasDefaultInt64); - Assert.IsTrue(message.HasDefaultUint32); - Assert.IsTrue(message.HasDefaultUint64); - Assert.IsTrue(message.HasDefaultSint32); - Assert.IsTrue(message.HasDefaultSint64); - Assert.IsTrue(message.HasDefaultFixed32); - Assert.IsTrue(message.HasDefaultFixed64); - Assert.IsTrue(message.HasDefaultSfixed32); - Assert.IsTrue(message.HasDefaultSfixed64); - Assert.IsTrue(message.HasDefaultFloat); - Assert.IsTrue(message.HasDefaultDouble); - Assert.IsTrue(message.HasDefaultBool); - Assert.IsTrue(message.HasDefaultString); - Assert.IsTrue(message.HasDefaultBytes); - - Assert.IsTrue(message.HasDefaultNestedEnum); - Assert.IsTrue(message.HasDefaultForeignEnum); - Assert.IsTrue(message.HasDefaultImportEnum); - - Assert.IsTrue(message.HasDefaultStringPiece); - Assert.IsTrue(message.HasDefaultCord); - - Assert.AreEqual(401, message.DefaultInt32); - Assert.AreEqual(402, message.DefaultInt64); - Assert.AreEqual(403u, message.DefaultUint32); - Assert.AreEqual(404u, message.DefaultUint64); - Assert.AreEqual(405, message.DefaultSint32); - Assert.AreEqual(406, message.DefaultSint64); - Assert.AreEqual(407u, message.DefaultFixed32); - Assert.AreEqual(408u, message.DefaultFixed64); - Assert.AreEqual(409, message.DefaultSfixed32); - Assert.AreEqual(410, message.DefaultSfixed64); - Assert.AreEqual(411, message.DefaultFloat); - Assert.AreEqual(412, message.DefaultDouble); - Assert.AreEqual(false, message.DefaultBool); - Assert.AreEqual("415", message.DefaultString); - Assert.AreEqual(ToBytes("416"), message.DefaultBytes); - - Assert.AreEqual(TestAllTypes.Types.NestedEnum.FOO, message.DefaultNestedEnum); - Assert.AreEqual(ForeignEnum.FOREIGN_FOO, message.DefaultForeignEnum); - Assert.AreEqual(ImportEnum.IMPORT_FOO, message.DefaultImportEnum); - - Assert.AreEqual("424", message.DefaultStringPiece); - Assert.AreEqual("425", message.DefaultCord); - } - - internal static void AssertClear(TestAllTypes message) - { - // HasBlah() should initially be false for all optional fields. - Assert.IsFalse(message.HasOptionalInt32); - Assert.IsFalse(message.HasOptionalInt64); - Assert.IsFalse(message.HasOptionalUint32); - Assert.IsFalse(message.HasOptionalUint64); - Assert.IsFalse(message.HasOptionalSint32); - Assert.IsFalse(message.HasOptionalSint64); - Assert.IsFalse(message.HasOptionalFixed32); - Assert.IsFalse(message.HasOptionalFixed64); - Assert.IsFalse(message.HasOptionalSfixed32); - Assert.IsFalse(message.HasOptionalSfixed64); - Assert.IsFalse(message.HasOptionalFloat); - Assert.IsFalse(message.HasOptionalDouble); - Assert.IsFalse(message.HasOptionalBool); - Assert.IsFalse(message.HasOptionalString); - Assert.IsFalse(message.HasOptionalBytes); - - Assert.IsFalse(message.HasOptionalGroup); - Assert.IsFalse(message.HasOptionalNestedMessage); - Assert.IsFalse(message.HasOptionalForeignMessage); - Assert.IsFalse(message.HasOptionalImportMessage); - - Assert.IsFalse(message.HasOptionalNestedEnum); - Assert.IsFalse(message.HasOptionalForeignEnum); - Assert.IsFalse(message.HasOptionalImportEnum); - - Assert.IsFalse(message.HasOptionalStringPiece); - Assert.IsFalse(message.HasOptionalCord); - - // Optional fields without defaults are set to zero or something like it. - Assert.AreEqual(0, message.OptionalInt32); - Assert.AreEqual(0, message.OptionalInt64); - Assert.AreEqual(0u, message.OptionalUint32); - Assert.AreEqual(0u, message.OptionalUint64); - Assert.AreEqual(0, message.OptionalSint32); - Assert.AreEqual(0, message.OptionalSint64); - Assert.AreEqual(0u, message.OptionalFixed32); - Assert.AreEqual(0u, message.OptionalFixed64); - Assert.AreEqual(0, message.OptionalSfixed32); - Assert.AreEqual(0, message.OptionalSfixed64); - Assert.AreEqual(0, message.OptionalFloat); - Assert.AreEqual(0, message.OptionalDouble); - Assert.AreEqual(false, message.OptionalBool); - Assert.AreEqual("", message.OptionalString); - Assert.AreEqual(ByteString.Empty, message.OptionalBytes); - - // Embedded messages should also be clear. - Assert.IsFalse(message.OptionalGroup.HasA); - Assert.IsFalse(message.OptionalNestedMessage.HasBb); - Assert.IsFalse(message.OptionalForeignMessage.HasC); - Assert.IsFalse(message.OptionalImportMessage.HasD); - - Assert.AreEqual(0, message.OptionalGroup.A); - Assert.AreEqual(0, message.OptionalNestedMessage.Bb); - Assert.AreEqual(0, message.OptionalForeignMessage.C); - Assert.AreEqual(0, message.OptionalImportMessage.D); - - // Enums without defaults are set to the first value in the enum. - Assert.AreEqual(TestAllTypes.Types.NestedEnum.FOO, message.OptionalNestedEnum); - Assert.AreEqual(ForeignEnum.FOREIGN_FOO, message.OptionalForeignEnum); - Assert.AreEqual(ImportEnum.IMPORT_FOO, message.OptionalImportEnum); - - Assert.AreEqual("", message.OptionalStringPiece); - Assert.AreEqual("", message.OptionalCord); - - // Repeated fields are empty. - Assert.AreEqual(0, message.RepeatedInt32Count); - Assert.AreEqual(0, message.RepeatedInt64Count); - Assert.AreEqual(0, message.RepeatedUint32Count); - Assert.AreEqual(0, message.RepeatedUint64Count); - Assert.AreEqual(0, message.RepeatedSint32Count); - Assert.AreEqual(0, message.RepeatedSint64Count); - Assert.AreEqual(0, message.RepeatedFixed32Count); - Assert.AreEqual(0, message.RepeatedFixed64Count); - Assert.AreEqual(0, message.RepeatedSfixed32Count); - Assert.AreEqual(0, message.RepeatedSfixed64Count); - Assert.AreEqual(0, message.RepeatedFloatCount); - Assert.AreEqual(0, message.RepeatedDoubleCount); - Assert.AreEqual(0, message.RepeatedBoolCount); - Assert.AreEqual(0, message.RepeatedStringCount); - Assert.AreEqual(0, message.RepeatedBytesCount); - - Assert.AreEqual(0, message.RepeatedGroupCount); - Assert.AreEqual(0, message.RepeatedNestedMessageCount); - Assert.AreEqual(0, message.RepeatedForeignMessageCount); - Assert.AreEqual(0, message.RepeatedImportMessageCount); - Assert.AreEqual(0, message.RepeatedNestedEnumCount); - Assert.AreEqual(0, message.RepeatedForeignEnumCount); - Assert.AreEqual(0, message.RepeatedImportEnumCount); - - Assert.AreEqual(0, message.RepeatedStringPieceCount); - Assert.AreEqual(0, message.RepeatedCordCount); - - // HasBlah() should also be false for all default fields. - Assert.IsFalse(message.HasDefaultInt32); - Assert.IsFalse(message.HasDefaultInt64); - Assert.IsFalse(message.HasDefaultUint32); - Assert.IsFalse(message.HasDefaultUint64); - Assert.IsFalse(message.HasDefaultSint32); - Assert.IsFalse(message.HasDefaultSint64); - Assert.IsFalse(message.HasDefaultFixed32); - Assert.IsFalse(message.HasDefaultFixed64); - Assert.IsFalse(message.HasDefaultSfixed32); - Assert.IsFalse(message.HasDefaultSfixed64); - Assert.IsFalse(message.HasDefaultFloat); - Assert.IsFalse(message.HasDefaultDouble); - Assert.IsFalse(message.HasDefaultBool); - Assert.IsFalse(message.HasDefaultString); - Assert.IsFalse(message.HasDefaultBytes); - - Assert.IsFalse(message.HasDefaultNestedEnum); - Assert.IsFalse(message.HasDefaultForeignEnum); - Assert.IsFalse(message.HasDefaultImportEnum); - - Assert.IsFalse(message.HasDefaultStringPiece); - Assert.IsFalse(message.HasDefaultCord); - - // Fields with defaults have their default values (duh). - Assert.AreEqual(41, message.DefaultInt32); - Assert.AreEqual(42, message.DefaultInt64); - Assert.AreEqual(43u, message.DefaultUint32); - Assert.AreEqual(44u, message.DefaultUint64); - Assert.AreEqual(-45, message.DefaultSint32); - Assert.AreEqual(46, message.DefaultSint64); - Assert.AreEqual(47u, message.DefaultFixed32); - Assert.AreEqual(48u, message.DefaultFixed64); - Assert.AreEqual(49, message.DefaultSfixed32); - Assert.AreEqual(-50, message.DefaultSfixed64); - Assert.AreEqual(51.5, message.DefaultFloat, 0.0); - Assert.AreEqual(52e3, message.DefaultDouble, 0.0); - Assert.AreEqual(true, message.DefaultBool); - Assert.AreEqual("hello", message.DefaultString); - Assert.AreEqual(ToBytes("world"), message.DefaultBytes); - - Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR, message.DefaultNestedEnum); - Assert.AreEqual(ForeignEnum.FOREIGN_BAR, message.DefaultForeignEnum); - Assert.AreEqual(ImportEnum.IMPORT_BAR, message.DefaultImportEnum); - - Assert.AreEqual("abc", message.DefaultStringPiece); - Assert.AreEqual("123", message.DefaultCord); - } - - /// - /// Get a TestAllExtensions with all fields set as they would be by - /// SetAllExtensions(TestAllExtensions.Builder). - /// - internal static TestAllExtensions GetAllExtensionsSet() - { - TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder(); - SetAllExtensions(builder); - return builder.Build(); - } - - public static TestPackedTypes GetPackedSet() - { - TestPackedTypes.Builder builder = TestPackedTypes.CreateBuilder(); - SetPackedFields(builder); - return builder.Build(); - } - - public static TestPackedExtensions GetPackedExtensionsSet() - { - TestPackedExtensions.Builder builder = TestPackedExtensions.CreateBuilder(); - SetPackedExtensions(builder); - return builder.Build(); - } - - /// - /// Sets every field of the specified builder to the values expected by - /// AssertAllExtensionsSet. - /// - internal static void SetAllExtensions(TestAllExtensions.Builder message) - { - message.SetExtension(UnitTestProtoFile.OptionalInt32Extension, 101); - message.SetExtension(UnitTestProtoFile.OptionalInt64Extension, 102L); - message.SetExtension(UnitTestProtoFile.OptionalUint32Extension, 103U); - message.SetExtension(UnitTestProtoFile.OptionalUint64Extension, 104UL); - message.SetExtension(UnitTestProtoFile.OptionalSint32Extension, 105); - message.SetExtension(UnitTestProtoFile.OptionalSint64Extension, 106L); - message.SetExtension(UnitTestProtoFile.OptionalFixed32Extension, 107U); - message.SetExtension(UnitTestProtoFile.OptionalFixed64Extension, 108UL); - message.SetExtension(UnitTestProtoFile.OptionalSfixed32Extension, 109); - message.SetExtension(UnitTestProtoFile.OptionalSfixed64Extension, 110L); - message.SetExtension(UnitTestProtoFile.OptionalFloatExtension, 111F); - message.SetExtension(UnitTestProtoFile.OptionalDoubleExtension, 112D); - message.SetExtension(UnitTestProtoFile.OptionalBoolExtension, true); - message.SetExtension(UnitTestProtoFile.OptionalStringExtension, "115"); - message.SetExtension(UnitTestProtoFile.OptionalBytesExtension, ToBytes("116")); - - message.SetExtension(UnitTestProtoFile.OptionalGroupExtension, - OptionalGroup_extension.CreateBuilder().SetA(117).Build()); - message.SetExtension(UnitTestProtoFile.OptionalNestedMessageExtension, - TestAllTypes.Types.NestedMessage.CreateBuilder().SetBb(118).Build()); - message.SetExtension(UnitTestProtoFile.OptionalForeignMessageExtension, - ForeignMessage.CreateBuilder().SetC(119).Build()); - message.SetExtension(UnitTestProtoFile.OptionalImportMessageExtension, - ImportMessage.CreateBuilder().SetD(120).Build()); - - message.SetExtension(UnitTestProtoFile.OptionalNestedEnumExtension, TestAllTypes.Types.NestedEnum.BAZ); - message.SetExtension(UnitTestProtoFile.OptionalForeignEnumExtension, ForeignEnum.FOREIGN_BAZ); - message.SetExtension(UnitTestProtoFile.OptionalImportEnumExtension, ImportEnum.IMPORT_BAZ); - - message.SetExtension(UnitTestProtoFile.OptionalStringPieceExtension, "124"); - message.SetExtension(UnitTestProtoFile.OptionalCordExtension, "125"); - - // ----------------------------------------------------------------- - - message.AddExtension(UnitTestProtoFile.RepeatedInt32Extension, 201); - message.AddExtension(UnitTestProtoFile.RepeatedInt64Extension, 202L); - message.AddExtension(UnitTestProtoFile.RepeatedUint32Extension, 203U); - message.AddExtension(UnitTestProtoFile.RepeatedUint64Extension, 204UL); - message.AddExtension(UnitTestProtoFile.RepeatedSint32Extension, 205); - message.AddExtension(UnitTestProtoFile.RepeatedSint64Extension, 206L); - message.AddExtension(UnitTestProtoFile.RepeatedFixed32Extension, 207U); - message.AddExtension(UnitTestProtoFile.RepeatedFixed64Extension, 208UL); - message.AddExtension(UnitTestProtoFile.RepeatedSfixed32Extension, 209); - message.AddExtension(UnitTestProtoFile.RepeatedSfixed64Extension, 210L); - message.AddExtension(UnitTestProtoFile.RepeatedFloatExtension, 211F); - message.AddExtension(UnitTestProtoFile.RepeatedDoubleExtension, 212D); - message.AddExtension(UnitTestProtoFile.RepeatedBoolExtension, true); - message.AddExtension(UnitTestProtoFile.RepeatedStringExtension, "215"); - message.AddExtension(UnitTestProtoFile.RepeatedBytesExtension, ToBytes("216")); - - message.AddExtension(UnitTestProtoFile.RepeatedGroupExtension, - RepeatedGroup_extension.CreateBuilder().SetA(217).Build()); - message.AddExtension(UnitTestProtoFile.RepeatedNestedMessageExtension, - TestAllTypes.Types.NestedMessage.CreateBuilder().SetBb(218).Build()); - message.AddExtension(UnitTestProtoFile.RepeatedForeignMessageExtension, - ForeignMessage.CreateBuilder().SetC(219).Build()); - message.AddExtension(UnitTestProtoFile.RepeatedImportMessageExtension, - ImportMessage.CreateBuilder().SetD(220).Build()); - - message.AddExtension(UnitTestProtoFile.RepeatedNestedEnumExtension, TestAllTypes.Types.NestedEnum.BAR); - message.AddExtension(UnitTestProtoFile.RepeatedForeignEnumExtension, ForeignEnum.FOREIGN_BAR); - message.AddExtension(UnitTestProtoFile.RepeatedImportEnumExtension, ImportEnum.IMPORT_BAR); - - message.AddExtension(UnitTestProtoFile.RepeatedStringPieceExtension, "224"); - message.AddExtension(UnitTestProtoFile.RepeatedCordExtension, "225"); - - // Add a second one of each field. - message.AddExtension(UnitTestProtoFile.RepeatedInt32Extension, 301); - message.AddExtension(UnitTestProtoFile.RepeatedInt64Extension, 302L); - message.AddExtension(UnitTestProtoFile.RepeatedUint32Extension, 303U); - message.AddExtension(UnitTestProtoFile.RepeatedUint64Extension, 304UL); - message.AddExtension(UnitTestProtoFile.RepeatedSint32Extension, 305); - message.AddExtension(UnitTestProtoFile.RepeatedSint64Extension, 306L); - message.AddExtension(UnitTestProtoFile.RepeatedFixed32Extension, 307U); - message.AddExtension(UnitTestProtoFile.RepeatedFixed64Extension, 308UL); - message.AddExtension(UnitTestProtoFile.RepeatedSfixed32Extension, 309); - message.AddExtension(UnitTestProtoFile.RepeatedSfixed64Extension, 310L); - message.AddExtension(UnitTestProtoFile.RepeatedFloatExtension, 311F); - message.AddExtension(UnitTestProtoFile.RepeatedDoubleExtension, 312D); - message.AddExtension(UnitTestProtoFile.RepeatedBoolExtension, false); - message.AddExtension(UnitTestProtoFile.RepeatedStringExtension, "315"); - message.AddExtension(UnitTestProtoFile.RepeatedBytesExtension, ToBytes("316")); - - message.AddExtension(UnitTestProtoFile.RepeatedGroupExtension, - RepeatedGroup_extension.CreateBuilder().SetA(317).Build()); - message.AddExtension(UnitTestProtoFile.RepeatedNestedMessageExtension, - TestAllTypes.Types.NestedMessage.CreateBuilder().SetBb(318).Build()); - message.AddExtension(UnitTestProtoFile.RepeatedForeignMessageExtension, - ForeignMessage.CreateBuilder().SetC(319).Build()); - message.AddExtension(UnitTestProtoFile.RepeatedImportMessageExtension, - ImportMessage.CreateBuilder().SetD(320).Build()); - - message.AddExtension(UnitTestProtoFile.RepeatedNestedEnumExtension, TestAllTypes.Types.NestedEnum.BAZ); - message.AddExtension(UnitTestProtoFile.RepeatedForeignEnumExtension, ForeignEnum.FOREIGN_BAZ); - message.AddExtension(UnitTestProtoFile.RepeatedImportEnumExtension, ImportEnum.IMPORT_BAZ); - - message.AddExtension(UnitTestProtoFile.RepeatedStringPieceExtension, "324"); - message.AddExtension(UnitTestProtoFile.RepeatedCordExtension, "325"); - - // ----------------------------------------------------------------- - - message.SetExtension(UnitTestProtoFile.DefaultInt32Extension, 401); - message.SetExtension(UnitTestProtoFile.DefaultInt64Extension, 402L); - message.SetExtension(UnitTestProtoFile.DefaultUint32Extension, 403U); - message.SetExtension(UnitTestProtoFile.DefaultUint64Extension, 404UL); - message.SetExtension(UnitTestProtoFile.DefaultSint32Extension, 405); - message.SetExtension(UnitTestProtoFile.DefaultSint64Extension, 406L); - message.SetExtension(UnitTestProtoFile.DefaultFixed32Extension, 407U); - message.SetExtension(UnitTestProtoFile.DefaultFixed64Extension, 408UL); - message.SetExtension(UnitTestProtoFile.DefaultSfixed32Extension, 409); - message.SetExtension(UnitTestProtoFile.DefaultSfixed64Extension, 410L); - message.SetExtension(UnitTestProtoFile.DefaultFloatExtension, 411F); - message.SetExtension(UnitTestProtoFile.DefaultDoubleExtension, 412D); - message.SetExtension(UnitTestProtoFile.DefaultBoolExtension, false); - message.SetExtension(UnitTestProtoFile.DefaultStringExtension, "415"); - message.SetExtension(UnitTestProtoFile.DefaultBytesExtension, ToBytes("416")); - - message.SetExtension(UnitTestProtoFile.DefaultNestedEnumExtension, TestAllTypes.Types.NestedEnum.FOO); - message.SetExtension(UnitTestProtoFile.DefaultForeignEnumExtension, ForeignEnum.FOREIGN_FOO); - message.SetExtension(UnitTestProtoFile.DefaultImportEnumExtension, ImportEnum.IMPORT_FOO); - - message.SetExtension(UnitTestProtoFile.DefaultStringPieceExtension, "424"); - message.SetExtension(UnitTestProtoFile.DefaultCordExtension, "425"); - } - - internal static void ModifyRepeatedFields(TestAllTypes.Builder message) - { - message.SetRepeatedInt32(1, 501); - message.SetRepeatedInt64(1, 502); - message.SetRepeatedUint32(1, 503); - message.SetRepeatedUint64(1, 504); - message.SetRepeatedSint32(1, 505); - message.SetRepeatedSint64(1, 506); - message.SetRepeatedFixed32(1, 507); - message.SetRepeatedFixed64(1, 508); - message.SetRepeatedSfixed32(1, 509); - message.SetRepeatedSfixed64(1, 510); - message.SetRepeatedFloat(1, 511); - message.SetRepeatedDouble(1, 512); - message.SetRepeatedBool(1, true); - message.SetRepeatedString(1, "515"); - message.SetRepeatedBytes(1, ToBytes("516")); - - message.SetRepeatedGroup(1, TestAllTypes.Types.RepeatedGroup.CreateBuilder().SetA(517).Build()); - message.SetRepeatedNestedMessage(1, TestAllTypes.Types.NestedMessage.CreateBuilder().SetBb(518).Build()); - message.SetRepeatedForeignMessage(1, ForeignMessage.CreateBuilder().SetC(519).Build()); - message.SetRepeatedImportMessage(1, ImportMessage.CreateBuilder().SetD(520).Build()); - - message.SetRepeatedNestedEnum(1, TestAllTypes.Types.NestedEnum.FOO); - message.SetRepeatedForeignEnum(1, ForeignEnum.FOREIGN_FOO); - message.SetRepeatedImportEnum(1, ImportEnum.IMPORT_FOO); - - message.SetRepeatedStringPiece(1, "524"); - message.SetRepeatedCord(1, "525"); - } - - internal static void AssertRepeatedFieldsModified(TestAllTypes message) - { - // ModifyRepeatedFields only sets the second repeated element of each - // field. In addition to verifying this, we also verify that the first - // element and size were *not* modified. - Assert.AreEqual(2, message.RepeatedInt32Count); - Assert.AreEqual(2, message.RepeatedInt64Count); - Assert.AreEqual(2, message.RepeatedUint32Count); - Assert.AreEqual(2, message.RepeatedUint64Count); - Assert.AreEqual(2, message.RepeatedSint32Count); - Assert.AreEqual(2, message.RepeatedSint64Count); - Assert.AreEqual(2, message.RepeatedFixed32Count); - Assert.AreEqual(2, message.RepeatedFixed64Count); - Assert.AreEqual(2, message.RepeatedSfixed32Count); - Assert.AreEqual(2, message.RepeatedSfixed64Count); - Assert.AreEqual(2, message.RepeatedFloatCount); - Assert.AreEqual(2, message.RepeatedDoubleCount); - Assert.AreEqual(2, message.RepeatedBoolCount); - Assert.AreEqual(2, message.RepeatedStringCount); - Assert.AreEqual(2, message.RepeatedBytesCount); - - Assert.AreEqual(2, message.RepeatedGroupCount); - Assert.AreEqual(2, message.RepeatedNestedMessageCount); - Assert.AreEqual(2, message.RepeatedForeignMessageCount); - Assert.AreEqual(2, message.RepeatedImportMessageCount); - Assert.AreEqual(2, message.RepeatedNestedEnumCount); - Assert.AreEqual(2, message.RepeatedForeignEnumCount); - Assert.AreEqual(2, message.RepeatedImportEnumCount); - - Assert.AreEqual(2, message.RepeatedStringPieceCount); - Assert.AreEqual(2, message.RepeatedCordCount); - - Assert.AreEqual(201, message.GetRepeatedInt32(0)); - Assert.AreEqual(202L, message.GetRepeatedInt64(0)); - Assert.AreEqual(203U, message.GetRepeatedUint32(0)); - Assert.AreEqual(204UL, message.GetRepeatedUint64(0)); - Assert.AreEqual(205, message.GetRepeatedSint32(0)); - Assert.AreEqual(206L, message.GetRepeatedSint64(0)); - Assert.AreEqual(207U, message.GetRepeatedFixed32(0)); - Assert.AreEqual(208UL, message.GetRepeatedFixed64(0)); - Assert.AreEqual(209, message.GetRepeatedSfixed32(0)); - Assert.AreEqual(210L, message.GetRepeatedSfixed64(0)); - Assert.AreEqual(211F, message.GetRepeatedFloat(0)); - Assert.AreEqual(212D, message.GetRepeatedDouble(0)); - Assert.AreEqual(true, message.GetRepeatedBool(0)); - Assert.AreEqual("215", message.GetRepeatedString(0)); - Assert.AreEqual(ToBytes("216"), message.GetRepeatedBytes(0)); - - Assert.AreEqual(217, message.GetRepeatedGroup(0).A); - Assert.AreEqual(218, message.GetRepeatedNestedMessage(0).Bb); - Assert.AreEqual(219, message.GetRepeatedForeignMessage(0).C); - Assert.AreEqual(220, message.GetRepeatedImportMessage(0).D); - - Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR, message.GetRepeatedNestedEnum(0)); - Assert.AreEqual(ForeignEnum.FOREIGN_BAR, message.GetRepeatedForeignEnum(0)); - Assert.AreEqual(ImportEnum.IMPORT_BAR, message.GetRepeatedImportEnum(0)); - - Assert.AreEqual("224", message.GetRepeatedStringPiece(0)); - Assert.AreEqual("225", message.GetRepeatedCord(0)); - - // Actually verify the second (modified) elements now. - Assert.AreEqual(501, message.GetRepeatedInt32(1)); - Assert.AreEqual(502L, message.GetRepeatedInt64(1)); - Assert.AreEqual(503U, message.GetRepeatedUint32(1)); - Assert.AreEqual(504UL, message.GetRepeatedUint64(1)); - Assert.AreEqual(505, message.GetRepeatedSint32(1)); - Assert.AreEqual(506L, message.GetRepeatedSint64(1)); - Assert.AreEqual(507U, message.GetRepeatedFixed32(1)); - Assert.AreEqual(508UL, message.GetRepeatedFixed64(1)); - Assert.AreEqual(509, message.GetRepeatedSfixed32(1)); - Assert.AreEqual(510L, message.GetRepeatedSfixed64(1)); - Assert.AreEqual(511F, message.GetRepeatedFloat(1)); - Assert.AreEqual(512D, message.GetRepeatedDouble(1)); - Assert.AreEqual(true, message.GetRepeatedBool(1)); - Assert.AreEqual("515", message.GetRepeatedString(1)); - Assert.AreEqual(ToBytes("516"), message.GetRepeatedBytes(1)); - - Assert.AreEqual(517, message.GetRepeatedGroup(1).A); - Assert.AreEqual(518, message.GetRepeatedNestedMessage(1).Bb); - Assert.AreEqual(519, message.GetRepeatedForeignMessage(1).C); - Assert.AreEqual(520, message.GetRepeatedImportMessage(1).D); - - Assert.AreEqual(TestAllTypes.Types.NestedEnum.FOO, message.GetRepeatedNestedEnum(1)); - Assert.AreEqual(ForeignEnum.FOREIGN_FOO, message.GetRepeatedForeignEnum(1)); - Assert.AreEqual(ImportEnum.IMPORT_FOO, message.GetRepeatedImportEnum(1)); - - Assert.AreEqual("524", message.GetRepeatedStringPiece(1)); - Assert.AreEqual("525", message.GetRepeatedCord(1)); - } - - /// - /// Helper to assert that sequences are equal. - /// - internal static void AssertEqual(IEnumerable first, IEnumerable second) - { - using (IEnumerator firstEnumerator = first.GetEnumerator()) - { - foreach (T secondElement in second) - { - Assert.IsTrue(firstEnumerator.MoveNext(), "First enumerator ran out of elements too early."); - Assert.AreEqual(firstEnumerator.Current, secondElement); - } - Assert.IsFalse(firstEnumerator.MoveNext(), "Second enumerator ran out of elements too early."); - } - } - - internal static void AssertEqualBytes(byte[] expected, byte[] actual) - { - Assert.AreEqual(ByteString.CopyFrom(expected), ByteString.CopyFrom(actual)); - } - - internal static void AssertAllExtensionsSet(TestAllExtensions message) - { - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalInt32Extension)); - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalInt64Extension)); - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalUint32Extension)); - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalUint64Extension)); - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalSint32Extension)); - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalSint64Extension)); - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalFixed32Extension)); - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalFixed64Extension)); - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalSfixed32Extension)); - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalSfixed64Extension)); - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalFloatExtension)); - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalDoubleExtension)); - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalBoolExtension)); - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalStringExtension)); - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalBytesExtension)); - - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalGroupExtension)); - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalNestedMessageExtension)); - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalForeignMessageExtension)); - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalImportMessageExtension)); - - Assert.IsTrue(message.GetExtension(UnitTestProtoFile.OptionalGroupExtension).HasA); - Assert.IsTrue(message.GetExtension(UnitTestProtoFile.OptionalNestedMessageExtension).HasBb); - Assert.IsTrue(message.GetExtension(UnitTestProtoFile.OptionalForeignMessageExtension).HasC); - Assert.IsTrue(message.GetExtension(UnitTestProtoFile.OptionalImportMessageExtension).HasD); - - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalNestedEnumExtension)); - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalForeignEnumExtension)); - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalImportEnumExtension)); - - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalStringPieceExtension)); - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.OptionalCordExtension)); - - Assert.AreEqual(101, message.GetExtension(UnitTestProtoFile.OptionalInt32Extension)); - Assert.AreEqual(102L, message.GetExtension(UnitTestProtoFile.OptionalInt64Extension)); - Assert.AreEqual(103U, message.GetExtension(UnitTestProtoFile.OptionalUint32Extension)); - Assert.AreEqual(104UL, message.GetExtension(UnitTestProtoFile.OptionalUint64Extension)); - Assert.AreEqual(105, message.GetExtension(UnitTestProtoFile.OptionalSint32Extension)); - Assert.AreEqual(106L, message.GetExtension(UnitTestProtoFile.OptionalSint64Extension)); - Assert.AreEqual(107U, message.GetExtension(UnitTestProtoFile.OptionalFixed32Extension)); - Assert.AreEqual(108UL, message.GetExtension(UnitTestProtoFile.OptionalFixed64Extension)); - Assert.AreEqual(109, message.GetExtension(UnitTestProtoFile.OptionalSfixed32Extension)); - Assert.AreEqual(110L, message.GetExtension(UnitTestProtoFile.OptionalSfixed64Extension)); - Assert.AreEqual(111F, message.GetExtension(UnitTestProtoFile.OptionalFloatExtension)); - Assert.AreEqual(112D, message.GetExtension(UnitTestProtoFile.OptionalDoubleExtension)); - Assert.AreEqual(true, message.GetExtension(UnitTestProtoFile.OptionalBoolExtension)); - Assert.AreEqual("115", message.GetExtension(UnitTestProtoFile.OptionalStringExtension)); - Assert.AreEqual(ToBytes("116"), message.GetExtension(UnitTestProtoFile.OptionalBytesExtension)); - - Assert.AreEqual(117, message.GetExtension(UnitTestProtoFile.OptionalGroupExtension).A); - Assert.AreEqual(118, message.GetExtension(UnitTestProtoFile.OptionalNestedMessageExtension).Bb); - Assert.AreEqual(119, message.GetExtension(UnitTestProtoFile.OptionalForeignMessageExtension).C); - Assert.AreEqual(120, message.GetExtension(UnitTestProtoFile.OptionalImportMessageExtension).D); - - Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAZ, - message.GetExtension(UnitTestProtoFile.OptionalNestedEnumExtension)); - Assert.AreEqual(ForeignEnum.FOREIGN_BAZ, - message.GetExtension(UnitTestProtoFile.OptionalForeignEnumExtension)); - Assert.AreEqual(ImportEnum.IMPORT_BAZ, message.GetExtension(UnitTestProtoFile.OptionalImportEnumExtension)); - - Assert.AreEqual("124", message.GetExtension(UnitTestProtoFile.OptionalStringPieceExtension)); - Assert.AreEqual("125", message.GetExtension(UnitTestProtoFile.OptionalCordExtension)); - - // ----------------------------------------------------------------- - - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedInt32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedInt64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedUint32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedUint64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedSint32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedSint64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedFixed32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedFixed64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedSfixed32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedSfixed64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedFloatExtension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedDoubleExtension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedBoolExtension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedStringExtension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedBytesExtension)); - - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedGroupExtension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedNestedMessageExtension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedForeignMessageExtension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedImportMessageExtension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedNestedEnumExtension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedForeignEnumExtension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedImportEnumExtension)); - - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedStringPieceExtension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedCordExtension)); - - Assert.AreEqual(201, message.GetExtension(UnitTestProtoFile.RepeatedInt32Extension, 0)); - Assert.AreEqual(202L, message.GetExtension(UnitTestProtoFile.RepeatedInt64Extension, 0)); - Assert.AreEqual(203U, message.GetExtension(UnitTestProtoFile.RepeatedUint32Extension, 0)); - Assert.AreEqual(204UL, message.GetExtension(UnitTestProtoFile.RepeatedUint64Extension, 0)); - Assert.AreEqual(205, message.GetExtension(UnitTestProtoFile.RepeatedSint32Extension, 0)); - Assert.AreEqual(206L, message.GetExtension(UnitTestProtoFile.RepeatedSint64Extension, 0)); - Assert.AreEqual(207U, message.GetExtension(UnitTestProtoFile.RepeatedFixed32Extension, 0)); - Assert.AreEqual(208UL, message.GetExtension(UnitTestProtoFile.RepeatedFixed64Extension, 0)); - Assert.AreEqual(209, message.GetExtension(UnitTestProtoFile.RepeatedSfixed32Extension, 0)); - Assert.AreEqual(210L, message.GetExtension(UnitTestProtoFile.RepeatedSfixed64Extension, 0)); - Assert.AreEqual(211F, message.GetExtension(UnitTestProtoFile.RepeatedFloatExtension, 0)); - Assert.AreEqual(212D, message.GetExtension(UnitTestProtoFile.RepeatedDoubleExtension, 0)); - Assert.AreEqual(true, message.GetExtension(UnitTestProtoFile.RepeatedBoolExtension, 0)); - Assert.AreEqual("215", message.GetExtension(UnitTestProtoFile.RepeatedStringExtension, 0)); - Assert.AreEqual(ToBytes("216"), message.GetExtension(UnitTestProtoFile.RepeatedBytesExtension, 0)); - - Assert.AreEqual(217, message.GetExtension(UnitTestProtoFile.RepeatedGroupExtension, 0).A); - Assert.AreEqual(218, message.GetExtension(UnitTestProtoFile.RepeatedNestedMessageExtension, 0).Bb); - Assert.AreEqual(219, message.GetExtension(UnitTestProtoFile.RepeatedForeignMessageExtension, 0).C); - Assert.AreEqual(220, message.GetExtension(UnitTestProtoFile.RepeatedImportMessageExtension, 0).D); - - Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR, - message.GetExtension(UnitTestProtoFile.RepeatedNestedEnumExtension, 0)); - Assert.AreEqual(ForeignEnum.FOREIGN_BAR, - message.GetExtension(UnitTestProtoFile.RepeatedForeignEnumExtension, 0)); - Assert.AreEqual(ImportEnum.IMPORT_BAR, - message.GetExtension(UnitTestProtoFile.RepeatedImportEnumExtension, 0)); - - Assert.AreEqual("224", message.GetExtension(UnitTestProtoFile.RepeatedStringPieceExtension, 0)); - Assert.AreEqual("225", message.GetExtension(UnitTestProtoFile.RepeatedCordExtension, 0)); - - Assert.AreEqual(301, message.GetExtension(UnitTestProtoFile.RepeatedInt32Extension, 1)); - Assert.AreEqual(302L, message.GetExtension(UnitTestProtoFile.RepeatedInt64Extension, 1)); - Assert.AreEqual(303U, message.GetExtension(UnitTestProtoFile.RepeatedUint32Extension, 1)); - Assert.AreEqual(304UL, message.GetExtension(UnitTestProtoFile.RepeatedUint64Extension, 1)); - Assert.AreEqual(305, message.GetExtension(UnitTestProtoFile.RepeatedSint32Extension, 1)); - Assert.AreEqual(306L, message.GetExtension(UnitTestProtoFile.RepeatedSint64Extension, 1)); - Assert.AreEqual(307U, message.GetExtension(UnitTestProtoFile.RepeatedFixed32Extension, 1)); - Assert.AreEqual(308UL, message.GetExtension(UnitTestProtoFile.RepeatedFixed64Extension, 1)); - Assert.AreEqual(309, message.GetExtension(UnitTestProtoFile.RepeatedSfixed32Extension, 1)); - Assert.AreEqual(310L, message.GetExtension(UnitTestProtoFile.RepeatedSfixed64Extension, 1)); - Assert.AreEqual(311F, message.GetExtension(UnitTestProtoFile.RepeatedFloatExtension, 1)); - Assert.AreEqual(312D, message.GetExtension(UnitTestProtoFile.RepeatedDoubleExtension, 1)); - Assert.AreEqual(false, message.GetExtension(UnitTestProtoFile.RepeatedBoolExtension, 1)); - Assert.AreEqual("315", message.GetExtension(UnitTestProtoFile.RepeatedStringExtension, 1)); - Assert.AreEqual(ToBytes("316"), message.GetExtension(UnitTestProtoFile.RepeatedBytesExtension, 1)); - - Assert.AreEqual(317, message.GetExtension(UnitTestProtoFile.RepeatedGroupExtension, 1).A); - Assert.AreEqual(318, message.GetExtension(UnitTestProtoFile.RepeatedNestedMessageExtension, 1).Bb); - Assert.AreEqual(319, message.GetExtension(UnitTestProtoFile.RepeatedForeignMessageExtension, 1).C); - Assert.AreEqual(320, message.GetExtension(UnitTestProtoFile.RepeatedImportMessageExtension, 1).D); - - Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAZ, - message.GetExtension(UnitTestProtoFile.RepeatedNestedEnumExtension, 1)); - Assert.AreEqual(ForeignEnum.FOREIGN_BAZ, - message.GetExtension(UnitTestProtoFile.RepeatedForeignEnumExtension, 1)); - Assert.AreEqual(ImportEnum.IMPORT_BAZ, - message.GetExtension(UnitTestProtoFile.RepeatedImportEnumExtension, 1)); - - Assert.AreEqual("324", message.GetExtension(UnitTestProtoFile.RepeatedStringPieceExtension, 1)); - Assert.AreEqual("325", message.GetExtension(UnitTestProtoFile.RepeatedCordExtension, 1)); - - // ----------------------------------------------------------------- - - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultInt32Extension)); - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultInt64Extension)); - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultUint32Extension)); - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultUint64Extension)); - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultSint32Extension)); - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultSint64Extension)); - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultFixed32Extension)); - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultFixed64Extension)); - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultSfixed32Extension)); - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultSfixed64Extension)); - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultFloatExtension)); - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultDoubleExtension)); - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultBoolExtension)); - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultStringExtension)); - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultBytesExtension)); - - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultNestedEnumExtension)); - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultForeignEnumExtension)); - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultImportEnumExtension)); - - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultStringPieceExtension)); - Assert.IsTrue(message.HasExtension(UnitTestProtoFile.DefaultCordExtension)); - - Assert.AreEqual(401, message.GetExtension(UnitTestProtoFile.DefaultInt32Extension)); - Assert.AreEqual(402L, message.GetExtension(UnitTestProtoFile.DefaultInt64Extension)); - Assert.AreEqual(403U, message.GetExtension(UnitTestProtoFile.DefaultUint32Extension)); - Assert.AreEqual(404UL, message.GetExtension(UnitTestProtoFile.DefaultUint64Extension)); - Assert.AreEqual(405, message.GetExtension(UnitTestProtoFile.DefaultSint32Extension)); - Assert.AreEqual(406L, message.GetExtension(UnitTestProtoFile.DefaultSint64Extension)); - Assert.AreEqual(407U, message.GetExtension(UnitTestProtoFile.DefaultFixed32Extension)); - Assert.AreEqual(408UL, message.GetExtension(UnitTestProtoFile.DefaultFixed64Extension)); - Assert.AreEqual(409, message.GetExtension(UnitTestProtoFile.DefaultSfixed32Extension)); - Assert.AreEqual(410L, message.GetExtension(UnitTestProtoFile.DefaultSfixed64Extension)); - Assert.AreEqual(411F, message.GetExtension(UnitTestProtoFile.DefaultFloatExtension)); - Assert.AreEqual(412D, message.GetExtension(UnitTestProtoFile.DefaultDoubleExtension)); - Assert.AreEqual(false, message.GetExtension(UnitTestProtoFile.DefaultBoolExtension)); - Assert.AreEqual("415", message.GetExtension(UnitTestProtoFile.DefaultStringExtension)); - Assert.AreEqual(ToBytes("416"), message.GetExtension(UnitTestProtoFile.DefaultBytesExtension)); - - Assert.AreEqual(TestAllTypes.Types.NestedEnum.FOO, - message.GetExtension(UnitTestProtoFile.DefaultNestedEnumExtension)); - Assert.AreEqual(ForeignEnum.FOREIGN_FOO, message.GetExtension(UnitTestProtoFile.DefaultForeignEnumExtension)); - Assert.AreEqual(ImportEnum.IMPORT_FOO, message.GetExtension(UnitTestProtoFile.DefaultImportEnumExtension)); - - Assert.AreEqual("424", message.GetExtension(UnitTestProtoFile.DefaultStringPieceExtension)); - Assert.AreEqual("425", message.GetExtension(UnitTestProtoFile.DefaultCordExtension)); - } - - /// - /// Modifies the repeated extensions of the given message to contain the values - /// expected by AssertRepeatedExtensionsModified. - /// - internal static void ModifyRepeatedExtensions(TestAllExtensions.Builder message) - { - message.SetExtension(UnitTestProtoFile.RepeatedInt32Extension, 1, 501); - message.SetExtension(UnitTestProtoFile.RepeatedInt64Extension, 1, 502L); - message.SetExtension(UnitTestProtoFile.RepeatedUint32Extension, 1, 503U); - message.SetExtension(UnitTestProtoFile.RepeatedUint64Extension, 1, 504UL); - message.SetExtension(UnitTestProtoFile.RepeatedSint32Extension, 1, 505); - message.SetExtension(UnitTestProtoFile.RepeatedSint64Extension, 1, 506L); - message.SetExtension(UnitTestProtoFile.RepeatedFixed32Extension, 1, 507U); - message.SetExtension(UnitTestProtoFile.RepeatedFixed64Extension, 1, 508UL); - message.SetExtension(UnitTestProtoFile.RepeatedSfixed32Extension, 1, 509); - message.SetExtension(UnitTestProtoFile.RepeatedSfixed64Extension, 1, 510L); - message.SetExtension(UnitTestProtoFile.RepeatedFloatExtension, 1, 511F); - message.SetExtension(UnitTestProtoFile.RepeatedDoubleExtension, 1, 512D); - message.SetExtension(UnitTestProtoFile.RepeatedBoolExtension, 1, true); - message.SetExtension(UnitTestProtoFile.RepeatedStringExtension, 1, "515"); - message.SetExtension(UnitTestProtoFile.RepeatedBytesExtension, 1, ToBytes("516")); - - message.SetExtension(UnitTestProtoFile.RepeatedGroupExtension, 1, - RepeatedGroup_extension.CreateBuilder().SetA(517).Build()); - message.SetExtension(UnitTestProtoFile.RepeatedNestedMessageExtension, 1, - TestAllTypes.Types.NestedMessage.CreateBuilder().SetBb(518).Build()); - message.SetExtension(UnitTestProtoFile.RepeatedForeignMessageExtension, 1, - ForeignMessage.CreateBuilder().SetC(519).Build()); - message.SetExtension(UnitTestProtoFile.RepeatedImportMessageExtension, 1, - ImportMessage.CreateBuilder().SetD(520).Build()); - - message.SetExtension(UnitTestProtoFile.RepeatedNestedEnumExtension, 1, TestAllTypes.Types.NestedEnum.FOO); - message.SetExtension(UnitTestProtoFile.RepeatedForeignEnumExtension, 1, ForeignEnum.FOREIGN_FOO); - message.SetExtension(UnitTestProtoFile.RepeatedImportEnumExtension, 1, ImportEnum.IMPORT_FOO); - - message.SetExtension(UnitTestProtoFile.RepeatedStringPieceExtension, 1, "524"); - message.SetExtension(UnitTestProtoFile.RepeatedCordExtension, 1, "525"); - } - - /// - /// Asserts that all repeated extensions are set to the values assigned by - /// SetAllExtensions follwed by ModifyRepeatedExtensions. - /// - internal static void AssertRepeatedExtensionsModified(TestAllExtensions message) - { - // ModifyRepeatedFields only sets the second repeated element of each - // field. In addition to verifying this, we also verify that the first - // element and size were *not* modified. - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedInt32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedInt64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedUint32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedUint64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedSint32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedSint64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedFixed32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedFixed64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedSfixed32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedSfixed64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedFloatExtension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedDoubleExtension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedBoolExtension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedStringExtension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedBytesExtension)); - - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedGroupExtension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedNestedMessageExtension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedForeignMessageExtension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedImportMessageExtension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedNestedEnumExtension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedForeignEnumExtension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedImportEnumExtension)); - - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedStringPieceExtension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.RepeatedCordExtension)); - - Assert.AreEqual(201, message.GetExtension(UnitTestProtoFile.RepeatedInt32Extension, 0)); - Assert.AreEqual(202L, message.GetExtension(UnitTestProtoFile.RepeatedInt64Extension, 0)); - Assert.AreEqual(203U, message.GetExtension(UnitTestProtoFile.RepeatedUint32Extension, 0)); - Assert.AreEqual(204UL, message.GetExtension(UnitTestProtoFile.RepeatedUint64Extension, 0)); - Assert.AreEqual(205, message.GetExtension(UnitTestProtoFile.RepeatedSint32Extension, 0)); - Assert.AreEqual(206L, message.GetExtension(UnitTestProtoFile.RepeatedSint64Extension, 0)); - Assert.AreEqual(207U, message.GetExtension(UnitTestProtoFile.RepeatedFixed32Extension, 0)); - Assert.AreEqual(208UL, message.GetExtension(UnitTestProtoFile.RepeatedFixed64Extension, 0)); - Assert.AreEqual(209, message.GetExtension(UnitTestProtoFile.RepeatedSfixed32Extension, 0)); - Assert.AreEqual(210L, message.GetExtension(UnitTestProtoFile.RepeatedSfixed64Extension, 0)); - Assert.AreEqual(211F, message.GetExtension(UnitTestProtoFile.RepeatedFloatExtension, 0)); - Assert.AreEqual(212D, message.GetExtension(UnitTestProtoFile.RepeatedDoubleExtension, 0)); - Assert.AreEqual(true, message.GetExtension(UnitTestProtoFile.RepeatedBoolExtension, 0)); - Assert.AreEqual("215", message.GetExtension(UnitTestProtoFile.RepeatedStringExtension, 0)); - Assert.AreEqual(ToBytes("216"), message.GetExtension(UnitTestProtoFile.RepeatedBytesExtension, 0)); - - Assert.AreEqual(217, message.GetExtension(UnitTestProtoFile.RepeatedGroupExtension, 0).A); - Assert.AreEqual(218, message.GetExtension(UnitTestProtoFile.RepeatedNestedMessageExtension, 0).Bb); - Assert.AreEqual(219, message.GetExtension(UnitTestProtoFile.RepeatedForeignMessageExtension, 0).C); - Assert.AreEqual(220, message.GetExtension(UnitTestProtoFile.RepeatedImportMessageExtension, 0).D); - - Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR, - message.GetExtension(UnitTestProtoFile.RepeatedNestedEnumExtension, 0)); - Assert.AreEqual(ForeignEnum.FOREIGN_BAR, - message.GetExtension(UnitTestProtoFile.RepeatedForeignEnumExtension, 0)); - Assert.AreEqual(ImportEnum.IMPORT_BAR, - message.GetExtension(UnitTestProtoFile.RepeatedImportEnumExtension, 0)); - - Assert.AreEqual("224", message.GetExtension(UnitTestProtoFile.RepeatedStringPieceExtension, 0)); - Assert.AreEqual("225", message.GetExtension(UnitTestProtoFile.RepeatedCordExtension, 0)); - - // Actually verify the second (modified) elements now. - Assert.AreEqual(501, message.GetExtension(UnitTestProtoFile.RepeatedInt32Extension, 1)); - Assert.AreEqual(502L, message.GetExtension(UnitTestProtoFile.RepeatedInt64Extension, 1)); - Assert.AreEqual(503U, message.GetExtension(UnitTestProtoFile.RepeatedUint32Extension, 1)); - Assert.AreEqual(504UL, message.GetExtension(UnitTestProtoFile.RepeatedUint64Extension, 1)); - Assert.AreEqual(505, message.GetExtension(UnitTestProtoFile.RepeatedSint32Extension, 1)); - Assert.AreEqual(506L, message.GetExtension(UnitTestProtoFile.RepeatedSint64Extension, 1)); - Assert.AreEqual(507U, message.GetExtension(UnitTestProtoFile.RepeatedFixed32Extension, 1)); - Assert.AreEqual(508UL, message.GetExtension(UnitTestProtoFile.RepeatedFixed64Extension, 1)); - Assert.AreEqual(509, message.GetExtension(UnitTestProtoFile.RepeatedSfixed32Extension, 1)); - Assert.AreEqual(510L, message.GetExtension(UnitTestProtoFile.RepeatedSfixed64Extension, 1)); - Assert.AreEqual(511F, message.GetExtension(UnitTestProtoFile.RepeatedFloatExtension, 1)); - Assert.AreEqual(512D, message.GetExtension(UnitTestProtoFile.RepeatedDoubleExtension, 1)); - Assert.AreEqual(true, message.GetExtension(UnitTestProtoFile.RepeatedBoolExtension, 1)); - Assert.AreEqual("515", message.GetExtension(UnitTestProtoFile.RepeatedStringExtension, 1)); - Assert.AreEqual(ToBytes("516"), message.GetExtension(UnitTestProtoFile.RepeatedBytesExtension, 1)); - - Assert.AreEqual(517, message.GetExtension(UnitTestProtoFile.RepeatedGroupExtension, 1).A); - Assert.AreEqual(518, message.GetExtension(UnitTestProtoFile.RepeatedNestedMessageExtension, 1).Bb); - Assert.AreEqual(519, message.GetExtension(UnitTestProtoFile.RepeatedForeignMessageExtension, 1).C); - Assert.AreEqual(520, message.GetExtension(UnitTestProtoFile.RepeatedImportMessageExtension, 1).D); - - Assert.AreEqual(TestAllTypes.Types.NestedEnum.FOO, - message.GetExtension(UnitTestProtoFile.RepeatedNestedEnumExtension, 1)); - Assert.AreEqual(ForeignEnum.FOREIGN_FOO, - message.GetExtension(UnitTestProtoFile.RepeatedForeignEnumExtension, 1)); - Assert.AreEqual(ImportEnum.IMPORT_FOO, - message.GetExtension(UnitTestProtoFile.RepeatedImportEnumExtension, 1)); - - Assert.AreEqual("524", message.GetExtension(UnitTestProtoFile.RepeatedStringPieceExtension, 1)); - Assert.AreEqual("525", message.GetExtension(UnitTestProtoFile.RepeatedCordExtension, 1)); - } - - internal static void AssertExtensionsClear(TestAllExtensions message) - { - // HasBlah() should initially be false for all optional fields. - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalInt32Extension)); - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalInt64Extension)); - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalUint32Extension)); - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalUint64Extension)); - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalSint32Extension)); - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalSint64Extension)); - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalFixed32Extension)); - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalFixed64Extension)); - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalSfixed32Extension)); - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalSfixed64Extension)); - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalFloatExtension)); - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalDoubleExtension)); - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalBoolExtension)); - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalStringExtension)); - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalBytesExtension)); - - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalGroupExtension)); - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalNestedMessageExtension)); - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalForeignMessageExtension)); - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalImportMessageExtension)); - - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalNestedEnumExtension)); - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalForeignEnumExtension)); - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalImportEnumExtension)); - - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalStringPieceExtension)); - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.OptionalCordExtension)); - - // Optional fields without defaults are set to zero or something like it. - Assert.AreEqual(0, message.GetExtension(UnitTestProtoFile.OptionalInt32Extension)); - Assert.AreEqual(0L, message.GetExtension(UnitTestProtoFile.OptionalInt64Extension)); - Assert.AreEqual(0U, message.GetExtension(UnitTestProtoFile.OptionalUint32Extension)); - Assert.AreEqual(0UL, message.GetExtension(UnitTestProtoFile.OptionalUint64Extension)); - Assert.AreEqual(0, message.GetExtension(UnitTestProtoFile.OptionalSint32Extension)); - Assert.AreEqual(0L, message.GetExtension(UnitTestProtoFile.OptionalSint64Extension)); - Assert.AreEqual(0U, message.GetExtension(UnitTestProtoFile.OptionalFixed32Extension)); - Assert.AreEqual(0UL, message.GetExtension(UnitTestProtoFile.OptionalFixed64Extension)); - Assert.AreEqual(0, message.GetExtension(UnitTestProtoFile.OptionalSfixed32Extension)); - Assert.AreEqual(0L, message.GetExtension(UnitTestProtoFile.OptionalSfixed64Extension)); - Assert.AreEqual(0F, message.GetExtension(UnitTestProtoFile.OptionalFloatExtension)); - Assert.AreEqual(0D, message.GetExtension(UnitTestProtoFile.OptionalDoubleExtension)); - Assert.AreEqual(false, message.GetExtension(UnitTestProtoFile.OptionalBoolExtension)); - Assert.AreEqual("", message.GetExtension(UnitTestProtoFile.OptionalStringExtension)); - Assert.AreEqual(ByteString.Empty, message.GetExtension(UnitTestProtoFile.OptionalBytesExtension)); - - // Embedded messages should also be clear. - Assert.IsFalse(message.GetExtension(UnitTestProtoFile.OptionalGroupExtension).HasA); - Assert.IsFalse(message.GetExtension(UnitTestProtoFile.OptionalNestedMessageExtension).HasBb); - Assert.IsFalse(message.GetExtension(UnitTestProtoFile.OptionalForeignMessageExtension).HasC); - Assert.IsFalse(message.GetExtension(UnitTestProtoFile.OptionalImportMessageExtension).HasD); - - Assert.AreEqual(0, message.GetExtension(UnitTestProtoFile.OptionalGroupExtension).A); - Assert.AreEqual(0, message.GetExtension(UnitTestProtoFile.OptionalNestedMessageExtension).Bb); - Assert.AreEqual(0, message.GetExtension(UnitTestProtoFile.OptionalForeignMessageExtension).C); - Assert.AreEqual(0, message.GetExtension(UnitTestProtoFile.OptionalImportMessageExtension).D); - - // Enums without defaults are set to the first value in the enum. - Assert.AreEqual(TestAllTypes.Types.NestedEnum.FOO, - message.GetExtension(UnitTestProtoFile.OptionalNestedEnumExtension)); - Assert.AreEqual(ForeignEnum.FOREIGN_FOO, - message.GetExtension(UnitTestProtoFile.OptionalForeignEnumExtension)); - Assert.AreEqual(ImportEnum.IMPORT_FOO, message.GetExtension(UnitTestProtoFile.OptionalImportEnumExtension)); - - Assert.AreEqual("", message.GetExtension(UnitTestProtoFile.OptionalStringPieceExtension)); - Assert.AreEqual("", message.GetExtension(UnitTestProtoFile.OptionalCordExtension)); - - // Repeated fields are empty. - Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedInt32Extension)); - Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedInt64Extension)); - Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedUint32Extension)); - Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedUint64Extension)); - Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedSint32Extension)); - Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedSint64Extension)); - Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedFixed32Extension)); - Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedFixed64Extension)); - Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedSfixed32Extension)); - Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedSfixed64Extension)); - Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedFloatExtension)); - Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedDoubleExtension)); - Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedBoolExtension)); - Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedStringExtension)); - Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedBytesExtension)); - - Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedGroupExtension)); - Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedNestedMessageExtension)); - Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedForeignMessageExtension)); - Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedImportMessageExtension)); - Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedNestedEnumExtension)); - Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedForeignEnumExtension)); - Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedImportEnumExtension)); - - Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedStringPieceExtension)); - Assert.AreEqual(0, message.GetExtensionCount(UnitTestProtoFile.RepeatedCordExtension)); - - // HasBlah() should also be false for all default fields. - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultInt32Extension)); - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultInt64Extension)); - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultUint32Extension)); - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultUint64Extension)); - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultSint32Extension)); - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultSint64Extension)); - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultFixed32Extension)); - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultFixed64Extension)); - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultSfixed32Extension)); - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultSfixed64Extension)); - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultFloatExtension)); - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultDoubleExtension)); - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultBoolExtension)); - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultStringExtension)); - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultBytesExtension)); - - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultNestedEnumExtension)); - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultForeignEnumExtension)); - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultImportEnumExtension)); - - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultStringPieceExtension)); - Assert.IsFalse(message.HasExtension(UnitTestProtoFile.DefaultCordExtension)); - - // Fields with defaults have their default values (duh). - Assert.AreEqual(41, message.GetExtension(UnitTestProtoFile.DefaultInt32Extension)); - Assert.AreEqual(42L, message.GetExtension(UnitTestProtoFile.DefaultInt64Extension)); - Assert.AreEqual(43U, message.GetExtension(UnitTestProtoFile.DefaultUint32Extension)); - Assert.AreEqual(44UL, message.GetExtension(UnitTestProtoFile.DefaultUint64Extension)); - Assert.AreEqual(-45, message.GetExtension(UnitTestProtoFile.DefaultSint32Extension)); - Assert.AreEqual(46L, message.GetExtension(UnitTestProtoFile.DefaultSint64Extension)); - Assert.AreEqual(47U, message.GetExtension(UnitTestProtoFile.DefaultFixed32Extension)); - Assert.AreEqual(48UL, message.GetExtension(UnitTestProtoFile.DefaultFixed64Extension)); - Assert.AreEqual(49, message.GetExtension(UnitTestProtoFile.DefaultSfixed32Extension)); - Assert.AreEqual(-50L, message.GetExtension(UnitTestProtoFile.DefaultSfixed64Extension)); - Assert.AreEqual(51.5F, message.GetExtension(UnitTestProtoFile.DefaultFloatExtension)); - Assert.AreEqual(52e3D, message.GetExtension(UnitTestProtoFile.DefaultDoubleExtension)); - Assert.AreEqual(true, message.GetExtension(UnitTestProtoFile.DefaultBoolExtension)); - Assert.AreEqual("hello", message.GetExtension(UnitTestProtoFile.DefaultStringExtension)); - Assert.AreEqual(ToBytes("world"), message.GetExtension(UnitTestProtoFile.DefaultBytesExtension)); - - Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR, - message.GetExtension(UnitTestProtoFile.DefaultNestedEnumExtension)); - Assert.AreEqual(ForeignEnum.FOREIGN_BAR, message.GetExtension(UnitTestProtoFile.DefaultForeignEnumExtension)); - Assert.AreEqual(ImportEnum.IMPORT_BAR, message.GetExtension(UnitTestProtoFile.DefaultImportEnumExtension)); - - Assert.AreEqual("abc", message.GetExtension(UnitTestProtoFile.DefaultStringPieceExtension)); - Assert.AreEqual("123", message.GetExtension(UnitTestProtoFile.DefaultCordExtension)); - } - - /// - /// Set every field of the specified message to a unique value. - /// - public static void SetPackedFields(TestPackedTypes.Builder message) - { - message.AddPackedInt32(601); - message.AddPackedInt64(602); - message.AddPackedUint32(603); - message.AddPackedUint64(604); - message.AddPackedSint32(605); - message.AddPackedSint64(606); - message.AddPackedFixed32(607); - message.AddPackedFixed64(608); - message.AddPackedSfixed32(609); - message.AddPackedSfixed64(610); - message.AddPackedFloat(611); - message.AddPackedDouble(612); - message.AddPackedBool(true); - message.AddPackedEnum(ForeignEnum.FOREIGN_BAR); - // Add a second one of each field. - message.AddPackedInt32(701); - message.AddPackedInt64(702); - message.AddPackedUint32(703); - message.AddPackedUint64(704); - message.AddPackedSint32(705); - message.AddPackedSint64(706); - message.AddPackedFixed32(707); - message.AddPackedFixed64(708); - message.AddPackedSfixed32(709); - message.AddPackedSfixed64(710); - message.AddPackedFloat(711); - message.AddPackedDouble(712); - message.AddPackedBool(false); - message.AddPackedEnum(ForeignEnum.FOREIGN_BAZ); - } - - /// - /// Asserts that all the fields of the specified message are set to the values assigned - /// in SetPackedFields. - /// - public static void AssertPackedFieldsSet(TestPackedTypes message) - { - Assert.AreEqual(2, message.PackedInt32Count); - Assert.AreEqual(2, message.PackedInt64Count); - Assert.AreEqual(2, message.PackedUint32Count); - Assert.AreEqual(2, message.PackedUint64Count); - Assert.AreEqual(2, message.PackedSint32Count); - Assert.AreEqual(2, message.PackedSint64Count); - Assert.AreEqual(2, message.PackedFixed32Count); - Assert.AreEqual(2, message.PackedFixed64Count); - Assert.AreEqual(2, message.PackedSfixed32Count); - Assert.AreEqual(2, message.PackedSfixed64Count); - Assert.AreEqual(2, message.PackedFloatCount); - Assert.AreEqual(2, message.PackedDoubleCount); - Assert.AreEqual(2, message.PackedBoolCount); - Assert.AreEqual(2, message.PackedEnumCount); - Assert.AreEqual(601, message.GetPackedInt32(0)); - Assert.AreEqual(602, message.GetPackedInt64(0)); - Assert.AreEqual(603u, message.GetPackedUint32(0)); - Assert.AreEqual(604u, message.GetPackedUint64(0)); - Assert.AreEqual(605, message.GetPackedSint32(0)); - Assert.AreEqual(606, message.GetPackedSint64(0)); - Assert.AreEqual(607u, message.GetPackedFixed32(0)); - Assert.AreEqual(608u, message.GetPackedFixed64(0)); - Assert.AreEqual(609, message.GetPackedSfixed32(0)); - Assert.AreEqual(610, message.GetPackedSfixed64(0)); - Assert.AreEqual(611, message.GetPackedFloat(0), 0.0); - Assert.AreEqual(612, message.GetPackedDouble(0), 0.0); - Assert.AreEqual(true, message.GetPackedBool(0)); - Assert.AreEqual(ForeignEnum.FOREIGN_BAR, message.GetPackedEnum(0)); - Assert.AreEqual(701, message.GetPackedInt32(1)); - Assert.AreEqual(702, message.GetPackedInt64(1)); - Assert.AreEqual(703u, message.GetPackedUint32(1)); - Assert.AreEqual(704u, message.GetPackedUint64(1)); - Assert.AreEqual(705, message.GetPackedSint32(1)); - Assert.AreEqual(706, message.GetPackedSint64(1)); - Assert.AreEqual(707u, message.GetPackedFixed32(1)); - Assert.AreEqual(708u, message.GetPackedFixed64(1)); - Assert.AreEqual(709, message.GetPackedSfixed32(1)); - Assert.AreEqual(710, message.GetPackedSfixed64(1)); - Assert.AreEqual(711, message.GetPackedFloat(1), 0.0); - Assert.AreEqual(712, message.GetPackedDouble(1), 0.0); - Assert.AreEqual(false, message.GetPackedBool(1)); - Assert.AreEqual(ForeignEnum.FOREIGN_BAZ, message.GetPackedEnum(1)); - } - /// - /// Asserts that all the fields of the specified message are set to the values assigned - /// in SetPackedFields. - /// - public static void AssertUnpackedFieldsSet(TestUnpackedTypes message) - { - Assert.AreEqual(2, message.UnpackedInt32Count); - Assert.AreEqual(2, message.UnpackedInt64Count); - Assert.AreEqual(2, message.UnpackedUint32Count); - Assert.AreEqual(2, message.UnpackedUint64Count); - Assert.AreEqual(2, message.UnpackedSint32Count); - Assert.AreEqual(2, message.UnpackedSint64Count); - Assert.AreEqual(2, message.UnpackedFixed32Count); - Assert.AreEqual(2, message.UnpackedFixed64Count); - Assert.AreEqual(2, message.UnpackedSfixed32Count); - Assert.AreEqual(2, message.UnpackedSfixed64Count); - Assert.AreEqual(2, message.UnpackedFloatCount); - Assert.AreEqual(2, message.UnpackedDoubleCount); - Assert.AreEqual(2, message.UnpackedBoolCount); - Assert.AreEqual(2, message.UnpackedEnumCount); - Assert.AreEqual(601, message.GetUnpackedInt32(0)); - Assert.AreEqual(602, message.GetUnpackedInt64(0)); - Assert.AreEqual(603u, message.GetUnpackedUint32(0)); - Assert.AreEqual(604u, message.GetUnpackedUint64(0)); - Assert.AreEqual(605, message.GetUnpackedSint32(0)); - Assert.AreEqual(606, message.GetUnpackedSint64(0)); - Assert.AreEqual(607u, message.GetUnpackedFixed32(0)); - Assert.AreEqual(608u, message.GetUnpackedFixed64(0)); - Assert.AreEqual(609, message.GetUnpackedSfixed32(0)); - Assert.AreEqual(610, message.GetUnpackedSfixed64(0)); - Assert.AreEqual(611, message.GetUnpackedFloat(0), 0.0); - Assert.AreEqual(612, message.GetUnpackedDouble(0), 0.0); - Assert.AreEqual(true, message.GetUnpackedBool(0)); - Assert.AreEqual(ForeignEnum.FOREIGN_BAR, message.GetUnpackedEnum(0)); - Assert.AreEqual(701, message.GetUnpackedInt32(1)); - Assert.AreEqual(702, message.GetUnpackedInt64(1)); - Assert.AreEqual(703u, message.GetUnpackedUint32(1)); - Assert.AreEqual(704u, message.GetUnpackedUint64(1)); - Assert.AreEqual(705, message.GetUnpackedSint32(1)); - Assert.AreEqual(706, message.GetUnpackedSint64(1)); - Assert.AreEqual(707u, message.GetUnpackedFixed32(1)); - Assert.AreEqual(708u, message.GetUnpackedFixed64(1)); - Assert.AreEqual(709, message.GetUnpackedSfixed32(1)); - Assert.AreEqual(710, message.GetUnpackedSfixed64(1)); - Assert.AreEqual(711, message.GetUnpackedFloat(1), 0.0); - Assert.AreEqual(712, message.GetUnpackedDouble(1), 0.0); - Assert.AreEqual(false, message.GetUnpackedBool(1)); - Assert.AreEqual(ForeignEnum.FOREIGN_BAZ, message.GetUnpackedEnum(1)); - } - - public static void SetPackedExtensions(TestPackedExtensions.Builder message) - { - message.AddExtension(UnitTestProtoFile.PackedInt32Extension, 601); - message.AddExtension(UnitTestProtoFile.PackedInt64Extension, 602L); - message.AddExtension(UnitTestProtoFile.PackedUint32Extension, 603U); - message.AddExtension(UnitTestProtoFile.PackedUint64Extension, 604UL); - message.AddExtension(UnitTestProtoFile.PackedSint32Extension, 605); - message.AddExtension(UnitTestProtoFile.PackedSint64Extension, 606L); - message.AddExtension(UnitTestProtoFile.PackedFixed32Extension, 607U); - message.AddExtension(UnitTestProtoFile.PackedFixed64Extension, 608UL); - message.AddExtension(UnitTestProtoFile.PackedSfixed32Extension, 609); - message.AddExtension(UnitTestProtoFile.PackedSfixed64Extension, 610L); - message.AddExtension(UnitTestProtoFile.PackedFloatExtension, 611F); - message.AddExtension(UnitTestProtoFile.PackedDoubleExtension, 612D); - message.AddExtension(UnitTestProtoFile.PackedBoolExtension, true); - message.AddExtension(UnitTestProtoFile.PackedEnumExtension, ForeignEnum.FOREIGN_BAR); - // Add a second one of each field. - message.AddExtension(UnitTestProtoFile.PackedInt32Extension, 701); - message.AddExtension(UnitTestProtoFile.PackedInt64Extension, 702L); - message.AddExtension(UnitTestProtoFile.PackedUint32Extension, 703U); - message.AddExtension(UnitTestProtoFile.PackedUint64Extension, 704UL); - message.AddExtension(UnitTestProtoFile.PackedSint32Extension, 705); - message.AddExtension(UnitTestProtoFile.PackedSint64Extension, 706L); - message.AddExtension(UnitTestProtoFile.PackedFixed32Extension, 707U); - message.AddExtension(UnitTestProtoFile.PackedFixed64Extension, 708UL); - message.AddExtension(UnitTestProtoFile.PackedSfixed32Extension, 709); - message.AddExtension(UnitTestProtoFile.PackedSfixed64Extension, 710L); - message.AddExtension(UnitTestProtoFile.PackedFloatExtension, 711F); - message.AddExtension(UnitTestProtoFile.PackedDoubleExtension, 712D); - message.AddExtension(UnitTestProtoFile.PackedBoolExtension, false); - message.AddExtension(UnitTestProtoFile.PackedEnumExtension, ForeignEnum.FOREIGN_BAZ); - } - - public static void AssertPackedExtensionsSet(TestPackedExtensions message) - { - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.PackedInt32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.PackedInt64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.PackedUint32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.PackedUint64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.PackedSint32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.PackedSint64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.PackedFixed32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.PackedFixed64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.PackedSfixed32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.PackedSfixed64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.PackedFloatExtension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.PackedDoubleExtension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.PackedBoolExtension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.PackedEnumExtension)); - Assert.AreEqual(601, message.GetExtension(UnitTestProtoFile.PackedInt32Extension, 0)); - Assert.AreEqual(602L, message.GetExtension(UnitTestProtoFile.PackedInt64Extension, 0)); - Assert.AreEqual(603u, message.GetExtension(UnitTestProtoFile.PackedUint32Extension, 0)); - Assert.AreEqual(604uL, message.GetExtension(UnitTestProtoFile.PackedUint64Extension, 0)); - Assert.AreEqual(605, message.GetExtension(UnitTestProtoFile.PackedSint32Extension, 0)); - Assert.AreEqual(606L, message.GetExtension(UnitTestProtoFile.PackedSint64Extension, 0)); - Assert.AreEqual(607u, message.GetExtension(UnitTestProtoFile.PackedFixed32Extension, 0)); - Assert.AreEqual(608uL, message.GetExtension(UnitTestProtoFile.PackedFixed64Extension, 0)); - Assert.AreEqual(609, message.GetExtension(UnitTestProtoFile.PackedSfixed32Extension, 0)); - Assert.AreEqual(610L, message.GetExtension(UnitTestProtoFile.PackedSfixed64Extension, 0)); - Assert.AreEqual(611F, message.GetExtension(UnitTestProtoFile.PackedFloatExtension, 0)); - Assert.AreEqual(612D, message.GetExtension(UnitTestProtoFile.PackedDoubleExtension, 0)); - Assert.AreEqual(true, message.GetExtension(UnitTestProtoFile.PackedBoolExtension, 0)); - Assert.AreEqual(ForeignEnum.FOREIGN_BAR, - message.GetExtension(UnitTestProtoFile.PackedEnumExtension, 0)); - Assert.AreEqual(701, message.GetExtension(UnitTestProtoFile.PackedInt32Extension, 1)); - Assert.AreEqual(702L, message.GetExtension(UnitTestProtoFile.PackedInt64Extension, 1)); - Assert.AreEqual(703u, message.GetExtension(UnitTestProtoFile.PackedUint32Extension, 1)); - Assert.AreEqual(704uL, message.GetExtension(UnitTestProtoFile.PackedUint64Extension, 1)); - Assert.AreEqual(705, message.GetExtension(UnitTestProtoFile.PackedSint32Extension, 1)); - Assert.AreEqual(706L, message.GetExtension(UnitTestProtoFile.PackedSint64Extension, 1)); - Assert.AreEqual(707u, message.GetExtension(UnitTestProtoFile.PackedFixed32Extension, 1)); - Assert.AreEqual(708uL, message.GetExtension(UnitTestProtoFile.PackedFixed64Extension, 1)); - Assert.AreEqual(709, message.GetExtension(UnitTestProtoFile.PackedSfixed32Extension, 1)); - Assert.AreEqual(710L, message.GetExtension(UnitTestProtoFile.PackedSfixed64Extension, 1)); - Assert.AreEqual(711F, message.GetExtension(UnitTestProtoFile.PackedFloatExtension, 1)); - Assert.AreEqual(712D, message.GetExtension(UnitTestProtoFile.PackedDoubleExtension, 1)); - Assert.AreEqual(false, message.GetExtension(UnitTestProtoFile.PackedBoolExtension, 1)); - Assert.AreEqual(ForeignEnum.FOREIGN_BAZ, message.GetExtension(UnitTestProtoFile.PackedEnumExtension, 1)); - } - - public static void AssertUnpackedExtensionsSet(TestUnpackedExtensions message) - { - Assert.AreEqual(2, message.GetExtensionCount(UnitTestExtrasProtoFile.UnpackedInt32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestExtrasProtoFile.UnpackedInt64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestExtrasProtoFile.UnpackedUint32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestExtrasProtoFile.UnpackedUint64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestExtrasProtoFile.UnpackedSint32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestExtrasProtoFile.UnpackedSint64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestExtrasProtoFile.UnpackedFixed32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestExtrasProtoFile.UnpackedFixed64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestExtrasProtoFile.UnpackedSfixed32Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestExtrasProtoFile.UnpackedSfixed64Extension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestExtrasProtoFile.UnpackedFloatExtension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestExtrasProtoFile.UnpackedDoubleExtension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestExtrasProtoFile.UnpackedBoolExtension)); - Assert.AreEqual(2, message.GetExtensionCount(UnitTestExtrasProtoFile.UnpackedEnumExtension)); - Assert.AreEqual(601, message.GetExtension(UnitTestExtrasProtoFile.UnpackedInt32Extension, 0)); - Assert.AreEqual(602L, message.GetExtension(UnitTestExtrasProtoFile.UnpackedInt64Extension, 0)); - Assert.AreEqual(603u, message.GetExtension(UnitTestExtrasProtoFile.UnpackedUint32Extension, 0)); - Assert.AreEqual(604uL, message.GetExtension(UnitTestExtrasProtoFile.UnpackedUint64Extension, 0)); - Assert.AreEqual(605, message.GetExtension(UnitTestExtrasProtoFile.UnpackedSint32Extension, 0)); - Assert.AreEqual(606L, message.GetExtension(UnitTestExtrasProtoFile.UnpackedSint64Extension, 0)); - Assert.AreEqual(607u, message.GetExtension(UnitTestExtrasProtoFile.UnpackedFixed32Extension, 0)); - Assert.AreEqual(608uL, message.GetExtension(UnitTestExtrasProtoFile.UnpackedFixed64Extension, 0)); - Assert.AreEqual(609, message.GetExtension(UnitTestExtrasProtoFile.UnpackedSfixed32Extension, 0)); - Assert.AreEqual(610L, message.GetExtension(UnitTestExtrasProtoFile.UnpackedSfixed64Extension, 0)); - Assert.AreEqual(611F, message.GetExtension(UnitTestExtrasProtoFile.UnpackedFloatExtension, 0)); - Assert.AreEqual(612D, message.GetExtension(UnitTestExtrasProtoFile.UnpackedDoubleExtension, 0)); - Assert.AreEqual(true, message.GetExtension(UnitTestExtrasProtoFile.UnpackedBoolExtension, 0)); - Assert.AreEqual(UnpackedExtensionsForeignEnum.FOREIGN_BAR, - message.GetExtension(UnitTestExtrasProtoFile.UnpackedEnumExtension, 0)); - Assert.AreEqual(701, message.GetExtension(UnitTestExtrasProtoFile.UnpackedInt32Extension, 1)); - Assert.AreEqual(702L, message.GetExtension(UnitTestExtrasProtoFile.UnpackedInt64Extension, 1)); - Assert.AreEqual(703u, message.GetExtension(UnitTestExtrasProtoFile.UnpackedUint32Extension, 1)); - Assert.AreEqual(704uL, message.GetExtension(UnitTestExtrasProtoFile.UnpackedUint64Extension, 1)); - Assert.AreEqual(705, message.GetExtension(UnitTestExtrasProtoFile.UnpackedSint32Extension, 1)); - Assert.AreEqual(706L, message.GetExtension(UnitTestExtrasProtoFile.UnpackedSint64Extension, 1)); - Assert.AreEqual(707u, message.GetExtension(UnitTestExtrasProtoFile.UnpackedFixed32Extension, 1)); - Assert.AreEqual(708uL, message.GetExtension(UnitTestExtrasProtoFile.UnpackedFixed64Extension, 1)); - Assert.AreEqual(709, message.GetExtension(UnitTestExtrasProtoFile.UnpackedSfixed32Extension, 1)); - Assert.AreEqual(710L, message.GetExtension(UnitTestExtrasProtoFile.UnpackedSfixed64Extension, 1)); - Assert.AreEqual(711F, message.GetExtension(UnitTestExtrasProtoFile.UnpackedFloatExtension, 1)); - Assert.AreEqual(712D, message.GetExtension(UnitTestExtrasProtoFile.UnpackedDoubleExtension, 1)); - Assert.AreEqual(false, message.GetExtension(UnitTestExtrasProtoFile.UnpackedBoolExtension, 1)); - Assert.AreEqual(UnpackedExtensionsForeignEnum.FOREIGN_BAZ, message.GetExtension(UnitTestExtrasProtoFile.UnpackedEnumExtension, 1)); - } - - private static readonly string[] TestCultures = {"en-US", "en-GB", "fr-FR", "de-DE"}; - - public delegate void CultureAction(); - - public static void TestInMultipleCultures(CultureAction test) - { -#if COMPACT_FRAMEWORK - test(); -#else - CultureInfo originalCulture = Thread.CurrentThread.CurrentCulture; - foreach (string culture in TestCultures) - { - try - { - Thread.CurrentThread.CurrentCulture = new CultureInfo(culture); - test(); - } - finally - { - Thread.CurrentThread.CurrentCulture = originalCulture; - } - } -#endif - } - - /// - /// Helper to construct a byte array from a bunch of bytes. - /// - internal static byte[] Bytes(params byte[] bytesAsInts) - { - byte[] bytes = new byte[bytesAsInts.Length]; - for (int i = 0; i < bytesAsInts.Length; i++) - { - bytes[i] = (byte) bytesAsInts[i]; - } - return bytes; - } - - - internal delegate void Action(); - - internal static void AssertNotSupported(Action action) - { - try - { - action(); - Assert.Fail("Expected NotSupportedException"); - } - catch (NotSupportedException) - { - // Expected - } - } - - internal static void AssertArgumentNullException(Action action) - { - try - { - action(); - Assert.Fail("Exception was not thrown"); - } - // Not a general case, however, Compact Framework v2 does use Invoke - catch (System.Reflection.TargetInvocationException te) - { - if (te.InnerException.GetType() != typeof(ArgumentNullException)) - throw; - } - // Normally expected exception - catch (ArgumentNullException) - { - // We expect this exception. - } - } - - internal static void AssertBytesEqual(byte[] a, byte[]b) - { - if (a == null || b == null) - { - Assert.AreEqual(a, b); - } - else - { - Assert.AreEqual(a.Length, b.Length, "The byte[] is not of the expected length."); - - for (int i = 0; i < a.Length; i++) - { - if (a[i] != b[i]) - { - Assert.AreEqual(a[i], b[i], "Byte[] differs at index " + i); - } - } - } - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/TestWriterFormatJson.cs b/src/ProtocolBuffers.Test/TestWriterFormatJson.cs deleted file mode 100644 index a3543af..0000000 --- a/src/ProtocolBuffers.Test/TestWriterFormatJson.cs +++ /dev/null @@ -1,498 +0,0 @@ -using System; -using System.IO; -using System.Text; -using Google.ProtocolBuffers.DescriptorProtos; -using Google.ProtocolBuffers.Serialization; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Google.ProtocolBuffers.TestProtos; -using EnumOptions = Google.ProtocolBuffers.TestProtos.EnumOptions; - -namespace Google.ProtocolBuffers -{ - [TestClass] - public class TestWriterFormatJson - { - [TestMethod] - public void Example_FromJson() - { - TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); - - //3.5: builder.MergeFromJson(@"{""valid"":true}"); - Extensions.MergeFromJson(builder, @"{""valid"":true}"); - - TestXmlMessage message = builder.Build(); - Assert.AreEqual(true, message.Valid); - } - - [TestMethod] - public void Example_ToJson() - { - TestXmlMessage message = - TestXmlMessage.CreateBuilder() - .SetValid(true) - .Build(); - - //3.5: string json = message.ToJson(); - string json = Extensions.ToJson(message); - - Assert.AreEqual(@"{""valid"":true}", json); - } - - [TestMethod] - public void Example_WriteJsonUsingICodedOutputStream() - { - TestXmlMessage message = - TestXmlMessage.CreateBuilder() - .SetValid(true) - .Build(); - - using (TextWriter output = new StringWriter()) - { - ICodedOutputStream writer = JsonFormatWriter.CreateInstance(output); - writer.WriteMessageStart(); //manually begin the message, output is '{' - - writer.Flush(); - Assert.AreEqual("{", output.ToString()); - - ICodedOutputStream stream = writer; - message.WriteTo(stream); //write the message normally - - writer.Flush(); - Assert.AreEqual(@"{""valid"":true", output.ToString()); - - writer.WriteMessageEnd(); //manually write the end message '}' - Assert.AreEqual(@"{""valid"":true}", output.ToString()); - } - } - - [TestMethod] - public void Example_ReadJsonUsingICodedInputStream() - { - TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); - ICodedInputStream reader = JsonFormatReader.CreateInstance(@"{""valid"":true}"); - - reader.ReadMessageStart(); //manually read the begin the message '{' - - builder.MergeFrom(reader); //write the message normally - - reader.ReadMessageEnd(); //manually read the end message '}' - } - - protected string Content; - [System.Diagnostics.DebuggerNonUserCode] - protected void FormatterAssert(TMessage message, params string[] expecting) where TMessage : IMessageLite - { - StringWriter sw = new StringWriter(); - JsonFormatWriter.CreateInstance(sw).WriteMessage(message); - - Content = sw.ToString(); - - ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); - UnitTestXmlSerializerTestProtoFile.RegisterAllExtensions(registry); - - IMessageLite copy = - JsonFormatReader.CreateInstance(Content) - .Merge(message.WeakCreateBuilderForType(), registry).WeakBuild(); - - Assert.AreEqual(typeof(TMessage), copy.GetType()); - Assert.AreEqual(message, copy); - foreach (string expect in expecting) - Assert.IsTrue(Content.IndexOf(expect) >= 0, "Expected to find content '{0}' in: \r\n{1}", expect, Content); - } - - [TestMethod] - public void TestToJsonParseFromJson() - { - TestAllTypes msg = new TestAllTypes.Builder().SetDefaultBool(true).Build(); - string json = Extensions.ToJson(msg); - Assert.AreEqual("{\"default_bool\":true}", json); - TestAllTypes copy = Extensions.MergeFromJson(new TestAllTypes.Builder(), json).Build(); - Assert.IsTrue(copy.HasDefaultBool && copy.DefaultBool); - Assert.AreEqual(msg, copy); - } - - [TestMethod] - public void TestToJsonParseFromJsonReader() - { - TestAllTypes msg = new TestAllTypes.Builder().SetDefaultBool(true).Build(); - string json = Extensions.ToJson(msg); - Assert.AreEqual("{\"default_bool\":true}", json); - TestAllTypes copy = Extensions.MergeFromJson(new TestAllTypes.Builder(), new StringReader(json)).Build(); - Assert.IsTrue(copy.HasDefaultBool && copy.DefaultBool); - Assert.AreEqual(msg, copy); - } - - [TestMethod] - public void TestJsonFormatted() - { - TestXmlMessage message = TestXmlMessage.CreateBuilder() - .SetValid(true) - .SetNumber(0x1010) - .AddChildren(TestXmlMessage.Types.Children.CreateBuilder()) - .AddChildren(TestXmlMessage.Types.Children.CreateBuilder().AddOptions(EnumOptions.ONE)) - .AddChildren(TestXmlMessage.Types.Children.CreateBuilder().AddOptions(EnumOptions.ONE).AddOptions(EnumOptions.TWO)) - .AddChildren(TestXmlMessage.Types.Children.CreateBuilder().SetBinary(ByteString.CopyFromUtf8("abc"))) - .Build(); - - StringWriter sw = new StringWriter(); - JsonFormatWriter.CreateInstance(sw).Formatted() - .WriteMessage(message); - - string json = sw.ToString(); - - TestXmlMessage copy = JsonFormatReader.CreateInstance(json) - .Merge(TestXmlMessage.CreateBuilder()).Build(); - Assert.AreEqual(message, copy); - } - - [TestMethod] - public void TestEmptyMessage() - { - FormatterAssert( - TestXmlChild.CreateBuilder() - .Build(), - @"{}" - ); - } - - [TestMethod] - public void TestRepeatedField() - { - FormatterAssert( - TestXmlChild.CreateBuilder() - .AddOptions(EnumOptions.ONE) - .AddOptions(EnumOptions.TWO) - .Build(), - @"{""options"":[""ONE"",""TWO""]}" - ); - } - - [TestMethod] - public void TestNestedEmptyMessage() - { - FormatterAssert( - TestXmlMessage.CreateBuilder() - .SetChild(TestXmlChild.CreateBuilder().Build()) - .Build(), - @"{""child"":{}}" - ); - } - - [TestMethod] - public void TestNestedMessage() - { - FormatterAssert( - TestXmlMessage.CreateBuilder() - .SetChild(TestXmlChild.CreateBuilder().AddOptions(EnumOptions.TWO).Build()) - .Build(), - @"{""child"":{""options"":[""TWO""]}}" - ); - } - - [TestMethod] - public void TestBooleanTypes() - { - FormatterAssert( - TestXmlMessage.CreateBuilder() - .SetValid(true) - .Build(), - @"{""valid"":true}" - ); - } - - [TestMethod] - public void TestFullMessage() - { - FormatterAssert( - TestXmlMessage.CreateBuilder() - .SetValid(true) - .SetText("text") - .AddTextlines("a") - .AddTextlines("b") - .AddTextlines("c") - .SetNumber(0x1010101010) - .AddNumbers(1) - .AddNumbers(2) - .AddNumbers(3) - .SetChild(TestXmlChild.CreateBuilder().AddOptions(EnumOptions.ONE).SetBinary(ByteString.CopyFrom(new byte[1]))) - .AddChildren(TestXmlMessage.Types.Children.CreateBuilder().AddOptions(EnumOptions.TWO).SetBinary(ByteString.CopyFrom(new byte[2]))) - .AddChildren(TestXmlMessage.Types.Children.CreateBuilder().AddOptions(EnumOptions.THREE).SetBinary(ByteString.CopyFrom(new byte[3]))) - .Build(), - @"""text"":""text""", - @"[""a"",""b"",""c""]", - @"[1,2,3]", - @"""child"":{", - @"""children"":[{", - @"AA==", - @"AAA=", - @"AAAA", - 0x1010101010L.ToString() - ); - } - - [TestMethod] - public void TestMessageWithXmlText() - { - FormatterAssert( - TestXmlMessage.CreateBuilder() - .SetText("") - .Build(), - @"{""text"":""<\/text>""}" - ); - } - - [TestMethod] - public void TestWithEscapeChars() - { - FormatterAssert( - TestXmlMessage.CreateBuilder() - .SetText(" \t <- \"leading space and trailing\" -> \\ \xef54 \x0000 \xFF \xFFFF \b \f \r \n \t ") - .Build(), - "{\"text\":\" \\t <- \\\"leading space and trailing\\\" -> \\\\ \\uef54 \\u0000 \\u00ff \\uffff \\b \\f \\r \\n \\t \"}" - ); - } - - [TestMethod] - public void TestWithExtensionText() - { - FormatterAssert( - TestXmlMessage.CreateBuilder() - .SetValid(false) - .SetExtension(UnitTestXmlSerializerTestProtoFile.ExtensionText, " extension text value ! ") - .Build(), - @"{""valid"":false,""extension_text"":"" extension text value ! ""}" - ); - } - - [TestMethod] - public void TestWithExtensionNumber() - { - FormatterAssert( - TestXmlMessage.CreateBuilder() - .SetExtension(UnitTestXmlSerializerTestProtoFile.ExtensionMessage, - new TestXmlExtension.Builder().SetNumber(42).Build()) - .Build(), - @"{""number"":42}" - ); - } - - [TestMethod] - public void TestWithExtensionArray() - { - FormatterAssert( - TestXmlMessage.CreateBuilder() - .AddExtension(UnitTestXmlSerializerTestProtoFile.ExtensionNumber, 100) - .AddExtension(UnitTestXmlSerializerTestProtoFile.ExtensionNumber, 101) - .AddExtension(UnitTestXmlSerializerTestProtoFile.ExtensionNumber, 102) - .Build(), - @"{""extension_number"":[100,101,102]}" - ); - } - - [TestMethod] - public void TestWithExtensionEnum() - { - FormatterAssert( - TestXmlMessage.CreateBuilder() - .SetExtension(UnitTestXmlSerializerTestProtoFile.ExtensionEnum, EnumOptions.ONE) - .Build(), - @"{""extension_enum"":""ONE""}" - ); - } - - [TestMethod] - public void TestMessageWithExtensions() - { - FormatterAssert( - TestXmlMessage.CreateBuilder() - .SetValid(true) - .SetText("text") - .SetExtension(UnitTestXmlSerializerTestProtoFile.ExtensionText, "extension text") - .SetExtension(UnitTestXmlSerializerTestProtoFile.ExtensionMessage, new TestXmlExtension.Builder().SetNumber(42).Build()) - .AddExtension(UnitTestXmlSerializerTestProtoFile.ExtensionNumber, 100) - .AddExtension(UnitTestXmlSerializerTestProtoFile.ExtensionNumber, 101) - .AddExtension(UnitTestXmlSerializerTestProtoFile.ExtensionNumber, 102) - .SetExtension(UnitTestXmlSerializerTestProtoFile.ExtensionEnum, EnumOptions.ONE) - .Build(), - @"""text"":""text""", - @"""valid"":true", - @"""extension_enum"":""ONE""", - @"""extension_text"":""extension text""", - @"""extension_number"":[100,101,102]", - @"""extension_message"":{""number"":42}" - ); - } - - [TestMethod] - public void TestMessageMissingExtensions() - { - TestXmlMessage original = TestXmlMessage.CreateBuilder() - .SetValid(true) - .SetText("text") - .SetExtension(UnitTestXmlSerializerTestProtoFile.ExtensionText, " extension text value ! ") - .SetExtension(UnitTestXmlSerializerTestProtoFile.ExtensionMessage, new TestXmlExtension.Builder().SetNumber(42).Build()) - .AddExtension(UnitTestXmlSerializerTestProtoFile.ExtensionNumber, 100) - .AddExtension(UnitTestXmlSerializerTestProtoFile.ExtensionNumber, 101) - .AddExtension(UnitTestXmlSerializerTestProtoFile.ExtensionNumber, 102) - .SetExtension(UnitTestXmlSerializerTestProtoFile.ExtensionEnum, EnumOptions.ONE) - .Build(); - - TestXmlMessage message = original.ToBuilder() - .ClearExtension(UnitTestXmlSerializerTestProtoFile.ExtensionText) - .ClearExtension(UnitTestXmlSerializerTestProtoFile.ExtensionMessage) - .ClearExtension(UnitTestXmlSerializerTestProtoFile.ExtensionNumber) - .ClearExtension(UnitTestXmlSerializerTestProtoFile.ExtensionEnum) - .Build(); - - JsonFormatWriter writer = JsonFormatWriter.CreateInstance(); - writer.WriteMessage(original); - Content = writer.ToString(); - - IMessageLite copy = JsonFormatReader.CreateInstance(Content) - .Merge(message.CreateBuilderForType()).Build(); - - Assert.AreNotEqual(original, message); - Assert.AreNotEqual(original, copy); - Assert.AreEqual(message, copy); - } - - [TestMethod] - public void TestMergeFields() - { - TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); - builder.MergeFrom(JsonFormatReader.CreateInstance("\"valid\": true")); - builder.MergeFrom(JsonFormatReader.CreateInstance("\"text\": \"text\", \"number\": \"411\"")); - Assert.AreEqual(true, builder.Valid); - Assert.AreEqual("text", builder.Text); - Assert.AreEqual(411, builder.Number); - } - - [TestMethod] - public void TestMessageArray() - { - JsonFormatWriter writer = JsonFormatWriter.CreateInstance().Formatted(); - using (writer.StartArray()) - { - writer.WriteMessage(TestXmlMessage.CreateBuilder().SetNumber(1).AddTextlines("a").Build()); - writer.WriteMessage(TestXmlMessage.CreateBuilder().SetNumber(2).AddTextlines("b").Build()); - writer.WriteMessage(TestXmlMessage.CreateBuilder().SetNumber(3).AddTextlines("c").Build()); - } - string json = writer.ToString(); - JsonFormatReader reader = JsonFormatReader.CreateInstance(json); - - TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); - int ordinal = 0; - - foreach (JsonFormatReader r in reader.EnumerateArray()) - { - r.Merge(builder); - Assert.AreEqual(++ordinal, builder.Number); - } - Assert.AreEqual(3, ordinal); - Assert.AreEqual(3, builder.TextlinesCount); - } - - [TestMethod] - public void TestNestedMessageArray() - { - JsonFormatWriter writer = JsonFormatWriter.CreateInstance(); - using (writer.StartArray()) - { - using (writer.StartArray()) - { - writer.WriteMessage(TestXmlMessage.CreateBuilder().SetNumber(1).AddTextlines("a").Build()); - writer.WriteMessage(TestXmlMessage.CreateBuilder().SetNumber(2).AddTextlines("b").Build()); - } - using (writer.StartArray()) - writer.WriteMessage(TestXmlMessage.CreateBuilder().SetNumber(3).AddTextlines("c").Build()); - } - string json = writer.ToString(); - JsonFormatReader reader = JsonFormatReader.CreateInstance(json); - - TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); - int ordinal = 0; - - foreach (JsonFormatReader r in reader.EnumerateArray()) - foreach (JsonFormatReader r2 in r.EnumerateArray()) - { - r2.Merge(builder); - Assert.AreEqual(++ordinal, builder.Number); - } - Assert.AreEqual(3, ordinal); - Assert.AreEqual(3, builder.TextlinesCount); - } - - [TestMethod] - public void TestReadWriteJsonWithoutRoot() - { - TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); - TestXmlMessage message = builder.SetText("abc").SetNumber(123).Build(); - - string Json; - using (StringWriter sw = new StringWriter()) - { - ICodedOutputStream output = JsonFormatWriter.CreateInstance(sw); - - message.WriteTo(output); - output.Flush(); - Json = sw.ToString(); - } - Assert.AreEqual(@"""text"":""abc"",""number"":123", Json); - - ICodedInputStream input = JsonFormatReader.CreateInstance(Json); - TestXmlMessage copy = TestXmlMessage.CreateBuilder().MergeFrom(input).Build(); - - Assert.AreEqual(message, copy); - } - - [TestMethod,ExpectedException(typeof(RecursionLimitExceededException))] - public void TestRecursiveLimit() - { - StringBuilder sb = new StringBuilder(8192); - for (int i = 0; i < 80; i++) - sb.Append("{\"child\":"); - TestXmlRescursive msg = Extensions.MergeFromJson(new TestXmlRescursive.Builder(), sb.ToString()).Build(); - } - - [TestMethod, ExpectedException(typeof(FormatException))] - public void FailWithEmptyText() - { - JsonFormatReader.CreateInstance("") - .Merge(TestXmlMessage.CreateBuilder()); - } - - [TestMethod, ExpectedException(typeof(FormatException))] - public void FailWithUnexpectedValue() - { - JsonFormatReader.CreateInstance("{{}}") - .Merge(TestXmlMessage.CreateBuilder()); - } - - [TestMethod, ExpectedException(typeof(FormatException))] - public void FailWithUnQuotedName() - { - JsonFormatReader.CreateInstance("{name:{}}") - .Merge(TestXmlMessage.CreateBuilder()); - } - - [TestMethod, ExpectedException(typeof(FormatException))] - public void FailWithUnexpectedType() - { - JsonFormatReader.CreateInstance("{\"valid\":{}}") - .Merge(TestXmlMessage.CreateBuilder()); - } - - // See issue 64 for background. - [TestMethod] - public void ToJsonRequiringBufferExpansion() - { - string s = new string('.', 4086); - var opts = FileDescriptorProto.CreateBuilder() - .SetName(s) - .SetPackage("package") - .BuildPartial(); - - Assert.IsNotNull(Extensions.ToJson(opts)); - } - } -} diff --git a/src/ProtocolBuffers.Test/TestWriterFormatXml.cs b/src/ProtocolBuffers.Test/TestWriterFormatXml.cs deleted file mode 100644 index 13ea060..0000000 --- a/src/ProtocolBuffers.Test/TestWriterFormatXml.cs +++ /dev/null @@ -1,455 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Xml; -using Google.ProtocolBuffers.Serialization; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Google.ProtocolBuffers.TestProtos; - -namespace Google.ProtocolBuffers -{ - [TestClass] - public class TestWriterFormatXml - { - [TestMethod] - public void Example_FromXml() - { - TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); - - XmlReader rdr = XmlReader.Create(new StringReader(@"true")); - //3.5: builder.MergeFromXml(rdr); - Extensions.MergeFromXml(builder, rdr); - - TestXmlMessage message = builder.Build(); - Assert.AreEqual(true, message.Valid); - } - - [TestMethod] - public void Example_ToXml() - { - TestXmlMessage message = - TestXmlMessage.CreateBuilder() - .SetValid(true) - .Build(); - - //3.5: string Xml = message.ToXml(); - string Xml = Extensions.ToXml(message); - - Assert.AreEqual(@"true", Xml); - } - - [TestMethod] - public void Example_WriteXmlUsingICodedOutputStream() - { - TestXmlMessage message = - TestXmlMessage.CreateBuilder() - .SetValid(true) - .Build(); - - using (TextWriter output = new StringWriter()) - { - ICodedOutputStream writer = XmlFormatWriter.CreateInstance(output); - writer.WriteMessageStart(); //manually begin the message, output is '{' - - ICodedOutputStream stream = writer; - message.WriteTo(stream); //write the message normally - - writer.WriteMessageEnd(); //manually write the end message '}' - Assert.AreEqual(@"true", output.ToString()); - } - } - - [TestMethod] - public void Example_ReadXmlUsingICodedInputStream() - { - TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); - ICodedInputStream reader = XmlFormatReader.CreateInstance(@"true"); - - reader.ReadMessageStart(); //manually read the begin the message '{' - - builder.MergeFrom(reader); //read the message normally - - reader.ReadMessageEnd(); //manually read the end message '}' - } - - [TestMethod] - public void TestToXmlParseFromXml() - { - TestAllTypes msg = new TestAllTypes.Builder().SetDefaultBool(true).Build(); - string xml = Extensions.ToXml(msg); - Assert.AreEqual("true", xml); - TestAllTypes copy = Extensions.MergeFromXml(new TestAllTypes.Builder(), XmlReader.Create(new StringReader(xml))).Build(); - Assert.IsTrue(copy.HasDefaultBool && copy.DefaultBool); - Assert.AreEqual(msg, copy); - } - - [TestMethod] - public void TestToXmlParseFromXmlWithRootName() - { - TestAllTypes msg = new TestAllTypes.Builder().SetDefaultBool(true).Build(); - string xml = Extensions.ToXml(msg, "message"); - Assert.AreEqual("true", xml); - TestAllTypes copy = Extensions.MergeFromXml(new TestAllTypes.Builder(), "message", XmlReader.Create(new StringReader(xml))).Build(); - Assert.IsTrue(copy.HasDefaultBool && copy.DefaultBool); - Assert.AreEqual(msg, copy); - } - - [TestMethod] - public void TestEmptyMessage() - { - TestXmlChild message = TestXmlChild.CreateBuilder() - .Build(); - - StringWriter sw = new StringWriter(); - XmlWriter xw = XmlWriter.Create(sw); - - //When we call message.WriteTo, we are responsible for the root element - xw.WriteStartElement("root"); - message.WriteTo(XmlFormatWriter.CreateInstance(xw)); - xw.WriteEndElement(); - xw.Flush(); - - string xml = sw.ToString(); - XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); - TestXmlChild copy = rdr.Merge(TestXmlChild.CreateBuilder()).Build(); - Assert.AreEqual(message, copy); - } - [TestMethod] - public void TestRepeatedField() - { - TestXmlChild message = TestXmlChild.CreateBuilder() - .AddOptions(EnumOptions.ONE) - .AddOptions(EnumOptions.TWO) - .Build(); - - //Allow the writer to write the root element - StringWriter sw = new StringWriter(); - XmlFormatWriter.CreateInstance(sw).WriteMessage("root", message); - - string xml = sw.ToString(); - XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); - TestXmlChild copy = rdr.Merge(TestXmlChild.CreateBuilder()).Build(); - Assert.AreEqual(message, copy); - } - [TestMethod] - public void TestNestedEmptyMessage() - { - TestXmlMessage message = TestXmlMessage.CreateBuilder() - .SetChild(TestXmlChild.CreateBuilder().Build()) - .Build(); - - StringWriter sw = new StringWriter(); - XmlFormatWriter.CreateInstance(sw).WriteMessage("root", message); - - string xml = sw.ToString(); - XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); - TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build(); - Assert.AreEqual(message, copy); - } - [TestMethod] - public void TestNestedMessage() - { - TestXmlMessage message = TestXmlMessage.CreateBuilder() - .SetChild(TestXmlChild.CreateBuilder().AddOptions(EnumOptions.TWO).Build()) - .Build(); - - StringWriter sw = new StringWriter(); - XmlFormatWriter.CreateInstance(sw).WriteMessage("root", message); - - string xml = sw.ToString(); - XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); - TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build(); - Assert.AreEqual(message, copy); - } - [TestMethod] - public void TestBooleanTypes() - { - TestXmlMessage message = TestXmlMessage.CreateBuilder() - .SetValid(true) - .Build(); - - StringWriter sw = new StringWriter(); - XmlFormatWriter.CreateInstance(sw).WriteMessage("root", message); - - string xml = sw.ToString(); - XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); - TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build(); - Assert.AreEqual(message, copy); - } - [TestMethod] - public void TestFullMessage() - { - TestXmlMessage message = TestXmlMessage.CreateBuilder() - .SetValid(true) - .SetText("text") - .AddTextlines("a") - .AddTextlines("b") - .AddTextlines("c") - .SetNumber(0x1010101010) - .AddNumbers(1) - .AddNumbers(2) - .AddNumbers(3) - .SetChild(TestXmlChild.CreateBuilder().AddOptions(EnumOptions.ONE).SetBinary(ByteString.CopyFrom(new byte[1]))) - .AddChildren(TestXmlMessage.Types.Children.CreateBuilder().AddOptions(EnumOptions.TWO).SetBinary(ByteString.CopyFrom(new byte[2]))) - .AddChildren(TestXmlMessage.Types.Children.CreateBuilder().AddOptions(EnumOptions.THREE).SetBinary(ByteString.CopyFrom(new byte[3]))) - .Build(); - - StringWriter sw = new StringWriter(); - XmlWriter xwtr = XmlWriter.Create(sw, new XmlWriterSettings {Indent = true, IndentChars = " "}); - - XmlFormatWriter.CreateInstance(xwtr).WriteMessage("root", message); - - string xml = sw.ToString(); - - XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); - TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build(); - Assert.AreEqual(message, copy); - } - [TestMethod] - public void TestFullMessageWithRichTypes() - { - TestXmlMessage message = TestXmlMessage.CreateBuilder() - .SetValid(true) - .SetText("text") - .AddTextlines("a") - .AddTextlines("b") - .AddTextlines("c") - .SetNumber(0x1010101010) - .AddNumbers(1) - .AddNumbers(2) - .AddNumbers(3) - .SetChild(TestXmlChild.CreateBuilder().AddOptions(EnumOptions.ONE).SetBinary(ByteString.CopyFrom(new byte[1]))) - .AddChildren(TestXmlMessage.Types.Children.CreateBuilder().AddOptions(EnumOptions.TWO).SetBinary(ByteString.CopyFrom(new byte[2]))) - .AddChildren(TestXmlMessage.Types.Children.CreateBuilder().AddOptions(EnumOptions.THREE).SetBinary(ByteString.CopyFrom(new byte[3]))) - .Build(); - - StringWriter sw = new StringWriter(); - XmlWriter xwtr = XmlWriter.Create(sw, new XmlWriterSettings { Indent = true, IndentChars = " " }); - - XmlFormatWriter.CreateInstance(xwtr) - .SetOptions(XmlWriterOptions.OutputNestedArrays | XmlWriterOptions.OutputEnumValues) - .WriteMessage("root", message); - - string xml = sw.ToString(); - - XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); - rdr.Options = XmlReaderOptions.ReadNestedArrays; - TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build(); - Assert.AreEqual(message, copy); - } - [TestMethod] - public void TestFullMessageWithUnknownFields() - { - TestXmlMessage origial = TestXmlMessage.CreateBuilder() - .SetValid(true) - .SetText("text") - .AddTextlines("a") - .AddTextlines("b") - .AddTextlines("c") - .SetNumber(0x1010101010) - .AddNumbers(1) - .AddNumbers(2) - .AddNumbers(3) - .SetChild(TestXmlChild.CreateBuilder().AddOptions(EnumOptions.ONE).SetBinary(ByteString.CopyFrom(new byte[1]))) - .AddChildren(TestXmlMessage.Types.Children.CreateBuilder().AddOptions(EnumOptions.TWO).SetBinary(ByteString.CopyFrom(new byte[2]))) - .AddChildren(TestXmlMessage.Types.Children.CreateBuilder().AddOptions(EnumOptions.THREE).SetBinary(ByteString.CopyFrom(new byte[3]))) - .Build(); - TestXmlNoFields message = TestXmlNoFields.CreateBuilder().MergeFrom(origial.ToByteArray()).Build(); - - Assert.AreEqual(0, message.AllFields.Count); - - StringWriter sw = new StringWriter(); - XmlFormatWriter.CreateInstance(sw) - .SetOptions(XmlWriterOptions.OutputNestedArrays | XmlWriterOptions.OutputEnumValues) - .WriteMessage("root", message); - - string xml = sw.ToString(); - - using (XmlReader x = XmlReader.Create(new StringReader(xml))) - { - x.MoveToContent(); - Assert.AreEqual(XmlNodeType.Element, x.NodeType); - //should always be empty - Assert.IsTrue(x.IsEmptyElement || - (x.Read() && x.NodeType == XmlNodeType.EndElement) - ); - } - - XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); - rdr.Options = XmlReaderOptions.ReadNestedArrays; - TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build(); - Assert.AreEqual(TestXmlMessage.DefaultInstance, copy); - } - [TestMethod] - public void TestMessageWithXmlText() - { - TestXmlMessage message = TestXmlMessage.CreateBuilder() - .SetText("").Build(); - - StringWriter sw = new StringWriter(); - XmlFormatWriter.CreateInstance(sw).WriteMessage("root", message); - - string xml = sw.ToString(); - - XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); - TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build(); - Assert.AreEqual(message, copy); - } - [TestMethod] - public void TestXmlWithWhitespace() - { - TestXmlMessage message = TestXmlMessage.CreateBuilder() - .SetText(" \t <- leading space and trailing -> \r\n\t").Build(); - - StringWriter sw = new StringWriter(); - XmlFormatWriter.CreateInstance(sw).WriteMessage("root", message); - - string xml = sw.ToString(); - - XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); - TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build(); - Assert.AreEqual(message, copy); - } - [TestMethod] - public void TestXmlWithExtensionText() - { - TestXmlMessage message = TestXmlMessage.CreateBuilder() - .SetExtension(UnitTestXmlSerializerTestProtoFile.ExtensionText, " extension text value ! ") - .Build(); - - StringWriter sw = new StringWriter(); - XmlFormatWriter.CreateInstance(sw).WriteMessage("root", message); - - string xml = sw.ToString(); - - ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); - UnitTestXmlSerializerTestProtoFile.RegisterAllExtensions(registry); - - XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); - TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder(), registry).Build(); - Assert.AreEqual(message, copy); - } - [TestMethod] - public void TestXmlWithExtensionMessage() - { - TestXmlMessage message = TestXmlMessage.CreateBuilder() - .SetExtension(UnitTestXmlSerializerTestProtoFile.ExtensionMessage, - new TestXmlExtension.Builder().SetNumber(42).Build()).Build(); - - StringWriter sw = new StringWriter(); - XmlFormatWriter.CreateInstance(sw).WriteMessage("root", message); - - string xml = sw.ToString(); - - ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); - UnitTestXmlSerializerTestProtoFile.RegisterAllExtensions(registry); - - XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); - TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder(), registry).Build(); - Assert.AreEqual(message, copy); - } - [TestMethod] - public void TestXmlWithExtensionArray() - { - TestXmlMessage message = TestXmlMessage.CreateBuilder() - .AddExtension(UnitTestXmlSerializerTestProtoFile.ExtensionNumber, 100) - .AddExtension(UnitTestXmlSerializerTestProtoFile.ExtensionNumber, 101) - .AddExtension(UnitTestXmlSerializerTestProtoFile.ExtensionNumber, 102) - .Build(); - - StringWriter sw = new StringWriter(); - XmlFormatWriter.CreateInstance(sw).WriteMessage("root", message); - - string xml = sw.ToString(); - - ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); - UnitTestXmlSerializerTestProtoFile.RegisterAllExtensions(registry); - - XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); - TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder(), registry).Build(); - Assert.AreEqual(message, copy); - } - [TestMethod] - public void TestXmlWithExtensionEnum() - { - TestXmlMessage message = TestXmlMessage.CreateBuilder() - .SetExtension(UnitTestXmlSerializerTestProtoFile.ExtensionEnum, EnumOptions.ONE) - .Build(); - - StringWriter sw = new StringWriter(); - XmlFormatWriter.CreateInstance(sw).WriteMessage("root", message); - - string xml = sw.ToString(); - - ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); - UnitTestXmlSerializerTestProtoFile.RegisterAllExtensions(registry); - - XmlFormatReader rdr = XmlFormatReader.CreateInstance(xml); - TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder(), registry).Build(); - Assert.AreEqual(message, copy); - } - [TestMethod] - public void TestXmlReadEmptyRoot() - { - TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); - ICodedInputStream reader = XmlFormatReader.CreateInstance(@""); - - reader.ReadMessageStart(); //manually read the begin the message '{' - - builder.MergeFrom(reader); //write the message normally - - reader.ReadMessageEnd(); //manually read the end message '}' - } - - [TestMethod] - public void TestXmlReadEmptyChild() - { - TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); - ICodedInputStream reader = XmlFormatReader.CreateInstance(@""); - - reader.ReadMessageStart(); //manually read the begin the message '{' - - builder.MergeFrom(reader); //write the message normally - Assert.IsTrue(builder.HasText); - Assert.AreEqual(String.Empty, builder.Text); - } - - [TestMethod] - public void TestXmlReadWriteWithoutRoot() - { - TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); - TestXmlMessage message = builder.SetText("abc").SetNumber(123).Build(); - - string xml; - using (StringWriter sw = new StringWriter()) - { - ICodedOutputStream output = XmlFormatWriter.CreateInstance( - XmlWriter.Create(sw, new XmlWriterSettings() { ConformanceLevel = ConformanceLevel.Fragment })); - - message.WriteTo(output); - output.Flush(); - xml = sw.ToString(); - } - Assert.AreEqual("abc123", xml); - - TestXmlMessage copy; - using (XmlReader xr = XmlReader.Create(new StringReader(xml), new XmlReaderSettings() { ConformanceLevel = ConformanceLevel.Fragment })) - { - ICodedInputStream input = XmlFormatReader.CreateInstance(xr); - copy = TestXmlMessage.CreateBuilder().MergeFrom(input).Build(); - } - - Assert.AreEqual(message, copy); - } - - [TestMethod, ExpectedException(typeof(RecursionLimitExceededException))] - public void TestRecursiveLimit() - { - StringBuilder sb = new StringBuilder(8192); - for (int i = 0; i < 80; i++) - sb.Append(""); - TestXmlRescursive msg = Extensions.MergeFromXml(new TestXmlRescursive.Builder(), "child", XmlReader.Create(new StringReader(sb.ToString()))).Build(); - } - } -} diff --git a/src/ProtocolBuffers.Test/TextFormatTest.cs b/src/ProtocolBuffers.Test/TextFormatTest.cs deleted file mode 100644 index 37a4192..0000000 --- a/src/ProtocolBuffers.Test/TextFormatTest.cs +++ /dev/null @@ -1,586 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.IO; -using System.Text; -using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.Globalization; -using System.Threading; - -namespace Google.ProtocolBuffers -{ - [TestClass] - public class TextFormatTest - { - private static readonly string AllFieldsSetText = TestResources.text_format_unittest_data; - private static readonly string AllExtensionsSetText = TestResources.text_format_unittest_extensions_data; - - /// - /// Note that this is slightly different to the Java - 123.0 becomes 123, and 1.23E17 becomes 1.23E+17. - /// Both of these differences can be parsed by the Java and the C++, and we can parse their output too. - /// - private const string ExoticText = - "repeated_int32: -1\n" + - "repeated_int32: -2147483648\n" + - "repeated_int64: -1\n" + - "repeated_int64: -9223372036854775808\n" + - "repeated_uint32: 4294967295\n" + - "repeated_uint32: 2147483648\n" + - "repeated_uint64: 18446744073709551615\n" + - "repeated_uint64: 9223372036854775808\n" + - "repeated_double: 123\n" + - "repeated_double: 123.5\n" + - "repeated_double: 0.125\n" + - "repeated_double: 1.23E+17\n" + - "repeated_double: 1.235E+22\n" + - "repeated_double: 1.235E-18\n" + - "repeated_double: 123.456789\n" + - "repeated_double: Infinity\n" + - "repeated_double: -Infinity\n" + - "repeated_double: NaN\n" + - "repeated_string: \"\\000\\001\\a\\b\\f\\n\\r\\t\\v\\\\\\'\\\"" + - "\\341\\210\\264\"\n" + - "repeated_bytes: \"\\000\\001\\a\\b\\f\\n\\r\\t\\v\\\\\\'\\\"\\376\"\n"; - - private const string MessageSetText = - "[protobuf_unittest.TestMessageSetExtension1] {\n" + - " i: 123\n" + - "}\n" + - "[protobuf_unittest.TestMessageSetExtension2] {\n" + - " str: \"foo\"\n" + - "}\n"; - - /// - /// Print TestAllTypes and compare with golden file. - /// - [TestMethod] - public void PrintMessage() - { - TestUtil.TestInMultipleCultures(() => - { - string text = TextFormat.PrintToString(TestUtil.GetAllSet()); - Assert.AreEqual(AllFieldsSetText.Replace("\r\n", "\n").Trim(), - text.Replace("\r\n", "\n").Trim()); - }); - } - - /// - /// Tests that a builder prints the same way as a message. - /// - [TestMethod] - public void PrintBuilder() - { - TestUtil.TestInMultipleCultures(() => - { - string messageText = TextFormat.PrintToString(TestUtil.GetAllSet()); - string builderText = TextFormat.PrintToString(TestUtil.GetAllSet().ToBuilder()); - Assert.AreEqual(messageText, builderText); - }); - } - - /// - /// Print TestAllExtensions and compare with golden file. - /// - [TestMethod] - public void PrintExtensions() - { - string text = TextFormat.PrintToString(TestUtil.GetAllExtensionsSet()); - - Assert.AreEqual(AllExtensionsSetText.Replace("\r\n", "\n").Trim(), text.Replace("\r\n", "\n").Trim()); - } - - /// - /// Test printing of unknown fields in a message. - /// - [TestMethod] - public void PrintUnknownFields() - { - TestEmptyMessage message = - TestEmptyMessage.CreateBuilder() - .SetUnknownFields( - UnknownFieldSet.CreateBuilder() - .AddField(5, - UnknownField.CreateBuilder() - .AddVarint(1) - .AddFixed32(2) - .AddFixed64(3) - .AddLengthDelimited(ByteString.CopyFromUtf8("4")) - .AddGroup( - UnknownFieldSet.CreateBuilder() - .AddField(10, - UnknownField.CreateBuilder() - .AddVarint(5) - .Build()) - .Build()) - .Build()) - .AddField(8, - UnknownField.CreateBuilder() - .AddVarint(1) - .AddVarint(2) - .AddVarint(3) - .Build()) - .AddField(15, - UnknownField.CreateBuilder() - .AddVarint(0xABCDEF1234567890L) - .AddFixed32(0xABCD1234) - .AddFixed64(0xABCDEF1234567890L) - .Build()) - .Build()) - .Build(); - - Assert.AreEqual( - "5: 1\n" + - "5: 0x00000002\n" + - "5: 0x0000000000000003\n" + - "5: \"4\"\n" + - "5 {\n" + - " 10: 5\n" + - "}\n" + - "8: 1\n" + - "8: 2\n" + - "8: 3\n" + - "15: 12379813812177893520\n" + - "15: 0xabcd1234\n" + - "15: 0xabcdef1234567890\n", - TextFormat.PrintToString(message)); - } - - /// - /// Helper to construct a ByteString from a string containing only 8-bit - /// characters. The characters are converted directly to bytes, *not* - /// encoded using UTF-8. - /// - private static ByteString Bytes(string str) - { - byte[] bytes = new byte[str.Length]; - for (int i = 0; i < bytes.Length; i++) - bytes[i] = (byte)str[i]; - return ByteString.CopyFrom(bytes); - } - - [TestMethod] - public void PrintExotic() - { - IMessage message = TestAllTypes.CreateBuilder() - // Signed vs. unsigned numbers. - .AddRepeatedInt32(-1) - .AddRepeatedUint32(uint.MaxValue) - .AddRepeatedInt64(-1) - .AddRepeatedUint64(ulong.MaxValue) - .AddRepeatedInt32(1 << 31) - .AddRepeatedUint32(1U << 31) - .AddRepeatedInt64(1L << 63) - .AddRepeatedUint64(1UL << 63) - - // Floats of various precisions and exponents. - .AddRepeatedDouble(123) - .AddRepeatedDouble(123.5) - .AddRepeatedDouble(0.125) - .AddRepeatedDouble(123e15) - .AddRepeatedDouble(123.5e20) - .AddRepeatedDouble(123.5e-20) - .AddRepeatedDouble(123.456789) - .AddRepeatedDouble(Double.PositiveInfinity) - .AddRepeatedDouble(Double.NegativeInfinity) - .AddRepeatedDouble(Double.NaN) - - // Strings and bytes that needing escaping. - .AddRepeatedString("\0\u0001\u0007\b\f\n\r\t\v\\\'\"\u1234") - .AddRepeatedBytes(Bytes("\0\u0001\u0007\b\f\n\r\t\v\\\'\"\u00fe")) - .Build(); - - Assert.AreEqual(ExoticText, message.ToString()); - } - - [TestMethod] - public void PrintMessageSet() - { - TestMessageSet messageSet = - TestMessageSet.CreateBuilder() - .SetExtension( - TestMessageSetExtension1.MessageSetExtension, - TestMessageSetExtension1.CreateBuilder().SetI(123).Build()) - .SetExtension( - TestMessageSetExtension2.MessageSetExtension, - TestMessageSetExtension2.CreateBuilder().SetStr("foo").Build()) - .Build(); - - Assert.AreEqual(MessageSetText, messageSet.ToString()); - } - - // ================================================================= - - [TestMethod] - public void Parse() - { - TestUtil.TestInMultipleCultures(() => - { - TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); - TextFormat.Merge(AllFieldsSetText, builder); - TestUtil.AssertAllFieldsSet(builder.Build()); - }); - } - - [TestMethod] - public void ParseReader() - { - TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); - TextFormat.Merge(new StringReader(AllFieldsSetText), builder); - TestUtil.AssertAllFieldsSet(builder.Build()); - } - - [TestMethod] - public void ParseExtensions() - { - TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder(); - TextFormat.Merge(AllExtensionsSetText, - TestUtil.CreateExtensionRegistry(), - builder); - TestUtil.AssertAllExtensionsSet(builder.Build()); - } - - [TestMethod] - public void ParseCompatibility() - { - string original = "repeated_float: inf\n" + - "repeated_float: -inf\n" + - "repeated_float: nan\n" + - "repeated_float: inff\n" + - "repeated_float: -inff\n" + - "repeated_float: nanf\n" + - "repeated_float: 1.0f\n" + - "repeated_float: infinityf\n" + - "repeated_float: -Infinityf\n" + - "repeated_double: infinity\n" + - "repeated_double: -infinity\n" + - "repeated_double: nan\n"; - string canonical = "repeated_float: Infinity\n" + - "repeated_float: -Infinity\n" + - "repeated_float: NaN\n" + - "repeated_float: Infinity\n" + - "repeated_float: -Infinity\n" + - "repeated_float: NaN\n" + - "repeated_float: 1\n" + // Java has 1.0; this is fine - "repeated_float: Infinity\n" + - "repeated_float: -Infinity\n" + - "repeated_double: Infinity\n" + - "repeated_double: -Infinity\n" + - "repeated_double: NaN\n"; - TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); - TextFormat.Merge(original, builder); - Assert.AreEqual(canonical, builder.Build().ToString()); - } - - [TestMethod] - public void ParseExotic() - { - TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); - TextFormat.Merge(ExoticText, builder); - - // Too lazy to check things individually. Don't try to debug this - // if testPrintExotic() is Assert.Failing. - Assert.AreEqual(ExoticText, builder.Build().ToString()); - } - - [TestMethod] - public void ParseMessageSet() - { - ExtensionRegistry extensionRegistry = ExtensionRegistry.CreateInstance(); - extensionRegistry.Add(TestMessageSetExtension1.MessageSetExtension); - extensionRegistry.Add(TestMessageSetExtension2.MessageSetExtension); - - TestMessageSet.Builder builder = TestMessageSet.CreateBuilder(); - TextFormat.Merge(MessageSetText, extensionRegistry, builder); - TestMessageSet messageSet = builder.Build(); - - Assert.IsTrue(messageSet.HasExtension(TestMessageSetExtension1.MessageSetExtension)); - Assert.AreEqual(123, messageSet.GetExtension(TestMessageSetExtension1.MessageSetExtension).I); - Assert.IsTrue(messageSet.HasExtension(TestMessageSetExtension2.MessageSetExtension)); - Assert.AreEqual("foo", messageSet.GetExtension(TestMessageSetExtension2.MessageSetExtension).Str); - } - - [TestMethod] - public void ParseNumericEnum() - { - TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); - TextFormat.Merge("optional_nested_enum: 2", builder); - Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR, builder.OptionalNestedEnum); - } - - [TestMethod] - public void ParseAngleBrackets() - { - TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); - TextFormat.Merge("OptionalGroup: < a: 1 >", builder); - Assert.IsTrue(builder.HasOptionalGroup); - Assert.AreEqual(1, builder.OptionalGroup.A); - } - - [TestMethod] - public void ParseComment() - { - TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); - TextFormat.Merge( - "# this is a comment\n" + - "optional_int32: 1 # another comment\n" + - "optional_int64: 2\n" + - "# EOF comment", builder); - Assert.AreEqual(1, builder.OptionalInt32); - Assert.AreEqual(2, builder.OptionalInt64); - } - - - private static void AssertParseError(string error, string text) - { - TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); - try - { - TextFormat.Merge(text, TestUtil.CreateExtensionRegistry(), builder); - Assert.Fail("Expected parse exception."); - } - catch (FormatException e) - { - Assert.AreEqual(error, e.Message); - } - } - - [TestMethod] - public void ParseErrors() - { - AssertParseError( - "1:16: Expected \":\".", - "optional_int32 123"); - AssertParseError( - "1:23: Expected identifier.", - "optional_nested_enum: ?"); - AssertParseError( - "1:18: Couldn't parse integer: Number must be positive: -1", - "optional_uint32: -1"); - AssertParseError( - "1:17: Couldn't parse integer: Number out of range for 32-bit signed " + - "integer: 82301481290849012385230157", - "optional_int32: 82301481290849012385230157"); - AssertParseError( - "1:16: Expected \"true\" or \"false\".", - "optional_bool: maybe"); - AssertParseError( - "1:18: Expected string.", - "optional_string: 123"); - AssertParseError( - "1:18: String missing ending quote.", - "optional_string: \"ueoauaoe"); - AssertParseError( - "1:18: String missing ending quote.", - "optional_string: \"ueoauaoe\n" + - "optional_int32: 123"); - AssertParseError( - "1:18: Invalid escape sequence: '\\z'", - "optional_string: \"\\z\""); - AssertParseError( - "1:18: String missing ending quote.", - "optional_string: \"ueoauaoe\n" + - "optional_int32: 123"); - AssertParseError( - "1:2: Extension \"nosuchext\" not found in the ExtensionRegistry.", - "[nosuchext]: 123"); - AssertParseError( - "1:20: Extension \"protobuf_unittest.optional_int32_extension\" " + - "not found in the ExtensionRegistry.", - "[protobuf_unittest.optional_int32_extension]: 123"); - AssertParseError( - "1:1: Message type \"protobuf_unittest.TestAllTypes\" has no field " + - "named \"nosuchfield\".", - "nosuchfield: 123"); - AssertParseError( - "1:21: Expected \">\".", - "OptionalGroup < a: 1"); - AssertParseError( - "1:23: Enum type \"protobuf_unittest.TestAllTypes.NestedEnum\" has no " + - "value named \"NO_SUCH_VALUE\".", - "optional_nested_enum: NO_SUCH_VALUE"); - AssertParseError( - "1:23: Enum type \"protobuf_unittest.TestAllTypes.NestedEnum\" has no " + - "value with number 123.", - "optional_nested_enum: 123"); - - // Delimiters must match. - AssertParseError( - "1:22: Expected identifier.", - "OptionalGroup < a: 1 }"); - AssertParseError( - "1:22: Expected identifier.", - "OptionalGroup { a: 1 >"); - } - - // ================================================================= - - private static ByteString Bytes(params byte[] bytes) - { - return ByteString.CopyFrom(bytes); - } - - private delegate void FormattingAction(); - - private static void AssertFormatException(FormattingAction action) - { - try - { - action(); - Assert.Fail("Should have thrown an exception."); - } - catch (FormatException) - { - // success - } - } - - [TestMethod] - public void Escape() - { - // Escape sequences. - Assert.AreEqual("\\000\\001\\a\\b\\f\\n\\r\\t\\v\\\\\\'\\\"", - TextFormat.EscapeBytes(Bytes("\0\u0001\u0007\b\f\n\r\t\v\\\'\""))); - Assert.AreEqual("\\000\\001\\a\\b\\f\\n\\r\\t\\v\\\\\\'\\\"", - TextFormat.EscapeText("\0\u0001\u0007\b\f\n\r\t\v\\\'\"")); - Assert.AreEqual(Bytes("\0\u0001\u0007\b\f\n\r\t\v\\\'\""), - TextFormat.UnescapeBytes("\\000\\001\\a\\b\\f\\n\\r\\t\\v\\\\\\'\\\"")); - Assert.AreEqual("\0\u0001\u0007\b\f\n\r\t\v\\\'\"", - TextFormat.UnescapeText("\\000\\001\\a\\b\\f\\n\\r\\t\\v\\\\\\'\\\"")); - - // Unicode handling. - Assert.AreEqual("\\341\\210\\264", TextFormat.EscapeText("\u1234")); - Assert.AreEqual("\\341\\210\\264", TextFormat.EscapeBytes(Bytes(0xe1, 0x88, 0xb4))); - Assert.AreEqual("\u1234", TextFormat.UnescapeText("\\341\\210\\264")); - Assert.AreEqual(Bytes(0xe1, 0x88, 0xb4), TextFormat.UnescapeBytes("\\341\\210\\264")); - Assert.AreEqual("\u1234", TextFormat.UnescapeText("\\xe1\\x88\\xb4")); - Assert.AreEqual(Bytes(0xe1, 0x88, 0xb4), TextFormat.UnescapeBytes("\\xe1\\x88\\xb4")); - - // Errors. - AssertFormatException(() => TextFormat.UnescapeText("\\x")); - AssertFormatException(() => TextFormat.UnescapeText("\\z")); - AssertFormatException(() => TextFormat.UnescapeText("\\")); - } - - [TestMethod] - public void ParseInteger() - { - Assert.AreEqual(0, TextFormat.ParseInt32("0")); - Assert.AreEqual(1, TextFormat.ParseInt32("1")); - Assert.AreEqual(-1, TextFormat.ParseInt32("-1")); - Assert.AreEqual(12345, TextFormat.ParseInt32("12345")); - Assert.AreEqual(-12345, TextFormat.ParseInt32("-12345")); - Assert.AreEqual(2147483647, TextFormat.ParseInt32("2147483647")); - Assert.AreEqual(-2147483648, TextFormat.ParseInt32("-2147483648")); - - Assert.AreEqual(0u, TextFormat.ParseUInt32("0")); - Assert.AreEqual(1u, TextFormat.ParseUInt32("1")); - Assert.AreEqual(12345u, TextFormat.ParseUInt32("12345")); - Assert.AreEqual(2147483647u, TextFormat.ParseUInt32("2147483647")); - Assert.AreEqual(2147483648U, TextFormat.ParseUInt32("2147483648")); - Assert.AreEqual(4294967295U, TextFormat.ParseUInt32("4294967295")); - - Assert.AreEqual(0L, TextFormat.ParseInt64("0")); - Assert.AreEqual(1L, TextFormat.ParseInt64("1")); - Assert.AreEqual(-1L, TextFormat.ParseInt64("-1")); - Assert.AreEqual(12345L, TextFormat.ParseInt64("12345")); - Assert.AreEqual(-12345L, TextFormat.ParseInt64("-12345")); - Assert.AreEqual(2147483647L, TextFormat.ParseInt64("2147483647")); - Assert.AreEqual(-2147483648L, TextFormat.ParseInt64("-2147483648")); - Assert.AreEqual(4294967295L, TextFormat.ParseInt64("4294967295")); - Assert.AreEqual(4294967296L, TextFormat.ParseInt64("4294967296")); - Assert.AreEqual(9223372036854775807L, TextFormat.ParseInt64("9223372036854775807")); - Assert.AreEqual(-9223372036854775808L, TextFormat.ParseInt64("-9223372036854775808")); - - Assert.AreEqual(0uL, TextFormat.ParseUInt64("0")); - Assert.AreEqual(1uL, TextFormat.ParseUInt64("1")); - Assert.AreEqual(12345uL, TextFormat.ParseUInt64("12345")); - Assert.AreEqual(2147483647uL, TextFormat.ParseUInt64("2147483647")); - Assert.AreEqual(4294967295uL, TextFormat.ParseUInt64("4294967295")); - Assert.AreEqual(4294967296uL, TextFormat.ParseUInt64("4294967296")); - Assert.AreEqual(9223372036854775807UL, TextFormat.ParseUInt64("9223372036854775807")); - Assert.AreEqual(9223372036854775808UL, TextFormat.ParseUInt64("9223372036854775808")); - Assert.AreEqual(18446744073709551615UL, TextFormat.ParseUInt64("18446744073709551615")); - - // Hex - Assert.AreEqual(0x1234abcd, TextFormat.ParseInt32("0x1234abcd")); - Assert.AreEqual(-0x1234abcd, TextFormat.ParseInt32("-0x1234abcd")); - Assert.AreEqual(0xffffffffffffffffUL, TextFormat.ParseUInt64("0xffffffffffffffff")); - Assert.AreEqual(0x7fffffffffffffffL, - TextFormat.ParseInt64("0x7fffffffffffffff")); - - // Octal - Assert.AreEqual(342391, TextFormat.ParseInt32("01234567")); - - // Out-of-range - AssertFormatException(() => TextFormat.ParseInt32("2147483648")); - AssertFormatException(() => TextFormat.ParseInt32("-2147483649")); - AssertFormatException(() => TextFormat.ParseUInt32("4294967296")); - AssertFormatException(() => TextFormat.ParseUInt32("-1")); - AssertFormatException(() => TextFormat.ParseInt64("9223372036854775808")); - AssertFormatException(() => TextFormat.ParseInt64("-9223372036854775809")); - AssertFormatException(() => TextFormat.ParseUInt64("18446744073709551616")); - AssertFormatException(() => TextFormat.ParseUInt64("-1")); - AssertFormatException(() => TextFormat.ParseInt32("abcd")); - } - - [TestMethod] - public void ParseLongString() - { - string longText = - "123456789012345678901234567890123456789012345678901234567890" + - "123456789012345678901234567890123456789012345678901234567890" + - "123456789012345678901234567890123456789012345678901234567890" + - "123456789012345678901234567890123456789012345678901234567890" + - "123456789012345678901234567890123456789012345678901234567890" + - "123456789012345678901234567890123456789012345678901234567890" + - "123456789012345678901234567890123456789012345678901234567890" + - "123456789012345678901234567890123456789012345678901234567890" + - "123456789012345678901234567890123456789012345678901234567890" + - "123456789012345678901234567890123456789012345678901234567890" + - "123456789012345678901234567890123456789012345678901234567890" + - "123456789012345678901234567890123456789012345678901234567890" + - "123456789012345678901234567890123456789012345678901234567890" + - "123456789012345678901234567890123456789012345678901234567890" + - "123456789012345678901234567890123456789012345678901234567890" + - "123456789012345678901234567890123456789012345678901234567890"; - TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); - TextFormat.Merge("optional_string: \"" + longText + "\"", builder); - Assert.AreEqual(longText, builder.OptionalString); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/UnknownFieldSetTest.cs b/src/ProtocolBuffers.Test/UnknownFieldSetTest.cs deleted file mode 100644 index f9bfd84..0000000 --- a/src/ProtocolBuffers.Test/UnknownFieldSetTest.cs +++ /dev/null @@ -1,433 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using Google.ProtocolBuffers.Descriptors; -using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers -{ - [TestClass] - public class UnknownFieldSetTest - { - private MessageDescriptor descriptor; - private TestAllTypes allFields; - private ByteString allFieldsData; - - /// - /// An empty message that has been parsed from allFieldsData. So, it has - /// unknown fields of every type. - /// - private TestEmptyMessage emptyMessage; - - private UnknownFieldSet unknownFields; - - [TestInitialize] - public void SetUp() - { - descriptor = TestAllTypes.Descriptor; - allFields = TestUtil.GetAllSet(); - allFieldsData = allFields.ToByteString(); - emptyMessage = TestEmptyMessage.ParseFrom(allFieldsData); - unknownFields = emptyMessage.UnknownFields; - } - - private UnknownField GetField(String name) - { - FieldDescriptor field = descriptor.FindDescriptor(name); - Assert.IsNotNull(field); - return unknownFields.FieldDictionary[field.FieldNumber]; - } - - /// - /// Constructs a protocol buffer which contains fields with all the same - /// numbers as allFieldsData except that each field is some other wire - /// type. - /// - private ByteString GetBizarroData() - { - UnknownFieldSet.Builder bizarroFields = UnknownFieldSet.CreateBuilder(); - - UnknownField varintField = UnknownField.CreateBuilder().AddVarint(1).Build(); - UnknownField fixed32Field = UnknownField.CreateBuilder().AddFixed32(1).Build(); - - foreach (KeyValuePair entry in unknownFields.FieldDictionary) - { - if (entry.Value.VarintList.Count == 0) - { - // Original field is not a varint, so use a varint. - bizarroFields.AddField(entry.Key, varintField); - } - else - { - // Original field *is* a varint, so use something else. - bizarroFields.AddField(entry.Key, fixed32Field); - } - } - - return bizarroFields.Build().ToByteString(); - } - - // ================================================================= - - [TestMethod] - public void Varint() - { - UnknownField field = GetField("optional_int32"); - Assert.AreEqual(1, field.VarintList.Count); - Assert.AreEqual(allFields.OptionalInt32, (long) field.VarintList[0]); - } - - [TestMethod] - public void Fixed32() - { - UnknownField field = GetField("optional_fixed32"); - Assert.AreEqual(1, field.Fixed32List.Count); - Assert.AreEqual(allFields.OptionalFixed32, (int) field.Fixed32List[0]); - } - - [TestMethod] - public void Fixed64() - { - UnknownField field = GetField("optional_fixed64"); - Assert.AreEqual(1, field.Fixed64List.Count); - Assert.AreEqual((long)allFields.OptionalFixed64, (long)field.Fixed64List[0]); - } - - [TestMethod] - public void LengthDelimited() - { - UnknownField field = GetField("optional_bytes"); - Assert.AreEqual(1, field.LengthDelimitedList.Count); - Assert.AreEqual(allFields.OptionalBytes, field.LengthDelimitedList[0]); - } - - [TestMethod] - public void Group() - { - FieldDescriptor nestedFieldDescriptor = - TestAllTypes.Types.OptionalGroup.Descriptor.FindDescriptor("a"); - Assert.IsNotNull(nestedFieldDescriptor); - - UnknownField field = GetField("optionalgroup"); - Assert.AreEqual(1, field.GroupList.Count); - - UnknownFieldSet group = field.GroupList[0]; - Assert.AreEqual(1, group.FieldDictionary.Count); - Assert.IsTrue(group.HasField(nestedFieldDescriptor.FieldNumber)); - - UnknownField nestedField = group[nestedFieldDescriptor.FieldNumber]; - Assert.AreEqual(1, nestedField.VarintList.Count); - Assert.AreEqual(allFields.OptionalGroup.A, (long) nestedField.VarintList[0]); - } - - [TestMethod] - public void Serialize() - { - // Check that serializing the UnknownFieldSet produces the original data again. - ByteString data = emptyMessage.ToByteString(); - Assert.AreEqual(allFieldsData, data); - } - - [TestMethod] - public void CopyFrom() - { - TestEmptyMessage message = - TestEmptyMessage.CreateBuilder().MergeFrom(emptyMessage).Build(); - - Assert.AreEqual(emptyMessage.ToString(), message.ToString()); - } - - [TestMethod] - public void MergeFrom() - { - TestEmptyMessage source = - TestEmptyMessage.CreateBuilder() - .SetUnknownFields( - UnknownFieldSet.CreateBuilder() - .AddField(2, - UnknownField.CreateBuilder() - .AddVarint(2).Build()) - .AddField(3, - UnknownField.CreateBuilder() - .AddVarint(4).Build()) - .Build()) - .Build(); - TestEmptyMessage destination = - TestEmptyMessage.CreateBuilder() - .SetUnknownFields( - UnknownFieldSet.CreateBuilder() - .AddField(1, - UnknownField.CreateBuilder() - .AddVarint(1).Build()) - .AddField(3, - UnknownField.CreateBuilder() - .AddVarint(3).Build()) - .Build()) - .MergeFrom(source) - .Build(); - - Assert.AreEqual( - "1: 1\n" + - "2: 2\n" + - "3: 3\n" + - "3: 4\n", - destination.ToString()); - } - - [TestMethod] - public void Clear() - { - UnknownFieldSet fields = - UnknownFieldSet.CreateBuilder().MergeFrom(unknownFields).Clear().Build(); - Assert.AreEqual(0, fields.FieldDictionary.Count); - } - - [TestMethod] - public void ClearMessage() - { - TestEmptyMessage message = - TestEmptyMessage.CreateBuilder().MergeFrom(emptyMessage).Clear().Build(); - Assert.AreEqual(0, message.SerializedSize); - } - - [TestMethod] - public void ParseKnownAndUnknown() - { - // Test mixing known and unknown fields when parsing. - - UnknownFieldSet fields = - UnknownFieldSet.CreateBuilder(unknownFields) - .AddField(123456, - UnknownField.CreateBuilder().AddVarint(654321).Build()) - .Build(); - - ByteString data = fields.ToByteString(); - TestAllTypes destination = TestAllTypes.ParseFrom(data); - - TestUtil.AssertAllFieldsSet(destination); - Assert.AreEqual(1, destination.UnknownFields.FieldDictionary.Count); - - UnknownField field = destination.UnknownFields[123456]; - Assert.AreEqual(1, field.VarintList.Count); - Assert.AreEqual(654321, (long) field.VarintList[0]); - } - - [TestMethod] - public void WrongTypeTreatedAsUnknown() - { - // Test that fields of the wrong wire type are treated like unknown fields - // when parsing. - - ByteString bizarroData = GetBizarroData(); - TestAllTypes allTypesMessage = TestAllTypes.ParseFrom(bizarroData); - TestEmptyMessage emptyMessage = TestEmptyMessage.ParseFrom(bizarroData); - - // All fields should have been interpreted as unknown, so the debug strings - // should be the same. - Assert.AreEqual(emptyMessage.ToString(), allTypesMessage.ToString()); - } - - [TestMethod] - public void UnknownExtensions() - { - // Make sure fields are properly parsed to the UnknownFieldSet even when - // they are declared as extension numbers. - - TestEmptyMessageWithExtensions message = - TestEmptyMessageWithExtensions.ParseFrom(allFieldsData); - - Assert.AreEqual(unknownFields.FieldDictionary.Count, - message.UnknownFields.FieldDictionary.Count); - Assert.AreEqual(allFieldsData, message.ToByteString()); - } - - [TestMethod] - public void WrongExtensionTypeTreatedAsUnknown() - { - // Test that fields of the wrong wire type are treated like unknown fields - // when parsing extensions. - - ByteString bizarroData = GetBizarroData(); - TestAllExtensions allExtensionsMessage = TestAllExtensions.ParseFrom(bizarroData); - TestEmptyMessage emptyMessage = TestEmptyMessage.ParseFrom(bizarroData); - - // All fields should have been interpreted as unknown, so the debug strings - // should be the same. - Assert.AreEqual(emptyMessage.ToString(), - allExtensionsMessage.ToString()); - } - - [TestMethod] - public void ParseUnknownEnumValue() - { - FieldDescriptor singularField = - TestAllTypes.Descriptor.FindDescriptor("optional_nested_enum"); - FieldDescriptor repeatedField = - TestAllTypes.Descriptor.FindDescriptor("repeated_nested_enum"); - Assert.IsNotNull(singularField); - Assert.IsNotNull(repeatedField); - - ByteString data = - UnknownFieldSet.CreateBuilder() - .AddField(singularField.FieldNumber, - UnknownField.CreateBuilder() - .AddVarint((int) TestAllTypes.Types.NestedEnum.BAR) - .AddVarint(5) // not valid - .Build()) - .AddField(repeatedField.FieldNumber, - UnknownField.CreateBuilder() - .AddVarint((int) TestAllTypes.Types.NestedEnum.FOO) - .AddVarint(4) // not valid - .AddVarint((int) TestAllTypes.Types.NestedEnum.BAZ) - .AddVarint(6) // not valid - .Build()) - .Build() - .ToByteString(); - - { - TestAllTypes message = TestAllTypes.ParseFrom(data); - Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR, - message.OptionalNestedEnum); - TestUtil.AssertEqual(new[] {TestAllTypes.Types.NestedEnum.FOO, TestAllTypes.Types.NestedEnum.BAZ}, - message.RepeatedNestedEnumList); - TestUtil.AssertEqual(new[] {5UL}, message.UnknownFields[singularField.FieldNumber].VarintList); - TestUtil.AssertEqual(new[] {4UL, 6UL}, message.UnknownFields[repeatedField.FieldNumber].VarintList); - } - - { - TestAllExtensions message = - TestAllExtensions.ParseFrom(data, TestUtil.CreateExtensionRegistry()); - Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR, - message.GetExtension(UnitTestProtoFile.OptionalNestedEnumExtension)); - TestUtil.AssertEqual(new[] {TestAllTypes.Types.NestedEnum.FOO, TestAllTypes.Types.NestedEnum.BAZ}, - message.GetExtension(UnitTestProtoFile.RepeatedNestedEnumExtension)); - TestUtil.AssertEqual(new[] {5UL}, message.UnknownFields[singularField.FieldNumber].VarintList); - TestUtil.AssertEqual(new[] {4UL, 6UL}, message.UnknownFields[repeatedField.FieldNumber].VarintList); - } - } - - [TestMethod] - public void LargeVarint() - { - ByteString data = - UnknownFieldSet.CreateBuilder() - .AddField(1, - UnknownField.CreateBuilder() - .AddVarint(0x7FFFFFFFFFFFFFFFL) - .Build()) - .Build() - .ToByteString(); - UnknownFieldSet parsed = UnknownFieldSet.ParseFrom(data); - UnknownField field = parsed[1]; - Assert.AreEqual(1, field.VarintList.Count); - Assert.AreEqual(0x7FFFFFFFFFFFFFFFUL, field.VarintList[0]); - } - - [TestMethod] - public void EqualsAndHashCode() - { - UnknownField fixed32Field = UnknownField.CreateBuilder().AddFixed32(1).Build(); - UnknownField fixed64Field = UnknownField.CreateBuilder().AddFixed64(1).Build(); - UnknownField varIntField = UnknownField.CreateBuilder().AddVarint(1).Build(); - UnknownField lengthDelimitedField = - UnknownField.CreateBuilder().AddLengthDelimited(ByteString.Empty).Build(); - UnknownField groupField = UnknownField.CreateBuilder().AddGroup(unknownFields).Build(); - - UnknownFieldSet a = UnknownFieldSet.CreateBuilder().AddField(1, fixed32Field).Build(); - UnknownFieldSet b = UnknownFieldSet.CreateBuilder().AddField(1, fixed64Field).Build(); - UnknownFieldSet c = UnknownFieldSet.CreateBuilder().AddField(1, varIntField).Build(); - UnknownFieldSet d = UnknownFieldSet.CreateBuilder().AddField(1, lengthDelimitedField).Build(); - UnknownFieldSet e = UnknownFieldSet.CreateBuilder().AddField(1, groupField).Build(); - - CheckEqualsIsConsistent(a); - CheckEqualsIsConsistent(b); - CheckEqualsIsConsistent(c); - CheckEqualsIsConsistent(d); - CheckEqualsIsConsistent(e); - - CheckNotEqual(a, b); - CheckNotEqual(a, c); - CheckNotEqual(a, d); - CheckNotEqual(a, e); - CheckNotEqual(b, c); - CheckNotEqual(b, d); - CheckNotEqual(b, e); - CheckNotEqual(c, d); - CheckNotEqual(c, e); - CheckNotEqual(d, e); - } - - /// - /// Asserts that the given field sets are not equal and have different - /// hash codes. - /// - /// - /// It's valid for non-equal objects to have the same hash code, so - /// this test is stricter than it needs to be. However, this should happen - /// relatively rarely. - /// - /// - /// - private static void CheckNotEqual(UnknownFieldSet s1, UnknownFieldSet s2) - { - String equalsError = string.Format("{0} should not be equal to {1}", s1, s2); - Assert.IsFalse(s1.Equals(s2), equalsError); - Assert.IsFalse(s2.Equals(s1), equalsError); - - Assert.IsFalse(s1.GetHashCode() == s2.GetHashCode(), - string.Format("{0} should have a different hash code from {1}", s1, s2)); - } - - /** - * Asserts that the given field sets are equal and have identical hash codes. - */ - - private static void CheckEqualsIsConsistent(UnknownFieldSet set) - { - // Object should be equal to itself. - Assert.AreEqual(set, set); - - // Object should be equal to a copy of itself. - UnknownFieldSet copy = UnknownFieldSet.CreateBuilder(set).Build(); - Assert.AreEqual(set, copy); - Assert.AreEqual(copy, set); - Assert.AreEqual(set.GetHashCode(), copy.GetHashCode()); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/WireFormatTest.cs b/src/ProtocolBuffers.Test/WireFormatTest.cs deleted file mode 100644 index 2e2c077..0000000 --- a/src/ProtocolBuffers.Test/WireFormatTest.cs +++ /dev/null @@ -1,312 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System.IO; -using System.Reflection; -using Google.ProtocolBuffers.Descriptors; -using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers -{ - [TestClass] - public class WireFormatTest - { - /// - /// Keeps the attributes on FieldType and the switch statement in WireFormat in sync. - /// - [TestMethod] - public void FieldTypeToWireTypeMapping() - { - foreach (FieldInfo field in typeof(FieldType).GetFields(BindingFlags.Static | BindingFlags.Public)) - { - FieldType fieldType = (FieldType) field.GetValue(null); - FieldMappingAttribute mapping = - (FieldMappingAttribute) field.GetCustomAttributes(typeof(FieldMappingAttribute), false)[0]; - Assert.AreEqual(mapping.WireType, WireFormat.GetWireType(fieldType)); - } - } - - [TestMethod] - public void Serialization() - { - TestAllTypes message = TestUtil.GetAllSet(); - - ByteString rawBytes = message.ToByteString(); - Assert.AreEqual(rawBytes.Length, message.SerializedSize); - - TestAllTypes message2 = TestAllTypes.ParseFrom(rawBytes); - - TestUtil.AssertAllFieldsSet(message2); - } - - [TestMethod] - public void SerializationPacked() - { - TestPackedTypes message = TestUtil.GetPackedSet(); - ByteString rawBytes = message.ToByteString(); - Assert.AreEqual(rawBytes.Length, message.SerializedSize); - TestPackedTypes message2 = TestPackedTypes.ParseFrom(rawBytes); - TestUtil.AssertPackedFieldsSet(message2); - } - - [TestMethod] - public void SerializeExtensions() - { - // TestAllTypes and TestAllExtensions should have compatible wire formats, - // so if we serialize a TestAllExtensions then parse it as TestAllTypes - // it should work. - TestAllExtensions message = TestUtil.GetAllExtensionsSet(); - ByteString rawBytes = message.ToByteString(); - Assert.AreEqual(rawBytes.Length, message.SerializedSize); - - TestAllTypes message2 = TestAllTypes.ParseFrom(rawBytes); - - TestUtil.AssertAllFieldsSet(message2); - } - - [TestMethod] - public void SerializePackedExtensions() - { - // TestPackedTypes and TestPackedExtensions should have compatible wire - // formats; check that they serialize to the same string. - TestPackedExtensions message = TestUtil.GetPackedExtensionsSet(); - ByteString rawBytes = message.ToByteString(); - - TestPackedTypes message2 = TestUtil.GetPackedSet(); - ByteString rawBytes2 = message2.ToByteString(); - - Assert.AreEqual(rawBytes, rawBytes2); - } - - [TestMethod] - public void SerializeDelimited() - { - MemoryStream stream = new MemoryStream(); - TestUtil.GetAllSet().WriteDelimitedTo(stream); - stream.WriteByte(12); - TestUtil.GetPackedSet().WriteDelimitedTo(stream); - stream.WriteByte(34); - - stream.Position = 0; - - TestUtil.AssertAllFieldsSet(TestAllTypes.ParseDelimitedFrom(stream)); - Assert.AreEqual(12, stream.ReadByte()); - TestUtil.AssertPackedFieldsSet(TestPackedTypes.ParseDelimitedFrom(stream)); - Assert.AreEqual(34, stream.ReadByte()); - Assert.AreEqual(-1, stream.ReadByte()); - } - - [TestMethod] - public void ParseExtensions() - { - // TestAllTypes and TestAllExtensions should have compatible wire formats, - // so if we serealize a TestAllTypes then parse it as TestAllExtensions - // it should work. - - TestAllTypes message = TestUtil.GetAllSet(); - ByteString rawBytes = message.ToByteString(); - - ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); - TestUtil.RegisterAllExtensions(registry); - registry = registry.AsReadOnly(); - - TestAllExtensions message2 = TestAllExtensions.ParseFrom(rawBytes, registry); - - TestUtil.AssertAllExtensionsSet(message2); - } - - [TestMethod] - public void ParsePackedExtensions() - { - // Ensure that packed extensions can be properly parsed. - TestPackedExtensions message = TestUtil.GetPackedExtensionsSet(); - ByteString rawBytes = message.ToByteString(); - - ExtensionRegistry registry = TestUtil.CreateExtensionRegistry(); - - TestPackedExtensions message2 = TestPackedExtensions.ParseFrom(rawBytes, registry); - TestUtil.AssertPackedExtensionsSet(message2); - } - - [TestMethod] - public void ExtensionsSerializedSize() - { - Assert.AreEqual(TestUtil.GetAllSet().SerializedSize, TestUtil.GetAllExtensionsSet().SerializedSize); - } - - private static void AssertFieldsInOrder(ByteString data) - { - CodedInputStream input = data.CreateCodedInput(); - uint previousTag = 0; - - uint tag; - string name; - while (input.ReadTag(out tag, out name)) - { - Assert.IsTrue(tag > previousTag); - previousTag = tag; - input.SkipField(); - } - } - - [TestMethod] - public void InterleavedFieldsAndExtensions() - { - // Tests that fields are written in order even when extension ranges - // are interleaved with field numbers. - ByteString data = - TestFieldOrderings.CreateBuilder() - .SetMyInt(1) - .SetMyString("foo") - .SetMyFloat(1.0F) - .SetExtension(UnitTestProtoFile.MyExtensionInt, 23) - .SetExtension(UnitTestProtoFile.MyExtensionString, "bar") - .Build().ToByteString(); - AssertFieldsInOrder(data); - - MessageDescriptor descriptor = TestFieldOrderings.Descriptor; - ByteString dynamic_data = - DynamicMessage.CreateBuilder(TestFieldOrderings.Descriptor) - .SetField(descriptor.FindDescriptor("my_int"), 1L) - .SetField(descriptor.FindDescriptor("my_string"), "foo") - .SetField(descriptor.FindDescriptor("my_float"), 1.0F) - .SetField(UnitTestProtoFile.MyExtensionInt.Descriptor, 23) - .SetField(UnitTestProtoFile.MyExtensionString.Descriptor, "bar") - .WeakBuild().ToByteString(); - AssertFieldsInOrder(dynamic_data); - } - - private const int UnknownTypeId = 1550055; - private static readonly int TypeId1 = TestMessageSetExtension1.Descriptor.Extensions[0].FieldNumber; - private static readonly int TypeId2 = TestMessageSetExtension2.Descriptor.Extensions[0].FieldNumber; - - [TestMethod] - public void SerializeMessageSet() - { - // Set up a TestMessageSet with two known messages and an unknown one. - TestMessageSet messageSet = - TestMessageSet.CreateBuilder() - .SetExtension( - TestMessageSetExtension1.MessageSetExtension, - TestMessageSetExtension1.CreateBuilder().SetI(123).Build()) - .SetExtension( - TestMessageSetExtension2.MessageSetExtension, - TestMessageSetExtension2.CreateBuilder().SetStr("foo").Build()) - .SetUnknownFields( - UnknownFieldSet.CreateBuilder() - .AddField(UnknownTypeId, - UnknownField.CreateBuilder() - .AddLengthDelimited(ByteString.CopyFromUtf8("bar")) - .Build()) - .Build()) - .Build(); - - ByteString data = messageSet.ToByteString(); - - // Parse back using RawMessageSet and check the contents. - RawMessageSet raw = RawMessageSet.ParseFrom(data); - - Assert.AreEqual(0, raw.UnknownFields.FieldDictionary.Count); - - Assert.AreEqual(3, raw.ItemCount); - Assert.AreEqual(TypeId1, raw.ItemList[0].TypeId); - Assert.AreEqual(TypeId2, raw.ItemList[1].TypeId); - Assert.AreEqual(UnknownTypeId, raw.ItemList[2].TypeId); - - TestMessageSetExtension1 message1 = TestMessageSetExtension1.ParseFrom(raw.GetItem(0).Message.ToByteArray()); - Assert.AreEqual(123, message1.I); - - TestMessageSetExtension2 message2 = TestMessageSetExtension2.ParseFrom(raw.GetItem(1).Message.ToByteArray()); - Assert.AreEqual("foo", message2.Str); - - Assert.AreEqual("bar", raw.GetItem(2).Message.ToStringUtf8()); - } - - [TestMethod] - public void ParseMessageSet() - { - ExtensionRegistry extensionRegistry = ExtensionRegistry.CreateInstance(); - extensionRegistry.Add(TestMessageSetExtension1.MessageSetExtension); - extensionRegistry.Add(TestMessageSetExtension2.MessageSetExtension); - - // Set up a RawMessageSet with two known messages and an unknown one. - RawMessageSet raw = - RawMessageSet.CreateBuilder() - .AddItem( - RawMessageSet.Types.Item.CreateBuilder() - .SetTypeId(TypeId1) - .SetMessage( - TestMessageSetExtension1.CreateBuilder() - .SetI(123) - .Build().ToByteString()) - .Build()) - .AddItem( - RawMessageSet.Types.Item.CreateBuilder() - .SetTypeId(TypeId2) - .SetMessage( - TestMessageSetExtension2.CreateBuilder() - .SetStr("foo") - .Build().ToByteString()) - .Build()) - .AddItem( - RawMessageSet.Types.Item.CreateBuilder() - .SetTypeId(UnknownTypeId) - .SetMessage(ByteString.CopyFromUtf8("bar")) - .Build()) - .Build(); - - ByteString data = raw.ToByteString(); - - // Parse as a TestMessageSet and check the contents. - TestMessageSet messageSet = - TestMessageSet.ParseFrom(data, extensionRegistry); - - Assert.AreEqual(123, messageSet.GetExtension(TestMessageSetExtension1.MessageSetExtension).I); - Assert.AreEqual("foo", messageSet.GetExtension(TestMessageSetExtension2.MessageSetExtension).Str); - - // Check for unknown field with type LENGTH_DELIMITED, - // number UNKNOWN_TYPE_ID, and contents "bar". - UnknownFieldSet unknownFields = messageSet.UnknownFields; - Assert.AreEqual(1, unknownFields.FieldDictionary.Count); - Assert.IsTrue(unknownFields.HasField(UnknownTypeId)); - - UnknownField field = unknownFields[UnknownTypeId]; - Assert.AreEqual(1, field.LengthDelimitedList.Count); - Assert.AreEqual("bar", field.LengthDelimitedList[0].ToStringUtf8()); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers.sln b/src/ProtocolBuffers.sln deleted file mode 100644 index 7741777..0000000 --- a/src/ProtocolBuffers.sln +++ /dev/null @@ -1,215 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "proto", "proto", "{1F896D5C-5FC2-4671-9216-781CB8187EC7}" - ProjectSection(SolutionItems) = preProject - ..\protos\tutorial\addressbook.proto = ..\protos\tutorial\addressbook.proto - ..\protos\google\protobuf\csharp_options.proto = ..\protos\google\protobuf\csharp_options.proto - ..\protos\google\protobuf\descriptor.proto = ..\protos\google\protobuf\descriptor.proto - ..\protos\google\protobuf\compiler\plugin.proto = ..\protos\google\protobuf\compiler\plugin.proto - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "unittest", "unittest", "{C8D3015A-EA39-4F03-AEEC-3FF1F2087A12}" - ProjectSection(SolutionItems) = preProject - ..\protos\google\test\google_size.proto = ..\protos\google\test\google_size.proto - ..\protos\google\test\google_speed.proto = ..\protos\google\test\google_speed.proto - ..\protos\google\protobuf\unittest.proto = ..\protos\google\protobuf\unittest.proto - ..\protos\google\protobuf\unittest_csharp_options.proto = ..\protos\google\protobuf\unittest_csharp_options.proto - ..\protos\google\protobuf\unittest_custom_options.proto = ..\protos\google\protobuf\unittest_custom_options.proto - ..\protos\google\protobuf\unittest_embed_optimize_for.proto = ..\protos\google\protobuf\unittest_embed_optimize_for.proto - ..\protos\google\protobuf\unittest_empty.proto = ..\protos\google\protobuf\unittest_empty.proto - ..\protos\google\protobuf\unittest_enormous_descriptor.proto = ..\protos\google\protobuf\unittest_enormous_descriptor.proto - ..\protos\extest\unittest_extras.proto = ..\protos\extest\unittest_extras.proto - ..\protos\extest\unittest_extras_full.proto = ..\protos\extest\unittest_extras_full.proto - ..\protos\extest\unittest_extras_lite.proto = ..\protos\extest\unittest_extras_lite.proto - ..\protos\extest\unittest_extras_xmltest.proto = ..\protos\extest\unittest_extras_xmltest.proto - ..\protos\extest\unittest_generic_services.proto = ..\protos\extest\unittest_generic_services.proto - ..\protos\google\protobuf\unittest_import.proto = ..\protos\google\protobuf\unittest_import.proto - ..\protos\google\protobuf\unittest_import_lite.proto = ..\protos\google\protobuf\unittest_import_lite.proto - ..\protos\extest\unittest_issues.proto = ..\protos\extest\unittest_issues.proto - ..\protos\google\protobuf\unittest_lite.proto = ..\protos\google\protobuf\unittest_lite.proto - ..\protos\google\protobuf\unittest_lite_imports_nonlite.proto = ..\protos\google\protobuf\unittest_lite_imports_nonlite.proto - ..\protos\google\protobuf\unittest_mset.proto = ..\protos\google\protobuf\unittest_mset.proto - ..\protos\google\protobuf\unittest_no_generic_services.proto = ..\protos\google\protobuf\unittest_no_generic_services.proto - ..\protos\google\protobuf\unittest_optimize_for.proto = ..\protos\google\protobuf\unittest_optimize_for.proto - ..\protos\extest\unittest_rpc_interop.proto = ..\protos\extest\unittest_rpc_interop.proto - ..\protos\extest\unittest_rpc_interop_lite.proto = ..\protos\extest\unittest_rpc_interop_lite.proto - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers", "ProtocolBuffers\ProtocolBuffers.csproj", "{6908BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Test", "ProtocolBuffers.Test\ProtocolBuffers.Test.csproj", "{DD01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtoGen", "ProtoGen\ProtoGen.csproj", "{250ADE34-82FD-4BAE-86D5-985FBE589C4A}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtoGen.Test", "ProtoGen.Test\ProtoGen.Test.csproj", "{C268DA4C-4004-47DA-AF23-44C983281A68}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AddressBook", "AddressBook\AddressBook.csproj", "{A31F5FB2-4FF3-432A-B35B-5CD203606311}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtoMunge", "ProtoMunge\ProtoMunge.csproj", "{8F09AF72-3327-4FA7-BC09-070B80221AB9}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtoBench", "ProtoBench\ProtoBench.csproj", "{C7A4A435-2813-41C8-AA87-BD914BA5223D}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtoDump", "ProtoDump\ProtoDump.csproj", "{D7282E99-2DC3-405B-946F-177DB2FD2AE2}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite", "ProtocolBuffers\ProtocolBuffersLite.csproj", "{6969BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLite.Test.csproj", "{EE01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLiteMixed.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLiteMixed.Test.csproj", "{EEFFED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{66ED1950-AD27-42D7-88F8-94355AEC8225}" - ProjectSection(SolutionItems) = preProject - ..\build\build.bat = ..\build\build.bat - ..\build\build.csproj = ..\build\build.csproj - ..\build\BuildAll.bat = ..\build\BuildAll.bat - ..\build\Common.targets = ..\build\Common.targets - ..\build\GenerateProjects.bat = ..\build\GenerateProjects.bat - ..\build\GenerateSource.bat = ..\build\GenerateSource.bat - ..\build\Google.ProtocolBuffers.nuspec = ..\build\Google.ProtocolBuffers.nuspec - ..\build\Google.ProtocolBuffersLite.nuspec = ..\build\Google.ProtocolBuffersLite.nuspec - ..\build\publish.csproj = ..\build\publish.csproj - ..\build\PublishTool.bat = ..\build\PublishTool.bat - ..\build\RunBenchmarks.bat = ..\build\RunBenchmarks.bat - ..\build\target.csproj = ..\build\target.csproj - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffers.Serialization.csproj", "{231391AF-449C-4A39-986C-AD7F270F4750}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffersLite.Serialization.csproj", "{E067A59D-9D0A-4A1F-92B1-38E4457241D1}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{0D7CDA8F-1BBF-4E0F-8D35-31AEA21A96E6}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{C7B69674-7A51-4AC6-8674-0330BA742CE4}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{75D5D25A-01A6-4594-957F-5993FB83F450}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "benchmarks", "benchmarks", "{FA9F5250-FDDC-48B8-832E-96E0464A02E6}" - ProjectSection(SolutionItems) = preProject - ..\protos\benchmarks\google_size.proto = ..\protos\benchmarks\google_size.proto - ..\protos\benchmarks\google_speed.proto = ..\protos\benchmarks\google_speed.proto - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "protoc-gen-cs", "ProtoGen\protoc-gen-cs.csproj", "{250ADE34-82FD-4BAE-86D5-985FBE589C4B}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "protoc-gen-cs.Test", "ProtoGen.Test\protoc-gen-cs.Test.csproj", "{C1024C9C-8176-48C3-B547-B9F6DF6B80A6}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug_Silverlight|Any CPU = Debug_Silverlight|Any CPU - Debug|Any CPU = Debug|Any CPU - Release_Silverlight|Any CPU = Release_Silverlight|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU - {250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU - {250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Release|Any CPU.Build.0 = Release|Any CPU - {C268DA4C-4004-47DA-AF23-44C983281A68}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU - {C268DA4C-4004-47DA-AF23-44C983281A68}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C268DA4C-4004-47DA-AF23-44C983281A68}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C268DA4C-4004-47DA-AF23-44C983281A68}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU - {C268DA4C-4004-47DA-AF23-44C983281A68}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C268DA4C-4004-47DA-AF23-44C983281A68}.Release|Any CPU.Build.0 = Release|Any CPU - {A31F5FB2-4FF3-432A-B35B-5CD203606311}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU - {A31F5FB2-4FF3-432A-B35B-5CD203606311}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A31F5FB2-4FF3-432A-B35B-5CD203606311}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A31F5FB2-4FF3-432A-B35B-5CD203606311}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU - {A31F5FB2-4FF3-432A-B35B-5CD203606311}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A31F5FB2-4FF3-432A-B35B-5CD203606311}.Release|Any CPU.Build.0 = Release|Any CPU - {8F09AF72-3327-4FA7-BC09-070B80221AB9}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU - {8F09AF72-3327-4FA7-BC09-070B80221AB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8F09AF72-3327-4FA7-BC09-070B80221AB9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8F09AF72-3327-4FA7-BC09-070B80221AB9}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU - {8F09AF72-3327-4FA7-BC09-070B80221AB9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8F09AF72-3327-4FA7-BC09-070B80221AB9}.Release|Any CPU.Build.0 = Release|Any CPU - {C7A4A435-2813-41C8-AA87-BD914BA5223D}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU - {C7A4A435-2813-41C8-AA87-BD914BA5223D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C7A4A435-2813-41C8-AA87-BD914BA5223D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C7A4A435-2813-41C8-AA87-BD914BA5223D}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU - {C7A4A435-2813-41C8-AA87-BD914BA5223D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C7A4A435-2813-41C8-AA87-BD914BA5223D}.Release|Any CPU.Build.0 = Release|Any CPU - {D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU - {D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU - {D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Release|Any CPU.Build.0 = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.Build.0 = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.ActiveCfg = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.Build.0 = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.Build.0 = Release|Any CPU - {250ADE34-82FD-4BAE-86D5-985FBE589C4B}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU - {250ADE34-82FD-4BAE-86D5-985FBE589C4B}.Debug_Silverlight|Any CPU.Build.0 = Debug|Any CPU - {250ADE34-82FD-4BAE-86D5-985FBE589C4B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {250ADE34-82FD-4BAE-86D5-985FBE589C4B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {250ADE34-82FD-4BAE-86D5-985FBE589C4B}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU - {250ADE34-82FD-4BAE-86D5-985FBE589C4B}.Release_Silverlight|Any CPU.Build.0 = Release|Any CPU - {250ADE34-82FD-4BAE-86D5-985FBE589C4B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {250ADE34-82FD-4BAE-86D5-985FBE589C4B}.Release|Any CPU.Build.0 = Release|Any CPU - {C1024C9C-8176-48C3-B547-B9F6DF6B80A6}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU - {C1024C9C-8176-48C3-B547-B9F6DF6B80A6}.Debug_Silverlight|Any CPU.Build.0 = Debug|Any CPU - {C1024C9C-8176-48C3-B547-B9F6DF6B80A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C1024C9C-8176-48C3-B547-B9F6DF6B80A6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C1024C9C-8176-48C3-B547-B9F6DF6B80A6}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU - {C1024C9C-8176-48C3-B547-B9F6DF6B80A6}.Release_Silverlight|Any CPU.Build.0 = Release|Any CPU - {C1024C9C-8176-48C3-B547-B9F6DF6B80A6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C1024C9C-8176-48C3-B547-B9F6DF6B80A6}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {C8D3015A-EA39-4F03-AEEC-3FF1F2087A12} = {1F896D5C-5FC2-4671-9216-781CB8187EC7} - {FA9F5250-FDDC-48B8-832E-96E0464A02E6} = {1F896D5C-5FC2-4671-9216-781CB8187EC7} - {C268DA4C-4004-47DA-AF23-44C983281A68} = {C7B69674-7A51-4AC6-8674-0330BA742CE4} - {EE01ED24-3750-4567-9A23-1DB676A15610} = {C7B69674-7A51-4AC6-8674-0330BA742CE4} - {EEFFED24-3750-4567-9A23-1DB676A15610} = {C7B69674-7A51-4AC6-8674-0330BA742CE4} - {DD01ED24-3750-4567-9A23-1DB676A15610} = {C7B69674-7A51-4AC6-8674-0330BA742CE4} - {C1024C9C-8176-48C3-B547-B9F6DF6B80A6} = {C7B69674-7A51-4AC6-8674-0330BA742CE4} - {A31F5FB2-4FF3-432A-B35B-5CD203606311} = {75D5D25A-01A6-4594-957F-5993FB83F450} - {C7A4A435-2813-41C8-AA87-BD914BA5223D} = {0D7CDA8F-1BBF-4E0F-8D35-31AEA21A96E6} - {D7282E99-2DC3-405B-946F-177DB2FD2AE2} = {0D7CDA8F-1BBF-4E0F-8D35-31AEA21A96E6} - {8F09AF72-3327-4FA7-BC09-070B80221AB9} = {0D7CDA8F-1BBF-4E0F-8D35-31AEA21A96E6} - EndGlobalSection -EndGlobal diff --git a/src/ProtocolBuffers/AbstractBuilder.cs b/src/ProtocolBuffers/AbstractBuilder.cs deleted file mode 100644 index e7a41fb..0000000 --- a/src/ProtocolBuffers/AbstractBuilder.cs +++ /dev/null @@ -1,266 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections; -using System.Collections.Generic; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers -{ - /// - /// Implementation of the non-generic IMessage interface as far as possible. - /// - public abstract partial class AbstractBuilder : AbstractBuilderLite, - IBuilder - where TMessage : AbstractMessage - where TBuilder : AbstractBuilder - { - #region Unimplemented members of IBuilder - - public abstract UnknownFieldSet UnknownFields { get; set; } - public abstract IDictionary AllFields { get; } - public abstract object this[FieldDescriptor field] { get; set; } - public abstract MessageDescriptor DescriptorForType { get; } - public abstract int GetRepeatedFieldCount(FieldDescriptor field); - public abstract object this[FieldDescriptor field, int index] { get; set; } - public abstract bool HasField(FieldDescriptor field); - public abstract IBuilder CreateBuilderForField(FieldDescriptor field); - public abstract TBuilder ClearField(FieldDescriptor field); - public abstract TBuilder AddRepeatedField(FieldDescriptor field, object value); - - #endregion - - public TBuilder SetUnknownFields(UnknownFieldSet fields) - { - UnknownFields = fields; - return ThisBuilder; - } - - public override TBuilder Clear() - { - foreach (FieldDescriptor field in AllFields.Keys) - { - ClearField(field); - } - return ThisBuilder; - } - - public override sealed TBuilder MergeFrom(IMessageLite other) - { - if (other is IMessage) - { - return MergeFrom((IMessage) other); - } - throw new ArgumentException("MergeFrom(Message) can only merge messages of the same type."); - } - - /// - /// Merge the specified other message into the message being - /// built. Merging occurs as follows. For each field: - /// For singular primitive fields, if the field is set in , - /// then 's value overwrites the value in this message. - /// For singular message fields, if the field is set in , - /// it is merged into the corresponding sub-message of this message using the same - /// merging rules. - /// For repeated fields, the elements in are concatenated - /// with the elements in this message. - /// - /// - /// - public abstract TBuilder MergeFrom(TMessage other); - - public virtual TBuilder MergeFrom(IMessage other) - { - if (other.DescriptorForType != DescriptorForType) - { - throw new ArgumentException("MergeFrom(IMessage) can only merge messages of the same type."); - } - - // Note: We don't attempt to verify that other's fields have valid - // types. Doing so would be a losing battle. We'd have to verify - // all sub-messages as well, and we'd have to make copies of all of - // them to insure that they don't change after verification (since - // the Message interface itself cannot enforce immutability of - // implementations). - // TODO(jonskeet): Provide a function somewhere called MakeDeepCopy() - // which allows people to make secure deep copies of messages. - foreach (KeyValuePair entry in other.AllFields) - { - FieldDescriptor field = entry.Key; - if (field.IsRepeated) - { - // Concatenate repeated fields - foreach (object element in (IEnumerable) entry.Value) - { - AddRepeatedField(field, element); - } - } - else if (field.MappedType == MappedType.Message) - { - // Merge singular messages - IMessageLite existingValue = (IMessageLite) this[field]; - if (existingValue == existingValue.WeakDefaultInstanceForType) - { - this[field] = entry.Value; - } - else - { - this[field] = existingValue.WeakCreateBuilderForType() - .WeakMergeFrom(existingValue) - .WeakMergeFrom((IMessageLite) entry.Value) - .WeakBuild(); - } - } - else - { - // Overwrite simple values - this[field] = entry.Value; - } - } - - //Fix for unknown fields not merging, see java's AbstractMessage.Builder line 236 - MergeUnknownFields(other.UnknownFields); - - return ThisBuilder; - } - - public override TBuilder MergeFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry) - { - UnknownFieldSet.Builder unknownFields = UnknownFieldSet.CreateBuilder(UnknownFields); - unknownFields.MergeFrom(input, extensionRegistry, this); - UnknownFields = unknownFields.Build(); - return ThisBuilder; - } - - public virtual TBuilder MergeUnknownFields(UnknownFieldSet unknownFields) - { - UnknownFields = UnknownFieldSet.CreateBuilder(UnknownFields) - .MergeFrom(unknownFields) - .Build(); - return ThisBuilder; - } - - public virtual IBuilder SetField(FieldDescriptor field, object value) - { - this[field] = value; - return ThisBuilder; - } - - public virtual IBuilder SetRepeatedField(FieldDescriptor field, int index, object value) - { - this[field, index] = value; - return ThisBuilder; - } - - #region Explicit Implementations - - IMessage IBuilder.WeakBuild() - { - return Build(); - } - - IBuilder IBuilder.WeakAddRepeatedField(FieldDescriptor field, object value) - { - return AddRepeatedField(field, value); - } - - IBuilder IBuilder.WeakClear() - { - return Clear(); - } - - IBuilder IBuilder.WeakMergeFrom(IMessage message) - { - return MergeFrom(message); - } - - IBuilder IBuilder.WeakMergeFrom(ICodedInputStream input) - { - return MergeFrom(input); - } - - IBuilder IBuilder.WeakMergeFrom(ICodedInputStream input, ExtensionRegistry registry) - { - return MergeFrom(input, registry); - } - - IBuilder IBuilder.WeakMergeFrom(ByteString data) - { - return MergeFrom(data); - } - - IBuilder IBuilder.WeakMergeFrom(ByteString data, ExtensionRegistry registry) - { - return MergeFrom(data, registry); - } - - IMessage IBuilder.WeakBuildPartial() - { - return BuildPartial(); - } - - IBuilder IBuilder.WeakClone() - { - return Clone(); - } - - IMessage IBuilder.WeakDefaultInstanceForType - { - get { return DefaultInstanceForType; } - } - - IBuilder IBuilder.WeakClearField(FieldDescriptor field) - { - return ClearField(field); - } - - #endregion - - /// - /// Converts this builder to a string using . - /// - /// - /// This method is not sealed (in the way that it is in - /// as it was added after earlier releases; some other implementations may already be overriding the - /// method. - /// - public override string ToString() - { - return TextFormat.PrintToString(this); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/AbstractBuilderLite.cs b/src/ProtocolBuffers/AbstractBuilderLite.cs deleted file mode 100644 index a7fedea..0000000 --- a/src/ProtocolBuffers/AbstractBuilderLite.cs +++ /dev/null @@ -1,264 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.IO; - -namespace Google.ProtocolBuffers -{ - /// - /// Implementation of the non-generic IMessage interface as far as possible. - /// - public abstract partial class AbstractBuilderLite : IBuilderLite - where TMessage : AbstractMessageLite - where TBuilder : AbstractBuilderLite - { - protected abstract TBuilder ThisBuilder { get; } - - public abstract bool IsInitialized { get; } - - public abstract TBuilder Clear(); - - public abstract TBuilder Clone(); - - public abstract TMessage Build(); - - public abstract TMessage BuildPartial(); - - public abstract TBuilder MergeFrom(IMessageLite other); - - public abstract TBuilder MergeFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry); - - public abstract TMessage DefaultInstanceForType { get; } - - #region IBuilderLite Members - - public virtual TBuilder MergeFrom(ICodedInputStream input) - { - return MergeFrom(input, ExtensionRegistry.CreateInstance()); - } - - public TBuilder MergeDelimitedFrom(Stream input) - { - return MergeDelimitedFrom(input, ExtensionRegistry.CreateInstance()); - } - - public TBuilder MergeDelimitedFrom(Stream input, ExtensionRegistry extensionRegistry) - { - int size = (int) CodedInputStream.ReadRawVarint32(input); - Stream limitedStream = new LimitedInputStream(input, size); - return MergeFrom(limitedStream, extensionRegistry); - } - - public TBuilder MergeFrom(ByteString data) - { - return MergeFrom(data, ExtensionRegistry.CreateInstance()); - } - - public TBuilder MergeFrom(ByteString data, ExtensionRegistry extensionRegistry) - { - CodedInputStream input = data.CreateCodedInput(); - MergeFrom(input, extensionRegistry); - input.CheckLastTagWas(0); - return ThisBuilder; - } - - public TBuilder MergeFrom(byte[] data) - { - CodedInputStream input = CodedInputStream.CreateInstance(data); - MergeFrom(input); - input.CheckLastTagWas(0); - return ThisBuilder; - } - - public TBuilder MergeFrom(byte[] data, ExtensionRegistry extensionRegistry) - { - CodedInputStream input = CodedInputStream.CreateInstance(data); - MergeFrom(input, extensionRegistry); - input.CheckLastTagWas(0); - return ThisBuilder; - } - - public TBuilder MergeFrom(Stream input) - { - CodedInputStream codedInput = CodedInputStream.CreateInstance(input); - MergeFrom(codedInput); - codedInput.CheckLastTagWas(0); - return ThisBuilder; - } - - public TBuilder MergeFrom(Stream input, ExtensionRegistry extensionRegistry) - { - CodedInputStream codedInput = CodedInputStream.CreateInstance(input); - MergeFrom(codedInput, extensionRegistry); - codedInput.CheckLastTagWas(0); - return ThisBuilder; - } - - #endregion - - #region Explicit definitions - - IBuilderLite IBuilderLite.WeakClear() - { - return Clear(); - } - - IBuilderLite IBuilderLite.WeakMergeFrom(IMessageLite message) - { - return MergeFrom(message); - } - - IBuilderLite IBuilderLite.WeakMergeFrom(ByteString data) - { - return MergeFrom(data); - } - - IBuilderLite IBuilderLite.WeakMergeFrom(ByteString data, ExtensionRegistry registry) - { - return MergeFrom(data, registry); - } - - IBuilderLite IBuilderLite.WeakMergeFrom(ICodedInputStream input) - { - return MergeFrom(input); - } - - IBuilderLite IBuilderLite.WeakMergeFrom(ICodedInputStream input, ExtensionRegistry registry) - { - return MergeFrom(input, registry); - } - - IMessageLite IBuilderLite.WeakBuild() - { - return Build(); - } - - IMessageLite IBuilderLite.WeakBuildPartial() - { - return BuildPartial(); - } - - IBuilderLite IBuilderLite.WeakClone() - { - return Clone(); - } - - IMessageLite IBuilderLite.WeakDefaultInstanceForType - { - get { return DefaultInstanceForType; } - } - - #endregion - - #region LimitedInputStream - - /// - /// Stream implementation which proxies another stream, only allowing a certain amount - /// of data to be read. Note that this is only used to read delimited streams, so it - /// doesn't attempt to implement everything. - /// - private class LimitedInputStream : Stream - { - private readonly Stream proxied; - private int bytesLeft; - - internal LimitedInputStream(Stream proxied, int size) - { - this.proxied = proxied; - bytesLeft = size; - } - - public override bool CanRead - { - get { return true; } - } - - public override bool CanSeek - { - get { return false; } - } - - public override bool CanWrite - { - get { return false; } - } - - public override void Flush() - { - } - - public override long Length - { - get { throw new NotSupportedException(); } - } - - public override long Position - { - get { throw new NotSupportedException(); } - set { throw new NotSupportedException(); } - } - - public override int Read(byte[] buffer, int offset, int count) - { - if (bytesLeft > 0) - { - int bytesRead = proxied.Read(buffer, offset, Math.Min(bytesLeft, count)); - bytesLeft -= bytesRead; - return bytesRead; - } - return 0; - } - - public override long Seek(long offset, SeekOrigin origin) - { - throw new NotSupportedException(); - } - - public override void SetLength(long value) - { - throw new NotSupportedException(); - } - - public override void Write(byte[] buffer, int offset, int count) - { - throw new NotSupportedException(); - } - } - - #endregion - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/AbstractMessage.cs b/src/ProtocolBuffers/AbstractMessage.cs deleted file mode 100644 index 16c8c78..0000000 --- a/src/ProtocolBuffers/AbstractMessage.cs +++ /dev/null @@ -1,291 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Text; -using Google.ProtocolBuffers.Collections; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers -{ - /// - /// Implementation of the non-generic IMessage interface as far as possible. - /// - public abstract partial class AbstractMessage : AbstractMessageLite, - IMessage - where TMessage : AbstractMessage - where TBuilder : AbstractBuilder - { - /// - /// The serialized size if it's already been computed, or null - /// if we haven't computed it yet. - /// - private int? memoizedSize = null; - - #region Unimplemented members of IMessage - - public abstract MessageDescriptor DescriptorForType { get; } - public abstract IDictionary AllFields { get; } - public abstract bool HasField(FieldDescriptor field); - public abstract object this[FieldDescriptor field] { get; } - public abstract int GetRepeatedFieldCount(FieldDescriptor field); - public abstract object this[FieldDescriptor field, int index] { get; } - public abstract UnknownFieldSet UnknownFields { get; } - - #endregion - - /// - /// Returns true iff all required fields in the message and all embedded - /// messages are set. - /// - public override bool IsInitialized - { - get - { - // Check that all required fields are present. - foreach (FieldDescriptor field in DescriptorForType.Fields) - { - if (field.IsRequired && !HasField(field)) - { - return false; - } - } - - // Check that embedded messages are initialized. - foreach (KeyValuePair entry in AllFields) - { - FieldDescriptor field = entry.Key; - if (field.MappedType == MappedType.Message) - { - if (field.IsRepeated) - { - // We know it's an IList, but not the exact type - so - // IEnumerable is the best we can do. (C# generics aren't covariant yet.) - foreach (IMessageLite element in (IEnumerable) entry.Value) - { - if (!element.IsInitialized) - { - return false; - } - } - } - else - { - if (!((IMessageLite) entry.Value).IsInitialized) - { - return false; - } - } - } - } - return true; - } - } - - public override sealed string ToString() - { - return TextFormat.PrintToString(this); - } - - public override sealed void PrintTo(TextWriter writer) - { - TextFormat.Print(this, writer); - } - - /// - /// Serializes the message and writes it to the given output stream. - /// This does not flush or close the stream. - /// - /// - /// Protocol Buffers are not self-delimiting. Therefore, if you write - /// any more data to the stream after the message, you must somehow ensure - /// that the parser on the receiving end does not interpret this as being - /// part of the protocol message. One way of doing this is by writing the size - /// of the message before the data, then making sure you limit the input to - /// that size when receiving the data. Alternatively, use WriteDelimitedTo(Stream). - /// - public override void WriteTo(ICodedOutputStream output) - { - foreach (KeyValuePair entry in AllFields) - { - FieldDescriptor field = entry.Key; - if (field.IsRepeated) - { - // We know it's an IList, but not the exact type - so - // IEnumerable is the best we can do. (C# generics aren't covariant yet.) - IEnumerable valueList = (IEnumerable) entry.Value; - if (field.IsPacked) - { - output.WritePackedArray(field.FieldType, field.FieldNumber, field.Name, valueList); - } - else - { - output.WriteArray(field.FieldType, field.FieldNumber, field.Name, valueList); - } - } - else - { - output.WriteField(field.FieldType, field.FieldNumber, field.Name, entry.Value); - } - } - - UnknownFieldSet unknownFields = UnknownFields; - if (DescriptorForType.Options.MessageSetWireFormat) - { - unknownFields.WriteAsMessageSetTo(output); - } - else - { - unknownFields.WriteTo(output); - } - } - - /// - /// Returns the number of bytes required to encode this message. - /// The result is only computed on the first call and memoized after that. - /// - public override int SerializedSize - { - get - { - if (memoizedSize != null) - { - return memoizedSize.Value; - } - - int size = 0; - foreach (KeyValuePair entry in AllFields) - { - FieldDescriptor field = entry.Key; - if (field.IsRepeated) - { - IEnumerable valueList = (IEnumerable) entry.Value; - if (field.IsPacked) - { - int dataSize = 0; - foreach (object element in valueList) - { - dataSize += CodedOutputStream.ComputeFieldSizeNoTag(field.FieldType, element); - } - size += dataSize; - size += CodedOutputStream.ComputeTagSize(field.FieldNumber); - size += CodedOutputStream.ComputeRawVarint32Size((uint) dataSize); - } - else - { - foreach (object element in valueList) - { - size += CodedOutputStream.ComputeFieldSize(field.FieldType, field.FieldNumber, element); - } - } - } - else - { - size += CodedOutputStream.ComputeFieldSize(field.FieldType, field.FieldNumber, entry.Value); - } - } - - UnknownFieldSet unknownFields = UnknownFields; - if (DescriptorForType.Options.MessageSetWireFormat) - { - size += unknownFields.SerializedSizeAsMessageSet; - } - else - { - size += unknownFields.SerializedSize; - } - - memoizedSize = size; - return size; - } - } - - /// - /// Compares the specified object with this message for equality. - /// Returns true iff the given object is a message of the same type - /// (as defined by DescriptorForType) and has identical values - /// for all its fields. - /// - public override bool Equals(object other) - { - if (other == this) - { - return true; - } - IMessage otherMessage = other as IMessage; - if (otherMessage == null || otherMessage.DescriptorForType != DescriptorForType) - { - return false; - } - return Dictionaries.Equals(AllFields, otherMessage.AllFields) && - UnknownFields.Equals(otherMessage.UnknownFields); - } - - /// - /// Returns the hash code value for this message. - /// TODO(jonskeet): Specify the hash algorithm, but better than the Java one! - /// - public override int GetHashCode() - { - int hash = 41; - hash = (19*hash) + DescriptorForType.GetHashCode(); - hash = (53*hash) + Dictionaries.GetHashCode(AllFields); - hash = (29*hash) + UnknownFields.GetHashCode(); - return hash; - } - - #region Explicit Members - - IBuilder IMessage.WeakCreateBuilderForType() - { - return CreateBuilderForType(); - } - - IBuilder IMessage.WeakToBuilder() - { - return ToBuilder(); - } - - IMessage IMessage.WeakDefaultInstanceForType - { - get { return DefaultInstanceForType; } - } - - #endregion - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/AbstractMessageLite.cs b/src/ProtocolBuffers/AbstractMessageLite.cs deleted file mode 100644 index 1cdead2..0000000 --- a/src/ProtocolBuffers/AbstractMessageLite.cs +++ /dev/null @@ -1,140 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System.IO; - -namespace Google.ProtocolBuffers -{ - /// - /// Implementation of the non-generic IMessage interface as far as possible. - /// - public abstract partial class AbstractMessageLite : IMessageLite - where TMessage : AbstractMessageLite - where TBuilder : AbstractBuilderLite - { - public abstract TBuilder CreateBuilderForType(); - - public abstract TBuilder ToBuilder(); - - public abstract TMessage DefaultInstanceForType { get; } - - public abstract bool IsInitialized { get; } - - public abstract void WriteTo(ICodedOutputStream output); - - public abstract int SerializedSize { get; } - - //public override bool Equals(object other) { - //} - - //public override int GetHashCode() { - //} - - public abstract void PrintTo(TextWriter writer); - - #region IMessageLite Members - - /// - /// Serializes the message to a ByteString. This is a trivial wrapper - /// around WriteTo(ICodedOutputStream). - /// - public ByteString ToByteString() - { - ByteString.CodedBuilder output = new ByteString.CodedBuilder(SerializedSize); - WriteTo(output.CodedOutput); - return output.Build(); - } - - /// - /// Serializes the message to a byte array. This is a trivial wrapper - /// around WriteTo(ICodedOutputStream). - /// - public byte[] ToByteArray() - { - byte[] result = new byte[SerializedSize]; - CodedOutputStream output = CodedOutputStream.CreateInstance(result); - WriteTo(output); - output.CheckNoSpaceLeft(); - return result; - } - - /// - /// Serializes the message and writes it to the given stream. - /// This is just a wrapper around WriteTo(CodedOutputStream). This - /// does not flush or close the stream. - /// - /// - public void WriteTo(Stream output) - { - CodedOutputStream codedOutput = CodedOutputStream.CreateInstance(output); - WriteTo(codedOutput); - codedOutput.Flush(); - } - - /// - /// Like WriteTo(Stream) but writes the size of the message as a varint before - /// writing the data. This allows more data to be written to the stream after the - /// message without the need to delimit the message data yourself. Use - /// IBuilder.MergeDelimitedFrom(Stream) or the static method - /// YourMessageType.ParseDelimitedFrom(Stream) to parse messages written by this method. - /// - /// - public void WriteDelimitedTo(Stream output) - { - CodedOutputStream codedOutput = CodedOutputStream.CreateInstance(output); - codedOutput.WriteRawVarint32((uint) SerializedSize); - WriteTo(codedOutput); - codedOutput.Flush(); - } - - IBuilderLite IMessageLite.WeakCreateBuilderForType() - { - return CreateBuilderForType(); - } - - IBuilderLite IMessageLite.WeakToBuilder() - { - return ToBuilder(); - } - - IMessageLite IMessageLite.WeakDefaultInstanceForType - { - get { return DefaultInstanceForType; } - } - - #endregion - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/ByteArray.cs b/src/ProtocolBuffers/ByteArray.cs deleted file mode 100644 index 3c51b7b..0000000 --- a/src/ProtocolBuffers/ByteArray.cs +++ /dev/null @@ -1,92 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; - -namespace Google.ProtocolBuffers -{ - /// - /// Provides a utility routine to copy small arrays much more quickly than Buffer.BlockCopy - /// - internal static class ByteArray - { - /// - /// The threshold above which you should use Buffer.BlockCopy rather than ByteArray.Copy - /// - private const int CopyThreshold = 12; - - /// - /// Determines which copy routine to use based on the number of bytes to be copied. - /// - public static void Copy(byte[] src, int srcOffset, byte[] dst, int dstOffset, int count) - { - if (count > CopyThreshold) - { - Buffer.BlockCopy(src, srcOffset, dst, dstOffset, count); - } - else - { - ByteCopy(src, srcOffset, dst, dstOffset, count); - } - } - - /// - /// Copy the bytes provided with a for loop, faster when there are only a few bytes to copy - /// - public static void ByteCopy(byte[] src, int srcOffset, byte[] dst, int dstOffset, int count) - { - int stop = srcOffset + count; - for (int i = srcOffset; i < stop; i++) - { - dst[dstOffset++] = src[i]; - } - } - - /// - /// Reverses the order of bytes in the array - /// - public static void Reverse(byte[] bytes) - { - byte temp; - for (int first = 0, last = bytes.Length - 1; first < last; first++, last--) - { - temp = bytes[first]; - bytes[first] = bytes[last]; - bytes[last] = temp; - } - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/ByteString.cs b/src/ProtocolBuffers/ByteString.cs deleted file mode 100644 index 434865b..0000000 --- a/src/ProtocolBuffers/ByteString.cs +++ /dev/null @@ -1,305 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Text; - -namespace Google.ProtocolBuffers -{ - /// - /// Immutable array of bytes. - /// TODO(jonskeet): Implement the common collection interfaces? - /// - public sealed class ByteString : IEnumerable, IEquatable - { - private static readonly ByteString empty = new ByteString(new byte[0]); - - private readonly byte[] bytes; - - /// - /// Unsafe operations that can cause IO Failure and/or other catestrophic side-effects. - /// - public static class Unsafe - { - /// - /// Constructs a new ByteString from the given byte array. The array is - /// *not* copied, and must not be modified after this constructor is called. - /// - public static ByteString FromBytes(byte[] bytes) - { - return new ByteString(bytes); - } - - /// - /// Provides direct, unrestricted access to the bytes contained in this instance. - /// You must not modify or resize the byte array returned by this method. - /// - public static byte[] GetBuffer(ByteString bytes) - { - return bytes.bytes; - } - } - - /// - /// Internal use only. Ensure that the provided array is not mutated and belongs to this instance. - /// - internal static ByteString AttachBytes(byte[] bytes) - { - return new ByteString(bytes); - } - - /// - /// Constructs a new ByteString from the given byte array. The array is - /// *not* copied, and must not be modified after this constructor is called. - /// - private ByteString(byte[] bytes) - { - this.bytes = bytes; - } - - /// - /// Returns an empty ByteString. - /// - public static ByteString Empty - { - get { return empty; } - } - - /// - /// Returns the length of this ByteString in bytes. - /// - public int Length - { - get { return bytes.Length; } - } - - public bool IsEmpty - { - get { return Length == 0; } - } - - public byte[] ToByteArray() - { - return (byte[]) bytes.Clone(); - } - - public string ToBase64() - { - return Convert.ToBase64String(bytes); - } - - /// - /// Constructs a ByteString from the Base64 Encoded String. - /// - public static ByteString FromBase64(string bytes) - { - // By handling the empty string explicitly, we not only optimize but we fix a - // problem on CF 2.0. See issue 61 for details. - return bytes == "" ? Empty : new ByteString(Convert.FromBase64String(bytes)); - } - - /// - /// Constructs a ByteString from the given array. The contents - /// are copied, so further modifications to the array will not - /// be reflected in the returned ByteString. - /// - public static ByteString CopyFrom(byte[] bytes) - { - return new ByteString((byte[]) bytes.Clone()); - } - - /// - /// Constructs a ByteString from a portion of a byte array. - /// - public static ByteString CopyFrom(byte[] bytes, int offset, int count) - { - byte[] portion = new byte[count]; - ByteArray.Copy(bytes, offset, portion, 0, count); - return new ByteString(portion); - } - - /// - /// Creates a new ByteString by encoding the specified text with - /// the given encoding. - /// - public static ByteString CopyFrom(string text, Encoding encoding) - { - return new ByteString(encoding.GetBytes(text)); - } - - /// - /// Creates a new ByteString by encoding the specified text in UTF-8. - /// - public static ByteString CopyFromUtf8(string text) - { - return CopyFrom(text, Encoding.UTF8); - } - - /// - /// Retuns the byte at the given index. - /// - public byte this[int index] - { - get { return bytes[index]; } - } - - public string ToString(Encoding encoding) - { - return encoding.GetString(bytes, 0, bytes.Length); - } - - public string ToStringUtf8() - { - return ToString(Encoding.UTF8); - } - - public IEnumerator GetEnumerator() - { - return ((IEnumerable) bytes).GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } - - /// - /// Creates a CodedInputStream from this ByteString's data. - /// - public CodedInputStream CreateCodedInput() - { - // We trust CodedInputStream not to reveal the provided byte array or modify it - return CodedInputStream.CreateInstance(bytes); - } - - // TODO(jonskeet): CopyTo if it turns out to be required - - public override bool Equals(object obj) - { - ByteString other = obj as ByteString; - if (obj == null) - { - return false; - } - return Equals(other); - } - - public override int GetHashCode() - { - int ret = 23; - foreach (byte b in bytes) - { - ret = (ret << 8) | b; - } - return ret; - } - - public bool Equals(ByteString other) - { - if (other.bytes.Length != bytes.Length) - { - return false; - } - for (int i = 0; i < bytes.Length; i++) - { - if (other.bytes[i] != bytes[i]) - { - return false; - } - } - return true; - } - - /// - /// Builder for ByteStrings which allows them to be created without extra - /// copying being involved. This has to be a nested type in order to have access - /// to the private ByteString constructor. - /// - internal sealed class CodedBuilder - { - private readonly CodedOutputStream output; - private readonly byte[] buffer; - - internal CodedBuilder(int size) - { - buffer = new byte[size]; - output = CodedOutputStream.CreateInstance(buffer); - } - - internal ByteString Build() - { - output.CheckNoSpaceLeft(); - - // We can be confident that the CodedOutputStream will not modify the - // underlying bytes anymore because it already wrote all of them. So, - // no need to make a copy. - return new ByteString(buffer); - } - - internal CodedOutputStream CodedOutput - { - get { return output; } - } - } - - /// - /// Used internally by CodedOutputStream to avoid creating a copy for the write - /// - internal void WriteRawBytesTo(CodedOutputStream outputStream) - { - outputStream.WriteRawBytes(bytes, 0, bytes.Length); - } - - /// - /// Copies the entire byte array to the destination array provided at the offset specified. - /// - public void CopyTo(byte[] array, int position) - { - ByteArray.Copy(bytes, 0, array, position, bytes.Length); - } - - /// - /// Writes the entire byte array to the provided stream - /// - public void WriteTo(Stream outputStream) - { - outputStream.Write(bytes, 0, bytes.Length); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/CodedInputStream.cs b/src/ProtocolBuffers/CodedInputStream.cs deleted file mode 100644 index 773e8c1..0000000 --- a/src/ProtocolBuffers/CodedInputStream.cs +++ /dev/null @@ -1,1864 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers -{ - /// - /// Readings and decodes protocol message fields. - /// - /// - /// This class contains two kinds of methods: methods that read specific - /// protocol message constructs and field types (e.g. ReadTag and - /// ReadInt32) and methods that read low-level values (e.g. - /// ReadRawVarint32 and ReadRawBytes). If you are reading encoded protocol - /// messages, you should use the former methods, but if you are reading some - /// other format of your own design, use the latter. The names of the former - /// methods are taken from the protocol buffer type names, not .NET types. - /// (Hence ReadFloat instead of ReadSingle, and ReadBool instead of ReadBoolean.) - /// - /// TODO(jonskeet): Consider whether recursion and size limits shouldn't be readonly, - /// set at construction time. - /// - public sealed class CodedInputStream : ICodedInputStream - { - private readonly byte[] buffer; - private int bufferSize; - private int bufferSizeAfterLimit = 0; - private int bufferPos = 0; - private readonly Stream input; - private uint lastTag = 0; - - private uint nextTag = 0; - private bool hasNextTag = false; - - internal const int DefaultRecursionLimit = 64; - internal const int DefaultSizeLimit = 64 << 20; // 64MB - public const int BufferSize = 4096; - - /// - /// The total number of bytes read before the current buffer. The - /// total bytes read up to the current position can be computed as - /// totalBytesRetired + bufferPos. - /// - private int totalBytesRetired = 0; - - /// - /// The absolute position of the end of the current message. - /// - private int currentLimit = int.MaxValue; - - /// - /// - /// - private int recursionDepth = 0; - - private int recursionLimit = DefaultRecursionLimit; - - /// - /// - /// - private int sizeLimit = DefaultSizeLimit; - - #region Construction - - /// - /// Creates a new CodedInputStream reading data from the given - /// stream. - /// - public static CodedInputStream CreateInstance(Stream input) - { - return new CodedInputStream(input); - } - /// - /// Creates a new CodedInputStream reading data from the given - /// stream and a pre-allocated memory buffer. - /// - public static CodedInputStream CreateInstance(Stream input, byte[] buffer) - { - return new CodedInputStream(input, buffer); - } - - /// - /// Creates a new CodedInputStream reading data from the given - /// byte array. - /// - public static CodedInputStream CreateInstance(byte[] buf) - { - return new CodedInputStream(buf, 0, buf.Length); - } - - /// - /// Creates a new CodedInputStream that reads from the given - /// byte array slice. - /// - public static CodedInputStream CreateInstance(byte[] buf, int offset, int length) - { - return new CodedInputStream(buf, offset, length); - } - - private CodedInputStream(byte[] buffer, int offset, int length) - { - this.buffer = buffer; - this.bufferPos = offset; - this.bufferSize = offset + length; - this.input = null; - } - - private CodedInputStream(Stream input) - { - this.buffer = new byte[BufferSize]; - this.bufferSize = 0; - this.input = input; - } - - private CodedInputStream(Stream input, byte[] buffer) - { - this.buffer = buffer; - this.bufferSize = 0; - this.input = input; - } - #endregion - - /// - /// Returns the current position in the input stream, or the position in the input buffer - /// - public long Position - { - get - { - if (input != null) - { - return input.Position - ((bufferSize + bufferSizeAfterLimit) - bufferPos); - } - return bufferPos; - } - } - - - void ICodedInputStream.ReadMessageStart() { } - void ICodedInputStream.ReadMessageEnd() { } - - #region Validation - - /// - /// Verifies that the last call to ReadTag() returned the given tag value. - /// This is used to verify that a nested group ended with the correct - /// end tag. - /// - /// The last - /// tag read was not the one specified - [CLSCompliant(false)] - public void CheckLastTagWas(uint value) - { - if (lastTag != value) - { - throw InvalidProtocolBufferException.InvalidEndTag(); - } - } - - #endregion - - #region Reading of tags etc - - /// - /// Attempt to peek at the next field tag. - /// - [CLSCompliant(false)] - public bool PeekNextTag(out uint fieldTag, out string fieldName) - { - if (hasNextTag) - { - fieldName = null; - fieldTag = nextTag; - return true; - } - - uint savedLast = lastTag; - hasNextTag = ReadTag(out nextTag, out fieldName); - lastTag = savedLast; - fieldTag = nextTag; - return hasNextTag; - } - - /// - /// Attempt to read a field tag, returning false if we have reached the end - /// of the input data. - /// - /// The 'tag' of the field (id * 8 + wire-format) - /// Not Supported - For protobuffer streams, this parameter is always null - /// true if the next fieldTag was read - [CLSCompliant(false)] - public bool ReadTag(out uint fieldTag, out string fieldName) - { - fieldName = null; - - if (hasNextTag) - { - fieldTag = nextTag; - lastTag = fieldTag; - hasNextTag = false; - return true; - } - - if (IsAtEnd) - { - fieldTag = 0; - lastTag = fieldTag; - return false; - } - - fieldTag = ReadRawVarint32(); - lastTag = fieldTag; - if (lastTag == 0) - { - // If we actually read zero, that's not a valid tag. - throw InvalidProtocolBufferException.InvalidTag(); - } - return true; - } - - /// - /// Read a double field from the stream. - /// - public bool ReadDouble(ref double value) - { - value = FrameworkPortability.Int64ToDouble((long) ReadRawLittleEndian64()); - return true; - } - - /// - /// Read a float field from the stream. - /// - public bool ReadFloat(ref float value) - { - if (BitConverter.IsLittleEndian && 4 <= bufferSize - bufferPos) - { - value = BitConverter.ToSingle(buffer, bufferPos); - bufferPos += 4; - } - else - { - byte[] rawBytes = ReadRawBytes(4); - if (!BitConverter.IsLittleEndian) - { - ByteArray.Reverse(rawBytes); - } - value = BitConverter.ToSingle(rawBytes, 0); - } - return true; - } - - /// - /// Read a uint64 field from the stream. - /// - [CLSCompliant(false)] - public bool ReadUInt64(ref ulong value) - { - value = ReadRawVarint64(); - return true; - } - - /// - /// Read an int64 field from the stream. - /// - public bool ReadInt64(ref long value) - { - value = (long) ReadRawVarint64(); - return true; - } - - /// - /// Read an int32 field from the stream. - /// - public bool ReadInt32(ref int value) - { - value = (int) ReadRawVarint32(); - return true; - } - - /// - /// Read a fixed64 field from the stream. - /// - [CLSCompliant(false)] - public bool ReadFixed64(ref ulong value) - { - value = ReadRawLittleEndian64(); - return true; - } - - /// - /// Read a fixed32 field from the stream. - /// - [CLSCompliant(false)] - public bool ReadFixed32(ref uint value) - { - value = ReadRawLittleEndian32(); - return true; - } - - /// - /// Read a bool field from the stream. - /// - public bool ReadBool(ref bool value) - { - value = ReadRawVarint32() != 0; - return true; - } - - /// - /// Reads a string field from the stream. - /// - public bool ReadString(ref string value) - { - int size = (int) ReadRawVarint32(); - // No need to read any data for an empty string. - if (size == 0) - { - value = ""; - return true; - } - if (size <= bufferSize - bufferPos) - { - // Fast path: We already have the bytes in a contiguous buffer, so - // just copy directly from it. - String result = Encoding.UTF8.GetString(buffer, bufferPos, size); - bufferPos += size; - value = result; - return true; - } - // Slow path: Build a byte array first then copy it. - value = Encoding.UTF8.GetString(ReadRawBytes(size), 0, size); - return true; - } - - /// - /// Reads a group field value from the stream. - /// - public void ReadGroup(int fieldNumber, IBuilderLite builder, - ExtensionRegistry extensionRegistry) - { - if (recursionDepth >= recursionLimit) - { - throw InvalidProtocolBufferException.RecursionLimitExceeded(); - } - ++recursionDepth; - builder.WeakMergeFrom(this, extensionRegistry); - CheckLastTagWas(WireFormat.MakeTag(fieldNumber, WireFormat.WireType.EndGroup)); - --recursionDepth; - } - - /// - /// Reads a group field value from the stream and merges it into the given - /// UnknownFieldSet. - /// - [Obsolete] - public void ReadUnknownGroup(int fieldNumber, IBuilderLite builder) - { - if (recursionDepth >= recursionLimit) - { - throw InvalidProtocolBufferException.RecursionLimitExceeded(); - } - ++recursionDepth; - builder.WeakMergeFrom(this); - CheckLastTagWas(WireFormat.MakeTag(fieldNumber, WireFormat.WireType.EndGroup)); - --recursionDepth; - } - - /// - /// Reads an embedded message field value from the stream. - /// - public void ReadMessage(IBuilderLite builder, ExtensionRegistry extensionRegistry) - { - int length = (int) ReadRawVarint32(); - if (recursionDepth >= recursionLimit) - { - throw InvalidProtocolBufferException.RecursionLimitExceeded(); - } - int oldLimit = PushLimit(length); - ++recursionDepth; - builder.WeakMergeFrom(this, extensionRegistry); - CheckLastTagWas(0); - --recursionDepth; - PopLimit(oldLimit); - } - - /// - /// Reads a bytes field value from the stream. - /// - public bool ReadBytes(ref ByteString value) - { - int size = (int) ReadRawVarint32(); - if (size <= bufferSize - bufferPos && size > 0) - { - // Fast path: We already have the bytes in a contiguous buffer, so - // just copy directly from it. - ByteString result = ByteString.CopyFrom(buffer, bufferPos, size); - bufferPos += size; - value = result; - return true; - } - else - { - // Slow path: Build a byte array and attach it to a new ByteString. - value = ByteString.AttachBytes(ReadRawBytes(size)); - return true; - } - } - - /// - /// Reads a uint32 field value from the stream. - /// - [CLSCompliant(false)] - public bool ReadUInt32(ref uint value) - { - value = ReadRawVarint32(); - return true; - } - - /// - /// Reads an enum field value from the stream. The caller is responsible - /// for converting the numeric value to an actual enum. - /// - public bool ReadEnum(ref IEnumLite value, out object unknown, IEnumLiteMap mapping) - { - int rawValue = (int) ReadRawVarint32(); - - value = mapping.FindValueByNumber(rawValue); - if (value != null) - { - unknown = null; - return true; - } - unknown = rawValue; - return false; - } - - /// - /// Reads an enum field value from the stream. If the enum is valid for type T, - /// then the ref value is set and it returns true. Otherwise the unknown output - /// value is set and this method returns false. - /// - [CLSCompliant(false)] - public bool ReadEnum(ref T value, out object unknown) - where T : struct, IComparable, IFormattable - { - int number = (int) ReadRawVarint32(); - if (EnumParser.TryConvert(number, ref value)) - { - unknown = null; - return true; - } - unknown = number; - return false; - } - - /// - /// Reads an sfixed32 field value from the stream. - /// - public bool ReadSFixed32(ref int value) - { - value = (int) ReadRawLittleEndian32(); - return true; - } - - /// - /// Reads an sfixed64 field value from the stream. - /// - public bool ReadSFixed64(ref long value) - { - value = (long) ReadRawLittleEndian64(); - return true; - } - - /// - /// Reads an sint32 field value from the stream. - /// - public bool ReadSInt32(ref int value) - { - value = DecodeZigZag32(ReadRawVarint32()); - return true; - } - - /// - /// Reads an sint64 field value from the stream. - /// - public bool ReadSInt64(ref long value) - { - value = DecodeZigZag64(ReadRawVarint64()); - return true; - } - - private bool BeginArray(uint fieldTag, out bool isPacked, out int oldLimit) - { - isPacked = WireFormat.GetTagWireType(fieldTag) == WireFormat.WireType.LengthDelimited; - - if (isPacked) - { - int length = (int) (ReadRawVarint32() & int.MaxValue); - if (length > 0) - { - oldLimit = PushLimit(length); - return true; - } - oldLimit = -1; - return false; //packed but empty - } - - oldLimit = -1; - return true; - } - - /// - /// Returns true if the next tag is also part of the same unpacked array. - /// - private bool ContinueArray(uint currentTag) - { - string ignore; - uint next; - if (PeekNextTag(out next, out ignore)) - { - if (next == currentTag) - { - hasNextTag = false; - return true; - } - } - return false; - } - - /// - /// Returns true if the next tag is also part of the same array, which may or may not be packed. - /// - private bool ContinueArray(uint currentTag, bool packed, int oldLimit) - { - if (packed) - { - if (ReachedLimit) - { - PopLimit(oldLimit); - return false; - } - return true; - } - - string ignore; - uint next; - if (PeekNextTag(out next, out ignore)) - { - if (next == currentTag) - { - hasNextTag = false; - return true; - } - } - return false; - } - - [CLSCompliant(false)] - public void ReadPrimitiveArray(FieldType fieldType, uint fieldTag, string fieldName, ICollection list) - { - WireFormat.WireType normal = WireFormat.GetWireType(fieldType); - WireFormat.WireType wformat = WireFormat.GetTagWireType(fieldTag); - - // 2.3 allows packed form even if the field is not declared packed. - if (normal != wformat && wformat == WireFormat.WireType.LengthDelimited) - { - int length = (int) (ReadRawVarint32() & int.MaxValue); - int limit = PushLimit(length); - while (!ReachedLimit) - { - Object value = null; - if (ReadPrimitiveField(fieldType, ref value)) - { - list.Add(value); - } - } - PopLimit(limit); - } - else - { - Object value = null; - do - { - if (ReadPrimitiveField(fieldType, ref value)) - { - list.Add(value); - } - } while (ContinueArray(fieldTag)); - } - } - - [CLSCompliant(false)] - public void ReadStringArray(uint fieldTag, string fieldName, ICollection list) - { - string tmp = null; - do - { - ReadString(ref tmp); - list.Add(tmp); - } while (ContinueArray(fieldTag)); - } - - [CLSCompliant(false)] - public void ReadBytesArray(uint fieldTag, string fieldName, ICollection list) - { - ByteString tmp = null; - do - { - ReadBytes(ref tmp); - list.Add(tmp); - } while (ContinueArray(fieldTag)); - } - - [CLSCompliant(false)] - public void ReadBoolArray(uint fieldTag, string fieldName, ICollection list) - { - bool isPacked; - int holdLimit; - if (BeginArray(fieldTag, out isPacked, out holdLimit)) - { - bool tmp = false; - do - { - ReadBool(ref tmp); - list.Add(tmp); - } while (ContinueArray(fieldTag, isPacked, holdLimit)); - } - } - - [CLSCompliant(false)] - public void ReadInt32Array(uint fieldTag, string fieldName, ICollection list) - { - bool isPacked; - int holdLimit; - if (BeginArray(fieldTag, out isPacked, out holdLimit)) - { - int tmp = 0; - do - { - ReadInt32(ref tmp); - list.Add(tmp); - } while (ContinueArray(fieldTag, isPacked, holdLimit)); - } - } - - [CLSCompliant(false)] - public void ReadSInt32Array(uint fieldTag, string fieldName, ICollection list) - { - bool isPacked; - int holdLimit; - if (BeginArray(fieldTag, out isPacked, out holdLimit)) - { - int tmp = 0; - do - { - ReadSInt32(ref tmp); - list.Add(tmp); - } while (ContinueArray(fieldTag, isPacked, holdLimit)); - } - } - - [CLSCompliant(false)] - public void ReadUInt32Array(uint fieldTag, string fieldName, ICollection list) - { - bool isPacked; - int holdLimit; - if (BeginArray(fieldTag, out isPacked, out holdLimit)) - { - uint tmp = 0; - do - { - ReadUInt32(ref tmp); - list.Add(tmp); - } while (ContinueArray(fieldTag, isPacked, holdLimit)); - } - } - - [CLSCompliant(false)] - public void ReadFixed32Array(uint fieldTag, string fieldName, ICollection list) - { - bool isPacked; - int holdLimit; - if (BeginArray(fieldTag, out isPacked, out holdLimit)) - { - uint tmp = 0; - do - { - ReadFixed32(ref tmp); - list.Add(tmp); - } while (ContinueArray(fieldTag, isPacked, holdLimit)); - } - } - - [CLSCompliant(false)] - public void ReadSFixed32Array(uint fieldTag, string fieldName, ICollection list) - { - bool isPacked; - int holdLimit; - if (BeginArray(fieldTag, out isPacked, out holdLimit)) - { - int tmp = 0; - do - { - ReadSFixed32(ref tmp); - list.Add(tmp); - } while (ContinueArray(fieldTag, isPacked, holdLimit)); - } - } - - [CLSCompliant(false)] - public void ReadInt64Array(uint fieldTag, string fieldName, ICollection list) - { - bool isPacked; - int holdLimit; - if (BeginArray(fieldTag, out isPacked, out holdLimit)) - { - long tmp = 0; - do - { - ReadInt64(ref tmp); - list.Add(tmp); - } while (ContinueArray(fieldTag, isPacked, holdLimit)); - } - } - - [CLSCompliant(false)] - public void ReadSInt64Array(uint fieldTag, string fieldName, ICollection list) - { - bool isPacked; - int holdLimit; - if (BeginArray(fieldTag, out isPacked, out holdLimit)) - { - long tmp = 0; - do - { - ReadSInt64(ref tmp); - list.Add(tmp); - } while (ContinueArray(fieldTag, isPacked, holdLimit)); - } - } - - [CLSCompliant(false)] - public void ReadUInt64Array(uint fieldTag, string fieldName, ICollection list) - { - bool isPacked; - int holdLimit; - if (BeginArray(fieldTag, out isPacked, out holdLimit)) - { - ulong tmp = 0; - do - { - ReadUInt64(ref tmp); - list.Add(tmp); - } while (ContinueArray(fieldTag, isPacked, holdLimit)); - } - } - - [CLSCompliant(false)] - public void ReadFixed64Array(uint fieldTag, string fieldName, ICollection list) - { - bool isPacked; - int holdLimit; - if (BeginArray(fieldTag, out isPacked, out holdLimit)) - { - ulong tmp = 0; - do - { - ReadFixed64(ref tmp); - list.Add(tmp); - } while (ContinueArray(fieldTag, isPacked, holdLimit)); - } - } - - [CLSCompliant(false)] - public void ReadSFixed64Array(uint fieldTag, string fieldName, ICollection list) - { - bool isPacked; - int holdLimit; - if (BeginArray(fieldTag, out isPacked, out holdLimit)) - { - long tmp = 0; - do - { - ReadSFixed64(ref tmp); - list.Add(tmp); - } while (ContinueArray(fieldTag, isPacked, holdLimit)); - } - } - - [CLSCompliant(false)] - public void ReadDoubleArray(uint fieldTag, string fieldName, ICollection list) - { - bool isPacked; - int holdLimit; - if (BeginArray(fieldTag, out isPacked, out holdLimit)) - { - double tmp = 0; - do - { - ReadDouble(ref tmp); - list.Add(tmp); - } while (ContinueArray(fieldTag, isPacked, holdLimit)); - } - } - - [CLSCompliant(false)] - public void ReadFloatArray(uint fieldTag, string fieldName, ICollection list) - { - bool isPacked; - int holdLimit; - if (BeginArray(fieldTag, out isPacked, out holdLimit)) - { - float tmp = 0; - do - { - ReadFloat(ref tmp); - list.Add(tmp); - } while (ContinueArray(fieldTag, isPacked, holdLimit)); - } - } - - [CLSCompliant(false)] - public void ReadEnumArray(uint fieldTag, string fieldName, ICollection list, - out ICollection unknown, IEnumLiteMap mapping) - { - unknown = null; - object unkval; - IEnumLite value = null; - WireFormat.WireType wformat = WireFormat.GetTagWireType(fieldTag); - - // 2.3 allows packed form even if the field is not declared packed. - if (wformat == WireFormat.WireType.LengthDelimited) - { - int length = (int) (ReadRawVarint32() & int.MaxValue); - int limit = PushLimit(length); - while (!ReachedLimit) - { - if (ReadEnum(ref value, out unkval, mapping)) - { - list.Add(value); - } - else - { - if (unknown == null) - { - unknown = new List(); - } - unknown.Add(unkval); - } - } - PopLimit(limit); - } - else - { - do - { - if (ReadEnum(ref value, out unkval, mapping)) - { - list.Add(value); - } - else - { - if (unknown == null) - { - unknown = new List(); - } - unknown.Add(unkval); - } - } while (ContinueArray(fieldTag)); - } - } - - [CLSCompliant(false)] - public void ReadEnumArray(uint fieldTag, string fieldName, ICollection list, - out ICollection unknown) - where T : struct, IComparable, IFormattable - { - unknown = null; - object unkval; - T value = default(T); - WireFormat.WireType wformat = WireFormat.GetTagWireType(fieldTag); - - // 2.3 allows packed form even if the field is not declared packed. - if (wformat == WireFormat.WireType.LengthDelimited) - { - int length = (int) (ReadRawVarint32() & int.MaxValue); - int limit = PushLimit(length); - while (!ReachedLimit) - { - if (ReadEnum(ref value, out unkval)) - { - list.Add(value); - } - else - { - if (unknown == null) - { - unknown = new List(); - } - unknown.Add(unkval); - } - } - PopLimit(limit); - } - else - { - do - { - if (ReadEnum(ref value, out unkval)) - { - list.Add(value); - } - else - { - if (unknown == null) - { - unknown = new List(); - } - unknown.Add(unkval); - } - } while (ContinueArray(fieldTag)); - } - } - - [CLSCompliant(false)] - public void ReadMessageArray(uint fieldTag, string fieldName, ICollection list, T messageType, - ExtensionRegistry registry) where T : IMessageLite - { - do - { - IBuilderLite builder = messageType.WeakCreateBuilderForType(); - ReadMessage(builder, registry); - list.Add((T) builder.WeakBuildPartial()); - } while (ContinueArray(fieldTag)); - } - - [CLSCompliant(false)] - public void ReadGroupArray(uint fieldTag, string fieldName, ICollection list, T messageType, - ExtensionRegistry registry) where T : IMessageLite - { - do - { - IBuilderLite builder = messageType.WeakCreateBuilderForType(); - ReadGroup(WireFormat.GetTagFieldNumber(fieldTag), builder, registry); - list.Add((T) builder.WeakBuildPartial()); - } while (ContinueArray(fieldTag)); - } - - /// - /// Reads a field of any primitive type. Enums, groups and embedded - /// messages are not handled by this method. - /// - public bool ReadPrimitiveField(FieldType fieldType, ref object value) - { - switch (fieldType) - { - case FieldType.Double: - { - double tmp = 0; - if (ReadDouble(ref tmp)) - { - value = tmp; - return true; - } - return false; - } - case FieldType.Float: - { - float tmp = 0; - if (ReadFloat(ref tmp)) - { - value = tmp; - return true; - } - return false; - } - case FieldType.Int64: - { - long tmp = 0; - if (ReadInt64(ref tmp)) - { - value = tmp; - return true; - } - return false; - } - case FieldType.UInt64: - { - ulong tmp = 0; - if (ReadUInt64(ref tmp)) - { - value = tmp; - return true; - } - return false; - } - case FieldType.Int32: - { - int tmp = 0; - if (ReadInt32(ref tmp)) - { - value = tmp; - return true; - } - return false; - } - case FieldType.Fixed64: - { - ulong tmp = 0; - if (ReadFixed64(ref tmp)) - { - value = tmp; - return true; - } - return false; - } - case FieldType.Fixed32: - { - uint tmp = 0; - if (ReadFixed32(ref tmp)) - { - value = tmp; - return true; - } - return false; - } - case FieldType.Bool: - { - bool tmp = false; - if (ReadBool(ref tmp)) - { - value = tmp; - return true; - } - return false; - } - case FieldType.String: - { - string tmp = null; - if (ReadString(ref tmp)) - { - value = tmp; - return true; - } - return false; - } - case FieldType.Bytes: - { - ByteString tmp = null; - if (ReadBytes(ref tmp)) - { - value = tmp; - return true; - } - return false; - } - case FieldType.UInt32: - { - uint tmp = 0; - if (ReadUInt32(ref tmp)) - { - value = tmp; - return true; - } - return false; - } - case FieldType.SFixed32: - { - int tmp = 0; - if (ReadSFixed32(ref tmp)) - { - value = tmp; - return true; - } - return false; - } - case FieldType.SFixed64: - { - long tmp = 0; - if (ReadSFixed64(ref tmp)) - { - value = tmp; - return true; - } - return false; - } - case FieldType.SInt32: - { - int tmp = 0; - if (ReadSInt32(ref tmp)) - { - value = tmp; - return true; - } - return false; - } - case FieldType.SInt64: - { - long tmp = 0; - if (ReadSInt64(ref tmp)) - { - value = tmp; - return true; - } - return false; - } - case FieldType.Group: - throw new ArgumentException("ReadPrimitiveField() cannot handle nested groups."); - case FieldType.Message: - throw new ArgumentException("ReadPrimitiveField() cannot handle embedded messages."); - // We don't handle enums because we don't know what to do if the - // value is not recognized. - case FieldType.Enum: - throw new ArgumentException("ReadPrimitiveField() cannot handle enums."); - default: - throw new ArgumentOutOfRangeException("Invalid field type " + fieldType); - } - } - - #endregion - - #region Underlying reading primitives - - /// - /// Same code as ReadRawVarint32, but read each byte individually, checking for - /// buffer overflow. - /// - private uint SlowReadRawVarint32() - { - int tmp = ReadRawByte(); - if (tmp < 128) - { - return (uint) tmp; - } - int result = tmp & 0x7f; - if ((tmp = ReadRawByte()) < 128) - { - result |= tmp << 7; - } - else - { - result |= (tmp & 0x7f) << 7; - if ((tmp = ReadRawByte()) < 128) - { - result |= tmp << 14; - } - else - { - result |= (tmp & 0x7f) << 14; - if ((tmp = ReadRawByte()) < 128) - { - result |= tmp << 21; - } - else - { - result |= (tmp & 0x7f) << 21; - result |= (tmp = ReadRawByte()) << 28; - if (tmp >= 128) - { - // Discard upper 32 bits. - for (int i = 0; i < 5; i++) - { - if (ReadRawByte() < 128) - { - return (uint) result; - } - } - throw InvalidProtocolBufferException.MalformedVarint(); - } - } - } - } - return (uint) result; - } - - /// - /// Read a raw Varint from the stream. If larger than 32 bits, discard the upper bits. - /// This method is optimised for the case where we've got lots of data in the buffer. - /// That means we can check the size just once, then just read directly from the buffer - /// without constant rechecking of the buffer length. - /// - [CLSCompliant(false)] - public uint ReadRawVarint32() - { - if (bufferPos + 5 > bufferSize) - { - return SlowReadRawVarint32(); - } - - int tmp = buffer[bufferPos++]; - if (tmp < 128) - { - return (uint) tmp; - } - int result = tmp & 0x7f; - if ((tmp = buffer[bufferPos++]) < 128) - { - result |= tmp << 7; - } - else - { - result |= (tmp & 0x7f) << 7; - if ((tmp = buffer[bufferPos++]) < 128) - { - result |= tmp << 14; - } - else - { - result |= (tmp & 0x7f) << 14; - if ((tmp = buffer[bufferPos++]) < 128) - { - result |= tmp << 21; - } - else - { - result |= (tmp & 0x7f) << 21; - result |= (tmp = buffer[bufferPos++]) << 28; - if (tmp >= 128) - { - // Discard upper 32 bits. - // Note that this has to use ReadRawByte() as we only ensure we've - // got at least 5 bytes at the start of the method. This lets us - // use the fast path in more cases, and we rarely hit this section of code. - for (int i = 0; i < 5; i++) - { - if (ReadRawByte() < 128) - { - return (uint) result; - } - } - throw InvalidProtocolBufferException.MalformedVarint(); - } - } - } - } - return (uint) result; - } - - /// - /// Reads a varint from the input one byte at a time, so that it does not - /// read any bytes after the end of the varint. If you simply wrapped the - /// stream in a CodedInputStream and used ReadRawVarint32(Stream)} - /// then you would probably end up reading past the end of the varint since - /// CodedInputStream buffers its input. - /// - /// - /// - [CLSCompliant(false)] - public static uint ReadRawVarint32(Stream input) - { - int result = 0; - int offset = 0; - for (; offset < 32; offset += 7) - { - int b = input.ReadByte(); - if (b == -1) - { - throw InvalidProtocolBufferException.TruncatedMessage(); - } - result |= (b & 0x7f) << offset; - if ((b & 0x80) == 0) - { - return (uint) result; - } - } - // Keep reading up to 64 bits. - for (; offset < 64; offset += 7) - { - int b = input.ReadByte(); - if (b == -1) - { - throw InvalidProtocolBufferException.TruncatedMessage(); - } - if ((b & 0x80) == 0) - { - return (uint) result; - } - } - throw InvalidProtocolBufferException.MalformedVarint(); - } - - /// - /// Read a raw varint from the stream. - /// - [CLSCompliant(false)] - public ulong ReadRawVarint64() - { - int shift = 0; - ulong result = 0; - while (shift < 64) - { - byte b = ReadRawByte(); - result |= (ulong) (b & 0x7F) << shift; - if ((b & 0x80) == 0) - { - return result; - } - shift += 7; - } - throw InvalidProtocolBufferException.MalformedVarint(); - } - - /// - /// Read a 32-bit little-endian integer from the stream. - /// - [CLSCompliant(false)] - public uint ReadRawLittleEndian32() - { - uint b1 = ReadRawByte(); - uint b2 = ReadRawByte(); - uint b3 = ReadRawByte(); - uint b4 = ReadRawByte(); - return b1 | (b2 << 8) | (b3 << 16) | (b4 << 24); - } - - /// - /// Read a 64-bit little-endian integer from the stream. - /// - [CLSCompliant(false)] - public ulong ReadRawLittleEndian64() - { - ulong b1 = ReadRawByte(); - ulong b2 = ReadRawByte(); - ulong b3 = ReadRawByte(); - ulong b4 = ReadRawByte(); - ulong b5 = ReadRawByte(); - ulong b6 = ReadRawByte(); - ulong b7 = ReadRawByte(); - ulong b8 = ReadRawByte(); - return b1 | (b2 << 8) | (b3 << 16) | (b4 << 24) - | (b5 << 32) | (b6 << 40) | (b7 << 48) | (b8 << 56); - } - - #endregion - - /// - /// Decode a 32-bit value with ZigZag encoding. - /// - /// - /// ZigZag encodes signed integers into values that can be efficiently - /// encoded with varint. (Otherwise, negative values must be - /// sign-extended to 64 bits to be varint encoded, thus always taking - /// 10 bytes on the wire.) - /// - [CLSCompliant(false)] - public static int DecodeZigZag32(uint n) - { - return (int) (n >> 1) ^ -(int) (n & 1); - } - - /// - /// Decode a 32-bit value with ZigZag encoding. - /// - /// - /// ZigZag encodes signed integers into values that can be efficiently - /// encoded with varint. (Otherwise, negative values must be - /// sign-extended to 64 bits to be varint encoded, thus always taking - /// 10 bytes on the wire.) - /// - [CLSCompliant(false)] - public static long DecodeZigZag64(ulong n) - { - return (long) (n >> 1) ^ -(long) (n & 1); - } - - /// - /// Set the maximum message recursion depth. - /// - /// - /// In order to prevent malicious - /// messages from causing stack overflows, CodedInputStream limits - /// how deeply messages may be nested. The default limit is 64. - /// - public int SetRecursionLimit(int limit) - { - if (limit < 0) - { - throw new ArgumentOutOfRangeException("Recursion limit cannot be negative: " + limit); - } - int oldLimit = recursionLimit; - recursionLimit = limit; - return oldLimit; - } - - /// - /// Set the maximum message size. - /// - /// - /// In order to prevent malicious messages from exhausting memory or - /// causing integer overflows, CodedInputStream limits how large a message may be. - /// The default limit is 64MB. You should set this limit as small - /// as you can without harming your app's functionality. Note that - /// size limits only apply when reading from an InputStream, not - /// when constructed around a raw byte array (nor with ByteString.NewCodedInput). - /// If you want to read several messages from a single CodedInputStream, you - /// can call ResetSizeCounter() after each message to avoid hitting the - /// size limit. - /// - public int SetSizeLimit(int limit) - { - if (limit < 0) - { - throw new ArgumentOutOfRangeException("Size limit cannot be negative: " + limit); - } - int oldLimit = sizeLimit; - sizeLimit = limit; - return oldLimit; - } - - #region Internal reading and buffer management - - /// - /// Resets the current size counter to zero (see SetSizeLimit). - /// - public void ResetSizeCounter() - { - totalBytesRetired = 0; - } - - /// - /// Sets currentLimit to (current position) + byteLimit. This is called - /// when descending into a length-delimited embedded message. The previous - /// limit is returned. - /// - /// The old limit. - public int PushLimit(int byteLimit) - { - if (byteLimit < 0) - { - throw InvalidProtocolBufferException.NegativeSize(); - } - byteLimit += totalBytesRetired + bufferPos; - int oldLimit = currentLimit; - if (byteLimit > oldLimit) - { - throw InvalidProtocolBufferException.TruncatedMessage(); - } - currentLimit = byteLimit; - - RecomputeBufferSizeAfterLimit(); - - return oldLimit; - } - - private void RecomputeBufferSizeAfterLimit() - { - bufferSize += bufferSizeAfterLimit; - int bufferEnd = totalBytesRetired + bufferSize; - if (bufferEnd > currentLimit) - { - // Limit is in current buffer. - bufferSizeAfterLimit = bufferEnd - currentLimit; - bufferSize -= bufferSizeAfterLimit; - } - else - { - bufferSizeAfterLimit = 0; - } - } - - /// - /// Discards the current limit, returning the previous limit. - /// - public void PopLimit(int oldLimit) - { - currentLimit = oldLimit; - RecomputeBufferSizeAfterLimit(); - } - - /// - /// Returns whether or not all the data before the limit has been read. - /// - /// - public bool ReachedLimit - { - get - { - if (currentLimit == int.MaxValue) - { - return false; - } - int currentAbsolutePosition = totalBytesRetired + bufferPos; - return currentAbsolutePosition >= currentLimit; - } - } - - /// - /// Returns true if the stream has reached the end of the input. This is the - /// case if either the end of the underlying input source has been reached or - /// the stream has reached a limit created using PushLimit. - /// - public bool IsAtEnd - { - get { return bufferPos == bufferSize && !RefillBuffer(false); } - } - - /// - /// Called when buffer is empty to read more bytes from the - /// input. If is true, RefillBuffer() gurantees that - /// either there will be at least one byte in the buffer when it returns - /// or it will throw an exception. If is false, - /// RefillBuffer() returns false if no more bytes were available. - /// - /// - /// - private bool RefillBuffer(bool mustSucceed) - { - if (bufferPos < bufferSize) - { - throw new InvalidOperationException("RefillBuffer() called when buffer wasn't empty."); - } - - if (totalBytesRetired + bufferSize == currentLimit) - { - // Oops, we hit a limit. - if (mustSucceed) - { - throw InvalidProtocolBufferException.TruncatedMessage(); - } - else - { - return false; - } - } - - totalBytesRetired += bufferSize; - - bufferPos = 0; - bufferSize = (input == null) ? 0 : input.Read(buffer, 0, buffer.Length); - if (bufferSize < 0) - { - throw new InvalidOperationException("Stream.Read returned a negative count"); - } - if (bufferSize == 0) - { - if (mustSucceed) - { - throw InvalidProtocolBufferException.TruncatedMessage(); - } - else - { - return false; - } - } - else - { - RecomputeBufferSizeAfterLimit(); - int totalBytesRead = - totalBytesRetired + bufferSize + bufferSizeAfterLimit; - if (totalBytesRead > sizeLimit || totalBytesRead < 0) - { - throw InvalidProtocolBufferException.SizeLimitExceeded(); - } - return true; - } - } - - /// - /// Read one byte from the input. - /// - /// - /// the end of the stream or the current limit was reached - /// - public byte ReadRawByte() - { - if (bufferPos == bufferSize) - { - RefillBuffer(true); - } - return buffer[bufferPos++]; - } - - /// - /// Read a fixed size of bytes from the input. - /// - /// - /// the end of the stream or the current limit was reached - /// - public byte[] ReadRawBytes(int size) - { - if (size < 0) - { - throw InvalidProtocolBufferException.NegativeSize(); - } - - if (totalBytesRetired + bufferPos + size > currentLimit) - { - // Read to the end of the stream anyway. - SkipRawBytes(currentLimit - totalBytesRetired - bufferPos); - // Then fail. - throw InvalidProtocolBufferException.TruncatedMessage(); - } - - if (size <= bufferSize - bufferPos) - { - // We have all the bytes we need already. - byte[] bytes = new byte[size]; - ByteArray.Copy(buffer, bufferPos, bytes, 0, size); - bufferPos += size; - return bytes; - } - else if (size < buffer.Length) - { - // Reading more bytes than are in the buffer, but not an excessive number - // of bytes. We can safely allocate the resulting array ahead of time. - - // First copy what we have. - byte[] bytes = new byte[size]; - int pos = bufferSize - bufferPos; - ByteArray.Copy(buffer, bufferPos, bytes, 0, pos); - bufferPos = bufferSize; - - // We want to use RefillBuffer() and then copy from the buffer into our - // byte array rather than reading directly into our byte array because - // the input may be unbuffered. - RefillBuffer(true); - - while (size - pos > bufferSize) - { - Buffer.BlockCopy(buffer, 0, bytes, pos, bufferSize); - pos += bufferSize; - bufferPos = bufferSize; - RefillBuffer(true); - } - - ByteArray.Copy(buffer, 0, bytes, pos, size - pos); - bufferPos = size - pos; - - return bytes; - } - else - { - // The size is very large. For security reasons, we can't allocate the - // entire byte array yet. The size comes directly from the input, so a - // maliciously-crafted message could provide a bogus very large size in - // order to trick the app into allocating a lot of memory. We avoid this - // by allocating and reading only a small chunk at a time, so that the - // malicious message must actually *be* extremely large to cause - // problems. Meanwhile, we limit the allowed size of a message elsewhere. - - // Remember the buffer markers since we'll have to copy the bytes out of - // it later. - int originalBufferPos = bufferPos; - int originalBufferSize = bufferSize; - - // Mark the current buffer consumed. - totalBytesRetired += bufferSize; - bufferPos = 0; - bufferSize = 0; - - // Read all the rest of the bytes we need. - int sizeLeft = size - (originalBufferSize - originalBufferPos); - List chunks = new List(); - - while (sizeLeft > 0) - { - byte[] chunk = new byte[Math.Min(sizeLeft, buffer.Length)]; - int pos = 0; - while (pos < chunk.Length) - { - int n = (input == null) ? -1 : input.Read(chunk, pos, chunk.Length - pos); - if (n <= 0) - { - throw InvalidProtocolBufferException.TruncatedMessage(); - } - totalBytesRetired += n; - pos += n; - } - sizeLeft -= chunk.Length; - chunks.Add(chunk); - } - - // OK, got everything. Now concatenate it all into one buffer. - byte[] bytes = new byte[size]; - - // Start by copying the leftover bytes from this.buffer. - int newPos = originalBufferSize - originalBufferPos; - ByteArray.Copy(buffer, originalBufferPos, bytes, 0, newPos); - - // And now all the chunks. - foreach (byte[] chunk in chunks) - { - Buffer.BlockCopy(chunk, 0, bytes, newPos, chunk.Length); - newPos += chunk.Length; - } - - // Done. - return bytes; - } - } - - /// - /// Reads and discards a single field, given its tag value. - /// - /// false if the tag is an end-group tag, in which case - /// nothing is skipped. Otherwise, returns true. - [CLSCompliant(false)] - public bool SkipField() - { - uint tag = lastTag; - switch (WireFormat.GetTagWireType(tag)) - { - case WireFormat.WireType.Varint: - ReadRawVarint64(); - return true; - case WireFormat.WireType.Fixed64: - ReadRawLittleEndian64(); - return true; - case WireFormat.WireType.LengthDelimited: - SkipRawBytes((int) ReadRawVarint32()); - return true; - case WireFormat.WireType.StartGroup: - SkipMessage(); - CheckLastTagWas( - WireFormat.MakeTag(WireFormat.GetTagFieldNumber(tag), - WireFormat.WireType.EndGroup)); - return true; - case WireFormat.WireType.EndGroup: - return false; - case WireFormat.WireType.Fixed32: - ReadRawLittleEndian32(); - return true; - default: - throw InvalidProtocolBufferException.InvalidWireType(); - } - } - - /// - /// Reads and discards an entire message. This will read either until EOF - /// or until an endgroup tag, whichever comes first. - /// - public void SkipMessage() - { - uint tag; - string name; - while (ReadTag(out tag, out name)) - { - if (!SkipField()) - { - return; - } - } - } - - /// - /// Reads and discards bytes. - /// - /// the end of the stream - /// or the current limit was reached - public void SkipRawBytes(int size) - { - if (size < 0) - { - throw InvalidProtocolBufferException.NegativeSize(); - } - - if (totalBytesRetired + bufferPos + size > currentLimit) - { - // Read to the end of the stream anyway. - SkipRawBytes(currentLimit - totalBytesRetired - bufferPos); - // Then fail. - throw InvalidProtocolBufferException.TruncatedMessage(); - } - - if (size <= bufferSize - bufferPos) - { - // We have all the bytes we need already. - bufferPos += size; - } - else - { - // Skipping more bytes than are in the buffer. First skip what we have. - int pos = bufferSize - bufferPos; - - // ROK 5/7/2013 Issue #54: should retire all bytes in buffer (bufferSize) - // totalBytesRetired += pos; - totalBytesRetired += bufferSize; - - bufferPos = 0; - bufferSize = 0; - - // Then skip directly from the InputStream for the rest. - if (pos < size) - { - if (input == null) - { - throw InvalidProtocolBufferException.TruncatedMessage(); - } - SkipImpl(size - pos); - totalBytesRetired += size - pos; - } - } - } - - /// - /// Abstraction of skipping to cope with streams which can't really skip. - /// - private void SkipImpl(int amountToSkip) - { - if (input.CanSeek) - { - long previousPosition = input.Position; - input.Position += amountToSkip; - if (input.Position != previousPosition + amountToSkip) - { - throw InvalidProtocolBufferException.TruncatedMessage(); - } - } - else - { - byte[] skipBuffer = new byte[1024]; - while (amountToSkip > 0) - { - int bytesRead = input.Read(skipBuffer, 0, skipBuffer.Length); - if (bytesRead <= 0) - { - throw InvalidProtocolBufferException.TruncatedMessage(); - } - amountToSkip -= bytesRead; - } - } - } - - #endregion - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/CodedOutputStream.ComputeSize.cs b/src/ProtocolBuffers/CodedOutputStream.ComputeSize.cs deleted file mode 100644 index ca6662a..0000000 --- a/src/ProtocolBuffers/CodedOutputStream.ComputeSize.cs +++ /dev/null @@ -1,653 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Globalization; -using System.Text; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers -{ - // This part of CodedOutputStream provides all the static entry points that are used - // by generated code and internally to compute the size of messages prior to being - // written to an instance of CodedOutputStream. - public sealed partial class CodedOutputStream - { - private const int LittleEndian64Size = 8; - private const int LittleEndian32Size = 4; - - /// - /// Compute the number of bytes that would be needed to encode a - /// double field, including the tag. - /// - public static int ComputeDoubleSize(int fieldNumber, double value) - { - return ComputeTagSize(fieldNumber) + LittleEndian64Size; - } - - /// - /// Compute the number of bytes that would be needed to encode a - /// float field, including the tag. - /// - public static int ComputeFloatSize(int fieldNumber, float value) - { - return ComputeTagSize(fieldNumber) + LittleEndian32Size; - } - - /// - /// Compute the number of bytes that would be needed to encode a - /// uint64 field, including the tag. - /// - [CLSCompliant(false)] - public static int ComputeUInt64Size(int fieldNumber, ulong value) - { - return ComputeTagSize(fieldNumber) + ComputeRawVarint64Size(value); - } - - /// - /// Compute the number of bytes that would be needed to encode an - /// int64 field, including the tag. - /// - public static int ComputeInt64Size(int fieldNumber, long value) - { - return ComputeTagSize(fieldNumber) + ComputeRawVarint64Size((ulong) value); - } - - /// - /// Compute the number of bytes that would be needed to encode an - /// int32 field, including the tag. - /// - public static int ComputeInt32Size(int fieldNumber, int value) - { - if (value >= 0) - { - return ComputeTagSize(fieldNumber) + ComputeRawVarint32Size((uint) value); - } - else - { - // Must sign-extend. - return ComputeTagSize(fieldNumber) + 10; - } - } - - /// - /// Compute the number of bytes that would be needed to encode a - /// fixed64 field, including the tag. - /// - [CLSCompliant(false)] - public static int ComputeFixed64Size(int fieldNumber, ulong value) - { - return ComputeTagSize(fieldNumber) + LittleEndian64Size; - } - - /// - /// Compute the number of bytes that would be needed to encode a - /// fixed32 field, including the tag. - /// - [CLSCompliant(false)] - public static int ComputeFixed32Size(int fieldNumber, uint value) - { - return ComputeTagSize(fieldNumber) + LittleEndian32Size; - } - - /// - /// Compute the number of bytes that would be needed to encode a - /// bool field, including the tag. - /// - public static int ComputeBoolSize(int fieldNumber, bool value) - { - return ComputeTagSize(fieldNumber) + 1; - } - - /// - /// Compute the number of bytes that would be needed to encode a - /// string field, including the tag. - /// - public static int ComputeStringSize(int fieldNumber, String value) - { - int byteArraySize = Encoding.UTF8.GetByteCount(value); - return ComputeTagSize(fieldNumber) + - ComputeRawVarint32Size((uint) byteArraySize) + - byteArraySize; - } - - /// - /// Compute the number of bytes that would be needed to encode a - /// group field, including the tag. - /// - public static int ComputeGroupSize(int fieldNumber, IMessageLite value) - { - return ComputeTagSize(fieldNumber)*2 + value.SerializedSize; - } - - /// - /// Compute the number of bytes that would be needed to encode a - /// group field represented by an UnknownFieldSet, including the tag. - /// - [Obsolete] - public static int ComputeUnknownGroupSize(int fieldNumber, - IMessageLite value) - { - return ComputeTagSize(fieldNumber)*2 + value.SerializedSize; - } - - /// - /// Compute the number of bytes that would be needed to encode an - /// embedded message field, including the tag. - /// - public static int ComputeMessageSize(int fieldNumber, IMessageLite value) - { - int size = value.SerializedSize; - return ComputeTagSize(fieldNumber) + ComputeRawVarint32Size((uint) size) + size; - } - - /// - /// Compute the number of bytes that would be needed to encode a - /// bytes field, including the tag. - /// - public static int ComputeBytesSize(int fieldNumber, ByteString value) - { - return ComputeTagSize(fieldNumber) + - ComputeRawVarint32Size((uint) value.Length) + - value.Length; - } - - /// - /// Compute the number of bytes that would be needed to encode a - /// uint32 field, including the tag. - /// - [CLSCompliant(false)] - public static int ComputeUInt32Size(int fieldNumber, uint value) - { - return ComputeTagSize(fieldNumber) + ComputeRawVarint32Size(value); - } - - /// - /// Compute the number of bytes that would be needed to encode a - /// enum field, including the tag. The caller is responsible for - /// converting the enum value to its numeric value. - /// - public static int ComputeEnumSize(int fieldNumber, int value) - { - return ComputeTagSize(fieldNumber) + ComputeEnumSizeNoTag(value); - } - - /// - /// Compute the number of bytes that would be needed to encode an - /// sfixed32 field, including the tag. - /// - public static int ComputeSFixed32Size(int fieldNumber, int value) - { - return ComputeTagSize(fieldNumber) + LittleEndian32Size; - } - - /// - /// Compute the number of bytes that would be needed to encode an - /// sfixed64 field, including the tag. - /// - public static int ComputeSFixed64Size(int fieldNumber, long value) - { - return ComputeTagSize(fieldNumber) + LittleEndian64Size; - } - - /// - /// Compute the number of bytes that would be needed to encode an - /// sint32 field, including the tag. - /// - public static int ComputeSInt32Size(int fieldNumber, int value) - { - return ComputeTagSize(fieldNumber) + ComputeRawVarint32Size(EncodeZigZag32(value)); - } - - /// - /// Compute the number of bytes that would be needed to encode an - /// sint64 field, including the tag. - /// - public static int ComputeSInt64Size(int fieldNumber, long value) - { - return ComputeTagSize(fieldNumber) + ComputeRawVarint64Size(EncodeZigZag64(value)); - } - - /// - /// Compute the number of bytes that would be needed to encode a - /// double field, including the tag. - /// - public static int ComputeDoubleSizeNoTag(double value) - { - return LittleEndian64Size; - } - - /// - /// Compute the number of bytes that would be needed to encode a - /// float field, including the tag. - /// - public static int ComputeFloatSizeNoTag(float value) - { - return LittleEndian32Size; - } - - /// - /// Compute the number of bytes that would be needed to encode a - /// uint64 field, including the tag. - /// - [CLSCompliant(false)] - public static int ComputeUInt64SizeNoTag(ulong value) - { - return ComputeRawVarint64Size(value); - } - - /// - /// Compute the number of bytes that would be needed to encode an - /// int64 field, including the tag. - /// - public static int ComputeInt64SizeNoTag(long value) - { - return ComputeRawVarint64Size((ulong) value); - } - - /// - /// Compute the number of bytes that would be needed to encode an - /// int32 field, including the tag. - /// - public static int ComputeInt32SizeNoTag(int value) - { - if (value >= 0) - { - return ComputeRawVarint32Size((uint) value); - } - else - { - // Must sign-extend. - return 10; - } - } - - /// - /// Compute the number of bytes that would be needed to encode a - /// fixed64 field, including the tag. - /// - [CLSCompliant(false)] - public static int ComputeFixed64SizeNoTag(ulong value) - { - return LittleEndian64Size; - } - - /// - /// Compute the number of bytes that would be needed to encode a - /// fixed32 field, including the tag. - /// - [CLSCompliant(false)] - public static int ComputeFixed32SizeNoTag(uint value) - { - return LittleEndian32Size; - } - - /// - /// Compute the number of bytes that would be needed to encode a - /// bool field, including the tag. - /// - public static int ComputeBoolSizeNoTag(bool value) - { - return 1; - } - - /// - /// Compute the number of bytes that would be needed to encode a - /// string field, including the tag. - /// - public static int ComputeStringSizeNoTag(String value) - { - int byteArraySize = Encoding.UTF8.GetByteCount(value); - return ComputeRawVarint32Size((uint) byteArraySize) + - byteArraySize; - } - - /// - /// Compute the number of bytes that would be needed to encode a - /// group field, including the tag. - /// - public static int ComputeGroupSizeNoTag(IMessageLite value) - { - return value.SerializedSize; - } - - /// - /// Compute the number of bytes that would be needed to encode a - /// group field represented by an UnknownFieldSet, including the tag. - /// - [Obsolete] - public static int ComputeUnknownGroupSizeNoTag(IMessageLite value) - { - return value.SerializedSize; - } - - /// - /// Compute the number of bytes that would be needed to encode an - /// embedded message field, including the tag. - /// - public static int ComputeMessageSizeNoTag(IMessageLite value) - { - int size = value.SerializedSize; - return ComputeRawVarint32Size((uint) size) + size; - } - - /// - /// Compute the number of bytes that would be needed to encode a - /// bytes field, including the tag. - /// - public static int ComputeBytesSizeNoTag(ByteString value) - { - return ComputeRawVarint32Size((uint) value.Length) + - value.Length; - } - - /// - /// Compute the number of bytes that would be needed to encode a - /// uint32 field, including the tag. - /// - [CLSCompliant(false)] - public static int ComputeUInt32SizeNoTag(uint value) - { - return ComputeRawVarint32Size(value); - } - - /// - /// Compute the number of bytes that would be needed to encode a - /// enum field, including the tag. The caller is responsible for - /// converting the enum value to its numeric value. - /// - public static int ComputeEnumSizeNoTag(int value) - { - return ComputeInt32SizeNoTag(value); - } - - /// - /// Compute the number of bytes that would be needed to encode an - /// sfixed32 field, including the tag. - /// - public static int ComputeSFixed32SizeNoTag(int value) - { - return LittleEndian32Size; - } - - /// - /// Compute the number of bytes that would be needed to encode an - /// sfixed64 field, including the tag. - /// - public static int ComputeSFixed64SizeNoTag(long value) - { - return LittleEndian64Size; - } - - /// - /// Compute the number of bytes that would be needed to encode an - /// sint32 field, including the tag. - /// - public static int ComputeSInt32SizeNoTag(int value) - { - return ComputeRawVarint32Size(EncodeZigZag32(value)); - } - - /// - /// Compute the number of bytes that would be needed to encode an - /// sint64 field, including the tag. - /// - public static int ComputeSInt64SizeNoTag(long value) - { - return ComputeRawVarint64Size(EncodeZigZag64(value)); - } - - /* - * Compute the number of bytes that would be needed to encode a - * MessageSet extension to the stream. For historical reasons, - * the wire format differs from normal fields. - */ - - /// - /// Compute the number of bytes that would be needed to encode a - /// MessageSet extension to the stream. For historical reasons, - /// the wire format differs from normal fields. - /// - public static int ComputeMessageSetExtensionSize(int fieldNumber, IMessageLite value) - { - return ComputeTagSize(WireFormat.MessageSetField.Item)*2 + - ComputeUInt32Size(WireFormat.MessageSetField.TypeID, (uint) fieldNumber) + - ComputeMessageSize(WireFormat.MessageSetField.Message, value); - } - - /// - /// Compute the number of bytes that would be needed to encode an - /// unparsed MessageSet extension field to the stream. For - /// historical reasons, the wire format differs from normal fields. - /// - public static int ComputeRawMessageSetExtensionSize(int fieldNumber, ByteString value) - { - return ComputeTagSize(WireFormat.MessageSetField.Item)*2 + - ComputeUInt32Size(WireFormat.MessageSetField.TypeID, (uint) fieldNumber) + - ComputeBytesSize(WireFormat.MessageSetField.Message, value); - } - - /// - /// Compute the number of bytes that would be needed to encode a varint. - /// - [CLSCompliant(false)] - public static int ComputeRawVarint32Size(uint value) - { - if ((value & (0xffffffff << 7)) == 0) - { - return 1; - } - if ((value & (0xffffffff << 14)) == 0) - { - return 2; - } - if ((value & (0xffffffff << 21)) == 0) - { - return 3; - } - if ((value & (0xffffffff << 28)) == 0) - { - return 4; - } - return 5; - } - - /// - /// Compute the number of bytes that would be needed to encode a varint. - /// - [CLSCompliant(false)] - public static int ComputeRawVarint64Size(ulong value) - { - if ((value & (0xffffffffffffffffL << 7)) == 0) - { - return 1; - } - if ((value & (0xffffffffffffffffL << 14)) == 0) - { - return 2; - } - if ((value & (0xffffffffffffffffL << 21)) == 0) - { - return 3; - } - if ((value & (0xffffffffffffffffL << 28)) == 0) - { - return 4; - } - if ((value & (0xffffffffffffffffL << 35)) == 0) - { - return 5; - } - if ((value & (0xffffffffffffffffL << 42)) == 0) - { - return 6; - } - if ((value & (0xffffffffffffffffL << 49)) == 0) - { - return 7; - } - if ((value & (0xffffffffffffffffL << 56)) == 0) - { - return 8; - } - if ((value & (0xffffffffffffffffL << 63)) == 0) - { - return 9; - } - return 10; - } - - /// - /// Compute the number of bytes that would be needed to encode a - /// field of arbitrary type, including the tag, to the stream. - /// - public static int ComputeFieldSize(FieldType fieldType, int fieldNumber, Object value) - { - switch (fieldType) - { - case FieldType.Double: - return ComputeDoubleSize(fieldNumber, (double) value); - case FieldType.Float: - return ComputeFloatSize(fieldNumber, (float) value); - case FieldType.Int64: - return ComputeInt64Size(fieldNumber, (long) value); - case FieldType.UInt64: - return ComputeUInt64Size(fieldNumber, (ulong) value); - case FieldType.Int32: - return ComputeInt32Size(fieldNumber, (int) value); - case FieldType.Fixed64: - return ComputeFixed64Size(fieldNumber, (ulong) value); - case FieldType.Fixed32: - return ComputeFixed32Size(fieldNumber, (uint) value); - case FieldType.Bool: - return ComputeBoolSize(fieldNumber, (bool) value); - case FieldType.String: - return ComputeStringSize(fieldNumber, (string) value); - case FieldType.Group: - return ComputeGroupSize(fieldNumber, (IMessageLite) value); - case FieldType.Message: - return ComputeMessageSize(fieldNumber, (IMessageLite) value); - case FieldType.Bytes: - return ComputeBytesSize(fieldNumber, (ByteString) value); - case FieldType.UInt32: - return ComputeUInt32Size(fieldNumber, (uint) value); - case FieldType.SFixed32: - return ComputeSFixed32Size(fieldNumber, (int) value); - case FieldType.SFixed64: - return ComputeSFixed64Size(fieldNumber, (long) value); - case FieldType.SInt32: - return ComputeSInt32Size(fieldNumber, (int) value); - case FieldType.SInt64: - return ComputeSInt64Size(fieldNumber, (long) value); - case FieldType.Enum: - if (value is Enum) - { - return ComputeEnumSize(fieldNumber, Convert.ToInt32(value)); - } - else - { - return ComputeEnumSize(fieldNumber, ((IEnumLite) value).Number); - } - default: - throw new ArgumentOutOfRangeException("Invalid field type " + fieldType); - } - } - - /// - /// Compute the number of bytes that would be needed to encode a - /// field of arbitrary type, excluding the tag, to the stream. - /// - public static int ComputeFieldSizeNoTag(FieldType fieldType, Object value) - { - switch (fieldType) - { - case FieldType.Double: - return ComputeDoubleSizeNoTag((double) value); - case FieldType.Float: - return ComputeFloatSizeNoTag((float) value); - case FieldType.Int64: - return ComputeInt64SizeNoTag((long) value); - case FieldType.UInt64: - return ComputeUInt64SizeNoTag((ulong) value); - case FieldType.Int32: - return ComputeInt32SizeNoTag((int) value); - case FieldType.Fixed64: - return ComputeFixed64SizeNoTag((ulong) value); - case FieldType.Fixed32: - return ComputeFixed32SizeNoTag((uint) value); - case FieldType.Bool: - return ComputeBoolSizeNoTag((bool) value); - case FieldType.String: - return ComputeStringSizeNoTag((string) value); - case FieldType.Group: - return ComputeGroupSizeNoTag((IMessageLite) value); - case FieldType.Message: - return ComputeMessageSizeNoTag((IMessageLite) value); - case FieldType.Bytes: - return ComputeBytesSizeNoTag((ByteString) value); - case FieldType.UInt32: - return ComputeUInt32SizeNoTag((uint) value); - case FieldType.SFixed32: - return ComputeSFixed32SizeNoTag((int) value); - case FieldType.SFixed64: - return ComputeSFixed64SizeNoTag((long) value); - case FieldType.SInt32: - return ComputeSInt32SizeNoTag((int) value); - case FieldType.SInt64: - return ComputeSInt64SizeNoTag((long) value); - case FieldType.Enum: - if (value is Enum) - { - return ComputeEnumSizeNoTag(Convert.ToInt32(value)); - } - else - { - return ComputeEnumSizeNoTag(((IEnumLite) value).Number); - } - default: - throw new ArgumentOutOfRangeException("Invalid field type " + fieldType); - } - } - - /// - /// Compute the number of bytes that would be needed to encode a tag. - /// - public static int ComputeTagSize(int fieldNumber) - { - return ComputeRawVarint32Size(WireFormat.MakeTag(fieldNumber, 0)); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/CodedOutputStream.cs b/src/ProtocolBuffers/CodedOutputStream.cs deleted file mode 100644 index d267b75..0000000 --- a/src/ProtocolBuffers/CodedOutputStream.cs +++ /dev/null @@ -1,1341 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Text; -using Google.ProtocolBuffers.Collections; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers -{ - /// - /// Encodes and writes protocol message fields. - /// - /// - /// This class contains two kinds of methods: methods that write specific - /// protocol message constructs and field types (e.g. WriteTag and - /// WriteInt32) and methods that write low-level values (e.g. - /// WriteRawVarint32 and WriteRawBytes). If you are writing encoded protocol - /// messages, you should use the former methods, but if you are writing some - /// other format of your own design, use the latter. The names of the former - /// methods are taken from the protocol buffer type names, not .NET types. - /// (Hence WriteFloat instead of WriteSingle, and WriteBool instead of WriteBoolean.) - /// - public sealed partial class CodedOutputStream : ICodedOutputStream - { - /// - /// The buffer size used by CreateInstance(Stream). - /// - public static readonly int DefaultBufferSize = 4096; - - private readonly byte[] buffer; - private readonly int limit; - private int position; - private readonly Stream output; - - #region Construction - - private CodedOutputStream(byte[] buffer, int offset, int length) - { - this.output = null; - this.buffer = buffer; - this.position = offset; - this.limit = offset + length; - } - - private CodedOutputStream(Stream output, byte[] buffer) - { - this.output = output; - this.buffer = buffer; - this.position = 0; - this.limit = buffer.Length; - } - - /// - /// Creates a new CodedOutputStream which write to the given stream. - /// - public static CodedOutputStream CreateInstance(Stream output) - { - return CreateInstance(output, DefaultBufferSize); - } - - /// - /// Creates a new CodedOutputStream which write to the given stream and uses - /// the specified buffer size. - /// - public static CodedOutputStream CreateInstance(Stream output, int bufferSize) - { - return new CodedOutputStream(output, new byte[bufferSize]); - } - - /// - /// Creates a new CodedOutputStream that writes directly to the given - /// byte array. If more bytes are written than fit in the array, - /// OutOfSpaceException will be thrown. - /// - public static CodedOutputStream CreateInstance(byte[] flatArray) - { - return CreateInstance(flatArray, 0, flatArray.Length); - } - - /// - /// Creates a new CodedOutputStream that writes directly to the given - /// byte array slice. If more bytes are written than fit in the array, - /// OutOfSpaceException will be thrown. - /// - public static CodedOutputStream CreateInstance(byte[] flatArray, int offset, int length) - { - return new CodedOutputStream(flatArray, offset, length); - } - - #endregion - - /// - /// Returns the current position in the stream, or the position in the output buffer - /// - public long Position - { - get - { - if (output != null) - { - return output.Position + position; - } - return position; - } - } - - void ICodedOutputStream.WriteMessageStart() { } - void ICodedOutputStream.WriteMessageEnd() { Flush(); } - - #region Writing of unknown fields - - [Obsolete] - public void WriteUnknownGroup(int fieldNumber, IMessageLite value) - { - WriteTag(fieldNumber, WireFormat.WireType.StartGroup); - value.WriteTo(this); - WriteTag(fieldNumber, WireFormat.WireType.EndGroup); - } - - public void WriteUnknownBytes(int fieldNumber, ByteString value) - { - WriteBytes(fieldNumber, null /*not used*/, value); - } - - [CLSCompliant(false)] - public void WriteUnknownField(int fieldNumber, WireFormat.WireType wireType, ulong value) - { - if (wireType == WireFormat.WireType.Varint) - { - WriteUInt64(fieldNumber, null /*not used*/, value); - } - else if (wireType == WireFormat.WireType.Fixed32) - { - WriteFixed32(fieldNumber, null /*not used*/, (uint) value); - } - else if (wireType == WireFormat.WireType.Fixed64) - { - WriteFixed64(fieldNumber, null /*not used*/, value); - } - else - { - throw InvalidProtocolBufferException.InvalidWireType(); - } - } - - #endregion - - #region Writing of tags and fields - - public void WriteField(FieldType fieldType, int fieldNumber, string fieldName, object value) - { - switch (fieldType) - { - case FieldType.String: - WriteString(fieldNumber, fieldName, (string) value); - break; - case FieldType.Message: - WriteMessage(fieldNumber, fieldName, (IMessageLite) value); - break; - case FieldType.Group: - WriteGroup(fieldNumber, fieldName, (IMessageLite) value); - break; - case FieldType.Bytes: - WriteBytes(fieldNumber, fieldName, (ByteString) value); - break; - case FieldType.Bool: - WriteBool(fieldNumber, fieldName, (bool) value); - break; - case FieldType.Enum: - if (value is Enum) - { - WriteEnum(fieldNumber, fieldName, (int) value, null /*not used*/); - } - else - { - WriteEnum(fieldNumber, fieldName, ((IEnumLite) value).Number, null /*not used*/); - } - break; - case FieldType.Int32: - WriteInt32(fieldNumber, fieldName, (int) value); - break; - case FieldType.Int64: - WriteInt64(fieldNumber, fieldName, (long) value); - break; - case FieldType.UInt32: - WriteUInt32(fieldNumber, fieldName, (uint) value); - break; - case FieldType.UInt64: - WriteUInt64(fieldNumber, fieldName, (ulong) value); - break; - case FieldType.SInt32: - WriteSInt32(fieldNumber, fieldName, (int) value); - break; - case FieldType.SInt64: - WriteSInt64(fieldNumber, fieldName, (long) value); - break; - case FieldType.Fixed32: - WriteFixed32(fieldNumber, fieldName, (uint) value); - break; - case FieldType.Fixed64: - WriteFixed64(fieldNumber, fieldName, (ulong) value); - break; - case FieldType.SFixed32: - WriteSFixed32(fieldNumber, fieldName, (int) value); - break; - case FieldType.SFixed64: - WriteSFixed64(fieldNumber, fieldName, (long) value); - break; - case FieldType.Double: - WriteDouble(fieldNumber, fieldName, (double) value); - break; - case FieldType.Float: - WriteFloat(fieldNumber, fieldName, (float) value); - break; - } - } - - /// - /// Writes a double field value, including tag, to the stream. - /// - public void WriteDouble(int fieldNumber, string fieldName, double value) - { - WriteTag(fieldNumber, WireFormat.WireType.Fixed64); - WriteDoubleNoTag(value); - } - - /// - /// Writes a float field value, including tag, to the stream. - /// - public void WriteFloat(int fieldNumber, string fieldName, float value) - { - WriteTag(fieldNumber, WireFormat.WireType.Fixed32); - WriteFloatNoTag(value); - } - - /// - /// Writes a uint64 field value, including tag, to the stream. - /// - [CLSCompliant(false)] - public void WriteUInt64(int fieldNumber, string fieldName, ulong value) - { - WriteTag(fieldNumber, WireFormat.WireType.Varint); - WriteRawVarint64(value); - } - - /// - /// Writes an int64 field value, including tag, to the stream. - /// - public void WriteInt64(int fieldNumber, string fieldName, long value) - { - WriteTag(fieldNumber, WireFormat.WireType.Varint); - WriteRawVarint64((ulong) value); - } - - /// - /// Writes an int32 field value, including tag, to the stream. - /// - public void WriteInt32(int fieldNumber, string fieldName, int value) - { - WriteTag(fieldNumber, WireFormat.WireType.Varint); - if (value >= 0) - { - WriteRawVarint32((uint) value); - } - else - { - // Must sign-extend. - WriteRawVarint64((ulong) value); - } - } - - /// - /// Writes a fixed64 field value, including tag, to the stream. - /// - [CLSCompliant(false)] - public void WriteFixed64(int fieldNumber, string fieldName, ulong value) - { - WriteTag(fieldNumber, WireFormat.WireType.Fixed64); - WriteRawLittleEndian64(value); - } - - /// - /// Writes a fixed32 field value, including tag, to the stream. - /// - [CLSCompliant(false)] - public void WriteFixed32(int fieldNumber, string fieldName, uint value) - { - WriteTag(fieldNumber, WireFormat.WireType.Fixed32); - WriteRawLittleEndian32(value); - } - - /// - /// Writes a bool field value, including tag, to the stream. - /// - public void WriteBool(int fieldNumber, string fieldName, bool value) - { - WriteTag(fieldNumber, WireFormat.WireType.Varint); - WriteRawByte(value ? (byte) 1 : (byte) 0); - } - - /// - /// Writes a string field value, including tag, to the stream. - /// - public void WriteString(int fieldNumber, string fieldName, string value) - { - WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited); - // Optimise the case where we have enough space to write - // the string directly to the buffer, which should be common. - int length = Encoding.UTF8.GetByteCount(value); - WriteRawVarint32((uint) length); - if (limit - position >= length) - { - Encoding.UTF8.GetBytes(value, 0, value.Length, buffer, position); - position += length; - } - else - { - byte[] bytes = Encoding.UTF8.GetBytes(value); - WriteRawBytes(bytes); - } - } - - /// - /// Writes a group field value, including tag, to the stream. - /// - public void WriteGroup(int fieldNumber, string fieldName, IMessageLite value) - { - WriteTag(fieldNumber, WireFormat.WireType.StartGroup); - value.WriteTo(this); - WriteTag(fieldNumber, WireFormat.WireType.EndGroup); - } - - public void WriteMessage(int fieldNumber, string fieldName, IMessageLite value) - { - WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited); - WriteRawVarint32((uint) value.SerializedSize); - value.WriteTo(this); - } - - public void WriteBytes(int fieldNumber, string fieldName, ByteString value) - { - WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited); - WriteRawVarint32((uint) value.Length); - value.WriteRawBytesTo(this); - } - - [CLSCompliant(false)] - public void WriteUInt32(int fieldNumber, string fieldName, uint value) - { - WriteTag(fieldNumber, WireFormat.WireType.Varint); - WriteRawVarint32(value); - } - - public void WriteEnum(int fieldNumber, string fieldName, int value, object rawValue) - { - WriteTag(fieldNumber, WireFormat.WireType.Varint); - WriteInt32NoTag(value); - } - - public void WriteSFixed32(int fieldNumber, string fieldName, int value) - { - WriteTag(fieldNumber, WireFormat.WireType.Fixed32); - WriteRawLittleEndian32((uint) value); - } - - public void WriteSFixed64(int fieldNumber, string fieldName, long value) - { - WriteTag(fieldNumber, WireFormat.WireType.Fixed64); - WriteRawLittleEndian64((ulong) value); - } - - public void WriteSInt32(int fieldNumber, string fieldName, int value) - { - WriteTag(fieldNumber, WireFormat.WireType.Varint); - WriteRawVarint32(EncodeZigZag32(value)); - } - - public void WriteSInt64(int fieldNumber, string fieldName, long value) - { - WriteTag(fieldNumber, WireFormat.WireType.Varint); - WriteRawVarint64(EncodeZigZag64(value)); - } - - public void WriteMessageSetExtension(int fieldNumber, string fieldName, IMessageLite value) - { - WriteTag(WireFormat.MessageSetField.Item, WireFormat.WireType.StartGroup); - WriteUInt32(WireFormat.MessageSetField.TypeID, "type_id", (uint) fieldNumber); - WriteMessage(WireFormat.MessageSetField.Message, "message", value); - WriteTag(WireFormat.MessageSetField.Item, WireFormat.WireType.EndGroup); - } - - public void WriteMessageSetExtension(int fieldNumber, string fieldName, ByteString value) - { - WriteTag(WireFormat.MessageSetField.Item, WireFormat.WireType.StartGroup); - WriteUInt32(WireFormat.MessageSetField.TypeID, "type_id", (uint) fieldNumber); - WriteBytes(WireFormat.MessageSetField.Message, "message", value); - WriteTag(WireFormat.MessageSetField.Item, WireFormat.WireType.EndGroup); - } - - #endregion - - #region Writing of values without tags - - public void WriteFieldNoTag(FieldType fieldType, object value) - { - switch (fieldType) - { - case FieldType.String: - WriteStringNoTag((string) value); - break; - case FieldType.Message: - WriteMessageNoTag((IMessageLite) value); - break; - case FieldType.Group: - WriteGroupNoTag((IMessageLite) value); - break; - case FieldType.Bytes: - WriteBytesNoTag((ByteString) value); - break; - case FieldType.Bool: - WriteBoolNoTag((bool) value); - break; - case FieldType.Enum: - if (value is Enum) - { - WriteEnumNoTag((int) value); - } - else - { - WriteEnumNoTag(((IEnumLite) value).Number); - } - break; - case FieldType.Int32: - WriteInt32NoTag((int) value); - break; - case FieldType.Int64: - WriteInt64NoTag((long) value); - break; - case FieldType.UInt32: - WriteUInt32NoTag((uint) value); - break; - case FieldType.UInt64: - WriteUInt64NoTag((ulong) value); - break; - case FieldType.SInt32: - WriteSInt32NoTag((int) value); - break; - case FieldType.SInt64: - WriteSInt64NoTag((long) value); - break; - case FieldType.Fixed32: - WriteFixed32NoTag((uint) value); - break; - case FieldType.Fixed64: - WriteFixed64NoTag((ulong) value); - break; - case FieldType.SFixed32: - WriteSFixed32NoTag((int) value); - break; - case FieldType.SFixed64: - WriteSFixed64NoTag((long) value); - break; - case FieldType.Double: - WriteDoubleNoTag((double) value); - break; - case FieldType.Float: - WriteFloatNoTag((float) value); - break; - } - } - - /// - /// Writes a double field value, including tag, to the stream. - /// - public void WriteDoubleNoTag(double value) - { - WriteRawLittleEndian64((ulong)FrameworkPortability.DoubleToInt64(value)); - } - - /// - /// Writes a float field value, without a tag, to the stream. - /// - public void WriteFloatNoTag(float value) - { - byte[] rawBytes = BitConverter.GetBytes(value); - if (!BitConverter.IsLittleEndian) - { - ByteArray.Reverse(rawBytes); - } - - if (limit - position >= 4) - { - buffer[position++] = rawBytes[0]; - buffer[position++] = rawBytes[1]; - buffer[position++] = rawBytes[2]; - buffer[position++] = rawBytes[3]; - } - else - { - WriteRawBytes(rawBytes, 0, 4); - } - } - - /// - /// Writes a uint64 field value, without a tag, to the stream. - /// - [CLSCompliant(false)] - public void WriteUInt64NoTag(ulong value) - { - WriteRawVarint64(value); - } - - /// - /// Writes an int64 field value, without a tag, to the stream. - /// - public void WriteInt64NoTag(long value) - { - WriteRawVarint64((ulong) value); - } - - /// - /// Writes an int32 field value, without a tag, to the stream. - /// - public void WriteInt32NoTag(int value) - { - if (value >= 0) - { - WriteRawVarint32((uint) value); - } - else - { - // Must sign-extend. - WriteRawVarint64((ulong) value); - } - } - - /// - /// Writes a fixed64 field value, without a tag, to the stream. - /// - [CLSCompliant(false)] - public void WriteFixed64NoTag(ulong value) - { - WriteRawLittleEndian64(value); - } - - /// - /// Writes a fixed32 field value, without a tag, to the stream. - /// - [CLSCompliant(false)] - public void WriteFixed32NoTag(uint value) - { - WriteRawLittleEndian32(value); - } - - /// - /// Writes a bool field value, without a tag, to the stream. - /// - public void WriteBoolNoTag(bool value) - { - WriteRawByte(value ? (byte) 1 : (byte) 0); - } - - /// - /// Writes a string field value, without a tag, to the stream. - /// - public void WriteStringNoTag(string value) - { - // Optimise the case where we have enough space to write - // the string directly to the buffer, which should be common. - int length = Encoding.UTF8.GetByteCount(value); - WriteRawVarint32((uint) length); - if (limit - position >= length) - { - Encoding.UTF8.GetBytes(value, 0, value.Length, buffer, position); - position += length; - } - else - { - byte[] bytes = Encoding.UTF8.GetBytes(value); - WriteRawBytes(bytes); - } - } - - /// - /// Writes a group field value, without a tag, to the stream. - /// - public void WriteGroupNoTag(IMessageLite value) - { - value.WriteTo(this); - } - - public void WriteMessageNoTag(IMessageLite value) - { - WriteRawVarint32((uint) value.SerializedSize); - value.WriteTo(this); - } - - public void WriteBytesNoTag(ByteString value) - { - WriteRawVarint32((uint) value.Length); - value.WriteRawBytesTo(this); - } - - [CLSCompliant(false)] - public void WriteUInt32NoTag(uint value) - { - WriteRawVarint32(value); - } - - public void WriteEnumNoTag(int value) - { - WriteInt32NoTag(value); - } - - public void WriteSFixed32NoTag(int value) - { - WriteRawLittleEndian32((uint) value); - } - - public void WriteSFixed64NoTag(long value) - { - WriteRawLittleEndian64((ulong) value); - } - - public void WriteSInt32NoTag(int value) - { - WriteRawVarint32(EncodeZigZag32(value)); - } - - public void WriteSInt64NoTag(long value) - { - WriteRawVarint64(EncodeZigZag64(value)); - } - - #endregion - - #region Write array members - - public void WriteArray(FieldType fieldType, int fieldNumber, string fieldName, IEnumerable list) - { - foreach (object element in list) - { - WriteField(fieldType, fieldNumber, fieldName, element); - } - } - - public void WriteGroupArray(int fieldNumber, string fieldName, IEnumerable list) - where T : IMessageLite - { - foreach (IMessageLite value in list) - { - WriteGroup(fieldNumber, fieldName, value); - } - } - - public void WriteMessageArray(int fieldNumber, string fieldName, IEnumerable list) - where T : IMessageLite - { - foreach (IMessageLite value in list) - { - WriteMessage(fieldNumber, fieldName, value); - } - } - - public void WriteStringArray(int fieldNumber, string fieldName, IEnumerable list) - { - foreach (var value in list) - { - WriteString(fieldNumber, fieldName, value); - } - } - - public void WriteBytesArray(int fieldNumber, string fieldName, IEnumerable list) - { - foreach (var value in list) - { - WriteBytes(fieldNumber, fieldName, value); - } - } - - public void WriteBoolArray(int fieldNumber, string fieldName, IEnumerable list) - { - foreach (var value in list) - { - WriteBool(fieldNumber, fieldName, value); - } - } - - public void WriteInt32Array(int fieldNumber, string fieldName, IEnumerable list) - { - foreach (var value in list) - { - WriteInt32(fieldNumber, fieldName, value); - } - } - - public void WriteSInt32Array(int fieldNumber, string fieldName, IEnumerable list) - { - foreach (var value in list) - { - WriteSInt32(fieldNumber, fieldName, value); - } - } - - public void WriteUInt32Array(int fieldNumber, string fieldName, IEnumerable list) - { - foreach (var value in list) - { - WriteUInt32(fieldNumber, fieldName, value); - } - } - - public void WriteFixed32Array(int fieldNumber, string fieldName, IEnumerable list) - { - foreach (var value in list) - { - WriteFixed32(fieldNumber, fieldName, value); - } - } - - public void WriteSFixed32Array(int fieldNumber, string fieldName, IEnumerable list) - { - foreach (var value in list) - { - WriteSFixed32(fieldNumber, fieldName, value); - } - } - - public void WriteInt64Array(int fieldNumber, string fieldName, IEnumerable list) - { - foreach (var value in list) - { - WriteInt64(fieldNumber, fieldName, value); - } - } - - public void WriteSInt64Array(int fieldNumber, string fieldName, IEnumerable list) - { - foreach (var value in list) - { - WriteSInt64(fieldNumber, fieldName, value); - } - } - - public void WriteUInt64Array(int fieldNumber, string fieldName, IEnumerable list) - { - foreach (var value in list) - { - WriteUInt64(fieldNumber, fieldName, value); - } - } - - public void WriteFixed64Array(int fieldNumber, string fieldName, IEnumerable list) - { - foreach (var value in list) - { - WriteFixed64(fieldNumber, fieldName, value); - } - } - - public void WriteSFixed64Array(int fieldNumber, string fieldName, IEnumerable list) - { - foreach (var value in list) - { - WriteSFixed64(fieldNumber, fieldName, value); - } - } - - public void WriteDoubleArray(int fieldNumber, string fieldName, IEnumerable list) - { - foreach (var value in list) - { - WriteDouble(fieldNumber, fieldName, value); - } - } - - public void WriteFloatArray(int fieldNumber, string fieldName, IEnumerable list) - { - foreach (var value in list) - { - WriteFloat(fieldNumber, fieldName, value); - } - } - - [CLSCompliant(false)] - public void WriteEnumArray(int fieldNumber, string fieldName, IEnumerable list) - where T : struct, IComparable, IFormattable - { - if (list is ICastArray) - { - foreach (int value in ((ICastArray) list).CastArray()) - { - WriteEnum(fieldNumber, fieldName, value, null /*unused*/); - } - } - else - { - foreach (object value in list) - { - WriteEnum(fieldNumber, fieldName, (int) value, null /*unused*/); - } - } - } - - #endregion - - #region Write packed array members - - public void WritePackedArray(FieldType fieldType, int fieldNumber, string fieldName, IEnumerable list) - { - int calculatedSize = 0; - foreach (object element in list) - { - calculatedSize += ComputeFieldSizeNoTag(fieldType, element); - } - - WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited); - WriteRawVarint32((uint) calculatedSize); - - foreach (object element in list) - { - WriteFieldNoTag(fieldType, element); - } - } - - public void WritePackedGroupArray(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list) - where T : IMessageLite - { - WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited); - WriteRawVarint32((uint) calculatedSize); - foreach (IMessageLite value in list) - { - WriteGroupNoTag(value); - } - } - - public void WritePackedMessageArray(int fieldNumber, string fieldName, int calculatedSize, - IEnumerable list) - where T : IMessageLite - { - WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited); - WriteRawVarint32((uint) calculatedSize); - foreach (IMessageLite value in list) - { - WriteMessageNoTag(value); - } - } - - public void WritePackedStringArray(int fieldNumber, string fieldName, int calculatedSize, - IEnumerable list) - { - WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited); - WriteRawVarint32((uint) calculatedSize); - foreach (var value in list) - { - WriteStringNoTag(value); - } - } - - public void WritePackedBytesArray(int fieldNumber, string fieldName, int calculatedSize, - IEnumerable list) - { - WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited); - WriteRawVarint32((uint) calculatedSize); - foreach (var value in list) - { - WriteBytesNoTag(value); - } - } - - public void WritePackedBoolArray(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list) - { - WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited); - WriteRawVarint32((uint) calculatedSize); - foreach (var value in list) - { - WriteBoolNoTag(value); - } - } - - public void WritePackedInt32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list) - { - WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited); - WriteRawVarint32((uint) calculatedSize); - foreach (var value in list) - { - WriteInt32NoTag(value); - } - } - - public void WritePackedSInt32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list) - { - WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited); - WriteRawVarint32((uint) calculatedSize); - foreach (var value in list) - { - WriteSInt32NoTag(value); - } - } - - public void WritePackedUInt32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list) - { - WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited); - WriteRawVarint32((uint) calculatedSize); - foreach (var value in list) - { - WriteUInt32NoTag(value); - } - } - - public void WritePackedFixed32Array(int fieldNumber, string fieldName, int calculatedSize, - IEnumerable list) - { - WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited); - WriteRawVarint32((uint) calculatedSize); - foreach (var value in list) - { - WriteFixed32NoTag(value); - } - } - - public void WritePackedSFixed32Array(int fieldNumber, string fieldName, int calculatedSize, - IEnumerable list) - { - WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited); - WriteRawVarint32((uint) calculatedSize); - foreach (var value in list) - { - WriteSFixed32NoTag(value); - } - } - - public void WritePackedInt64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list) - { - WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited); - WriteRawVarint32((uint) calculatedSize); - foreach (var value in list) - { - WriteInt64NoTag(value); - } - } - - public void WritePackedSInt64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list) - { - WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited); - WriteRawVarint32((uint) calculatedSize); - foreach (var value in list) - { - WriteSInt64NoTag(value); - } - } - - public void WritePackedUInt64Array(int fieldNumber, string fieldName, int calculatedSize, - IEnumerable list) - { - WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited); - WriteRawVarint32((uint) calculatedSize); - foreach (var value in list) - { - WriteUInt64NoTag(value); - } - } - - public void WritePackedFixed64Array(int fieldNumber, string fieldName, int calculatedSize, - IEnumerable list) - { - WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited); - WriteRawVarint32((uint) calculatedSize); - foreach (var value in list) - { - WriteFixed64NoTag(value); - } - } - - public void WritePackedSFixed64Array(int fieldNumber, string fieldName, int calculatedSize, - IEnumerable list) - { - WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited); - WriteRawVarint32((uint) calculatedSize); - foreach (var value in list) - { - WriteSFixed64NoTag(value); - } - } - - public void WritePackedDoubleArray(int fieldNumber, string fieldName, int calculatedSize, - IEnumerable list) - { - WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited); - WriteRawVarint32((uint) calculatedSize); - foreach (var value in list) - { - WriteDoubleNoTag(value); - } - } - - public void WritePackedFloatArray(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list) - { - WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited); - WriteRawVarint32((uint) calculatedSize); - foreach (var value in list) - { - WriteFloatNoTag(value); - } - } - - [CLSCompliant(false)] - public void WritePackedEnumArray(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list) - where T : struct, IComparable, IFormattable - { - WriteTag(fieldNumber, WireFormat.WireType.LengthDelimited); - WriteRawVarint32((uint) calculatedSize); - if (list is ICastArray) - { - foreach (int value in ((ICastArray) list).CastArray()) - { - WriteEnumNoTag(value); - } - } - else - { - foreach (object value in list) - { - WriteEnumNoTag((int) value); - } - } - } - - #endregion - - #region Underlying writing primitives - - /// - /// Encodes and writes a tag. - /// - [CLSCompliant(false)] - public void WriteTag(int fieldNumber, WireFormat.WireType type) - { - WriteRawVarint32(WireFormat.MakeTag(fieldNumber, type)); - } - - /// - /// Writes a 32 bit value as a varint. The fast route is taken when - /// there's enough buffer space left to whizz through without checking - /// for each byte; otherwise, we resort to calling WriteRawByte each time. - /// - [CLSCompliant(false)] - public void WriteRawVarint32(uint value) - { - while (value > 127 && position < limit) - { - buffer[position++] = (byte) ((value & 0x7F) | 0x80); - value >>= 7; - } - while (value > 127) - { - WriteRawByte((byte) ((value & 0x7F) | 0x80)); - value >>= 7; - } - if (position < limit) - { - buffer[position++] = (byte) value; - } - else - { - WriteRawByte((byte) value); - } - } - - [CLSCompliant(false)] - public void WriteRawVarint64(ulong value) - { - while (value > 127 && position < limit) - { - buffer[position++] = (byte) ((value & 0x7F) | 0x80); - value >>= 7; - } - while (value > 127) - { - WriteRawByte((byte) ((value & 0x7F) | 0x80)); - value >>= 7; - } - if (position < limit) - { - buffer[position++] = (byte) value; - } - else - { - WriteRawByte((byte) value); - } - } - - [CLSCompliant(false)] - public void WriteRawLittleEndian32(uint value) - { - if (position + 4 > limit) - { - WriteRawByte((byte) value); - WriteRawByte((byte) (value >> 8)); - WriteRawByte((byte) (value >> 16)); - WriteRawByte((byte) (value >> 24)); - } - else - { - buffer[position++] = ((byte) value); - buffer[position++] = ((byte) (value >> 8)); - buffer[position++] = ((byte) (value >> 16)); - buffer[position++] = ((byte) (value >> 24)); - } - } - - [CLSCompliant(false)] - public void WriteRawLittleEndian64(ulong value) - { - if (position + 8 > limit) - { - WriteRawByte((byte) value); - WriteRawByte((byte) (value >> 8)); - WriteRawByte((byte) (value >> 16)); - WriteRawByte((byte) (value >> 24)); - WriteRawByte((byte) (value >> 32)); - WriteRawByte((byte) (value >> 40)); - WriteRawByte((byte) (value >> 48)); - WriteRawByte((byte) (value >> 56)); - } - else - { - buffer[position++] = ((byte) value); - buffer[position++] = ((byte) (value >> 8)); - buffer[position++] = ((byte) (value >> 16)); - buffer[position++] = ((byte) (value >> 24)); - buffer[position++] = ((byte) (value >> 32)); - buffer[position++] = ((byte) (value >> 40)); - buffer[position++] = ((byte) (value >> 48)); - buffer[position++] = ((byte) (value >> 56)); - } - } - - public void WriteRawByte(byte value) - { - if (position == limit) - { - RefreshBuffer(); - } - - buffer[position++] = value; - } - - [CLSCompliant(false)] - public void WriteRawByte(uint value) - { - WriteRawByte((byte) value); - } - - /// - /// Writes out an array of bytes. - /// - public void WriteRawBytes(byte[] value) - { - WriteRawBytes(value, 0, value.Length); - } - - /// - /// Writes out part of an array of bytes. - /// - public void WriteRawBytes(byte[] value, int offset, int length) - { - if (limit - position >= length) - { - ByteArray.Copy(value, offset, buffer, position, length); - // We have room in the current buffer. - position += length; - } - else - { - // Write extends past current buffer. Fill the rest of this buffer and - // flush. - int bytesWritten = limit - position; - ByteArray.Copy(value, offset, buffer, position, bytesWritten); - offset += bytesWritten; - length -= bytesWritten; - position = limit; - RefreshBuffer(); - - // Now deal with the rest. - // Since we have an output stream, this is our buffer - // and buffer offset == 0 - if (length <= limit) - { - // Fits in new buffer. - ByteArray.Copy(value, offset, buffer, 0, length); - position = length; - } - else - { - // Write is very big. Let's do it all at once. - output.Write(value, offset, length); - } - } - } - - #endregion - - /// - /// Encode a 32-bit value with ZigZag encoding. - /// - /// - /// ZigZag encodes signed integers into values that can be efficiently - /// encoded with varint. (Otherwise, negative values must be - /// sign-extended to 64 bits to be varint encoded, thus always taking - /// 10 bytes on the wire.) - /// - [CLSCompliant(false)] - public static uint EncodeZigZag32(int n) - { - // Note: the right-shift must be arithmetic - return (uint) ((n << 1) ^ (n >> 31)); - } - - /// - /// Encode a 64-bit value with ZigZag encoding. - /// - /// - /// ZigZag encodes signed integers into values that can be efficiently - /// encoded with varint. (Otherwise, negative values must be - /// sign-extended to 64 bits to be varint encoded, thus always taking - /// 10 bytes on the wire.) - /// - [CLSCompliant(false)] - public static ulong EncodeZigZag64(long n) - { - return (ulong) ((n << 1) ^ (n >> 63)); - } - - private void RefreshBuffer() - { - if (output == null) - { - // We're writing to a single buffer. - throw new OutOfSpaceException(); - } - - // Since we have an output stream, this is our buffer - // and buffer offset == 0 - output.Write(buffer, 0, position); - position = 0; - } - - /// - /// Indicates that a CodedOutputStream wrapping a flat byte array - /// ran out of space. - /// - public sealed class OutOfSpaceException : IOException - { - internal OutOfSpaceException() - : base("CodedOutputStream was writing to a flat byte array and ran out of space.") - { - } - } - - public void Flush() - { - if (output != null) - { - RefreshBuffer(); - } - } - - /// - /// Verifies that SpaceLeft returns zero. It's common to create a byte array - /// that is exactly big enough to hold a message, then write to it with - /// a CodedOutputStream. Calling CheckNoSpaceLeft after writing verifies that - /// the message was actually as big as expected, which can help bugs. - /// - public void CheckNoSpaceLeft() - { - if (SpaceLeft != 0) - { - throw new InvalidOperationException("Did not write as much data as expected."); - } - } - - /// - /// If writing to a flat array, returns the space left in the array. Otherwise, - /// throws an InvalidOperationException. - /// - public int SpaceLeft - { - get - { - if (output == null) - { - return limit - position; - } - else - { - throw new InvalidOperationException( - "SpaceLeft can only be called on CodedOutputStreams that are " + - "writing to a flat array."); - } - } - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/Collections/Dictionaries.cs b/src/ProtocolBuffers/Collections/Dictionaries.cs deleted file mode 100644 index 1f3791b..0000000 --- a/src/ProtocolBuffers/Collections/Dictionaries.cs +++ /dev/null @@ -1,122 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -using System; -using System.Collections; -using System.Collections.Generic; - -namespace Google.ProtocolBuffers.Collections -{ - /// - /// Utility class for dictionaries. - /// - public static class Dictionaries - { - /// - /// Compares two dictionaries for equality. Each value is compared with equality using Equals - /// for non-IEnumerable implementations, and using EnumerableEquals otherwise. - /// TODO(jonskeet): This is clearly pretty slow, and involves lots of boxing/unboxing... - /// - public static bool Equals(IDictionary left, IDictionary right) - { - if (left.Count != right.Count) - { - return false; - } - foreach (KeyValuePair leftEntry in left) - { - TValue rightValue; - if (!right.TryGetValue(leftEntry.Key, out rightValue)) - { - return false; - } - - IEnumerable leftEnumerable = leftEntry.Value as IEnumerable; - IEnumerable rightEnumerable = rightValue as IEnumerable; - if (leftEnumerable == null || rightEnumerable == null) - { - if (!Equals(leftEntry.Value, rightValue)) - { - return false; - } - } - else - { - if (!Enumerables.Equals(leftEnumerable, rightEnumerable)) - { - return false; - } - } - } - return true; - } - - public static IDictionary AsReadOnly(IDictionary dictionary) - { - return dictionary.IsReadOnly ? dictionary : new ReadOnlyDictionary(dictionary); - } - - /// - /// Creates a hashcode for a dictionary by XORing the hashcodes of all the fields - /// and values. (By XORing, we avoid ordering issues.) - /// TODO(jonskeet): Currently XORs other stuff too, and assumes non-null values. - /// - public static int GetHashCode(IDictionary dictionary) - { - int ret = 31; - foreach (KeyValuePair entry in dictionary) - { - int hash = entry.Key.GetHashCode() ^ GetDeepHashCode(entry.Value); - ret ^= hash; - } - return ret; - } - - /// - /// Determines the hash of a value by either taking it directly or hashing all the elements - /// for IEnumerable implementations. - /// - private static int GetDeepHashCode(object value) - { - IEnumerable iterable = value as IEnumerable; - if (iterable == null) - { - return value.GetHashCode(); - } - int hash = 29; - foreach (object element in iterable) - { - hash = hash*37 + element.GetHashCode(); - } - return hash; - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/Collections/Enumerables.cs b/src/ProtocolBuffers/Collections/Enumerables.cs deleted file mode 100644 index 7ad9a83..0000000 --- a/src/ProtocolBuffers/Collections/Enumerables.cs +++ /dev/null @@ -1,74 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -using System; -using System.Collections; - -namespace Google.ProtocolBuffers.Collections -{ - /// - /// Utility class for IEnumerable (and potentially the generic version in the future). - /// - public static class Enumerables - { - public static bool Equals(IEnumerable left, IEnumerable right) - { - IEnumerator leftEnumerator = left.GetEnumerator(); - try - { - foreach (object rightObject in right) - { - if (!leftEnumerator.MoveNext()) - { - return false; - } - if (!Equals(leftEnumerator.Current, rightObject)) - { - return false; - } - } - if (leftEnumerator.MoveNext()) - { - return false; - } - } - finally - { - IDisposable leftEnumeratorDisposable = leftEnumerator as IDisposable; - if (leftEnumeratorDisposable != null) - { - leftEnumeratorDisposable.Dispose(); - } - } - return true; - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/Collections/IPopsicleList.cs b/src/ProtocolBuffers/Collections/IPopsicleList.cs deleted file mode 100644 index a1a7581..0000000 --- a/src/ProtocolBuffers/Collections/IPopsicleList.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -using System.Collections.Generic; - -namespace Google.ProtocolBuffers.Collections -{ - /// - /// A list which has an Add method which accepts an IEnumerable[T]. - /// This allows whole collections to be added easily using collection initializers. - /// It causes a potential overload confusion if T : IEnumerable[T], but in - /// practice that won't happen in protocol buffers. - /// - /// This is only currently implemented by PopsicleList, and it's likely - /// to stay that way - hence the name. More genuinely descriptive names are - /// horribly ugly. (At least, the ones the author could think of...) - /// The element type of the list - public interface IPopsicleList : IList - { - void Add(IEnumerable collection); - } - - /// - /// Used to efficiently cast the elements of enumerations - /// - internal interface ICastArray - { - IEnumerable CastArray(); - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/Collections/Lists.cs b/src/ProtocolBuffers/Collections/Lists.cs deleted file mode 100644 index a24e1d9..0000000 --- a/src/ProtocolBuffers/Collections/Lists.cs +++ /dev/null @@ -1,110 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -using System.Collections.Generic; -using System.Collections.ObjectModel; - -namespace Google.ProtocolBuffers.Collections -{ - /// - /// Utility non-generic class for calling into Lists{T} using type inference. - /// - public static class Lists - { - /// - /// Returns a read-only view of the specified list. - /// - public static IList AsReadOnly(IList list) - { - return Lists.AsReadOnly(list); - } - - public static bool Equals(IList left, IList right) - { - if (left == right) - { - return true; - } - if (left == null || right == null) - { - return false; - } - if (left.Count != right.Count) - { - return false; - } - IEqualityComparer comparer = EqualityComparer.Default; - for (int i = 0; i < left.Count; i++) - { - if (!comparer.Equals(left[i], right[i])) - { - return false; - } - } - return true; - } - - public static int GetHashCode(IList list) - { - int hash = 31; - foreach (T element in list) - { - hash = hash*29 + element.GetHashCode(); - } - return hash; - } - } - - /// - /// Utility class for dealing with lists. - /// - public static class Lists - { - private static readonly ReadOnlyCollection empty = new ReadOnlyCollection(new T[0]); - - /// - /// Returns an immutable empty list. - /// - public static ReadOnlyCollection Empty - { - get { return empty; } - } - - /// - /// Returns either the original reference if it's already read-only, - /// or a new ReadOnlyCollection wrapping the original list. - /// - public static IList AsReadOnly(IList list) - { - return list.IsReadOnly ? list : new ReadOnlyCollection(list); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/Collections/PopsicleList.cs b/src/ProtocolBuffers/Collections/PopsicleList.cs deleted file mode 100644 index 3de97f8..0000000 --- a/src/ProtocolBuffers/Collections/PopsicleList.cs +++ /dev/null @@ -1,208 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -using System; -using System.Collections; -using System.Collections.Generic; - -namespace Google.ProtocolBuffers.Collections -{ - /// - /// Proxies calls to a , but allows the list - /// to be made read-only (with the method), - /// after which any modifying methods throw . - /// - public sealed class PopsicleList : IPopsicleList, ICastArray - { - private static readonly bool CheckForNull = default(T) == null; - private static readonly T[] EmptySet = new T[0]; - - private List items; - private bool readOnly; - - /// - /// Makes this list read-only ("freezes the popsicle"). From this - /// point on, mutating methods (Clear, Add etc) will throw a - /// NotSupportedException. There is no way of "defrosting" the list afterwards. - /// - public void MakeReadOnly() - { - readOnly = true; - } - - public int IndexOf(T item) - { - return items == null ? -1 : items.IndexOf(item); - } - - public void Insert(int index, T item) - { - ValidateModification(); - if (CheckForNull) - { - ThrowHelper.ThrowIfNull(item); - } - items.Insert(index, item); - } - - public void RemoveAt(int index) - { - ValidateModification(); - items.RemoveAt(index); - } - - public T this[int index] - { - get - { - if (items == null) - { - throw new ArgumentOutOfRangeException(); - } - return items[index]; - } - set - { - ValidateModification(); - if (CheckForNull) - { - ThrowHelper.ThrowIfNull(value); - } - items[index] = value; - } - } - - public void Add(T item) - { - ValidateModification(); - if (CheckForNull) - { - ThrowHelper.ThrowIfNull(item); - } - items.Add(item); - } - - public void Clear() - { - ValidateModification(); - items.Clear(); - } - - public bool Contains(T item) - { - return items == null ? false : items.Contains(item); - } - - public void CopyTo(T[] array, int arrayIndex) - { - if (items != null) - { - items.CopyTo(array, arrayIndex); - } - } - - public int Count - { - get { return items == null ? 0 : items.Count; } - } - - public bool IsReadOnly - { - get { return readOnly; } - } - - public bool Remove(T item) - { - ValidateModification(); - return items.Remove(item); - } - - public IEnumerator GetEnumerator() - { - IEnumerable tenum = (IEnumerable)items ?? EmptySet; - return tenum.GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } - - public void Add(IEnumerable collection) - { - ValidateModification(); - ThrowHelper.ThrowIfNull(collection); - - if (!CheckForNull || collection is PopsicleList) - { - items.AddRange(collection); - } - else - { - // Assumption, it's ok to enumerate collections more than once. - if (collection is ICollection) - { - ThrowHelper.ThrowIfAnyNull(collection); - items.AddRange(collection); - } - else - { - foreach (T item in collection) - { - ThrowHelper.ThrowIfNull(item); - items.Add(item); - } - } - } - } - - private void ValidateModification() - { - if (readOnly) - { - throw new NotSupportedException("List is read-only"); - } - if (items == null) - { - items = new List(); - } - } - - IEnumerable ICastArray.CastArray() - { - if (items == null) - { - return PopsicleList.EmptySet; - } - return (TItemType[]) (object) items.ToArray(); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/Collections/ReadOnlyDictionary.cs b/src/ProtocolBuffers/Collections/ReadOnlyDictionary.cs deleted file mode 100644 index b0bc55f..0000000 --- a/src/ProtocolBuffers/Collections/ReadOnlyDictionary.cs +++ /dev/null @@ -1,146 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -using System; -using System.Collections; -using System.Collections.Generic; - -namespace Google.ProtocolBuffers.Collections -{ - /// - /// Read-only wrapper around another dictionary. - /// - public sealed class ReadOnlyDictionary : IDictionary - { - private readonly IDictionary wrapped; - - public ReadOnlyDictionary(IDictionary wrapped) - { - this.wrapped = wrapped; - } - - public void Add(TKey key, TValue value) - { - throw new InvalidOperationException(); - } - - public bool ContainsKey(TKey key) - { - return wrapped.ContainsKey(key); - } - - public ICollection Keys - { - get { return wrapped.Keys; } - } - - public bool Remove(TKey key) - { - throw new InvalidOperationException(); - } - - public bool TryGetValue(TKey key, out TValue value) - { - return wrapped.TryGetValue(key, out value); - } - - public ICollection Values - { - get { return wrapped.Values; } - } - - public TValue this[TKey key] - { - get { return wrapped[key]; } - set { throw new InvalidOperationException(); } - } - - public void Add(KeyValuePair item) - { - throw new InvalidOperationException(); - } - - public void Clear() - { - throw new InvalidOperationException(); - } - - public bool Contains(KeyValuePair item) - { - return wrapped.Contains(item); - } - - public void CopyTo(KeyValuePair[] array, int arrayIndex) - { - wrapped.CopyTo(array, arrayIndex); - } - - public int Count - { - get { return wrapped.Count; } - } - - public bool IsReadOnly - { - get { return true; } - } - - public bool Remove(KeyValuePair item) - { - throw new InvalidOperationException(); - } - - public IEnumerator> GetEnumerator() - { - return wrapped.GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return ((IEnumerable) wrapped).GetEnumerator(); - } - - public override bool Equals(object obj) - { - return wrapped.Equals(obj); - } - - public override int GetHashCode() - { - return wrapped.GetHashCode(); - } - - public override string ToString() - { - return wrapped.ToString(); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/CustomSerialization.cs b/src/ProtocolBuffers/CustomSerialization.cs deleted file mode 100644 index ae9fca2..0000000 --- a/src/ProtocolBuffers/CustomSerialization.cs +++ /dev/null @@ -1,201 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion -/* - * This entire source file is not supported on some platform - */ -#if !NOSERIALIZABLE -using System; -using System.Security.Permissions; -using System.Runtime.Serialization; -using System.Security; - -namespace Google.ProtocolBuffers -{ - /* - * Specialized handing of *all* message types. Messages are serialized into a byte[] and stored - * into the SerializationInfo, and are then reconstituted by an IObjectReference class after - * deserialization. IDeserializationCallback is supported on both the Builder and Message. - */ - [Serializable] - partial class AbstractMessageLite : ISerializable - { - [SecurityCritical] - [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)] - void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) - { - info.SetType(typeof(SerializationSurrogate)); - info.AddValue("message", ToByteArray()); - info.AddValue("initialized", IsInitialized); - } - - [Serializable] - private sealed class SerializationSurrogate : IObjectReference, ISerializable - { - static readonly TBuilder TemplateInstance = (TBuilder)Activator.CreateInstance(typeof(TBuilder)); - private readonly byte[] _message; - private readonly bool _initialized; - - private SerializationSurrogate(SerializationInfo info, StreamingContext context) - { - _message = (byte[])info.GetValue("message", typeof(byte[])); - _initialized = info.GetBoolean("initialized"); - } - - [SecurityCritical] - [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)] - object IObjectReference.GetRealObject(StreamingContext context) - { - ExtensionRegistry registry = context.Context as ExtensionRegistry; - TBuilder builder = TemplateInstance.DefaultInstanceForType.CreateBuilderForType(); - builder.MergeFrom(_message, registry ?? ExtensionRegistry.Empty); - - IDeserializationCallback callback = builder as IDeserializationCallback; - if(callback != null) - { - callback.OnDeserialization(context); - } - - TMessage message = _initialized ? builder.Build() : builder.BuildPartial(); - callback = message as IDeserializationCallback; - if (callback != null) - { - callback.OnDeserialization(context); - } - - return message; - } - - [SecurityCritical] - [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)] - void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) - { - info.AddValue("message", _message); - } - } - } - - [Serializable] - partial class AbstractBuilderLite : ISerializable - { - [SecurityCritical] - [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)] - void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) - { - info.SetType(typeof(SerializationSurrogate)); - info.AddValue("message", Clone().BuildPartial().ToByteArray()); - } - - [Serializable] - private sealed class SerializationSurrogate : IObjectReference, ISerializable - { - static readonly TBuilder TemplateInstance = (TBuilder)Activator.CreateInstance(typeof(TBuilder)); - private readonly byte[] _message; - - private SerializationSurrogate(SerializationInfo info, StreamingContext context) - { - _message = (byte[])info.GetValue("message", typeof(byte[])); - } - - [SecurityCritical] - [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)] - object IObjectReference.GetRealObject(StreamingContext context) - { - ExtensionRegistry registry = context.Context as ExtensionRegistry; - TBuilder builder = TemplateInstance.DefaultInstanceForType.CreateBuilderForType(); - builder.MergeFrom(_message, registry ?? ExtensionRegistry.Empty); - - IDeserializationCallback callback = builder as IDeserializationCallback; - if(callback != null) - { - callback.OnDeserialization(context); - } - - return builder; - } - - [SecurityCritical] - [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)] - void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) - { - info.AddValue("message", _message); - } - } - } - - /* - * Spread some attribute love around, keeping this all here so we don't use conditional compliation - * in every one of these classes. If we introduce a new platform that also does not support this - * we can control it all from this source file. - */ - - [Serializable] - partial class GeneratedMessageLite { } - - [Serializable] - partial class ExtendableMessageLite { } - - [Serializable] - partial class AbstractMessage { } - - [Serializable] - partial class GeneratedMessage { } - - [Serializable] - partial class ExtendableMessage { } - - [Serializable] - partial class GeneratedBuilderLite { } - - [Serializable] - partial class ExtendableBuilderLite { } - - [Serializable] - partial class AbstractBuilder { } - - [Serializable] - partial class GeneratedBuilder { } - - [Serializable] - partial class ExtendableBuilder { } - - [Serializable] - partial class DynamicMessage - { - [Serializable] - partial class Builder { } - } -} -#endif \ No newline at end of file diff --git a/src/ProtocolBuffers/Delegates.cs b/src/ProtocolBuffers/Delegates.cs deleted file mode 100644 index 3b62bc0..0000000 --- a/src/ProtocolBuffers/Delegates.cs +++ /dev/null @@ -1,54 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System.IO; - -namespace Google.ProtocolBuffers -{ - /// - /// Delegate to return a stream when asked, used by MessageStreamIterator. - /// - public delegate Stream StreamProvider(); - - // These delegate declarations mirror the ones in .NET 3.5 for the sake of familiarity. - internal delegate TResult Func(); - - internal delegate TResult Func(T arg); - - internal delegate TResult Func(T1 arg1, T2 arg2); - - internal delegate void Action(T1 arg1, T2 arg2); -} \ No newline at end of file diff --git a/src/ProtocolBuffers/DescriptorProtos/CSharpOptions.cs b/src/ProtocolBuffers/DescriptorProtos/CSharpOptions.cs deleted file mode 100644 index 9a77d6e..0000000 --- a/src/ProtocolBuffers/DescriptorProtos/CSharpOptions.cs +++ /dev/null @@ -1,1887 +0,0 @@ -// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.DescriptorProtos { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class CSharpOptions { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - registry.Add(global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.CSharpFileOptions); - registry.Add(global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.CSharpFieldOptions); - registry.Add(global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.CsharpServiceOptions); - registry.Add(global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.CsharpMethodOptions); - } - #endregion - #region Extensions - public const int CSharpFileOptionsFieldNumber = 1000; - public static pb::GeneratedExtensionBase CSharpFileOptions; - public const int CSharpFieldOptionsFieldNumber = 1000; - public static pb::GeneratedExtensionBase CSharpFieldOptions; - public const int CsharpServiceOptionsFieldNumber = 1000; - public static pb::GeneratedExtensionBase CsharpServiceOptions; - public const int CsharpMethodOptionsFieldNumber = 1000; - public static pb::GeneratedExtensionBase CsharpMethodOptions; - #endregion - - #region Static variables - internal static pbd::MessageDescriptor internal__static_google_protobuf_CSharpFileOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_CSharpFileOptions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_CSharpFieldOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_CSharpFieldOptions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_CSharpServiceOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_CSharpServiceOptions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_CSharpMethodOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_CSharpMethodOptions__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static CSharpOptions() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CiRnb29nbGUvcHJvdG9idWYvY3NoYXJwX29wdGlvbnMucHJvdG8SD2dvb2ds", - "ZS5wcm90b2J1ZhogZ29vZ2xlL3Byb3RvYnVmL2Rlc2NyaXB0b3IucHJvdG8i", - "pwQKEUNTaGFycEZpbGVPcHRpb25zEhEKCW5hbWVzcGFjZRgBIAEoCRIaChJ1", - "bWJyZWxsYV9jbGFzc25hbWUYAiABKAkSHAoOcHVibGljX2NsYXNzZXMYAyAB", - "KAg6BHRydWUSFgoObXVsdGlwbGVfZmlsZXMYBCABKAgSFAoMbmVzdF9jbGFz", - "c2VzGAUgASgIEhYKDmNvZGVfY29udHJhY3RzGAYgASgIEiQKHGV4cGFuZF9u", - "YW1lc3BhY2VfZGlyZWN0b3JpZXMYByABKAgSHAoOY2xzX2NvbXBsaWFuY2UY", - "CCABKAg6BHRydWUSHwoQYWRkX3NlcmlhbGl6YWJsZRgJIAEoCDoFZmFsc2US", - "IwoVZ2VuZXJhdGVfcHJpdmF0ZV9jdG9yGAogASgIOgR0cnVlEhwKDmZpbGVf", - "ZXh0ZW5zaW9uGN0BIAEoCToDLmNzEhsKEnVtYnJlbGxhX25hbWVzcGFjZRje", - "ASABKAkSHAoQb3V0cHV0X2RpcmVjdG9yeRjfASABKAk6AS4SJgoWaWdub3Jl", - "X2dvb2dsZV9wcm90b2J1ZhjgASABKAg6BWZhbHNlEkkKFnNlcnZpY2VfZ2Vu", - "ZXJhdG9yX3R5cGUY4QEgASgOMiIuZ29vZ2xlLnByb3RvYnVmLkNTaGFycFNl", - "cnZpY2VUeXBlOgROT05FEikKGWdlbmVyYXRlZF9jb2RlX2F0dHJpYnV0ZXMY", - "4gEgASgIOgVmYWxzZSIrChJDU2hhcnBGaWVsZE9wdGlvbnMSFQoNcHJvcGVy", - "dHlfbmFtZRgBIAEoCSIsChRDU2hhcnBTZXJ2aWNlT3B0aW9ucxIUCgxpbnRl", - "cmZhY2VfaWQYASABKAkiKgoTQ1NoYXJwTWV0aG9kT3B0aW9ucxITCgtkaXNw", - "YXRjaF9pZBgBIAEoBSpLChFDU2hhcnBTZXJ2aWNlVHlwZRIICgROT05FEAAS", - "CwoHR0VORVJJQxABEg0KCUlOVEVSRkFDRRACEhAKDElSUENESVNQQVRDSBAD", - "Ol4KE2NzaGFycF9maWxlX29wdGlvbnMSHC5nb29nbGUucHJvdG9idWYuRmls", - "ZU9wdGlvbnMY6AcgASgLMiIuZ29vZ2xlLnByb3RvYnVmLkNTaGFycEZpbGVP", - "cHRpb25zOmEKFGNzaGFycF9maWVsZF9vcHRpb25zEh0uZ29vZ2xlLnByb3Rv", - "YnVmLkZpZWxkT3B0aW9ucxjoByABKAsyIy5nb29nbGUucHJvdG9idWYuQ1No", - "YXJwRmllbGRPcHRpb25zOmcKFmNzaGFycF9zZXJ2aWNlX29wdGlvbnMSHy5n", - "b29nbGUucHJvdG9idWYuU2VydmljZU9wdGlvbnMY6AcgASgLMiUuZ29vZ2xl", - "LnByb3RvYnVmLkNTaGFycFNlcnZpY2VPcHRpb25zOmQKFWNzaGFycF9tZXRo", - "b2Rfb3B0aW9ucxIeLmdvb2dsZS5wcm90b2J1Zi5NZXRob2RPcHRpb25zGOgH", - "IAEoCzIkLmdvb2dsZS5wcm90b2J1Zi5DU2hhcnBNZXRob2RPcHRpb25z")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_google_protobuf_CSharpFileOptions__Descriptor = Descriptor.MessageTypes[0]; - internal__static_google_protobuf_CSharpFileOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_CSharpFileOptions__Descriptor, - new string[] { "Namespace", "UmbrellaClassname", "PublicClasses", "MultipleFiles", "NestClasses", "CodeContracts", "ExpandNamespaceDirectories", "ClsCompliance", "AddSerializable", "GeneratePrivateCtor", "FileExtension", "UmbrellaNamespace", "OutputDirectory", "IgnoreGoogleProtobuf", "ServiceGeneratorType", "GeneratedCodeAttributes", }); - internal__static_google_protobuf_CSharpFieldOptions__Descriptor = Descriptor.MessageTypes[1]; - internal__static_google_protobuf_CSharpFieldOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_CSharpFieldOptions__Descriptor, - new string[] { "PropertyName", }); - internal__static_google_protobuf_CSharpServiceOptions__Descriptor = Descriptor.MessageTypes[2]; - internal__static_google_protobuf_CSharpServiceOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_CSharpServiceOptions__Descriptor, - new string[] { "InterfaceId", }); - internal__static_google_protobuf_CSharpMethodOptions__Descriptor = Descriptor.MessageTypes[3]; - internal__static_google_protobuf_CSharpMethodOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_CSharpMethodOptions__Descriptor, - new string[] { "DispatchId", }); - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.CSharpFileOptions = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor.Extensions[0]); - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.CSharpFieldOptions = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor.Extensions[1]); - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.CsharpServiceOptions = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor.Extensions[2]); - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.CsharpMethodOptions = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor.Extensions[3]); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, - }, assigner); - } - #endregion - - } - #region Enums - public enum CSharpServiceType { - NONE = 0, - GENERIC = 1, - INTERFACE = 2, - IRPCDISPATCH = 3, - } - - #endregion - - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class CSharpFileOptions : pb::GeneratedMessage { - private CSharpFileOptions() { } - private static readonly CSharpFileOptions defaultInstance = new CSharpFileOptions().MakeReadOnly(); - private static readonly string[] _cSharpFileOptionsFieldNames = new string[] { "add_serializable", "cls_compliance", "code_contracts", "expand_namespace_directories", "file_extension", "generate_private_ctor", "generated_code_attributes", "ignore_google_protobuf", "multiple_files", "namespace", "nest_classes", "output_directory", "public_classes", "service_generator_type", "umbrella_classname", "umbrella_namespace" }; - private static readonly uint[] _cSharpFileOptionsFieldTags = new uint[] { 72, 64, 48, 56, 1770, 80, 1808, 1792, 32, 10, 40, 1786, 24, 1800, 18, 1778 }; - public static CSharpFileOptions DefaultInstance { - get { return defaultInstance; } - } - - public override CSharpFileOptions DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override CSharpFileOptions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.internal__static_google_protobuf_CSharpFileOptions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.internal__static_google_protobuf_CSharpFileOptions__FieldAccessorTable; } - } - - public const int NamespaceFieldNumber = 1; - private bool hasNamespace; - private string namespace_ = ""; - public bool HasNamespace { - get { return hasNamespace; } - } - public string Namespace { - get { return namespace_; } - } - - public const int UmbrellaClassnameFieldNumber = 2; - private bool hasUmbrellaClassname; - private string umbrellaClassname_ = ""; - public bool HasUmbrellaClassname { - get { return hasUmbrellaClassname; } - } - public string UmbrellaClassname { - get { return umbrellaClassname_; } - } - - public const int PublicClassesFieldNumber = 3; - private bool hasPublicClasses; - private bool publicClasses_ = true; - public bool HasPublicClasses { - get { return hasPublicClasses; } - } - public bool PublicClasses { - get { return publicClasses_; } - } - - public const int MultipleFilesFieldNumber = 4; - private bool hasMultipleFiles; - private bool multipleFiles_; - public bool HasMultipleFiles { - get { return hasMultipleFiles; } - } - public bool MultipleFiles { - get { return multipleFiles_; } - } - - public const int NestClassesFieldNumber = 5; - private bool hasNestClasses; - private bool nestClasses_; - public bool HasNestClasses { - get { return hasNestClasses; } - } - public bool NestClasses { - get { return nestClasses_; } - } - - public const int CodeContractsFieldNumber = 6; - private bool hasCodeContracts; - private bool codeContracts_; - public bool HasCodeContracts { - get { return hasCodeContracts; } - } - public bool CodeContracts { - get { return codeContracts_; } - } - - public const int ExpandNamespaceDirectoriesFieldNumber = 7; - private bool hasExpandNamespaceDirectories; - private bool expandNamespaceDirectories_; - public bool HasExpandNamespaceDirectories { - get { return hasExpandNamespaceDirectories; } - } - public bool ExpandNamespaceDirectories { - get { return expandNamespaceDirectories_; } - } - - public const int ClsComplianceFieldNumber = 8; - private bool hasClsCompliance; - private bool clsCompliance_ = true; - public bool HasClsCompliance { - get { return hasClsCompliance; } - } - public bool ClsCompliance { - get { return clsCompliance_; } - } - - public const int AddSerializableFieldNumber = 9; - private bool hasAddSerializable; - private bool addSerializable_; - public bool HasAddSerializable { - get { return hasAddSerializable; } - } - public bool AddSerializable { - get { return addSerializable_; } - } - - public const int GeneratePrivateCtorFieldNumber = 10; - private bool hasGeneratePrivateCtor; - private bool generatePrivateCtor_ = true; - public bool HasGeneratePrivateCtor { - get { return hasGeneratePrivateCtor; } - } - public bool GeneratePrivateCtor { - get { return generatePrivateCtor_; } - } - - public const int FileExtensionFieldNumber = 221; - private bool hasFileExtension; - private string fileExtension_ = ".cs"; - public bool HasFileExtension { - get { return hasFileExtension; } - } - public string FileExtension { - get { return fileExtension_; } - } - - public const int UmbrellaNamespaceFieldNumber = 222; - private bool hasUmbrellaNamespace; - private string umbrellaNamespace_ = ""; - public bool HasUmbrellaNamespace { - get { return hasUmbrellaNamespace; } - } - public string UmbrellaNamespace { - get { return umbrellaNamespace_; } - } - - public const int OutputDirectoryFieldNumber = 223; - private bool hasOutputDirectory; - private string outputDirectory_ = "."; - public bool HasOutputDirectory { - get { return hasOutputDirectory; } - } - public string OutputDirectory { - get { return outputDirectory_; } - } - - public const int IgnoreGoogleProtobufFieldNumber = 224; - private bool hasIgnoreGoogleProtobuf; - private bool ignoreGoogleProtobuf_; - public bool HasIgnoreGoogleProtobuf { - get { return hasIgnoreGoogleProtobuf; } - } - public bool IgnoreGoogleProtobuf { - get { return ignoreGoogleProtobuf_; } - } - - public const int ServiceGeneratorTypeFieldNumber = 225; - private bool hasServiceGeneratorType; - private global::Google.ProtocolBuffers.DescriptorProtos.CSharpServiceType serviceGeneratorType_ = global::Google.ProtocolBuffers.DescriptorProtos.CSharpServiceType.NONE; - public bool HasServiceGeneratorType { - get { return hasServiceGeneratorType; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.CSharpServiceType ServiceGeneratorType { - get { return serviceGeneratorType_; } - } - - public const int GeneratedCodeAttributesFieldNumber = 226; - private bool hasGeneratedCodeAttributes; - private bool generatedCodeAttributes_; - public bool HasGeneratedCodeAttributes { - get { return hasGeneratedCodeAttributes; } - } - public bool GeneratedCodeAttributes { - get { return generatedCodeAttributes_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _cSharpFileOptionsFieldNames; - if (hasNamespace) { - output.WriteString(1, field_names[9], Namespace); - } - if (hasUmbrellaClassname) { - output.WriteString(2, field_names[14], UmbrellaClassname); - } - if (hasPublicClasses) { - output.WriteBool(3, field_names[12], PublicClasses); - } - if (hasMultipleFiles) { - output.WriteBool(4, field_names[8], MultipleFiles); - } - if (hasNestClasses) { - output.WriteBool(5, field_names[10], NestClasses); - } - if (hasCodeContracts) { - output.WriteBool(6, field_names[2], CodeContracts); - } - if (hasExpandNamespaceDirectories) { - output.WriteBool(7, field_names[3], ExpandNamespaceDirectories); - } - if (hasClsCompliance) { - output.WriteBool(8, field_names[1], ClsCompliance); - } - if (hasAddSerializable) { - output.WriteBool(9, field_names[0], AddSerializable); - } - if (hasGeneratePrivateCtor) { - output.WriteBool(10, field_names[5], GeneratePrivateCtor); - } - if (hasFileExtension) { - output.WriteString(221, field_names[4], FileExtension); - } - if (hasUmbrellaNamespace) { - output.WriteString(222, field_names[15], UmbrellaNamespace); - } - if (hasOutputDirectory) { - output.WriteString(223, field_names[11], OutputDirectory); - } - if (hasIgnoreGoogleProtobuf) { - output.WriteBool(224, field_names[7], IgnoreGoogleProtobuf); - } - if (hasServiceGeneratorType) { - output.WriteEnum(225, field_names[13], (int) ServiceGeneratorType, ServiceGeneratorType); - } - if (hasGeneratedCodeAttributes) { - output.WriteBool(226, field_names[6], GeneratedCodeAttributes); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasNamespace) { - size += pb::CodedOutputStream.ComputeStringSize(1, Namespace); - } - if (hasUmbrellaClassname) { - size += pb::CodedOutputStream.ComputeStringSize(2, UmbrellaClassname); - } - if (hasPublicClasses) { - size += pb::CodedOutputStream.ComputeBoolSize(3, PublicClasses); - } - if (hasMultipleFiles) { - size += pb::CodedOutputStream.ComputeBoolSize(4, MultipleFiles); - } - if (hasNestClasses) { - size += pb::CodedOutputStream.ComputeBoolSize(5, NestClasses); - } - if (hasCodeContracts) { - size += pb::CodedOutputStream.ComputeBoolSize(6, CodeContracts); - } - if (hasExpandNamespaceDirectories) { - size += pb::CodedOutputStream.ComputeBoolSize(7, ExpandNamespaceDirectories); - } - if (hasClsCompliance) { - size += pb::CodedOutputStream.ComputeBoolSize(8, ClsCompliance); - } - if (hasAddSerializable) { - size += pb::CodedOutputStream.ComputeBoolSize(9, AddSerializable); - } - if (hasGeneratePrivateCtor) { - size += pb::CodedOutputStream.ComputeBoolSize(10, GeneratePrivateCtor); - } - if (hasFileExtension) { - size += pb::CodedOutputStream.ComputeStringSize(221, FileExtension); - } - if (hasUmbrellaNamespace) { - size += pb::CodedOutputStream.ComputeStringSize(222, UmbrellaNamespace); - } - if (hasOutputDirectory) { - size += pb::CodedOutputStream.ComputeStringSize(223, OutputDirectory); - } - if (hasIgnoreGoogleProtobuf) { - size += pb::CodedOutputStream.ComputeBoolSize(224, IgnoreGoogleProtobuf); - } - if (hasServiceGeneratorType) { - size += pb::CodedOutputStream.ComputeEnumSize(225, (int) ServiceGeneratorType); - } - if (hasGeneratedCodeAttributes) { - size += pb::CodedOutputStream.ComputeBoolSize(226, GeneratedCodeAttributes); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static CSharpFileOptions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CSharpFileOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CSharpFileOptions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CSharpFileOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CSharpFileOptions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CSharpFileOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static CSharpFileOptions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static CSharpFileOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static CSharpFileOptions ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CSharpFileOptions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private CSharpFileOptions MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(CSharpFileOptions prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(CSharpFileOptions cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private CSharpFileOptions result; - - private CSharpFileOptions PrepareBuilder() { - if (resultIsReadOnly) { - CSharpFileOptions original = result; - result = new CSharpFileOptions(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override CSharpFileOptions MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpFileOptions.Descriptor; } - } - - public override CSharpFileOptions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpFileOptions.DefaultInstance; } - } - - public override CSharpFileOptions BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is CSharpFileOptions) { - return MergeFrom((CSharpFileOptions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(CSharpFileOptions other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.CSharpFileOptions.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasNamespace) { - Namespace = other.Namespace; - } - if (other.HasUmbrellaClassname) { - UmbrellaClassname = other.UmbrellaClassname; - } - if (other.HasPublicClasses) { - PublicClasses = other.PublicClasses; - } - if (other.HasMultipleFiles) { - MultipleFiles = other.MultipleFiles; - } - if (other.HasNestClasses) { - NestClasses = other.NestClasses; - } - if (other.HasCodeContracts) { - CodeContracts = other.CodeContracts; - } - if (other.HasExpandNamespaceDirectories) { - ExpandNamespaceDirectories = other.ExpandNamespaceDirectories; - } - if (other.HasClsCompliance) { - ClsCompliance = other.ClsCompliance; - } - if (other.HasAddSerializable) { - AddSerializable = other.AddSerializable; - } - if (other.HasGeneratePrivateCtor) { - GeneratePrivateCtor = other.GeneratePrivateCtor; - } - if (other.HasFileExtension) { - FileExtension = other.FileExtension; - } - if (other.HasUmbrellaNamespace) { - UmbrellaNamespace = other.UmbrellaNamespace; - } - if (other.HasOutputDirectory) { - OutputDirectory = other.OutputDirectory; - } - if (other.HasIgnoreGoogleProtobuf) { - IgnoreGoogleProtobuf = other.IgnoreGoogleProtobuf; - } - if (other.HasServiceGeneratorType) { - ServiceGeneratorType = other.ServiceGeneratorType; - } - if (other.HasGeneratedCodeAttributes) { - GeneratedCodeAttributes = other.GeneratedCodeAttributes; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_cSharpFileOptionsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _cSharpFileOptionsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasNamespace = input.ReadString(ref result.namespace_); - break; - } - case 18: { - result.hasUmbrellaClassname = input.ReadString(ref result.umbrellaClassname_); - break; - } - case 24: { - result.hasPublicClasses = input.ReadBool(ref result.publicClasses_); - break; - } - case 32: { - result.hasMultipleFiles = input.ReadBool(ref result.multipleFiles_); - break; - } - case 40: { - result.hasNestClasses = input.ReadBool(ref result.nestClasses_); - break; - } - case 48: { - result.hasCodeContracts = input.ReadBool(ref result.codeContracts_); - break; - } - case 56: { - result.hasExpandNamespaceDirectories = input.ReadBool(ref result.expandNamespaceDirectories_); - break; - } - case 64: { - result.hasClsCompliance = input.ReadBool(ref result.clsCompliance_); - break; - } - case 72: { - result.hasAddSerializable = input.ReadBool(ref result.addSerializable_); - break; - } - case 80: { - result.hasGeneratePrivateCtor = input.ReadBool(ref result.generatePrivateCtor_); - break; - } - case 1770: { - result.hasFileExtension = input.ReadString(ref result.fileExtension_); - break; - } - case 1778: { - result.hasUmbrellaNamespace = input.ReadString(ref result.umbrellaNamespace_); - break; - } - case 1786: { - result.hasOutputDirectory = input.ReadString(ref result.outputDirectory_); - break; - } - case 1792: { - result.hasIgnoreGoogleProtobuf = input.ReadBool(ref result.ignoreGoogleProtobuf_); - break; - } - case 1800: { - object unknown; - if(input.ReadEnum(ref result.serviceGeneratorType_, out unknown)) { - result.hasServiceGeneratorType = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(225, (ulong)(int)unknown); - } - break; - } - case 1808: { - result.hasGeneratedCodeAttributes = input.ReadBool(ref result.generatedCodeAttributes_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasNamespace { - get { return result.hasNamespace; } - } - public string Namespace { - get { return result.Namespace; } - set { SetNamespace(value); } - } - public Builder SetNamespace(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasNamespace = true; - result.namespace_ = value; - return this; - } - public Builder ClearNamespace() { - PrepareBuilder(); - result.hasNamespace = false; - result.namespace_ = ""; - return this; - } - - public bool HasUmbrellaClassname { - get { return result.hasUmbrellaClassname; } - } - public string UmbrellaClassname { - get { return result.UmbrellaClassname; } - set { SetUmbrellaClassname(value); } - } - public Builder SetUmbrellaClassname(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasUmbrellaClassname = true; - result.umbrellaClassname_ = value; - return this; - } - public Builder ClearUmbrellaClassname() { - PrepareBuilder(); - result.hasUmbrellaClassname = false; - result.umbrellaClassname_ = ""; - return this; - } - - public bool HasPublicClasses { - get { return result.hasPublicClasses; } - } - public bool PublicClasses { - get { return result.PublicClasses; } - set { SetPublicClasses(value); } - } - public Builder SetPublicClasses(bool value) { - PrepareBuilder(); - result.hasPublicClasses = true; - result.publicClasses_ = value; - return this; - } - public Builder ClearPublicClasses() { - PrepareBuilder(); - result.hasPublicClasses = false; - result.publicClasses_ = true; - return this; - } - - public bool HasMultipleFiles { - get { return result.hasMultipleFiles; } - } - public bool MultipleFiles { - get { return result.MultipleFiles; } - set { SetMultipleFiles(value); } - } - public Builder SetMultipleFiles(bool value) { - PrepareBuilder(); - result.hasMultipleFiles = true; - result.multipleFiles_ = value; - return this; - } - public Builder ClearMultipleFiles() { - PrepareBuilder(); - result.hasMultipleFiles = false; - result.multipleFiles_ = false; - return this; - } - - public bool HasNestClasses { - get { return result.hasNestClasses; } - } - public bool NestClasses { - get { return result.NestClasses; } - set { SetNestClasses(value); } - } - public Builder SetNestClasses(bool value) { - PrepareBuilder(); - result.hasNestClasses = true; - result.nestClasses_ = value; - return this; - } - public Builder ClearNestClasses() { - PrepareBuilder(); - result.hasNestClasses = false; - result.nestClasses_ = false; - return this; - } - - public bool HasCodeContracts { - get { return result.hasCodeContracts; } - } - public bool CodeContracts { - get { return result.CodeContracts; } - set { SetCodeContracts(value); } - } - public Builder SetCodeContracts(bool value) { - PrepareBuilder(); - result.hasCodeContracts = true; - result.codeContracts_ = value; - return this; - } - public Builder ClearCodeContracts() { - PrepareBuilder(); - result.hasCodeContracts = false; - result.codeContracts_ = false; - return this; - } - - public bool HasExpandNamespaceDirectories { - get { return result.hasExpandNamespaceDirectories; } - } - public bool ExpandNamespaceDirectories { - get { return result.ExpandNamespaceDirectories; } - set { SetExpandNamespaceDirectories(value); } - } - public Builder SetExpandNamespaceDirectories(bool value) { - PrepareBuilder(); - result.hasExpandNamespaceDirectories = true; - result.expandNamespaceDirectories_ = value; - return this; - } - public Builder ClearExpandNamespaceDirectories() { - PrepareBuilder(); - result.hasExpandNamespaceDirectories = false; - result.expandNamespaceDirectories_ = false; - return this; - } - - public bool HasClsCompliance { - get { return result.hasClsCompliance; } - } - public bool ClsCompliance { - get { return result.ClsCompliance; } - set { SetClsCompliance(value); } - } - public Builder SetClsCompliance(bool value) { - PrepareBuilder(); - result.hasClsCompliance = true; - result.clsCompliance_ = value; - return this; - } - public Builder ClearClsCompliance() { - PrepareBuilder(); - result.hasClsCompliance = false; - result.clsCompliance_ = true; - return this; - } - - public bool HasAddSerializable { - get { return result.hasAddSerializable; } - } - public bool AddSerializable { - get { return result.AddSerializable; } - set { SetAddSerializable(value); } - } - public Builder SetAddSerializable(bool value) { - PrepareBuilder(); - result.hasAddSerializable = true; - result.addSerializable_ = value; - return this; - } - public Builder ClearAddSerializable() { - PrepareBuilder(); - result.hasAddSerializable = false; - result.addSerializable_ = false; - return this; - } - - public bool HasGeneratePrivateCtor { - get { return result.hasGeneratePrivateCtor; } - } - public bool GeneratePrivateCtor { - get { return result.GeneratePrivateCtor; } - set { SetGeneratePrivateCtor(value); } - } - public Builder SetGeneratePrivateCtor(bool value) { - PrepareBuilder(); - result.hasGeneratePrivateCtor = true; - result.generatePrivateCtor_ = value; - return this; - } - public Builder ClearGeneratePrivateCtor() { - PrepareBuilder(); - result.hasGeneratePrivateCtor = false; - result.generatePrivateCtor_ = true; - return this; - } - - public bool HasFileExtension { - get { return result.hasFileExtension; } - } - public string FileExtension { - get { return result.FileExtension; } - set { SetFileExtension(value); } - } - public Builder SetFileExtension(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasFileExtension = true; - result.fileExtension_ = value; - return this; - } - public Builder ClearFileExtension() { - PrepareBuilder(); - result.hasFileExtension = false; - result.fileExtension_ = ".cs"; - return this; - } - - public bool HasUmbrellaNamespace { - get { return result.hasUmbrellaNamespace; } - } - public string UmbrellaNamespace { - get { return result.UmbrellaNamespace; } - set { SetUmbrellaNamespace(value); } - } - public Builder SetUmbrellaNamespace(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasUmbrellaNamespace = true; - result.umbrellaNamespace_ = value; - return this; - } - public Builder ClearUmbrellaNamespace() { - PrepareBuilder(); - result.hasUmbrellaNamespace = false; - result.umbrellaNamespace_ = ""; - return this; - } - - public bool HasOutputDirectory { - get { return result.hasOutputDirectory; } - } - public string OutputDirectory { - get { return result.OutputDirectory; } - set { SetOutputDirectory(value); } - } - public Builder SetOutputDirectory(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOutputDirectory = true; - result.outputDirectory_ = value; - return this; - } - public Builder ClearOutputDirectory() { - PrepareBuilder(); - result.hasOutputDirectory = false; - result.outputDirectory_ = "."; - return this; - } - - public bool HasIgnoreGoogleProtobuf { - get { return result.hasIgnoreGoogleProtobuf; } - } - public bool IgnoreGoogleProtobuf { - get { return result.IgnoreGoogleProtobuf; } - set { SetIgnoreGoogleProtobuf(value); } - } - public Builder SetIgnoreGoogleProtobuf(bool value) { - PrepareBuilder(); - result.hasIgnoreGoogleProtobuf = true; - result.ignoreGoogleProtobuf_ = value; - return this; - } - public Builder ClearIgnoreGoogleProtobuf() { - PrepareBuilder(); - result.hasIgnoreGoogleProtobuf = false; - result.ignoreGoogleProtobuf_ = false; - return this; - } - - public bool HasServiceGeneratorType { - get { return result.hasServiceGeneratorType; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.CSharpServiceType ServiceGeneratorType { - get { return result.ServiceGeneratorType; } - set { SetServiceGeneratorType(value); } - } - public Builder SetServiceGeneratorType(global::Google.ProtocolBuffers.DescriptorProtos.CSharpServiceType value) { - PrepareBuilder(); - result.hasServiceGeneratorType = true; - result.serviceGeneratorType_ = value; - return this; - } - public Builder ClearServiceGeneratorType() { - PrepareBuilder(); - result.hasServiceGeneratorType = false; - result.serviceGeneratorType_ = global::Google.ProtocolBuffers.DescriptorProtos.CSharpServiceType.NONE; - return this; - } - - public bool HasGeneratedCodeAttributes { - get { return result.hasGeneratedCodeAttributes; } - } - public bool GeneratedCodeAttributes { - get { return result.GeneratedCodeAttributes; } - set { SetGeneratedCodeAttributes(value); } - } - public Builder SetGeneratedCodeAttributes(bool value) { - PrepareBuilder(); - result.hasGeneratedCodeAttributes = true; - result.generatedCodeAttributes_ = value; - return this; - } - public Builder ClearGeneratedCodeAttributes() { - PrepareBuilder(); - result.hasGeneratedCodeAttributes = false; - result.generatedCodeAttributes_ = false; - return this; - } - } - static CSharpFileOptions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class CSharpFieldOptions : pb::GeneratedMessage { - private CSharpFieldOptions() { } - private static readonly CSharpFieldOptions defaultInstance = new CSharpFieldOptions().MakeReadOnly(); - private static readonly string[] _cSharpFieldOptionsFieldNames = new string[] { "property_name" }; - private static readonly uint[] _cSharpFieldOptionsFieldTags = new uint[] { 10 }; - public static CSharpFieldOptions DefaultInstance { - get { return defaultInstance; } - } - - public override CSharpFieldOptions DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override CSharpFieldOptions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.internal__static_google_protobuf_CSharpFieldOptions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.internal__static_google_protobuf_CSharpFieldOptions__FieldAccessorTable; } - } - - public const int PropertyNameFieldNumber = 1; - private bool hasPropertyName; - private string propertyName_ = ""; - public bool HasPropertyName { - get { return hasPropertyName; } - } - public string PropertyName { - get { return propertyName_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _cSharpFieldOptionsFieldNames; - if (hasPropertyName) { - output.WriteString(1, field_names[0], PropertyName); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasPropertyName) { - size += pb::CodedOutputStream.ComputeStringSize(1, PropertyName); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static CSharpFieldOptions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CSharpFieldOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CSharpFieldOptions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CSharpFieldOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CSharpFieldOptions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CSharpFieldOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static CSharpFieldOptions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static CSharpFieldOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static CSharpFieldOptions ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CSharpFieldOptions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private CSharpFieldOptions MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(CSharpFieldOptions prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(CSharpFieldOptions cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private CSharpFieldOptions result; - - private CSharpFieldOptions PrepareBuilder() { - if (resultIsReadOnly) { - CSharpFieldOptions original = result; - result = new CSharpFieldOptions(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override CSharpFieldOptions MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpFieldOptions.Descriptor; } - } - - public override CSharpFieldOptions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpFieldOptions.DefaultInstance; } - } - - public override CSharpFieldOptions BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is CSharpFieldOptions) { - return MergeFrom((CSharpFieldOptions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(CSharpFieldOptions other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.CSharpFieldOptions.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasPropertyName) { - PropertyName = other.PropertyName; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_cSharpFieldOptionsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _cSharpFieldOptionsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasPropertyName = input.ReadString(ref result.propertyName_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasPropertyName { - get { return result.hasPropertyName; } - } - public string PropertyName { - get { return result.PropertyName; } - set { SetPropertyName(value); } - } - public Builder SetPropertyName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasPropertyName = true; - result.propertyName_ = value; - return this; - } - public Builder ClearPropertyName() { - PrepareBuilder(); - result.hasPropertyName = false; - result.propertyName_ = ""; - return this; - } - } - static CSharpFieldOptions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class CSharpServiceOptions : pb::GeneratedMessage { - private CSharpServiceOptions() { } - private static readonly CSharpServiceOptions defaultInstance = new CSharpServiceOptions().MakeReadOnly(); - private static readonly string[] _cSharpServiceOptionsFieldNames = new string[] { "interface_id" }; - private static readonly uint[] _cSharpServiceOptionsFieldTags = new uint[] { 10 }; - public static CSharpServiceOptions DefaultInstance { - get { return defaultInstance; } - } - - public override CSharpServiceOptions DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override CSharpServiceOptions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.internal__static_google_protobuf_CSharpServiceOptions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.internal__static_google_protobuf_CSharpServiceOptions__FieldAccessorTable; } - } - - public const int InterfaceIdFieldNumber = 1; - private bool hasInterfaceId; - private string interfaceId_ = ""; - public bool HasInterfaceId { - get { return hasInterfaceId; } - } - public string InterfaceId { - get { return interfaceId_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _cSharpServiceOptionsFieldNames; - if (hasInterfaceId) { - output.WriteString(1, field_names[0], InterfaceId); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasInterfaceId) { - size += pb::CodedOutputStream.ComputeStringSize(1, InterfaceId); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static CSharpServiceOptions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CSharpServiceOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CSharpServiceOptions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CSharpServiceOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CSharpServiceOptions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CSharpServiceOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static CSharpServiceOptions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static CSharpServiceOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static CSharpServiceOptions ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CSharpServiceOptions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private CSharpServiceOptions MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(CSharpServiceOptions prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(CSharpServiceOptions cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private CSharpServiceOptions result; - - private CSharpServiceOptions PrepareBuilder() { - if (resultIsReadOnly) { - CSharpServiceOptions original = result; - result = new CSharpServiceOptions(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override CSharpServiceOptions MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpServiceOptions.Descriptor; } - } - - public override CSharpServiceOptions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpServiceOptions.DefaultInstance; } - } - - public override CSharpServiceOptions BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is CSharpServiceOptions) { - return MergeFrom((CSharpServiceOptions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(CSharpServiceOptions other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.CSharpServiceOptions.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasInterfaceId) { - InterfaceId = other.InterfaceId; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_cSharpServiceOptionsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _cSharpServiceOptionsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasInterfaceId = input.ReadString(ref result.interfaceId_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasInterfaceId { - get { return result.hasInterfaceId; } - } - public string InterfaceId { - get { return result.InterfaceId; } - set { SetInterfaceId(value); } - } - public Builder SetInterfaceId(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasInterfaceId = true; - result.interfaceId_ = value; - return this; - } - public Builder ClearInterfaceId() { - PrepareBuilder(); - result.hasInterfaceId = false; - result.interfaceId_ = ""; - return this; - } - } - static CSharpServiceOptions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class CSharpMethodOptions : pb::GeneratedMessage { - private CSharpMethodOptions() { } - private static readonly CSharpMethodOptions defaultInstance = new CSharpMethodOptions().MakeReadOnly(); - private static readonly string[] _cSharpMethodOptionsFieldNames = new string[] { "dispatch_id" }; - private static readonly uint[] _cSharpMethodOptionsFieldTags = new uint[] { 8 }; - public static CSharpMethodOptions DefaultInstance { - get { return defaultInstance; } - } - - public override CSharpMethodOptions DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override CSharpMethodOptions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.internal__static_google_protobuf_CSharpMethodOptions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.internal__static_google_protobuf_CSharpMethodOptions__FieldAccessorTable; } - } - - public const int DispatchIdFieldNumber = 1; - private bool hasDispatchId; - private int dispatchId_; - public bool HasDispatchId { - get { return hasDispatchId; } - } - public int DispatchId { - get { return dispatchId_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _cSharpMethodOptionsFieldNames; - if (hasDispatchId) { - output.WriteInt32(1, field_names[0], DispatchId); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasDispatchId) { - size += pb::CodedOutputStream.ComputeInt32Size(1, DispatchId); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static CSharpMethodOptions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CSharpMethodOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CSharpMethodOptions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CSharpMethodOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CSharpMethodOptions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CSharpMethodOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static CSharpMethodOptions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static CSharpMethodOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static CSharpMethodOptions ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CSharpMethodOptions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private CSharpMethodOptions MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(CSharpMethodOptions prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(CSharpMethodOptions cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private CSharpMethodOptions result; - - private CSharpMethodOptions PrepareBuilder() { - if (resultIsReadOnly) { - CSharpMethodOptions original = result; - result = new CSharpMethodOptions(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override CSharpMethodOptions MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpMethodOptions.Descriptor; } - } - - public override CSharpMethodOptions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpMethodOptions.DefaultInstance; } - } - - public override CSharpMethodOptions BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is CSharpMethodOptions) { - return MergeFrom((CSharpMethodOptions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(CSharpMethodOptions other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.CSharpMethodOptions.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasDispatchId) { - DispatchId = other.DispatchId; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_cSharpMethodOptionsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _cSharpMethodOptionsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasDispatchId = input.ReadInt32(ref result.dispatchId_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasDispatchId { - get { return result.hasDispatchId; } - } - public int DispatchId { - get { return result.DispatchId; } - set { SetDispatchId(value); } - } - public Builder SetDispatchId(int value) { - PrepareBuilder(); - result.hasDispatchId = true; - result.dispatchId_ = value; - return this; - } - public Builder ClearDispatchId() { - PrepareBuilder(); - result.hasDispatchId = false; - result.dispatchId_ = 0; - return this; - } - } - static CSharpMethodOptions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, null); - } - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/ProtocolBuffers/DescriptorProtos/DescriptorProtoFile.cs b/src/ProtocolBuffers/DescriptorProtos/DescriptorProtoFile.cs deleted file mode 100644 index c319c60..0000000 --- a/src/ProtocolBuffers/DescriptorProtos/DescriptorProtoFile.cs +++ /dev/null @@ -1,9110 +0,0 @@ -// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.DescriptorProtos { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class DescriptorProtoFile { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_google_protobuf_FileDescriptorSet__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_FileDescriptorSet__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_FileDescriptorProto__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_FileDescriptorProto__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_DescriptorProto__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_DescriptorProto__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_DescriptorProto_ExtensionRange__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_DescriptorProto_ExtensionRange__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_FieldDescriptorProto__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_FieldDescriptorProto__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_EnumDescriptorProto__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_EnumDescriptorProto__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_EnumValueDescriptorProto__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_EnumValueDescriptorProto__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_ServiceDescriptorProto__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_ServiceDescriptorProto__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_MethodDescriptorProto__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_MethodDescriptorProto__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_FileOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_FileOptions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_MessageOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_MessageOptions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_FieldOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_FieldOptions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_EnumOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_EnumOptions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_EnumValueOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_EnumValueOptions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_ServiceOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_ServiceOptions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_MethodOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_MethodOptions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_UninterpretedOption__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_UninterpretedOption__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_UninterpretedOption_NamePart__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_UninterpretedOption_NamePart__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_SourceCodeInfo__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_SourceCodeInfo__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_SourceCodeInfo_Location__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_SourceCodeInfo_Location__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static DescriptorProtoFile() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CiBnb29nbGUvcHJvdG9idWYvZGVzY3JpcHRvci5wcm90bxIPZ29vZ2xlLnBy", - "b3RvYnVmIkcKEUZpbGVEZXNjcmlwdG9yU2V0EjIKBGZpbGUYASADKAsyJC5n", - "b29nbGUucHJvdG9idWYuRmlsZURlc2NyaXB0b3JQcm90byKXAwoTRmlsZURl", - "c2NyaXB0b3JQcm90bxIMCgRuYW1lGAEgASgJEg8KB3BhY2thZ2UYAiABKAkS", - "EgoKZGVwZW5kZW5jeRgDIAMoCRI2CgxtZXNzYWdlX3R5cGUYBCADKAsyIC5n", - "b29nbGUucHJvdG9idWYuRGVzY3JpcHRvclByb3RvEjcKCWVudW1fdHlwZRgF", - "IAMoCzIkLmdvb2dsZS5wcm90b2J1Zi5FbnVtRGVzY3JpcHRvclByb3RvEjgK", - "B3NlcnZpY2UYBiADKAsyJy5nb29nbGUucHJvdG9idWYuU2VydmljZURlc2Ny", - "aXB0b3JQcm90bxI4CglleHRlbnNpb24YByADKAsyJS5nb29nbGUucHJvdG9i", - "dWYuRmllbGREZXNjcmlwdG9yUHJvdG8SLQoHb3B0aW9ucxgIIAEoCzIcLmdv", - "b2dsZS5wcm90b2J1Zi5GaWxlT3B0aW9ucxI5ChBzb3VyY2VfY29kZV9pbmZv", - "GAkgASgLMh8uZ29vZ2xlLnByb3RvYnVmLlNvdXJjZUNvZGVJbmZvIqkDCg9E", - "ZXNjcmlwdG9yUHJvdG8SDAoEbmFtZRgBIAEoCRI0CgVmaWVsZBgCIAMoCzIl", - "Lmdvb2dsZS5wcm90b2J1Zi5GaWVsZERlc2NyaXB0b3JQcm90bxI4CglleHRl", - "bnNpb24YBiADKAsyJS5nb29nbGUucHJvdG9idWYuRmllbGREZXNjcmlwdG9y", - "UHJvdG8SNQoLbmVzdGVkX3R5cGUYAyADKAsyIC5nb29nbGUucHJvdG9idWYu", - "RGVzY3JpcHRvclByb3RvEjcKCWVudW1fdHlwZRgEIAMoCzIkLmdvb2dsZS5w", - "cm90b2J1Zi5FbnVtRGVzY3JpcHRvclByb3RvEkgKD2V4dGVuc2lvbl9yYW5n", - "ZRgFIAMoCzIvLmdvb2dsZS5wcm90b2J1Zi5EZXNjcmlwdG9yUHJvdG8uRXh0", - "ZW5zaW9uUmFuZ2USMAoHb3B0aW9ucxgHIAEoCzIfLmdvb2dsZS5wcm90b2J1", - "Zi5NZXNzYWdlT3B0aW9ucxosCg5FeHRlbnNpb25SYW5nZRINCgVzdGFydBgB", - "IAEoBRILCgNlbmQYAiABKAUilAUKFEZpZWxkRGVzY3JpcHRvclByb3RvEgwK", - "BG5hbWUYASABKAkSDgoGbnVtYmVyGAMgASgFEjoKBWxhYmVsGAQgASgOMisu", - "Z29vZ2xlLnByb3RvYnVmLkZpZWxkRGVzY3JpcHRvclByb3RvLkxhYmVsEjgK", - "BHR5cGUYBSABKA4yKi5nb29nbGUucHJvdG9idWYuRmllbGREZXNjcmlwdG9y", - "UHJvdG8uVHlwZRIRCgl0eXBlX25hbWUYBiABKAkSEAoIZXh0ZW5kZWUYAiAB", - "KAkSFQoNZGVmYXVsdF92YWx1ZRgHIAEoCRIuCgdvcHRpb25zGAggASgLMh0u", - "Z29vZ2xlLnByb3RvYnVmLkZpZWxkT3B0aW9ucyK2AgoEVHlwZRIPCgtUWVBF", - "X0RPVUJMRRABEg4KClRZUEVfRkxPQVQQAhIOCgpUWVBFX0lOVDY0EAMSDwoL", - "VFlQRV9VSU5UNjQQBBIOCgpUWVBFX0lOVDMyEAUSEAoMVFlQRV9GSVhFRDY0", - "EAYSEAoMVFlQRV9GSVhFRDMyEAcSDQoJVFlQRV9CT09MEAgSDwoLVFlQRV9T", - "VFJJTkcQCRIOCgpUWVBFX0dST1VQEAoSEAoMVFlQRV9NRVNTQUdFEAsSDgoK", - "VFlQRV9CWVRFUxAMEg8KC1RZUEVfVUlOVDMyEA0SDQoJVFlQRV9FTlVNEA4S", - "EQoNVFlQRV9TRklYRUQzMhAPEhEKDVRZUEVfU0ZJWEVENjQQEBIPCgtUWVBF", - "X1NJTlQzMhAREg8KC1RZUEVfU0lOVDY0EBIiQwoFTGFiZWwSEgoOTEFCRUxf", - "T1BUSU9OQUwQARISCg5MQUJFTF9SRVFVSVJFRBACEhIKDkxBQkVMX1JFUEVB", - "VEVEEAMijAEKE0VudW1EZXNjcmlwdG9yUHJvdG8SDAoEbmFtZRgBIAEoCRI4", - "CgV2YWx1ZRgCIAMoCzIpLmdvb2dsZS5wcm90b2J1Zi5FbnVtVmFsdWVEZXNj", - "cmlwdG9yUHJvdG8SLQoHb3B0aW9ucxgDIAEoCzIcLmdvb2dsZS5wcm90b2J1", - "Zi5FbnVtT3B0aW9ucyJsChhFbnVtVmFsdWVEZXNjcmlwdG9yUHJvdG8SDAoE", - "bmFtZRgBIAEoCRIOCgZudW1iZXIYAiABKAUSMgoHb3B0aW9ucxgDIAEoCzIh", - "Lmdvb2dsZS5wcm90b2J1Zi5FbnVtVmFsdWVPcHRpb25zIpABChZTZXJ2aWNl", - "RGVzY3JpcHRvclByb3RvEgwKBG5hbWUYASABKAkSNgoGbWV0aG9kGAIgAygL", - "MiYuZ29vZ2xlLnByb3RvYnVmLk1ldGhvZERlc2NyaXB0b3JQcm90bxIwCgdv", - "cHRpb25zGAMgASgLMh8uZ29vZ2xlLnByb3RvYnVmLlNlcnZpY2VPcHRpb25z", - "In8KFU1ldGhvZERlc2NyaXB0b3JQcm90bxIMCgRuYW1lGAEgASgJEhIKCmlu", - "cHV0X3R5cGUYAiABKAkSEwoLb3V0cHV0X3R5cGUYAyABKAkSLwoHb3B0aW9u", - "cxgEIAEoCzIeLmdvb2dsZS5wcm90b2J1Zi5NZXRob2RPcHRpb25zItUDCgtG", - "aWxlT3B0aW9ucxIUCgxqYXZhX3BhY2thZ2UYASABKAkSHAoUamF2YV9vdXRl", - "cl9jbGFzc25hbWUYCCABKAkSIgoTamF2YV9tdWx0aXBsZV9maWxlcxgKIAEo", - "CDoFZmFsc2USLAodamF2YV9nZW5lcmF0ZV9lcXVhbHNfYW5kX2hhc2gYFCAB", - "KAg6BWZhbHNlEkYKDG9wdGltaXplX2ZvchgJIAEoDjIpLmdvb2dsZS5wcm90", - "b2J1Zi5GaWxlT3B0aW9ucy5PcHRpbWl6ZU1vZGU6BVNQRUVEEiIKE2NjX2dl", - "bmVyaWNfc2VydmljZXMYECABKAg6BWZhbHNlEiQKFWphdmFfZ2VuZXJpY19z", - "ZXJ2aWNlcxgRIAEoCDoFZmFsc2USIgoTcHlfZ2VuZXJpY19zZXJ2aWNlcxgS", - "IAEoCDoFZmFsc2USQwoUdW5pbnRlcnByZXRlZF9vcHRpb24Y5wcgAygLMiQu", - "Z29vZ2xlLnByb3RvYnVmLlVuaW50ZXJwcmV0ZWRPcHRpb24iOgoMT3B0aW1p", - "emVNb2RlEgkKBVNQRUVEEAESDQoJQ09ERV9TSVpFEAISEAoMTElURV9SVU5U", - "SU1FEAMqCQjoBxCAgICAAiK4AQoOTWVzc2FnZU9wdGlvbnMSJgoXbWVzc2Fn", - "ZV9zZXRfd2lyZV9mb3JtYXQYASABKAg6BWZhbHNlEi4KH25vX3N0YW5kYXJk", - "X2Rlc2NyaXB0b3JfYWNjZXNzb3IYAiABKAg6BWZhbHNlEkMKFHVuaW50ZXJw", - "cmV0ZWRfb3B0aW9uGOcHIAMoCzIkLmdvb2dsZS5wcm90b2J1Zi5VbmludGVy", - "cHJldGVkT3B0aW9uKgkI6AcQgICAgAIilAIKDEZpZWxkT3B0aW9ucxI6CgVj", - "dHlwZRgBIAEoDjIjLmdvb2dsZS5wcm90b2J1Zi5GaWVsZE9wdGlvbnMuQ1R5", - "cGU6BlNUUklORxIOCgZwYWNrZWQYAiABKAgSGQoKZGVwcmVjYXRlZBgDIAEo", - "CDoFZmFsc2USHAoUZXhwZXJpbWVudGFsX21hcF9rZXkYCSABKAkSQwoUdW5p", - "bnRlcnByZXRlZF9vcHRpb24Y5wcgAygLMiQuZ29vZ2xlLnByb3RvYnVmLlVu", - "aW50ZXJwcmV0ZWRPcHRpb24iLwoFQ1R5cGUSCgoGU1RSSU5HEAASCAoEQ09S", - "RBABEhAKDFNUUklOR19QSUVDRRACKgkI6AcQgICAgAIiXQoLRW51bU9wdGlv", - "bnMSQwoUdW5pbnRlcnByZXRlZF9vcHRpb24Y5wcgAygLMiQuZ29vZ2xlLnBy", - "b3RvYnVmLlVuaW50ZXJwcmV0ZWRPcHRpb24qCQjoBxCAgICAAiJiChBFbnVt", - "VmFsdWVPcHRpb25zEkMKFHVuaW50ZXJwcmV0ZWRfb3B0aW9uGOcHIAMoCzIk", - "Lmdvb2dsZS5wcm90b2J1Zi5VbmludGVycHJldGVkT3B0aW9uKgkI6AcQgICA", - "gAIiYAoOU2VydmljZU9wdGlvbnMSQwoUdW5pbnRlcnByZXRlZF9vcHRpb24Y", - "5wcgAygLMiQuZ29vZ2xlLnByb3RvYnVmLlVuaW50ZXJwcmV0ZWRPcHRpb24q", - "CQjoBxCAgICAAiJfCg1NZXRob2RPcHRpb25zEkMKFHVuaW50ZXJwcmV0ZWRf", - "b3B0aW9uGOcHIAMoCzIkLmdvb2dsZS5wcm90b2J1Zi5VbmludGVycHJldGVk", - "T3B0aW9uKgkI6AcQgICAgAIingIKE1VuaW50ZXJwcmV0ZWRPcHRpb24SOwoE", - "bmFtZRgCIAMoCzItLmdvb2dsZS5wcm90b2J1Zi5VbmludGVycHJldGVkT3B0", - "aW9uLk5hbWVQYXJ0EhgKEGlkZW50aWZpZXJfdmFsdWUYAyABKAkSGgoScG9z", - "aXRpdmVfaW50X3ZhbHVlGAQgASgEEhoKEm5lZ2F0aXZlX2ludF92YWx1ZRgF", - "IAEoAxIUCgxkb3VibGVfdmFsdWUYBiABKAESFAoMc3RyaW5nX3ZhbHVlGAcg", - "ASgMEhcKD2FnZ3JlZ2F0ZV92YWx1ZRgIIAEoCRozCghOYW1lUGFydBIRCglu", - "YW1lX3BhcnQYASACKAkSFAoMaXNfZXh0ZW5zaW9uGAIgAigIInwKDlNvdXJj", - "ZUNvZGVJbmZvEjoKCGxvY2F0aW9uGAEgAygLMiguZ29vZ2xlLnByb3RvYnVm", - "LlNvdXJjZUNvZGVJbmZvLkxvY2F0aW9uGi4KCExvY2F0aW9uEhAKBHBhdGgY", - "ASADKAVCAhABEhAKBHNwYW4YAiADKAVCAhABQikKE2NvbS5nb29nbGUucHJv", - "dG9idWZCEERlc2NyaXB0b3JQcm90b3NIAQ==")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_google_protobuf_FileDescriptorSet__Descriptor = Descriptor.MessageTypes[0]; - internal__static_google_protobuf_FileDescriptorSet__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_FileDescriptorSet__Descriptor, - new string[] { "File", }); - internal__static_google_protobuf_FileDescriptorProto__Descriptor = Descriptor.MessageTypes[1]; - internal__static_google_protobuf_FileDescriptorProto__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_FileDescriptorProto__Descriptor, - new string[] { "Name", "Package", "Dependency", "MessageType", "EnumType", "Service", "Extension", "Options", "SourceCodeInfo", }); - internal__static_google_protobuf_DescriptorProto__Descriptor = Descriptor.MessageTypes[2]; - internal__static_google_protobuf_DescriptorProto__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_DescriptorProto__Descriptor, - new string[] { "Name", "Field", "Extension", "NestedType", "EnumType", "ExtensionRange", "Options", }); - internal__static_google_protobuf_DescriptorProto_ExtensionRange__Descriptor = internal__static_google_protobuf_DescriptorProto__Descriptor.NestedTypes[0]; - internal__static_google_protobuf_DescriptorProto_ExtensionRange__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_DescriptorProto_ExtensionRange__Descriptor, - new string[] { "Start", "End", }); - internal__static_google_protobuf_FieldDescriptorProto__Descriptor = Descriptor.MessageTypes[3]; - internal__static_google_protobuf_FieldDescriptorProto__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_FieldDescriptorProto__Descriptor, - new string[] { "Name", "Number", "Label", "Type", "TypeName", "Extendee", "DefaultValue", "Options", }); - internal__static_google_protobuf_EnumDescriptorProto__Descriptor = Descriptor.MessageTypes[4]; - internal__static_google_protobuf_EnumDescriptorProto__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_EnumDescriptorProto__Descriptor, - new string[] { "Name", "Value", "Options", }); - internal__static_google_protobuf_EnumValueDescriptorProto__Descriptor = Descriptor.MessageTypes[5]; - internal__static_google_protobuf_EnumValueDescriptorProto__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_EnumValueDescriptorProto__Descriptor, - new string[] { "Name", "Number", "Options", }); - internal__static_google_protobuf_ServiceDescriptorProto__Descriptor = Descriptor.MessageTypes[6]; - internal__static_google_protobuf_ServiceDescriptorProto__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_ServiceDescriptorProto__Descriptor, - new string[] { "Name", "Method", "Options", }); - internal__static_google_protobuf_MethodDescriptorProto__Descriptor = Descriptor.MessageTypes[7]; - internal__static_google_protobuf_MethodDescriptorProto__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_MethodDescriptorProto__Descriptor, - new string[] { "Name", "InputType", "OutputType", "Options", }); - internal__static_google_protobuf_FileOptions__Descriptor = Descriptor.MessageTypes[8]; - internal__static_google_protobuf_FileOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_FileOptions__Descriptor, - new string[] { "JavaPackage", "JavaOuterClassname", "JavaMultipleFiles", "JavaGenerateEqualsAndHash", "OptimizeFor", "CcGenericServices", "JavaGenericServices", "PyGenericServices", "UninterpretedOption", }); - internal__static_google_protobuf_MessageOptions__Descriptor = Descriptor.MessageTypes[9]; - internal__static_google_protobuf_MessageOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_MessageOptions__Descriptor, - new string[] { "MessageSetWireFormat", "NoStandardDescriptorAccessor", "UninterpretedOption", }); - internal__static_google_protobuf_FieldOptions__Descriptor = Descriptor.MessageTypes[10]; - internal__static_google_protobuf_FieldOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_FieldOptions__Descriptor, - new string[] { "Ctype", "Packed", "Deprecated", "ExperimentalMapKey", "UninterpretedOption", }); - internal__static_google_protobuf_EnumOptions__Descriptor = Descriptor.MessageTypes[11]; - internal__static_google_protobuf_EnumOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_EnumOptions__Descriptor, - new string[] { "UninterpretedOption", }); - internal__static_google_protobuf_EnumValueOptions__Descriptor = Descriptor.MessageTypes[12]; - internal__static_google_protobuf_EnumValueOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_EnumValueOptions__Descriptor, - new string[] { "UninterpretedOption", }); - internal__static_google_protobuf_ServiceOptions__Descriptor = Descriptor.MessageTypes[13]; - internal__static_google_protobuf_ServiceOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_ServiceOptions__Descriptor, - new string[] { "UninterpretedOption", }); - internal__static_google_protobuf_MethodOptions__Descriptor = Descriptor.MessageTypes[14]; - internal__static_google_protobuf_MethodOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_MethodOptions__Descriptor, - new string[] { "UninterpretedOption", }); - internal__static_google_protobuf_UninterpretedOption__Descriptor = Descriptor.MessageTypes[15]; - internal__static_google_protobuf_UninterpretedOption__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_UninterpretedOption__Descriptor, - new string[] { "Name", "IdentifierValue", "PositiveIntValue", "NegativeIntValue", "DoubleValue", "StringValue", "AggregateValue", }); - internal__static_google_protobuf_UninterpretedOption_NamePart__Descriptor = internal__static_google_protobuf_UninterpretedOption__Descriptor.NestedTypes[0]; - internal__static_google_protobuf_UninterpretedOption_NamePart__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_UninterpretedOption_NamePart__Descriptor, - new string[] { "NamePart_", "IsExtension", }); - internal__static_google_protobuf_SourceCodeInfo__Descriptor = Descriptor.MessageTypes[16]; - internal__static_google_protobuf_SourceCodeInfo__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_SourceCodeInfo__Descriptor, - new string[] { "Location", }); - internal__static_google_protobuf_SourceCodeInfo_Location__Descriptor = internal__static_google_protobuf_SourceCodeInfo__Descriptor.NestedTypes[0]; - internal__static_google_protobuf_SourceCodeInfo_Location__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_SourceCodeInfo_Location__Descriptor, - new string[] { "Path", "Span", }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - }, assigner); - } - #endregion - - } - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class FileDescriptorSet : pb::GeneratedMessage { - private FileDescriptorSet() { } - private static readonly FileDescriptorSet defaultInstance = new FileDescriptorSet().MakeReadOnly(); - private static readonly string[] _fileDescriptorSetFieldNames = new string[] { "file" }; - private static readonly uint[] _fileDescriptorSetFieldTags = new uint[] { 10 }; - public static FileDescriptorSet DefaultInstance { - get { return defaultInstance; } - } - - public override FileDescriptorSet DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override FileDescriptorSet ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FileDescriptorSet__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FileDescriptorSet__FieldAccessorTable; } - } - - public const int FileFieldNumber = 1; - private pbc::PopsicleList file_ = new pbc::PopsicleList(); - public scg::IList FileList { - get { return file_; } - } - public int FileCount { - get { return file_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto GetFile(int index) { - return file_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto element in FileList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _fileDescriptorSetFieldNames; - if (file_.Count > 0) { - output.WriteMessageArray(1, field_names[0], file_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto element in FileList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static FileDescriptorSet ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FileDescriptorSet ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FileDescriptorSet ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FileDescriptorSet ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FileDescriptorSet ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FileDescriptorSet ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static FileDescriptorSet ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static FileDescriptorSet ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static FileDescriptorSet ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FileDescriptorSet ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private FileDescriptorSet MakeReadOnly() { - file_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(FileDescriptorSet prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(FileDescriptorSet cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private FileDescriptorSet result; - - private FileDescriptorSet PrepareBuilder() { - if (resultIsReadOnly) { - FileDescriptorSet original = result; - result = new FileDescriptorSet(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override FileDescriptorSet MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorSet.Descriptor; } - } - - public override FileDescriptorSet DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorSet.DefaultInstance; } - } - - public override FileDescriptorSet BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is FileDescriptorSet) { - return MergeFrom((FileDescriptorSet) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(FileDescriptorSet other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorSet.DefaultInstance) return this; - PrepareBuilder(); - if (other.file_.Count != 0) { - result.file_.Add(other.file_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_fileDescriptorSetFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _fileDescriptorSetFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - input.ReadMessageArray(tag, field_name, result.file_, global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto.DefaultInstance, extensionRegistry); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public pbc::IPopsicleList FileList { - get { return PrepareBuilder().file_; } - } - public int FileCount { - get { return result.FileCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto GetFile(int index) { - return result.GetFile(index); - } - public Builder SetFile(int index, global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.file_[index] = value; - return this; - } - public Builder SetFile(int index, global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.file_[index] = builderForValue.Build(); - return this; - } - public Builder AddFile(global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.file_.Add(value); - return this; - } - public Builder AddFile(global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.file_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeFile(scg::IEnumerable values) { - PrepareBuilder(); - result.file_.Add(values); - return this; - } - public Builder ClearFile() { - PrepareBuilder(); - result.file_.Clear(); - return this; - } - } - static FileDescriptorSet() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class FileDescriptorProto : pb::GeneratedMessage { - private FileDescriptorProto() { } - private static readonly FileDescriptorProto defaultInstance = new FileDescriptorProto().MakeReadOnly(); - private static readonly string[] _fileDescriptorProtoFieldNames = new string[] { "dependency", "enum_type", "extension", "message_type", "name", "options", "package", "service", "source_code_info" }; - private static readonly uint[] _fileDescriptorProtoFieldTags = new uint[] { 26, 42, 58, 34, 10, 66, 18, 50, 74 }; - public static FileDescriptorProto DefaultInstance { - get { return defaultInstance; } - } - - public override FileDescriptorProto DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override FileDescriptorProto ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FileDescriptorProto__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FileDescriptorProto__FieldAccessorTable; } - } - - public const int NameFieldNumber = 1; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public const int PackageFieldNumber = 2; - private bool hasPackage; - private string package_ = ""; - public bool HasPackage { - get { return hasPackage; } - } - public string Package { - get { return package_; } - } - - public const int DependencyFieldNumber = 3; - private pbc::PopsicleList dependency_ = new pbc::PopsicleList(); - public scg::IList DependencyList { - get { return pbc::Lists.AsReadOnly(dependency_); } - } - public int DependencyCount { - get { return dependency_.Count; } - } - public string GetDependency(int index) { - return dependency_[index]; - } - - public const int MessageTypeFieldNumber = 4; - private pbc::PopsicleList messageType_ = new pbc::PopsicleList(); - public scg::IList MessageTypeList { - get { return messageType_; } - } - public int MessageTypeCount { - get { return messageType_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto GetMessageType(int index) { - return messageType_[index]; - } - - public const int EnumTypeFieldNumber = 5; - private pbc::PopsicleList enumType_ = new pbc::PopsicleList(); - public scg::IList EnumTypeList { - get { return enumType_; } - } - public int EnumTypeCount { - get { return enumType_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto GetEnumType(int index) { - return enumType_[index]; - } - - public const int ServiceFieldNumber = 6; - private pbc::PopsicleList service_ = new pbc::PopsicleList(); - public scg::IList ServiceList { - get { return service_; } - } - public int ServiceCount { - get { return service_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto GetService(int index) { - return service_[index]; - } - - public const int ExtensionFieldNumber = 7; - private pbc::PopsicleList extension_ = new pbc::PopsicleList(); - public scg::IList ExtensionList { - get { return extension_; } - } - public int ExtensionCount { - get { return extension_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto GetExtension(int index) { - return extension_[index]; - } - - public const int OptionsFieldNumber = 8; - private bool hasOptions; - private global::Google.ProtocolBuffers.DescriptorProtos.FileOptions options_; - public bool HasOptions { - get { return hasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FileOptions Options { - get { return options_ ?? global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.DefaultInstance; } - } - - public const int SourceCodeInfoFieldNumber = 9; - private bool hasSourceCodeInfo; - private global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo sourceCodeInfo_; - public bool HasSourceCodeInfo { - get { return hasSourceCodeInfo; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo SourceCodeInfo { - get { return sourceCodeInfo_ ?? global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.DefaultInstance; } - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto element in MessageTypeList) { - if (!element.IsInitialized) return false; - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto element in EnumTypeList) { - if (!element.IsInitialized) return false; - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto element in ServiceList) { - if (!element.IsInitialized) return false; - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto element in ExtensionList) { - if (!element.IsInitialized) return false; - } - if (HasOptions) { - if (!Options.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _fileDescriptorProtoFieldNames; - if (hasName) { - output.WriteString(1, field_names[4], Name); - } - if (hasPackage) { - output.WriteString(2, field_names[6], Package); - } - if (dependency_.Count > 0) { - output.WriteStringArray(3, field_names[0], dependency_); - } - if (messageType_.Count > 0) { - output.WriteMessageArray(4, field_names[3], messageType_); - } - if (enumType_.Count > 0) { - output.WriteMessageArray(5, field_names[1], enumType_); - } - if (service_.Count > 0) { - output.WriteMessageArray(6, field_names[7], service_); - } - if (extension_.Count > 0) { - output.WriteMessageArray(7, field_names[2], extension_); - } - if (hasOptions) { - output.WriteMessage(8, field_names[5], Options); - } - if (hasSourceCodeInfo) { - output.WriteMessage(9, field_names[8], SourceCodeInfo); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasName) { - size += pb::CodedOutputStream.ComputeStringSize(1, Name); - } - if (hasPackage) { - size += pb::CodedOutputStream.ComputeStringSize(2, Package); - } - { - int dataSize = 0; - foreach (string element in DependencyList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 1 * dependency_.Count; - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto element in MessageTypeList) { - size += pb::CodedOutputStream.ComputeMessageSize(4, element); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto element in EnumTypeList) { - size += pb::CodedOutputStream.ComputeMessageSize(5, element); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto element in ServiceList) { - size += pb::CodedOutputStream.ComputeMessageSize(6, element); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto element in ExtensionList) { - size += pb::CodedOutputStream.ComputeMessageSize(7, element); - } - if (hasOptions) { - size += pb::CodedOutputStream.ComputeMessageSize(8, Options); - } - if (hasSourceCodeInfo) { - size += pb::CodedOutputStream.ComputeMessageSize(9, SourceCodeInfo); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static FileDescriptorProto ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FileDescriptorProto ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FileDescriptorProto ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FileDescriptorProto ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FileDescriptorProto ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FileDescriptorProto ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static FileDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static FileDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static FileDescriptorProto ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FileDescriptorProto ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private FileDescriptorProto MakeReadOnly() { - dependency_.MakeReadOnly(); - messageType_.MakeReadOnly(); - enumType_.MakeReadOnly(); - service_.MakeReadOnly(); - extension_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(FileDescriptorProto prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(FileDescriptorProto cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private FileDescriptorProto result; - - private FileDescriptorProto PrepareBuilder() { - if (resultIsReadOnly) { - FileDescriptorProto original = result; - result = new FileDescriptorProto(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override FileDescriptorProto MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto.Descriptor; } - } - - public override FileDescriptorProto DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto.DefaultInstance; } - } - - public override FileDescriptorProto BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is FileDescriptorProto) { - return MergeFrom((FileDescriptorProto) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(FileDescriptorProto other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasName) { - Name = other.Name; - } - if (other.HasPackage) { - Package = other.Package; - } - if (other.dependency_.Count != 0) { - result.dependency_.Add(other.dependency_); - } - if (other.messageType_.Count != 0) { - result.messageType_.Add(other.messageType_); - } - if (other.enumType_.Count != 0) { - result.enumType_.Add(other.enumType_); - } - if (other.service_.Count != 0) { - result.service_.Add(other.service_); - } - if (other.extension_.Count != 0) { - result.extension_.Add(other.extension_); - } - if (other.HasOptions) { - MergeOptions(other.Options); - } - if (other.HasSourceCodeInfo) { - MergeSourceCodeInfo(other.SourceCodeInfo); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_fileDescriptorProtoFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _fileDescriptorProtoFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasName = input.ReadString(ref result.name_); - break; - } - case 18: { - result.hasPackage = input.ReadString(ref result.package_); - break; - } - case 26: { - input.ReadStringArray(tag, field_name, result.dependency_); - break; - } - case 34: { - input.ReadMessageArray(tag, field_name, result.messageType_, global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.DefaultInstance, extensionRegistry); - break; - } - case 42: { - input.ReadMessageArray(tag, field_name, result.enumType_, global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto.DefaultInstance, extensionRegistry); - break; - } - case 50: { - input.ReadMessageArray(tag, field_name, result.service_, global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto.DefaultInstance, extensionRegistry); - break; - } - case 58: { - input.ReadMessageArray(tag, field_name, result.extension_, global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.DefaultInstance, extensionRegistry); - break; - } - case 66: { - global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.CreateBuilder(); - if (result.hasOptions) { - subBuilder.MergeFrom(Options); - } - input.ReadMessage(subBuilder, extensionRegistry); - Options = subBuilder.BuildPartial(); - break; - } - case 74: { - global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.CreateBuilder(); - if (result.hasSourceCodeInfo) { - subBuilder.MergeFrom(SourceCodeInfo); - } - input.ReadMessage(subBuilder, extensionRegistry); - SourceCodeInfo = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasName { - get { return result.hasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - PrepareBuilder(); - result.hasName = false; - result.name_ = ""; - return this; - } - - public bool HasPackage { - get { return result.hasPackage; } - } - public string Package { - get { return result.Package; } - set { SetPackage(value); } - } - public Builder SetPackage(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasPackage = true; - result.package_ = value; - return this; - } - public Builder ClearPackage() { - PrepareBuilder(); - result.hasPackage = false; - result.package_ = ""; - return this; - } - - public pbc::IPopsicleList DependencyList { - get { return PrepareBuilder().dependency_; } - } - public int DependencyCount { - get { return result.DependencyCount; } - } - public string GetDependency(int index) { - return result.GetDependency(index); - } - public Builder SetDependency(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.dependency_[index] = value; - return this; - } - public Builder AddDependency(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.dependency_.Add(value); - return this; - } - public Builder AddRangeDependency(scg::IEnumerable values) { - PrepareBuilder(); - result.dependency_.Add(values); - return this; - } - public Builder ClearDependency() { - PrepareBuilder(); - result.dependency_.Clear(); - return this; - } - - public pbc::IPopsicleList MessageTypeList { - get { return PrepareBuilder().messageType_; } - } - public int MessageTypeCount { - get { return result.MessageTypeCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto GetMessageType(int index) { - return result.GetMessageType(index); - } - public Builder SetMessageType(int index, global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.messageType_[index] = value; - return this; - } - public Builder SetMessageType(int index, global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.messageType_[index] = builderForValue.Build(); - return this; - } - public Builder AddMessageType(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.messageType_.Add(value); - return this; - } - public Builder AddMessageType(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.messageType_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeMessageType(scg::IEnumerable values) { - PrepareBuilder(); - result.messageType_.Add(values); - return this; - } - public Builder ClearMessageType() { - PrepareBuilder(); - result.messageType_.Clear(); - return this; - } - - public pbc::IPopsicleList EnumTypeList { - get { return PrepareBuilder().enumType_; } - } - public int EnumTypeCount { - get { return result.EnumTypeCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto GetEnumType(int index) { - return result.GetEnumType(index); - } - public Builder SetEnumType(int index, global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.enumType_[index] = value; - return this; - } - public Builder SetEnumType(int index, global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.enumType_[index] = builderForValue.Build(); - return this; - } - public Builder AddEnumType(global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.enumType_.Add(value); - return this; - } - public Builder AddEnumType(global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.enumType_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeEnumType(scg::IEnumerable values) { - PrepareBuilder(); - result.enumType_.Add(values); - return this; - } - public Builder ClearEnumType() { - PrepareBuilder(); - result.enumType_.Clear(); - return this; - } - - public pbc::IPopsicleList ServiceList { - get { return PrepareBuilder().service_; } - } - public int ServiceCount { - get { return result.ServiceCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto GetService(int index) { - return result.GetService(index); - } - public Builder SetService(int index, global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.service_[index] = value; - return this; - } - public Builder SetService(int index, global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.service_[index] = builderForValue.Build(); - return this; - } - public Builder AddService(global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.service_.Add(value); - return this; - } - public Builder AddService(global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.service_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeService(scg::IEnumerable values) { - PrepareBuilder(); - result.service_.Add(values); - return this; - } - public Builder ClearService() { - PrepareBuilder(); - result.service_.Clear(); - return this; - } - - public pbc::IPopsicleList ExtensionList { - get { return PrepareBuilder().extension_; } - } - public int ExtensionCount { - get { return result.ExtensionCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto GetExtension(int index) { - return result.GetExtension(index); - } - public Builder SetExtension(int index, global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.extension_[index] = value; - return this; - } - public Builder SetExtension(int index, global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.extension_[index] = builderForValue.Build(); - return this; - } - public Builder AddExtension(global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.extension_.Add(value); - return this; - } - public Builder AddExtension(global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.extension_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeExtension(scg::IEnumerable values) { - PrepareBuilder(); - result.extension_.Add(values); - return this; - } - public Builder ClearExtension() { - PrepareBuilder(); - result.extension_.Clear(); - return this; - } - - public bool HasOptions { - get { return result.hasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FileOptions Options { - get { return result.Options; } - set { SetOptions(value); } - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.FileOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptions = true; - result.options_ = value; - return this; - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptions = true; - result.options_ = builderForValue.Build(); - return this; - } - public Builder MergeOptions(global::Google.ProtocolBuffers.DescriptorProtos.FileOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptions && - result.options_ != global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.DefaultInstance) { - result.options_ = global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.CreateBuilder(result.options_).MergeFrom(value).BuildPartial(); - } else { - result.options_ = value; - } - result.hasOptions = true; - return this; - } - public Builder ClearOptions() { - PrepareBuilder(); - result.hasOptions = false; - result.options_ = null; - return this; - } - - public bool HasSourceCodeInfo { - get { return result.hasSourceCodeInfo; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo SourceCodeInfo { - get { return result.SourceCodeInfo; } - set { SetSourceCodeInfo(value); } - } - public Builder SetSourceCodeInfo(global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasSourceCodeInfo = true; - result.sourceCodeInfo_ = value; - return this; - } - public Builder SetSourceCodeInfo(global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasSourceCodeInfo = true; - result.sourceCodeInfo_ = builderForValue.Build(); - return this; - } - public Builder MergeSourceCodeInfo(global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasSourceCodeInfo && - result.sourceCodeInfo_ != global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.DefaultInstance) { - result.sourceCodeInfo_ = global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.CreateBuilder(result.sourceCodeInfo_).MergeFrom(value).BuildPartial(); - } else { - result.sourceCodeInfo_ = value; - } - result.hasSourceCodeInfo = true; - return this; - } - public Builder ClearSourceCodeInfo() { - PrepareBuilder(); - result.hasSourceCodeInfo = false; - result.sourceCodeInfo_ = null; - return this; - } - } - static FileDescriptorProto() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class DescriptorProto : pb::GeneratedMessage { - private DescriptorProto() { } - private static readonly DescriptorProto defaultInstance = new DescriptorProto().MakeReadOnly(); - private static readonly string[] _descriptorProtoFieldNames = new string[] { "enum_type", "extension", "extension_range", "field", "name", "nested_type", "options" }; - private static readonly uint[] _descriptorProtoFieldTags = new uint[] { 34, 50, 42, 18, 10, 26, 58 }; - public static DescriptorProto DefaultInstance { - get { return defaultInstance; } - } - - public override DescriptorProto DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override DescriptorProto ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_DescriptorProto__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_DescriptorProto__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class ExtensionRange : pb::GeneratedMessage { - private ExtensionRange() { } - private static readonly ExtensionRange defaultInstance = new ExtensionRange().MakeReadOnly(); - private static readonly string[] _extensionRangeFieldNames = new string[] { "end", "start" }; - private static readonly uint[] _extensionRangeFieldTags = new uint[] { 16, 8 }; - public static ExtensionRange DefaultInstance { - get { return defaultInstance; } - } - - public override ExtensionRange DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override ExtensionRange ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_DescriptorProto_ExtensionRange__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_DescriptorProto_ExtensionRange__FieldAccessorTable; } - } - - public const int StartFieldNumber = 1; - private bool hasStart; - private int start_; - public bool HasStart { - get { return hasStart; } - } - public int Start { - get { return start_; } - } - - public const int EndFieldNumber = 2; - private bool hasEnd; - private int end_; - public bool HasEnd { - get { return hasEnd; } - } - public int End { - get { return end_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _extensionRangeFieldNames; - if (hasStart) { - output.WriteInt32(1, field_names[1], Start); - } - if (hasEnd) { - output.WriteInt32(2, field_names[0], End); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasStart) { - size += pb::CodedOutputStream.ComputeInt32Size(1, Start); - } - if (hasEnd) { - size += pb::CodedOutputStream.ComputeInt32Size(2, End); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static ExtensionRange ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ExtensionRange ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ExtensionRange ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ExtensionRange ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ExtensionRange ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ExtensionRange ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ExtensionRange ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ExtensionRange ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ExtensionRange ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ExtensionRange ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private ExtensionRange MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ExtensionRange prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(ExtensionRange cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private ExtensionRange result; - - private ExtensionRange PrepareBuilder() { - if (resultIsReadOnly) { - ExtensionRange original = result; - result = new ExtensionRange(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override ExtensionRange MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange.Descriptor; } - } - - public override ExtensionRange DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange.DefaultInstance; } - } - - public override ExtensionRange BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ExtensionRange) { - return MergeFrom((ExtensionRange) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ExtensionRange other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasStart) { - Start = other.Start; - } - if (other.HasEnd) { - End = other.End; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_extensionRangeFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _extensionRangeFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasStart = input.ReadInt32(ref result.start_); - break; - } - case 16: { - result.hasEnd = input.ReadInt32(ref result.end_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasStart { - get { return result.hasStart; } - } - public int Start { - get { return result.Start; } - set { SetStart(value); } - } - public Builder SetStart(int value) { - PrepareBuilder(); - result.hasStart = true; - result.start_ = value; - return this; - } - public Builder ClearStart() { - PrepareBuilder(); - result.hasStart = false; - result.start_ = 0; - return this; - } - - public bool HasEnd { - get { return result.hasEnd; } - } - public int End { - get { return result.End; } - set { SetEnd(value); } - } - public Builder SetEnd(int value) { - PrepareBuilder(); - result.hasEnd = true; - result.end_ = value; - return this; - } - public Builder ClearEnd() { - PrepareBuilder(); - result.hasEnd = false; - result.end_ = 0; - return this; - } - } - static ExtensionRange() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - } - #endregion - - public const int NameFieldNumber = 1; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public const int FieldFieldNumber = 2; - private pbc::PopsicleList field_ = new pbc::PopsicleList(); - public scg::IList FieldList { - get { return field_; } - } - public int FieldCount { - get { return field_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto GetField(int index) { - return field_[index]; - } - - public const int ExtensionFieldNumber = 6; - private pbc::PopsicleList extension_ = new pbc::PopsicleList(); - public scg::IList ExtensionList { - get { return extension_; } - } - public int ExtensionCount { - get { return extension_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto GetExtension(int index) { - return extension_[index]; - } - - public const int NestedTypeFieldNumber = 3; - private pbc::PopsicleList nestedType_ = new pbc::PopsicleList(); - public scg::IList NestedTypeList { - get { return nestedType_; } - } - public int NestedTypeCount { - get { return nestedType_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto GetNestedType(int index) { - return nestedType_[index]; - } - - public const int EnumTypeFieldNumber = 4; - private pbc::PopsicleList enumType_ = new pbc::PopsicleList(); - public scg::IList EnumTypeList { - get { return enumType_; } - } - public int EnumTypeCount { - get { return enumType_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto GetEnumType(int index) { - return enumType_[index]; - } - - public const int ExtensionRangeFieldNumber = 5; - private pbc::PopsicleList extensionRange_ = new pbc::PopsicleList(); - public scg::IList ExtensionRangeList { - get { return extensionRange_; } - } - public int ExtensionRangeCount { - get { return extensionRange_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange GetExtensionRange(int index) { - return extensionRange_[index]; - } - - public const int OptionsFieldNumber = 7; - private bool hasOptions; - private global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions options_; - public bool HasOptions { - get { return hasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions Options { - get { return options_ ?? global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions.DefaultInstance; } - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto element in FieldList) { - if (!element.IsInitialized) return false; - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto element in ExtensionList) { - if (!element.IsInitialized) return false; - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto element in NestedTypeList) { - if (!element.IsInitialized) return false; - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto element in EnumTypeList) { - if (!element.IsInitialized) return false; - } - if (HasOptions) { - if (!Options.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _descriptorProtoFieldNames; - if (hasName) { - output.WriteString(1, field_names[4], Name); - } - if (field_.Count > 0) { - output.WriteMessageArray(2, field_names[3], field_); - } - if (nestedType_.Count > 0) { - output.WriteMessageArray(3, field_names[5], nestedType_); - } - if (enumType_.Count > 0) { - output.WriteMessageArray(4, field_names[0], enumType_); - } - if (extensionRange_.Count > 0) { - output.WriteMessageArray(5, field_names[2], extensionRange_); - } - if (extension_.Count > 0) { - output.WriteMessageArray(6, field_names[1], extension_); - } - if (hasOptions) { - output.WriteMessage(7, field_names[6], Options); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasName) { - size += pb::CodedOutputStream.ComputeStringSize(1, Name); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto element in FieldList) { - size += pb::CodedOutputStream.ComputeMessageSize(2, element); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto element in ExtensionList) { - size += pb::CodedOutputStream.ComputeMessageSize(6, element); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto element in NestedTypeList) { - size += pb::CodedOutputStream.ComputeMessageSize(3, element); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto element in EnumTypeList) { - size += pb::CodedOutputStream.ComputeMessageSize(4, element); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange element in ExtensionRangeList) { - size += pb::CodedOutputStream.ComputeMessageSize(5, element); - } - if (hasOptions) { - size += pb::CodedOutputStream.ComputeMessageSize(7, Options); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static DescriptorProto ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static DescriptorProto ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static DescriptorProto ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static DescriptorProto ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static DescriptorProto ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static DescriptorProto ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static DescriptorProto ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static DescriptorProto ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static DescriptorProto ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static DescriptorProto ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private DescriptorProto MakeReadOnly() { - field_.MakeReadOnly(); - extension_.MakeReadOnly(); - nestedType_.MakeReadOnly(); - enumType_.MakeReadOnly(); - extensionRange_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(DescriptorProto prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(DescriptorProto cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private DescriptorProto result; - - private DescriptorProto PrepareBuilder() { - if (resultIsReadOnly) { - DescriptorProto original = result; - result = new DescriptorProto(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override DescriptorProto MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Descriptor; } - } - - public override DescriptorProto DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.DefaultInstance; } - } - - public override DescriptorProto BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is DescriptorProto) { - return MergeFrom((DescriptorProto) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(DescriptorProto other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasName) { - Name = other.Name; - } - if (other.field_.Count != 0) { - result.field_.Add(other.field_); - } - if (other.extension_.Count != 0) { - result.extension_.Add(other.extension_); - } - if (other.nestedType_.Count != 0) { - result.nestedType_.Add(other.nestedType_); - } - if (other.enumType_.Count != 0) { - result.enumType_.Add(other.enumType_); - } - if (other.extensionRange_.Count != 0) { - result.extensionRange_.Add(other.extensionRange_); - } - if (other.HasOptions) { - MergeOptions(other.Options); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_descriptorProtoFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _descriptorProtoFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasName = input.ReadString(ref result.name_); - break; - } - case 18: { - input.ReadMessageArray(tag, field_name, result.field_, global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.DefaultInstance, extensionRegistry); - break; - } - case 26: { - input.ReadMessageArray(tag, field_name, result.nestedType_, global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.DefaultInstance, extensionRegistry); - break; - } - case 34: { - input.ReadMessageArray(tag, field_name, result.enumType_, global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto.DefaultInstance, extensionRegistry); - break; - } - case 42: { - input.ReadMessageArray(tag, field_name, result.extensionRange_, global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange.DefaultInstance, extensionRegistry); - break; - } - case 50: { - input.ReadMessageArray(tag, field_name, result.extension_, global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.DefaultInstance, extensionRegistry); - break; - } - case 58: { - global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions.CreateBuilder(); - if (result.hasOptions) { - subBuilder.MergeFrom(Options); - } - input.ReadMessage(subBuilder, extensionRegistry); - Options = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasName { - get { return result.hasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - PrepareBuilder(); - result.hasName = false; - result.name_ = ""; - return this; - } - - public pbc::IPopsicleList FieldList { - get { return PrepareBuilder().field_; } - } - public int FieldCount { - get { return result.FieldCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto GetField(int index) { - return result.GetField(index); - } - public Builder SetField(int index, global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.field_[index] = value; - return this; - } - public Builder SetField(int index, global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.field_[index] = builderForValue.Build(); - return this; - } - public Builder AddField(global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.field_.Add(value); - return this; - } - public Builder AddField(global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.field_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeField(scg::IEnumerable values) { - PrepareBuilder(); - result.field_.Add(values); - return this; - } - public Builder ClearField() { - PrepareBuilder(); - result.field_.Clear(); - return this; - } - - public pbc::IPopsicleList ExtensionList { - get { return PrepareBuilder().extension_; } - } - public int ExtensionCount { - get { return result.ExtensionCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto GetExtension(int index) { - return result.GetExtension(index); - } - public Builder SetExtension(int index, global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.extension_[index] = value; - return this; - } - public Builder SetExtension(int index, global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.extension_[index] = builderForValue.Build(); - return this; - } - public Builder AddExtension(global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.extension_.Add(value); - return this; - } - public Builder AddExtension(global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.extension_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeExtension(scg::IEnumerable values) { - PrepareBuilder(); - result.extension_.Add(values); - return this; - } - public Builder ClearExtension() { - PrepareBuilder(); - result.extension_.Clear(); - return this; - } - - public pbc::IPopsicleList NestedTypeList { - get { return PrepareBuilder().nestedType_; } - } - public int NestedTypeCount { - get { return result.NestedTypeCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto GetNestedType(int index) { - return result.GetNestedType(index); - } - public Builder SetNestedType(int index, global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.nestedType_[index] = value; - return this; - } - public Builder SetNestedType(int index, global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.nestedType_[index] = builderForValue.Build(); - return this; - } - public Builder AddNestedType(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.nestedType_.Add(value); - return this; - } - public Builder AddNestedType(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.nestedType_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeNestedType(scg::IEnumerable values) { - PrepareBuilder(); - result.nestedType_.Add(values); - return this; - } - public Builder ClearNestedType() { - PrepareBuilder(); - result.nestedType_.Clear(); - return this; - } - - public pbc::IPopsicleList EnumTypeList { - get { return PrepareBuilder().enumType_; } - } - public int EnumTypeCount { - get { return result.EnumTypeCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto GetEnumType(int index) { - return result.GetEnumType(index); - } - public Builder SetEnumType(int index, global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.enumType_[index] = value; - return this; - } - public Builder SetEnumType(int index, global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.enumType_[index] = builderForValue.Build(); - return this; - } - public Builder AddEnumType(global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.enumType_.Add(value); - return this; - } - public Builder AddEnumType(global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.enumType_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeEnumType(scg::IEnumerable values) { - PrepareBuilder(); - result.enumType_.Add(values); - return this; - } - public Builder ClearEnumType() { - PrepareBuilder(); - result.enumType_.Clear(); - return this; - } - - public pbc::IPopsicleList ExtensionRangeList { - get { return PrepareBuilder().extensionRange_; } - } - public int ExtensionRangeCount { - get { return result.ExtensionRangeCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange GetExtensionRange(int index) { - return result.GetExtensionRange(index); - } - public Builder SetExtensionRange(int index, global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.extensionRange_[index] = value; - return this; - } - public Builder SetExtensionRange(int index, global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.extensionRange_[index] = builderForValue.Build(); - return this; - } - public Builder AddExtensionRange(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.extensionRange_.Add(value); - return this; - } - public Builder AddExtensionRange(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.extensionRange_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeExtensionRange(scg::IEnumerable values) { - PrepareBuilder(); - result.extensionRange_.Add(values); - return this; - } - public Builder ClearExtensionRange() { - PrepareBuilder(); - result.extensionRange_.Clear(); - return this; - } - - public bool HasOptions { - get { return result.hasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions Options { - get { return result.Options; } - set { SetOptions(value); } - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptions = true; - result.options_ = value; - return this; - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptions = true; - result.options_ = builderForValue.Build(); - return this; - } - public Builder MergeOptions(global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptions && - result.options_ != global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions.DefaultInstance) { - result.options_ = global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions.CreateBuilder(result.options_).MergeFrom(value).BuildPartial(); - } else { - result.options_ = value; - } - result.hasOptions = true; - return this; - } - public Builder ClearOptions() { - PrepareBuilder(); - result.hasOptions = false; - result.options_ = null; - return this; - } - } - static DescriptorProto() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class FieldDescriptorProto : pb::GeneratedMessage { - private FieldDescriptorProto() { } - private static readonly FieldDescriptorProto defaultInstance = new FieldDescriptorProto().MakeReadOnly(); - private static readonly string[] _fieldDescriptorProtoFieldNames = new string[] { "default_value", "extendee", "label", "name", "number", "options", "type", "type_name" }; - private static readonly uint[] _fieldDescriptorProtoFieldTags = new uint[] { 58, 18, 32, 10, 24, 66, 40, 50 }; - public static FieldDescriptorProto DefaultInstance { - get { return defaultInstance; } - } - - public override FieldDescriptorProto DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override FieldDescriptorProto ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FieldDescriptorProto__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FieldDescriptorProto__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - public enum Type { - TYPE_DOUBLE = 1, - TYPE_FLOAT = 2, - TYPE_INT64 = 3, - TYPE_UINT64 = 4, - TYPE_INT32 = 5, - TYPE_FIXED64 = 6, - TYPE_FIXED32 = 7, - TYPE_BOOL = 8, - TYPE_STRING = 9, - TYPE_GROUP = 10, - TYPE_MESSAGE = 11, - TYPE_BYTES = 12, - TYPE_UINT32 = 13, - TYPE_ENUM = 14, - TYPE_SFIXED32 = 15, - TYPE_SFIXED64 = 16, - TYPE_SINT32 = 17, - TYPE_SINT64 = 18, - } - - public enum Label { - LABEL_OPTIONAL = 1, - LABEL_REQUIRED = 2, - LABEL_REPEATED = 3, - } - - } - #endregion - - public const int NameFieldNumber = 1; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public const int NumberFieldNumber = 3; - private bool hasNumber; - private int number_; - public bool HasNumber { - get { return hasNumber; } - } - public int Number { - get { return number_; } - } - - public const int LabelFieldNumber = 4; - private bool hasLabel; - private global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Label label_ = global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Label.LABEL_OPTIONAL; - public bool HasLabel { - get { return hasLabel; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Label Label { - get { return label_; } - } - - public const int TypeFieldNumber = 5; - private bool hasType; - private global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Type type_ = global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Type.TYPE_DOUBLE; - public bool HasType { - get { return hasType; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Type Type { - get { return type_; } - } - - public const int TypeNameFieldNumber = 6; - private bool hasTypeName; - private string typeName_ = ""; - public bool HasTypeName { - get { return hasTypeName; } - } - public string TypeName { - get { return typeName_; } - } - - public const int ExtendeeFieldNumber = 2; - private bool hasExtendee; - private string extendee_ = ""; - public bool HasExtendee { - get { return hasExtendee; } - } - public string Extendee { - get { return extendee_; } - } - - public const int DefaultValueFieldNumber = 7; - private bool hasDefaultValue; - private string defaultValue_ = ""; - public bool HasDefaultValue { - get { return hasDefaultValue; } - } - public string DefaultValue { - get { return defaultValue_; } - } - - public const int OptionsFieldNumber = 8; - private bool hasOptions; - private global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions options_; - public bool HasOptions { - get { return hasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions Options { - get { return options_ ?? global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.DefaultInstance; } - } - - public override bool IsInitialized { - get { - if (HasOptions) { - if (!Options.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _fieldDescriptorProtoFieldNames; - if (hasName) { - output.WriteString(1, field_names[3], Name); - } - if (hasExtendee) { - output.WriteString(2, field_names[1], Extendee); - } - if (hasNumber) { - output.WriteInt32(3, field_names[4], Number); - } - if (hasLabel) { - output.WriteEnum(4, field_names[2], (int) Label, Label); - } - if (hasType) { - output.WriteEnum(5, field_names[6], (int) Type, Type); - } - if (hasTypeName) { - output.WriteString(6, field_names[7], TypeName); - } - if (hasDefaultValue) { - output.WriteString(7, field_names[0], DefaultValue); - } - if (hasOptions) { - output.WriteMessage(8, field_names[5], Options); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasName) { - size += pb::CodedOutputStream.ComputeStringSize(1, Name); - } - if (hasNumber) { - size += pb::CodedOutputStream.ComputeInt32Size(3, Number); - } - if (hasLabel) { - size += pb::CodedOutputStream.ComputeEnumSize(4, (int) Label); - } - if (hasType) { - size += pb::CodedOutputStream.ComputeEnumSize(5, (int) Type); - } - if (hasTypeName) { - size += pb::CodedOutputStream.ComputeStringSize(6, TypeName); - } - if (hasExtendee) { - size += pb::CodedOutputStream.ComputeStringSize(2, Extendee); - } - if (hasDefaultValue) { - size += pb::CodedOutputStream.ComputeStringSize(7, DefaultValue); - } - if (hasOptions) { - size += pb::CodedOutputStream.ComputeMessageSize(8, Options); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static FieldDescriptorProto ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FieldDescriptorProto ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FieldDescriptorProto ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FieldDescriptorProto ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FieldDescriptorProto ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FieldDescriptorProto ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static FieldDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static FieldDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static FieldDescriptorProto ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FieldDescriptorProto ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private FieldDescriptorProto MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(FieldDescriptorProto prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(FieldDescriptorProto cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private FieldDescriptorProto result; - - private FieldDescriptorProto PrepareBuilder() { - if (resultIsReadOnly) { - FieldDescriptorProto original = result; - result = new FieldDescriptorProto(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override FieldDescriptorProto MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Descriptor; } - } - - public override FieldDescriptorProto DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.DefaultInstance; } - } - - public override FieldDescriptorProto BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is FieldDescriptorProto) { - return MergeFrom((FieldDescriptorProto) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(FieldDescriptorProto other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasName) { - Name = other.Name; - } - if (other.HasNumber) { - Number = other.Number; - } - if (other.HasLabel) { - Label = other.Label; - } - if (other.HasType) { - Type = other.Type; - } - if (other.HasTypeName) { - TypeName = other.TypeName; - } - if (other.HasExtendee) { - Extendee = other.Extendee; - } - if (other.HasDefaultValue) { - DefaultValue = other.DefaultValue; - } - if (other.HasOptions) { - MergeOptions(other.Options); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_fieldDescriptorProtoFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _fieldDescriptorProtoFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasName = input.ReadString(ref result.name_); - break; - } - case 18: { - result.hasExtendee = input.ReadString(ref result.extendee_); - break; - } - case 24: { - result.hasNumber = input.ReadInt32(ref result.number_); - break; - } - case 32: { - object unknown; - if(input.ReadEnum(ref result.label_, out unknown)) { - result.hasLabel = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(4, (ulong)(int)unknown); - } - break; - } - case 40: { - object unknown; - if(input.ReadEnum(ref result.type_, out unknown)) { - result.hasType = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(5, (ulong)(int)unknown); - } - break; - } - case 50: { - result.hasTypeName = input.ReadString(ref result.typeName_); - break; - } - case 58: { - result.hasDefaultValue = input.ReadString(ref result.defaultValue_); - break; - } - case 66: { - global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.CreateBuilder(); - if (result.hasOptions) { - subBuilder.MergeFrom(Options); - } - input.ReadMessage(subBuilder, extensionRegistry); - Options = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasName { - get { return result.hasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - PrepareBuilder(); - result.hasName = false; - result.name_ = ""; - return this; - } - - public bool HasNumber { - get { return result.hasNumber; } - } - public int Number { - get { return result.Number; } - set { SetNumber(value); } - } - public Builder SetNumber(int value) { - PrepareBuilder(); - result.hasNumber = true; - result.number_ = value; - return this; - } - public Builder ClearNumber() { - PrepareBuilder(); - result.hasNumber = false; - result.number_ = 0; - return this; - } - - public bool HasLabel { - get { return result.hasLabel; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Label Label { - get { return result.Label; } - set { SetLabel(value); } - } - public Builder SetLabel(global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Label value) { - PrepareBuilder(); - result.hasLabel = true; - result.label_ = value; - return this; - } - public Builder ClearLabel() { - PrepareBuilder(); - result.hasLabel = false; - result.label_ = global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Label.LABEL_OPTIONAL; - return this; - } - - public bool HasType { - get { return result.hasType; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Type Type { - get { return result.Type; } - set { SetType(value); } - } - public Builder SetType(global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Type value) { - PrepareBuilder(); - result.hasType = true; - result.type_ = value; - return this; - } - public Builder ClearType() { - PrepareBuilder(); - result.hasType = false; - result.type_ = global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Type.TYPE_DOUBLE; - return this; - } - - public bool HasTypeName { - get { return result.hasTypeName; } - } - public string TypeName { - get { return result.TypeName; } - set { SetTypeName(value); } - } - public Builder SetTypeName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasTypeName = true; - result.typeName_ = value; - return this; - } - public Builder ClearTypeName() { - PrepareBuilder(); - result.hasTypeName = false; - result.typeName_ = ""; - return this; - } - - public bool HasExtendee { - get { return result.hasExtendee; } - } - public string Extendee { - get { return result.Extendee; } - set { SetExtendee(value); } - } - public Builder SetExtendee(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasExtendee = true; - result.extendee_ = value; - return this; - } - public Builder ClearExtendee() { - PrepareBuilder(); - result.hasExtendee = false; - result.extendee_ = ""; - return this; - } - - public bool HasDefaultValue { - get { return result.hasDefaultValue; } - } - public string DefaultValue { - get { return result.DefaultValue; } - set { SetDefaultValue(value); } - } - public Builder SetDefaultValue(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasDefaultValue = true; - result.defaultValue_ = value; - return this; - } - public Builder ClearDefaultValue() { - PrepareBuilder(); - result.hasDefaultValue = false; - result.defaultValue_ = ""; - return this; - } - - public bool HasOptions { - get { return result.hasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions Options { - get { return result.Options; } - set { SetOptions(value); } - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptions = true; - result.options_ = value; - return this; - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptions = true; - result.options_ = builderForValue.Build(); - return this; - } - public Builder MergeOptions(global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptions && - result.options_ != global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.DefaultInstance) { - result.options_ = global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.CreateBuilder(result.options_).MergeFrom(value).BuildPartial(); - } else { - result.options_ = value; - } - result.hasOptions = true; - return this; - } - public Builder ClearOptions() { - PrepareBuilder(); - result.hasOptions = false; - result.options_ = null; - return this; - } - } - static FieldDescriptorProto() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class EnumDescriptorProto : pb::GeneratedMessage { - private EnumDescriptorProto() { } - private static readonly EnumDescriptorProto defaultInstance = new EnumDescriptorProto().MakeReadOnly(); - private static readonly string[] _enumDescriptorProtoFieldNames = new string[] { "name", "options", "value" }; - private static readonly uint[] _enumDescriptorProtoFieldTags = new uint[] { 10, 26, 18 }; - public static EnumDescriptorProto DefaultInstance { - get { return defaultInstance; } - } - - public override EnumDescriptorProto DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override EnumDescriptorProto ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumDescriptorProto__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumDescriptorProto__FieldAccessorTable; } - } - - public const int NameFieldNumber = 1; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public const int ValueFieldNumber = 2; - private pbc::PopsicleList value_ = new pbc::PopsicleList(); - public scg::IList ValueList { - get { return value_; } - } - public int ValueCount { - get { return value_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto GetValue(int index) { - return value_[index]; - } - - public const int OptionsFieldNumber = 3; - private bool hasOptions; - private global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions options_; - public bool HasOptions { - get { return hasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions Options { - get { return options_ ?? global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions.DefaultInstance; } - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto element in ValueList) { - if (!element.IsInitialized) return false; - } - if (HasOptions) { - if (!Options.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _enumDescriptorProtoFieldNames; - if (hasName) { - output.WriteString(1, field_names[0], Name); - } - if (value_.Count > 0) { - output.WriteMessageArray(2, field_names[2], value_); - } - if (hasOptions) { - output.WriteMessage(3, field_names[1], Options); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasName) { - size += pb::CodedOutputStream.ComputeStringSize(1, Name); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto element in ValueList) { - size += pb::CodedOutputStream.ComputeMessageSize(2, element); - } - if (hasOptions) { - size += pb::CodedOutputStream.ComputeMessageSize(3, Options); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static EnumDescriptorProto ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static EnumDescriptorProto ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static EnumDescriptorProto ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static EnumDescriptorProto ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static EnumDescriptorProto ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static EnumDescriptorProto ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static EnumDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static EnumDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static EnumDescriptorProto ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static EnumDescriptorProto ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private EnumDescriptorProto MakeReadOnly() { - value_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(EnumDescriptorProto prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(EnumDescriptorProto cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private EnumDescriptorProto result; - - private EnumDescriptorProto PrepareBuilder() { - if (resultIsReadOnly) { - EnumDescriptorProto original = result; - result = new EnumDescriptorProto(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override EnumDescriptorProto MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto.Descriptor; } - } - - public override EnumDescriptorProto DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto.DefaultInstance; } - } - - public override EnumDescriptorProto BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is EnumDescriptorProto) { - return MergeFrom((EnumDescriptorProto) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(EnumDescriptorProto other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasName) { - Name = other.Name; - } - if (other.value_.Count != 0) { - result.value_.Add(other.value_); - } - if (other.HasOptions) { - MergeOptions(other.Options); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_enumDescriptorProtoFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _enumDescriptorProtoFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasName = input.ReadString(ref result.name_); - break; - } - case 18: { - input.ReadMessageArray(tag, field_name, result.value_, global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto.DefaultInstance, extensionRegistry); - break; - } - case 26: { - global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions.CreateBuilder(); - if (result.hasOptions) { - subBuilder.MergeFrom(Options); - } - input.ReadMessage(subBuilder, extensionRegistry); - Options = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasName { - get { return result.hasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - PrepareBuilder(); - result.hasName = false; - result.name_ = ""; - return this; - } - - public pbc::IPopsicleList ValueList { - get { return PrepareBuilder().value_; } - } - public int ValueCount { - get { return result.ValueCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto GetValue(int index) { - return result.GetValue(index); - } - public Builder SetValue(int index, global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.value_[index] = value; - return this; - } - public Builder SetValue(int index, global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.value_[index] = builderForValue.Build(); - return this; - } - public Builder AddValue(global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.value_.Add(value); - return this; - } - public Builder AddValue(global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.value_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeValue(scg::IEnumerable values) { - PrepareBuilder(); - result.value_.Add(values); - return this; - } - public Builder ClearValue() { - PrepareBuilder(); - result.value_.Clear(); - return this; - } - - public bool HasOptions { - get { return result.hasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions Options { - get { return result.Options; } - set { SetOptions(value); } - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptions = true; - result.options_ = value; - return this; - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptions = true; - result.options_ = builderForValue.Build(); - return this; - } - public Builder MergeOptions(global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptions && - result.options_ != global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions.DefaultInstance) { - result.options_ = global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions.CreateBuilder(result.options_).MergeFrom(value).BuildPartial(); - } else { - result.options_ = value; - } - result.hasOptions = true; - return this; - } - public Builder ClearOptions() { - PrepareBuilder(); - result.hasOptions = false; - result.options_ = null; - return this; - } - } - static EnumDescriptorProto() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class EnumValueDescriptorProto : pb::GeneratedMessage { - private EnumValueDescriptorProto() { } - private static readonly EnumValueDescriptorProto defaultInstance = new EnumValueDescriptorProto().MakeReadOnly(); - private static readonly string[] _enumValueDescriptorProtoFieldNames = new string[] { "name", "number", "options" }; - private static readonly uint[] _enumValueDescriptorProtoFieldTags = new uint[] { 10, 16, 26 }; - public static EnumValueDescriptorProto DefaultInstance { - get { return defaultInstance; } - } - - public override EnumValueDescriptorProto DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override EnumValueDescriptorProto ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumValueDescriptorProto__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumValueDescriptorProto__FieldAccessorTable; } - } - - public const int NameFieldNumber = 1; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public const int NumberFieldNumber = 2; - private bool hasNumber; - private int number_; - public bool HasNumber { - get { return hasNumber; } - } - public int Number { - get { return number_; } - } - - public const int OptionsFieldNumber = 3; - private bool hasOptions; - private global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions options_; - public bool HasOptions { - get { return hasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions Options { - get { return options_ ?? global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions.DefaultInstance; } - } - - public override bool IsInitialized { - get { - if (HasOptions) { - if (!Options.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _enumValueDescriptorProtoFieldNames; - if (hasName) { - output.WriteString(1, field_names[0], Name); - } - if (hasNumber) { - output.WriteInt32(2, field_names[1], Number); - } - if (hasOptions) { - output.WriteMessage(3, field_names[2], Options); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasName) { - size += pb::CodedOutputStream.ComputeStringSize(1, Name); - } - if (hasNumber) { - size += pb::CodedOutputStream.ComputeInt32Size(2, Number); - } - if (hasOptions) { - size += pb::CodedOutputStream.ComputeMessageSize(3, Options); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static EnumValueDescriptorProto ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static EnumValueDescriptorProto ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static EnumValueDescriptorProto ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static EnumValueDescriptorProto ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static EnumValueDescriptorProto ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static EnumValueDescriptorProto ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static EnumValueDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static EnumValueDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static EnumValueDescriptorProto ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static EnumValueDescriptorProto ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private EnumValueDescriptorProto MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(EnumValueDescriptorProto prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(EnumValueDescriptorProto cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private EnumValueDescriptorProto result; - - private EnumValueDescriptorProto PrepareBuilder() { - if (resultIsReadOnly) { - EnumValueDescriptorProto original = result; - result = new EnumValueDescriptorProto(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override EnumValueDescriptorProto MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto.Descriptor; } - } - - public override EnumValueDescriptorProto DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto.DefaultInstance; } - } - - public override EnumValueDescriptorProto BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is EnumValueDescriptorProto) { - return MergeFrom((EnumValueDescriptorProto) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(EnumValueDescriptorProto other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasName) { - Name = other.Name; - } - if (other.HasNumber) { - Number = other.Number; - } - if (other.HasOptions) { - MergeOptions(other.Options); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_enumValueDescriptorProtoFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _enumValueDescriptorProtoFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasName = input.ReadString(ref result.name_); - break; - } - case 16: { - result.hasNumber = input.ReadInt32(ref result.number_); - break; - } - case 26: { - global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions.CreateBuilder(); - if (result.hasOptions) { - subBuilder.MergeFrom(Options); - } - input.ReadMessage(subBuilder, extensionRegistry); - Options = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasName { - get { return result.hasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - PrepareBuilder(); - result.hasName = false; - result.name_ = ""; - return this; - } - - public bool HasNumber { - get { return result.hasNumber; } - } - public int Number { - get { return result.Number; } - set { SetNumber(value); } - } - public Builder SetNumber(int value) { - PrepareBuilder(); - result.hasNumber = true; - result.number_ = value; - return this; - } - public Builder ClearNumber() { - PrepareBuilder(); - result.hasNumber = false; - result.number_ = 0; - return this; - } - - public bool HasOptions { - get { return result.hasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions Options { - get { return result.Options; } - set { SetOptions(value); } - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptions = true; - result.options_ = value; - return this; - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptions = true; - result.options_ = builderForValue.Build(); - return this; - } - public Builder MergeOptions(global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptions && - result.options_ != global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions.DefaultInstance) { - result.options_ = global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions.CreateBuilder(result.options_).MergeFrom(value).BuildPartial(); - } else { - result.options_ = value; - } - result.hasOptions = true; - return this; - } - public Builder ClearOptions() { - PrepareBuilder(); - result.hasOptions = false; - result.options_ = null; - return this; - } - } - static EnumValueDescriptorProto() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class ServiceDescriptorProto : pb::GeneratedMessage { - private ServiceDescriptorProto() { } - private static readonly ServiceDescriptorProto defaultInstance = new ServiceDescriptorProto().MakeReadOnly(); - private static readonly string[] _serviceDescriptorProtoFieldNames = new string[] { "method", "name", "options" }; - private static readonly uint[] _serviceDescriptorProtoFieldTags = new uint[] { 18, 10, 26 }; - public static ServiceDescriptorProto DefaultInstance { - get { return defaultInstance; } - } - - public override ServiceDescriptorProto DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override ServiceDescriptorProto ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_ServiceDescriptorProto__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_ServiceDescriptorProto__FieldAccessorTable; } - } - - public const int NameFieldNumber = 1; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public const int MethodFieldNumber = 2; - private pbc::PopsicleList method_ = new pbc::PopsicleList(); - public scg::IList MethodList { - get { return method_; } - } - public int MethodCount { - get { return method_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto GetMethod(int index) { - return method_[index]; - } - - public const int OptionsFieldNumber = 3; - private bool hasOptions; - private global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions options_; - public bool HasOptions { - get { return hasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions Options { - get { return options_ ?? global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions.DefaultInstance; } - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto element in MethodList) { - if (!element.IsInitialized) return false; - } - if (HasOptions) { - if (!Options.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _serviceDescriptorProtoFieldNames; - if (hasName) { - output.WriteString(1, field_names[1], Name); - } - if (method_.Count > 0) { - output.WriteMessageArray(2, field_names[0], method_); - } - if (hasOptions) { - output.WriteMessage(3, field_names[2], Options); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasName) { - size += pb::CodedOutputStream.ComputeStringSize(1, Name); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto element in MethodList) { - size += pb::CodedOutputStream.ComputeMessageSize(2, element); - } - if (hasOptions) { - size += pb::CodedOutputStream.ComputeMessageSize(3, Options); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static ServiceDescriptorProto ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ServiceDescriptorProto ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ServiceDescriptorProto ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ServiceDescriptorProto ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ServiceDescriptorProto ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ServiceDescriptorProto ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ServiceDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ServiceDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ServiceDescriptorProto ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ServiceDescriptorProto ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private ServiceDescriptorProto MakeReadOnly() { - method_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ServiceDescriptorProto prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(ServiceDescriptorProto cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private ServiceDescriptorProto result; - - private ServiceDescriptorProto PrepareBuilder() { - if (resultIsReadOnly) { - ServiceDescriptorProto original = result; - result = new ServiceDescriptorProto(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override ServiceDescriptorProto MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto.Descriptor; } - } - - public override ServiceDescriptorProto DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto.DefaultInstance; } - } - - public override ServiceDescriptorProto BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ServiceDescriptorProto) { - return MergeFrom((ServiceDescriptorProto) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ServiceDescriptorProto other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasName) { - Name = other.Name; - } - if (other.method_.Count != 0) { - result.method_.Add(other.method_); - } - if (other.HasOptions) { - MergeOptions(other.Options); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_serviceDescriptorProtoFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _serviceDescriptorProtoFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasName = input.ReadString(ref result.name_); - break; - } - case 18: { - input.ReadMessageArray(tag, field_name, result.method_, global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto.DefaultInstance, extensionRegistry); - break; - } - case 26: { - global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions.CreateBuilder(); - if (result.hasOptions) { - subBuilder.MergeFrom(Options); - } - input.ReadMessage(subBuilder, extensionRegistry); - Options = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasName { - get { return result.hasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - PrepareBuilder(); - result.hasName = false; - result.name_ = ""; - return this; - } - - public pbc::IPopsicleList MethodList { - get { return PrepareBuilder().method_; } - } - public int MethodCount { - get { return result.MethodCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto GetMethod(int index) { - return result.GetMethod(index); - } - public Builder SetMethod(int index, global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.method_[index] = value; - return this; - } - public Builder SetMethod(int index, global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.method_[index] = builderForValue.Build(); - return this; - } - public Builder AddMethod(global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.method_.Add(value); - return this; - } - public Builder AddMethod(global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.method_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeMethod(scg::IEnumerable values) { - PrepareBuilder(); - result.method_.Add(values); - return this; - } - public Builder ClearMethod() { - PrepareBuilder(); - result.method_.Clear(); - return this; - } - - public bool HasOptions { - get { return result.hasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions Options { - get { return result.Options; } - set { SetOptions(value); } - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptions = true; - result.options_ = value; - return this; - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptions = true; - result.options_ = builderForValue.Build(); - return this; - } - public Builder MergeOptions(global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptions && - result.options_ != global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions.DefaultInstance) { - result.options_ = global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions.CreateBuilder(result.options_).MergeFrom(value).BuildPartial(); - } else { - result.options_ = value; - } - result.hasOptions = true; - return this; - } - public Builder ClearOptions() { - PrepareBuilder(); - result.hasOptions = false; - result.options_ = null; - return this; - } - } - static ServiceDescriptorProto() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MethodDescriptorProto : pb::GeneratedMessage { - private MethodDescriptorProto() { } - private static readonly MethodDescriptorProto defaultInstance = new MethodDescriptorProto().MakeReadOnly(); - private static readonly string[] _methodDescriptorProtoFieldNames = new string[] { "input_type", "name", "options", "output_type" }; - private static readonly uint[] _methodDescriptorProtoFieldTags = new uint[] { 18, 10, 34, 26 }; - public static MethodDescriptorProto DefaultInstance { - get { return defaultInstance; } - } - - public override MethodDescriptorProto DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override MethodDescriptorProto ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_MethodDescriptorProto__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_MethodDescriptorProto__FieldAccessorTable; } - } - - public const int NameFieldNumber = 1; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public const int InputTypeFieldNumber = 2; - private bool hasInputType; - private string inputType_ = ""; - public bool HasInputType { - get { return hasInputType; } - } - public string InputType { - get { return inputType_; } - } - - public const int OutputTypeFieldNumber = 3; - private bool hasOutputType; - private string outputType_ = ""; - public bool HasOutputType { - get { return hasOutputType; } - } - public string OutputType { - get { return outputType_; } - } - - public const int OptionsFieldNumber = 4; - private bool hasOptions; - private global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions options_; - public bool HasOptions { - get { return hasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions Options { - get { return options_ ?? global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions.DefaultInstance; } - } - - public override bool IsInitialized { - get { - if (HasOptions) { - if (!Options.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _methodDescriptorProtoFieldNames; - if (hasName) { - output.WriteString(1, field_names[1], Name); - } - if (hasInputType) { - output.WriteString(2, field_names[0], InputType); - } - if (hasOutputType) { - output.WriteString(3, field_names[3], OutputType); - } - if (hasOptions) { - output.WriteMessage(4, field_names[2], Options); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasName) { - size += pb::CodedOutputStream.ComputeStringSize(1, Name); - } - if (hasInputType) { - size += pb::CodedOutputStream.ComputeStringSize(2, InputType); - } - if (hasOutputType) { - size += pb::CodedOutputStream.ComputeStringSize(3, OutputType); - } - if (hasOptions) { - size += pb::CodedOutputStream.ComputeMessageSize(4, Options); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static MethodDescriptorProto ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static MethodDescriptorProto ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static MethodDescriptorProto ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static MethodDescriptorProto ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static MethodDescriptorProto ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static MethodDescriptorProto ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static MethodDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static MethodDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static MethodDescriptorProto ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static MethodDescriptorProto ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private MethodDescriptorProto MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(MethodDescriptorProto prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(MethodDescriptorProto cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private MethodDescriptorProto result; - - private MethodDescriptorProto PrepareBuilder() { - if (resultIsReadOnly) { - MethodDescriptorProto original = result; - result = new MethodDescriptorProto(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override MethodDescriptorProto MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto.Descriptor; } - } - - public override MethodDescriptorProto DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto.DefaultInstance; } - } - - public override MethodDescriptorProto BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is MethodDescriptorProto) { - return MergeFrom((MethodDescriptorProto) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(MethodDescriptorProto other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasName) { - Name = other.Name; - } - if (other.HasInputType) { - InputType = other.InputType; - } - if (other.HasOutputType) { - OutputType = other.OutputType; - } - if (other.HasOptions) { - MergeOptions(other.Options); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_methodDescriptorProtoFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _methodDescriptorProtoFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasName = input.ReadString(ref result.name_); - break; - } - case 18: { - result.hasInputType = input.ReadString(ref result.inputType_); - break; - } - case 26: { - result.hasOutputType = input.ReadString(ref result.outputType_); - break; - } - case 34: { - global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions.CreateBuilder(); - if (result.hasOptions) { - subBuilder.MergeFrom(Options); - } - input.ReadMessage(subBuilder, extensionRegistry); - Options = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasName { - get { return result.hasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - PrepareBuilder(); - result.hasName = false; - result.name_ = ""; - return this; - } - - public bool HasInputType { - get { return result.hasInputType; } - } - public string InputType { - get { return result.InputType; } - set { SetInputType(value); } - } - public Builder SetInputType(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasInputType = true; - result.inputType_ = value; - return this; - } - public Builder ClearInputType() { - PrepareBuilder(); - result.hasInputType = false; - result.inputType_ = ""; - return this; - } - - public bool HasOutputType { - get { return result.hasOutputType; } - } - public string OutputType { - get { return result.OutputType; } - set { SetOutputType(value); } - } - public Builder SetOutputType(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOutputType = true; - result.outputType_ = value; - return this; - } - public Builder ClearOutputType() { - PrepareBuilder(); - result.hasOutputType = false; - result.outputType_ = ""; - return this; - } - - public bool HasOptions { - get { return result.hasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions Options { - get { return result.Options; } - set { SetOptions(value); } - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptions = true; - result.options_ = value; - return this; - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptions = true; - result.options_ = builderForValue.Build(); - return this; - } - public Builder MergeOptions(global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptions && - result.options_ != global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions.DefaultInstance) { - result.options_ = global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions.CreateBuilder(result.options_).MergeFrom(value).BuildPartial(); - } else { - result.options_ = value; - } - result.hasOptions = true; - return this; - } - public Builder ClearOptions() { - PrepareBuilder(); - result.hasOptions = false; - result.options_ = null; - return this; - } - } - static MethodDescriptorProto() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class FileOptions : pb::ExtendableMessage { - private FileOptions() { } - private static readonly FileOptions defaultInstance = new FileOptions().MakeReadOnly(); - private static readonly string[] _fileOptionsFieldNames = new string[] { "cc_generic_services", "java_generate_equals_and_hash", "java_generic_services", "java_multiple_files", "java_outer_classname", "java_package", "optimize_for", "py_generic_services", "uninterpreted_option" }; - private static readonly uint[] _fileOptionsFieldTags = new uint[] { 128, 160, 136, 80, 66, 10, 72, 144, 7994 }; - public static FileOptions DefaultInstance { - get { return defaultInstance; } - } - - public override FileOptions DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override FileOptions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FileOptions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FileOptions__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - public enum OptimizeMode { - SPEED = 1, - CODE_SIZE = 2, - LITE_RUNTIME = 3, - } - - } - #endregion - - public const int JavaPackageFieldNumber = 1; - private bool hasJavaPackage; - private string javaPackage_ = ""; - public bool HasJavaPackage { - get { return hasJavaPackage; } - } - public string JavaPackage { - get { return javaPackage_; } - } - - public const int JavaOuterClassnameFieldNumber = 8; - private bool hasJavaOuterClassname; - private string javaOuterClassname_ = ""; - public bool HasJavaOuterClassname { - get { return hasJavaOuterClassname; } - } - public string JavaOuterClassname { - get { return javaOuterClassname_; } - } - - public const int JavaMultipleFilesFieldNumber = 10; - private bool hasJavaMultipleFiles; - private bool javaMultipleFiles_; - public bool HasJavaMultipleFiles { - get { return hasJavaMultipleFiles; } - } - public bool JavaMultipleFiles { - get { return javaMultipleFiles_; } - } - - public const int JavaGenerateEqualsAndHashFieldNumber = 20; - private bool hasJavaGenerateEqualsAndHash; - private bool javaGenerateEqualsAndHash_; - public bool HasJavaGenerateEqualsAndHash { - get { return hasJavaGenerateEqualsAndHash; } - } - public bool JavaGenerateEqualsAndHash { - get { return javaGenerateEqualsAndHash_; } - } - - public const int OptimizeForFieldNumber = 9; - private bool hasOptimizeFor; - private global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Types.OptimizeMode optimizeFor_ = global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Types.OptimizeMode.SPEED; - public bool HasOptimizeFor { - get { return hasOptimizeFor; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Types.OptimizeMode OptimizeFor { - get { return optimizeFor_; } - } - - public const int CcGenericServicesFieldNumber = 16; - private bool hasCcGenericServices; - private bool ccGenericServices_; - public bool HasCcGenericServices { - get { return hasCcGenericServices; } - } - public bool CcGenericServices { - get { return ccGenericServices_; } - } - - public const int JavaGenericServicesFieldNumber = 17; - private bool hasJavaGenericServices; - private bool javaGenericServices_; - public bool HasJavaGenericServices { - get { return hasJavaGenericServices; } - } - public bool JavaGenericServices { - get { return javaGenericServices_; } - } - - public const int PyGenericServicesFieldNumber = 18; - private bool hasPyGenericServices; - private bool pyGenericServices_; - public bool HasPyGenericServices { - get { return hasPyGenericServices; } - } - public bool PyGenericServices { - get { return pyGenericServices_; } - } - - public const int UninterpretedOptionFieldNumber = 999; - private pbc::PopsicleList uninterpretedOption_ = new pbc::PopsicleList(); - public scg::IList UninterpretedOptionList { - get { return uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return uninterpretedOption_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return uninterpretedOption_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - if (!element.IsInitialized) return false; - } - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _fileOptionsFieldNames; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - if (hasJavaPackage) { - output.WriteString(1, field_names[5], JavaPackage); - } - if (hasJavaOuterClassname) { - output.WriteString(8, field_names[4], JavaOuterClassname); - } - if (hasOptimizeFor) { - output.WriteEnum(9, field_names[6], (int) OptimizeFor, OptimizeFor); - } - if (hasJavaMultipleFiles) { - output.WriteBool(10, field_names[3], JavaMultipleFiles); - } - if (hasCcGenericServices) { - output.WriteBool(16, field_names[0], CcGenericServices); - } - if (hasJavaGenericServices) { - output.WriteBool(17, field_names[2], JavaGenericServices); - } - if (hasPyGenericServices) { - output.WriteBool(18, field_names[7], PyGenericServices); - } - if (hasJavaGenerateEqualsAndHash) { - output.WriteBool(20, field_names[1], JavaGenerateEqualsAndHash); - } - if (uninterpretedOption_.Count > 0) { - output.WriteMessageArray(999, field_names[8], uninterpretedOption_); - } - extensionWriter.WriteUntil(536870912, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasJavaPackage) { - size += pb::CodedOutputStream.ComputeStringSize(1, JavaPackage); - } - if (hasJavaOuterClassname) { - size += pb::CodedOutputStream.ComputeStringSize(8, JavaOuterClassname); - } - if (hasJavaMultipleFiles) { - size += pb::CodedOutputStream.ComputeBoolSize(10, JavaMultipleFiles); - } - if (hasJavaGenerateEqualsAndHash) { - size += pb::CodedOutputStream.ComputeBoolSize(20, JavaGenerateEqualsAndHash); - } - if (hasOptimizeFor) { - size += pb::CodedOutputStream.ComputeEnumSize(9, (int) OptimizeFor); - } - if (hasCcGenericServices) { - size += pb::CodedOutputStream.ComputeBoolSize(16, CcGenericServices); - } - if (hasJavaGenericServices) { - size += pb::CodedOutputStream.ComputeBoolSize(17, JavaGenericServices); - } - if (hasPyGenericServices) { - size += pb::CodedOutputStream.ComputeBoolSize(18, PyGenericServices); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - size += pb::CodedOutputStream.ComputeMessageSize(999, element); - } - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static FileOptions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FileOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FileOptions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FileOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FileOptions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FileOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static FileOptions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static FileOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static FileOptions ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FileOptions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private FileOptions MakeReadOnly() { - uninterpretedOption_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(FileOptions prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(FileOptions cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private FileOptions result; - - private FileOptions PrepareBuilder() { - if (resultIsReadOnly) { - FileOptions original = result; - result = new FileOptions(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override FileOptions MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Descriptor; } - } - - public override FileOptions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.DefaultInstance; } - } - - public override FileOptions BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is FileOptions) { - return MergeFrom((FileOptions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(FileOptions other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasJavaPackage) { - JavaPackage = other.JavaPackage; - } - if (other.HasJavaOuterClassname) { - JavaOuterClassname = other.JavaOuterClassname; - } - if (other.HasJavaMultipleFiles) { - JavaMultipleFiles = other.JavaMultipleFiles; - } - if (other.HasJavaGenerateEqualsAndHash) { - JavaGenerateEqualsAndHash = other.JavaGenerateEqualsAndHash; - } - if (other.HasOptimizeFor) { - OptimizeFor = other.OptimizeFor; - } - if (other.HasCcGenericServices) { - CcGenericServices = other.CcGenericServices; - } - if (other.HasJavaGenericServices) { - JavaGenericServices = other.JavaGenericServices; - } - if (other.HasPyGenericServices) { - PyGenericServices = other.PyGenericServices; - } - if (other.uninterpretedOption_.Count != 0) { - result.uninterpretedOption_.Add(other.uninterpretedOption_); - } - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_fileOptionsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _fileOptionsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasJavaPackage = input.ReadString(ref result.javaPackage_); - break; - } - case 66: { - result.hasJavaOuterClassname = input.ReadString(ref result.javaOuterClassname_); - break; - } - case 72: { - object unknown; - if(input.ReadEnum(ref result.optimizeFor_, out unknown)) { - result.hasOptimizeFor = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(9, (ulong)(int)unknown); - } - break; - } - case 80: { - result.hasJavaMultipleFiles = input.ReadBool(ref result.javaMultipleFiles_); - break; - } - case 128: { - result.hasCcGenericServices = input.ReadBool(ref result.ccGenericServices_); - break; - } - case 136: { - result.hasJavaGenericServices = input.ReadBool(ref result.javaGenericServices_); - break; - } - case 144: { - result.hasPyGenericServices = input.ReadBool(ref result.pyGenericServices_); - break; - } - case 160: { - result.hasJavaGenerateEqualsAndHash = input.ReadBool(ref result.javaGenerateEqualsAndHash_); - break; - } - case 7994: { - input.ReadMessageArray(tag, field_name, result.uninterpretedOption_, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.DefaultInstance, extensionRegistry); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasJavaPackage { - get { return result.hasJavaPackage; } - } - public string JavaPackage { - get { return result.JavaPackage; } - set { SetJavaPackage(value); } - } - public Builder SetJavaPackage(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasJavaPackage = true; - result.javaPackage_ = value; - return this; - } - public Builder ClearJavaPackage() { - PrepareBuilder(); - result.hasJavaPackage = false; - result.javaPackage_ = ""; - return this; - } - - public bool HasJavaOuterClassname { - get { return result.hasJavaOuterClassname; } - } - public string JavaOuterClassname { - get { return result.JavaOuterClassname; } - set { SetJavaOuterClassname(value); } - } - public Builder SetJavaOuterClassname(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasJavaOuterClassname = true; - result.javaOuterClassname_ = value; - return this; - } - public Builder ClearJavaOuterClassname() { - PrepareBuilder(); - result.hasJavaOuterClassname = false; - result.javaOuterClassname_ = ""; - return this; - } - - public bool HasJavaMultipleFiles { - get { return result.hasJavaMultipleFiles; } - } - public bool JavaMultipleFiles { - get { return result.JavaMultipleFiles; } - set { SetJavaMultipleFiles(value); } - } - public Builder SetJavaMultipleFiles(bool value) { - PrepareBuilder(); - result.hasJavaMultipleFiles = true; - result.javaMultipleFiles_ = value; - return this; - } - public Builder ClearJavaMultipleFiles() { - PrepareBuilder(); - result.hasJavaMultipleFiles = false; - result.javaMultipleFiles_ = false; - return this; - } - - public bool HasJavaGenerateEqualsAndHash { - get { return result.hasJavaGenerateEqualsAndHash; } - } - public bool JavaGenerateEqualsAndHash { - get { return result.JavaGenerateEqualsAndHash; } - set { SetJavaGenerateEqualsAndHash(value); } - } - public Builder SetJavaGenerateEqualsAndHash(bool value) { - PrepareBuilder(); - result.hasJavaGenerateEqualsAndHash = true; - result.javaGenerateEqualsAndHash_ = value; - return this; - } - public Builder ClearJavaGenerateEqualsAndHash() { - PrepareBuilder(); - result.hasJavaGenerateEqualsAndHash = false; - result.javaGenerateEqualsAndHash_ = false; - return this; - } - - public bool HasOptimizeFor { - get { return result.hasOptimizeFor; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Types.OptimizeMode OptimizeFor { - get { return result.OptimizeFor; } - set { SetOptimizeFor(value); } - } - public Builder SetOptimizeFor(global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Types.OptimizeMode value) { - PrepareBuilder(); - result.hasOptimizeFor = true; - result.optimizeFor_ = value; - return this; - } - public Builder ClearOptimizeFor() { - PrepareBuilder(); - result.hasOptimizeFor = false; - result.optimizeFor_ = global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Types.OptimizeMode.SPEED; - return this; - } - - public bool HasCcGenericServices { - get { return result.hasCcGenericServices; } - } - public bool CcGenericServices { - get { return result.CcGenericServices; } - set { SetCcGenericServices(value); } - } - public Builder SetCcGenericServices(bool value) { - PrepareBuilder(); - result.hasCcGenericServices = true; - result.ccGenericServices_ = value; - return this; - } - public Builder ClearCcGenericServices() { - PrepareBuilder(); - result.hasCcGenericServices = false; - result.ccGenericServices_ = false; - return this; - } - - public bool HasJavaGenericServices { - get { return result.hasJavaGenericServices; } - } - public bool JavaGenericServices { - get { return result.JavaGenericServices; } - set { SetJavaGenericServices(value); } - } - public Builder SetJavaGenericServices(bool value) { - PrepareBuilder(); - result.hasJavaGenericServices = true; - result.javaGenericServices_ = value; - return this; - } - public Builder ClearJavaGenericServices() { - PrepareBuilder(); - result.hasJavaGenericServices = false; - result.javaGenericServices_ = false; - return this; - } - - public bool HasPyGenericServices { - get { return result.hasPyGenericServices; } - } - public bool PyGenericServices { - get { return result.PyGenericServices; } - set { SetPyGenericServices(value); } - } - public Builder SetPyGenericServices(bool value) { - PrepareBuilder(); - result.hasPyGenericServices = true; - result.pyGenericServices_ = value; - return this; - } - public Builder ClearPyGenericServices() { - PrepareBuilder(); - result.hasPyGenericServices = false; - result.pyGenericServices_ = false; - return this; - } - - public pbc::IPopsicleList UninterpretedOptionList { - get { return PrepareBuilder().uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return result.UninterpretedOptionCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return result.GetUninterpretedOption(index); - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.uninterpretedOption_[index] = value; - return this; - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.uninterpretedOption_[index] = builderForValue.Build(); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.uninterpretedOption_.Add(value); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.uninterpretedOption_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeUninterpretedOption(scg::IEnumerable values) { - PrepareBuilder(); - result.uninterpretedOption_.Add(values); - return this; - } - public Builder ClearUninterpretedOption() { - PrepareBuilder(); - result.uninterpretedOption_.Clear(); - return this; - } - } - static FileOptions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MessageOptions : pb::ExtendableMessage { - private MessageOptions() { } - private static readonly MessageOptions defaultInstance = new MessageOptions().MakeReadOnly(); - private static readonly string[] _messageOptionsFieldNames = new string[] { "message_set_wire_format", "no_standard_descriptor_accessor", "uninterpreted_option" }; - private static readonly uint[] _messageOptionsFieldTags = new uint[] { 8, 16, 7994 }; - public static MessageOptions DefaultInstance { - get { return defaultInstance; } - } - - public override MessageOptions DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override MessageOptions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_MessageOptions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_MessageOptions__FieldAccessorTable; } - } - - public const int MessageSetWireFormatFieldNumber = 1; - private bool hasMessageSetWireFormat; - private bool messageSetWireFormat_; - public bool HasMessageSetWireFormat { - get { return hasMessageSetWireFormat; } - } - public bool MessageSetWireFormat { - get { return messageSetWireFormat_; } - } - - public const int NoStandardDescriptorAccessorFieldNumber = 2; - private bool hasNoStandardDescriptorAccessor; - private bool noStandardDescriptorAccessor_; - public bool HasNoStandardDescriptorAccessor { - get { return hasNoStandardDescriptorAccessor; } - } - public bool NoStandardDescriptorAccessor { - get { return noStandardDescriptorAccessor_; } - } - - public const int UninterpretedOptionFieldNumber = 999; - private pbc::PopsicleList uninterpretedOption_ = new pbc::PopsicleList(); - public scg::IList UninterpretedOptionList { - get { return uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return uninterpretedOption_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return uninterpretedOption_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - if (!element.IsInitialized) return false; - } - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _messageOptionsFieldNames; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - if (hasMessageSetWireFormat) { - output.WriteBool(1, field_names[0], MessageSetWireFormat); - } - if (hasNoStandardDescriptorAccessor) { - output.WriteBool(2, field_names[1], NoStandardDescriptorAccessor); - } - if (uninterpretedOption_.Count > 0) { - output.WriteMessageArray(999, field_names[2], uninterpretedOption_); - } - extensionWriter.WriteUntil(536870912, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasMessageSetWireFormat) { - size += pb::CodedOutputStream.ComputeBoolSize(1, MessageSetWireFormat); - } - if (hasNoStandardDescriptorAccessor) { - size += pb::CodedOutputStream.ComputeBoolSize(2, NoStandardDescriptorAccessor); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - size += pb::CodedOutputStream.ComputeMessageSize(999, element); - } - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static MessageOptions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static MessageOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static MessageOptions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static MessageOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static MessageOptions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static MessageOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static MessageOptions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static MessageOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static MessageOptions ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static MessageOptions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private MessageOptions MakeReadOnly() { - uninterpretedOption_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(MessageOptions prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(MessageOptions cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private MessageOptions result; - - private MessageOptions PrepareBuilder() { - if (resultIsReadOnly) { - MessageOptions original = result; - result = new MessageOptions(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override MessageOptions MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions.Descriptor; } - } - - public override MessageOptions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions.DefaultInstance; } - } - - public override MessageOptions BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is MessageOptions) { - return MergeFrom((MessageOptions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(MessageOptions other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasMessageSetWireFormat) { - MessageSetWireFormat = other.MessageSetWireFormat; - } - if (other.HasNoStandardDescriptorAccessor) { - NoStandardDescriptorAccessor = other.NoStandardDescriptorAccessor; - } - if (other.uninterpretedOption_.Count != 0) { - result.uninterpretedOption_.Add(other.uninterpretedOption_); - } - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_messageOptionsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _messageOptionsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasMessageSetWireFormat = input.ReadBool(ref result.messageSetWireFormat_); - break; - } - case 16: { - result.hasNoStandardDescriptorAccessor = input.ReadBool(ref result.noStandardDescriptorAccessor_); - break; - } - case 7994: { - input.ReadMessageArray(tag, field_name, result.uninterpretedOption_, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.DefaultInstance, extensionRegistry); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasMessageSetWireFormat { - get { return result.hasMessageSetWireFormat; } - } - public bool MessageSetWireFormat { - get { return result.MessageSetWireFormat; } - set { SetMessageSetWireFormat(value); } - } - public Builder SetMessageSetWireFormat(bool value) { - PrepareBuilder(); - result.hasMessageSetWireFormat = true; - result.messageSetWireFormat_ = value; - return this; - } - public Builder ClearMessageSetWireFormat() { - PrepareBuilder(); - result.hasMessageSetWireFormat = false; - result.messageSetWireFormat_ = false; - return this; - } - - public bool HasNoStandardDescriptorAccessor { - get { return result.hasNoStandardDescriptorAccessor; } - } - public bool NoStandardDescriptorAccessor { - get { return result.NoStandardDescriptorAccessor; } - set { SetNoStandardDescriptorAccessor(value); } - } - public Builder SetNoStandardDescriptorAccessor(bool value) { - PrepareBuilder(); - result.hasNoStandardDescriptorAccessor = true; - result.noStandardDescriptorAccessor_ = value; - return this; - } - public Builder ClearNoStandardDescriptorAccessor() { - PrepareBuilder(); - result.hasNoStandardDescriptorAccessor = false; - result.noStandardDescriptorAccessor_ = false; - return this; - } - - public pbc::IPopsicleList UninterpretedOptionList { - get { return PrepareBuilder().uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return result.UninterpretedOptionCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return result.GetUninterpretedOption(index); - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.uninterpretedOption_[index] = value; - return this; - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.uninterpretedOption_[index] = builderForValue.Build(); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.uninterpretedOption_.Add(value); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.uninterpretedOption_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeUninterpretedOption(scg::IEnumerable values) { - PrepareBuilder(); - result.uninterpretedOption_.Add(values); - return this; - } - public Builder ClearUninterpretedOption() { - PrepareBuilder(); - result.uninterpretedOption_.Clear(); - return this; - } - } - static MessageOptions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class FieldOptions : pb::ExtendableMessage { - private FieldOptions() { } - private static readonly FieldOptions defaultInstance = new FieldOptions().MakeReadOnly(); - private static readonly string[] _fieldOptionsFieldNames = new string[] { "ctype", "deprecated", "experimental_map_key", "packed", "uninterpreted_option" }; - private static readonly uint[] _fieldOptionsFieldTags = new uint[] { 8, 24, 74, 16, 7994 }; - public static FieldOptions DefaultInstance { - get { return defaultInstance; } - } - - public override FieldOptions DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override FieldOptions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FieldOptions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FieldOptions__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - public enum CType { - STRING = 0, - CORD = 1, - STRING_PIECE = 2, - } - - } - #endregion - - public const int CtypeFieldNumber = 1; - private bool hasCtype; - private global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.Types.CType ctype_ = global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.Types.CType.STRING; - public bool HasCtype { - get { return hasCtype; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.Types.CType Ctype { - get { return ctype_; } - } - - public const int PackedFieldNumber = 2; - private bool hasPacked; - private bool packed_; - public bool HasPacked { - get { return hasPacked; } - } - public bool Packed { - get { return packed_; } - } - - public const int DeprecatedFieldNumber = 3; - private bool hasDeprecated; - private bool deprecated_; - public bool HasDeprecated { - get { return hasDeprecated; } - } - public bool Deprecated { - get { return deprecated_; } - } - - public const int ExperimentalMapKeyFieldNumber = 9; - private bool hasExperimentalMapKey; - private string experimentalMapKey_ = ""; - public bool HasExperimentalMapKey { - get { return hasExperimentalMapKey; } - } - public string ExperimentalMapKey { - get { return experimentalMapKey_; } - } - - public const int UninterpretedOptionFieldNumber = 999; - private pbc::PopsicleList uninterpretedOption_ = new pbc::PopsicleList(); - public scg::IList UninterpretedOptionList { - get { return uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return uninterpretedOption_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return uninterpretedOption_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - if (!element.IsInitialized) return false; - } - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _fieldOptionsFieldNames; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - if (hasCtype) { - output.WriteEnum(1, field_names[0], (int) Ctype, Ctype); - } - if (hasPacked) { - output.WriteBool(2, field_names[3], Packed); - } - if (hasDeprecated) { - output.WriteBool(3, field_names[1], Deprecated); - } - if (hasExperimentalMapKey) { - output.WriteString(9, field_names[2], ExperimentalMapKey); - } - if (uninterpretedOption_.Count > 0) { - output.WriteMessageArray(999, field_names[4], uninterpretedOption_); - } - extensionWriter.WriteUntil(536870912, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasCtype) { - size += pb::CodedOutputStream.ComputeEnumSize(1, (int) Ctype); - } - if (hasPacked) { - size += pb::CodedOutputStream.ComputeBoolSize(2, Packed); - } - if (hasDeprecated) { - size += pb::CodedOutputStream.ComputeBoolSize(3, Deprecated); - } - if (hasExperimentalMapKey) { - size += pb::CodedOutputStream.ComputeStringSize(9, ExperimentalMapKey); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - size += pb::CodedOutputStream.ComputeMessageSize(999, element); - } - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static FieldOptions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FieldOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FieldOptions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FieldOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FieldOptions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FieldOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static FieldOptions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static FieldOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static FieldOptions ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FieldOptions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private FieldOptions MakeReadOnly() { - uninterpretedOption_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(FieldOptions prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(FieldOptions cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private FieldOptions result; - - private FieldOptions PrepareBuilder() { - if (resultIsReadOnly) { - FieldOptions original = result; - result = new FieldOptions(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override FieldOptions MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.Descriptor; } - } - - public override FieldOptions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.DefaultInstance; } - } - - public override FieldOptions BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is FieldOptions) { - return MergeFrom((FieldOptions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(FieldOptions other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasCtype) { - Ctype = other.Ctype; - } - if (other.HasPacked) { - Packed = other.Packed; - } - if (other.HasDeprecated) { - Deprecated = other.Deprecated; - } - if (other.HasExperimentalMapKey) { - ExperimentalMapKey = other.ExperimentalMapKey; - } - if (other.uninterpretedOption_.Count != 0) { - result.uninterpretedOption_.Add(other.uninterpretedOption_); - } - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_fieldOptionsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _fieldOptionsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - object unknown; - if(input.ReadEnum(ref result.ctype_, out unknown)) { - result.hasCtype = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(1, (ulong)(int)unknown); - } - break; - } - case 16: { - result.hasPacked = input.ReadBool(ref result.packed_); - break; - } - case 24: { - result.hasDeprecated = input.ReadBool(ref result.deprecated_); - break; - } - case 74: { - result.hasExperimentalMapKey = input.ReadString(ref result.experimentalMapKey_); - break; - } - case 7994: { - input.ReadMessageArray(tag, field_name, result.uninterpretedOption_, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.DefaultInstance, extensionRegistry); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasCtype { - get { return result.hasCtype; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.Types.CType Ctype { - get { return result.Ctype; } - set { SetCtype(value); } - } - public Builder SetCtype(global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.Types.CType value) { - PrepareBuilder(); - result.hasCtype = true; - result.ctype_ = value; - return this; - } - public Builder ClearCtype() { - PrepareBuilder(); - result.hasCtype = false; - result.ctype_ = global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.Types.CType.STRING; - return this; - } - - public bool HasPacked { - get { return result.hasPacked; } - } - public bool Packed { - get { return result.Packed; } - set { SetPacked(value); } - } - public Builder SetPacked(bool value) { - PrepareBuilder(); - result.hasPacked = true; - result.packed_ = value; - return this; - } - public Builder ClearPacked() { - PrepareBuilder(); - result.hasPacked = false; - result.packed_ = false; - return this; - } - - public bool HasDeprecated { - get { return result.hasDeprecated; } - } - public bool Deprecated { - get { return result.Deprecated; } - set { SetDeprecated(value); } - } - public Builder SetDeprecated(bool value) { - PrepareBuilder(); - result.hasDeprecated = true; - result.deprecated_ = value; - return this; - } - public Builder ClearDeprecated() { - PrepareBuilder(); - result.hasDeprecated = false; - result.deprecated_ = false; - return this; - } - - public bool HasExperimentalMapKey { - get { return result.hasExperimentalMapKey; } - } - public string ExperimentalMapKey { - get { return result.ExperimentalMapKey; } - set { SetExperimentalMapKey(value); } - } - public Builder SetExperimentalMapKey(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasExperimentalMapKey = true; - result.experimentalMapKey_ = value; - return this; - } - public Builder ClearExperimentalMapKey() { - PrepareBuilder(); - result.hasExperimentalMapKey = false; - result.experimentalMapKey_ = ""; - return this; - } - - public pbc::IPopsicleList UninterpretedOptionList { - get { return PrepareBuilder().uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return result.UninterpretedOptionCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return result.GetUninterpretedOption(index); - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.uninterpretedOption_[index] = value; - return this; - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.uninterpretedOption_[index] = builderForValue.Build(); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.uninterpretedOption_.Add(value); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.uninterpretedOption_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeUninterpretedOption(scg::IEnumerable values) { - PrepareBuilder(); - result.uninterpretedOption_.Add(values); - return this; - } - public Builder ClearUninterpretedOption() { - PrepareBuilder(); - result.uninterpretedOption_.Clear(); - return this; - } - } - static FieldOptions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class EnumOptions : pb::ExtendableMessage { - private EnumOptions() { } - private static readonly EnumOptions defaultInstance = new EnumOptions().MakeReadOnly(); - private static readonly string[] _enumOptionsFieldNames = new string[] { "uninterpreted_option" }; - private static readonly uint[] _enumOptionsFieldTags = new uint[] { 7994 }; - public static EnumOptions DefaultInstance { - get { return defaultInstance; } - } - - public override EnumOptions DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override EnumOptions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumOptions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumOptions__FieldAccessorTable; } - } - - public const int UninterpretedOptionFieldNumber = 999; - private pbc::PopsicleList uninterpretedOption_ = new pbc::PopsicleList(); - public scg::IList UninterpretedOptionList { - get { return uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return uninterpretedOption_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return uninterpretedOption_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - if (!element.IsInitialized) return false; - } - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _enumOptionsFieldNames; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - if (uninterpretedOption_.Count > 0) { - output.WriteMessageArray(999, field_names[0], uninterpretedOption_); - } - extensionWriter.WriteUntil(536870912, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - size += pb::CodedOutputStream.ComputeMessageSize(999, element); - } - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static EnumOptions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static EnumOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static EnumOptions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static EnumOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static EnumOptions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static EnumOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static EnumOptions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static EnumOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static EnumOptions ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static EnumOptions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private EnumOptions MakeReadOnly() { - uninterpretedOption_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(EnumOptions prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(EnumOptions cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private EnumOptions result; - - private EnumOptions PrepareBuilder() { - if (resultIsReadOnly) { - EnumOptions original = result; - result = new EnumOptions(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override EnumOptions MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions.Descriptor; } - } - - public override EnumOptions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions.DefaultInstance; } - } - - public override EnumOptions BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is EnumOptions) { - return MergeFrom((EnumOptions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(EnumOptions other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions.DefaultInstance) return this; - PrepareBuilder(); - if (other.uninterpretedOption_.Count != 0) { - result.uninterpretedOption_.Add(other.uninterpretedOption_); - } - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_enumOptionsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _enumOptionsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 7994: { - input.ReadMessageArray(tag, field_name, result.uninterpretedOption_, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.DefaultInstance, extensionRegistry); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public pbc::IPopsicleList UninterpretedOptionList { - get { return PrepareBuilder().uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return result.UninterpretedOptionCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return result.GetUninterpretedOption(index); - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.uninterpretedOption_[index] = value; - return this; - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.uninterpretedOption_[index] = builderForValue.Build(); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.uninterpretedOption_.Add(value); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.uninterpretedOption_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeUninterpretedOption(scg::IEnumerable values) { - PrepareBuilder(); - result.uninterpretedOption_.Add(values); - return this; - } - public Builder ClearUninterpretedOption() { - PrepareBuilder(); - result.uninterpretedOption_.Clear(); - return this; - } - } - static EnumOptions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class EnumValueOptions : pb::ExtendableMessage { - private EnumValueOptions() { } - private static readonly EnumValueOptions defaultInstance = new EnumValueOptions().MakeReadOnly(); - private static readonly string[] _enumValueOptionsFieldNames = new string[] { "uninterpreted_option" }; - private static readonly uint[] _enumValueOptionsFieldTags = new uint[] { 7994 }; - public static EnumValueOptions DefaultInstance { - get { return defaultInstance; } - } - - public override EnumValueOptions DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override EnumValueOptions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumValueOptions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumValueOptions__FieldAccessorTable; } - } - - public const int UninterpretedOptionFieldNumber = 999; - private pbc::PopsicleList uninterpretedOption_ = new pbc::PopsicleList(); - public scg::IList UninterpretedOptionList { - get { return uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return uninterpretedOption_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return uninterpretedOption_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - if (!element.IsInitialized) return false; - } - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _enumValueOptionsFieldNames; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - if (uninterpretedOption_.Count > 0) { - output.WriteMessageArray(999, field_names[0], uninterpretedOption_); - } - extensionWriter.WriteUntil(536870912, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - size += pb::CodedOutputStream.ComputeMessageSize(999, element); - } - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static EnumValueOptions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static EnumValueOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static EnumValueOptions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static EnumValueOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static EnumValueOptions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static EnumValueOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static EnumValueOptions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static EnumValueOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static EnumValueOptions ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static EnumValueOptions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private EnumValueOptions MakeReadOnly() { - uninterpretedOption_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(EnumValueOptions prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(EnumValueOptions cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private EnumValueOptions result; - - private EnumValueOptions PrepareBuilder() { - if (resultIsReadOnly) { - EnumValueOptions original = result; - result = new EnumValueOptions(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override EnumValueOptions MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions.Descriptor; } - } - - public override EnumValueOptions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions.DefaultInstance; } - } - - public override EnumValueOptions BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is EnumValueOptions) { - return MergeFrom((EnumValueOptions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(EnumValueOptions other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions.DefaultInstance) return this; - PrepareBuilder(); - if (other.uninterpretedOption_.Count != 0) { - result.uninterpretedOption_.Add(other.uninterpretedOption_); - } - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_enumValueOptionsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _enumValueOptionsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 7994: { - input.ReadMessageArray(tag, field_name, result.uninterpretedOption_, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.DefaultInstance, extensionRegistry); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public pbc::IPopsicleList UninterpretedOptionList { - get { return PrepareBuilder().uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return result.UninterpretedOptionCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return result.GetUninterpretedOption(index); - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.uninterpretedOption_[index] = value; - return this; - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.uninterpretedOption_[index] = builderForValue.Build(); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.uninterpretedOption_.Add(value); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.uninterpretedOption_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeUninterpretedOption(scg::IEnumerable values) { - PrepareBuilder(); - result.uninterpretedOption_.Add(values); - return this; - } - public Builder ClearUninterpretedOption() { - PrepareBuilder(); - result.uninterpretedOption_.Clear(); - return this; - } - } - static EnumValueOptions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class ServiceOptions : pb::ExtendableMessage { - private ServiceOptions() { } - private static readonly ServiceOptions defaultInstance = new ServiceOptions().MakeReadOnly(); - private static readonly string[] _serviceOptionsFieldNames = new string[] { "uninterpreted_option" }; - private static readonly uint[] _serviceOptionsFieldTags = new uint[] { 7994 }; - public static ServiceOptions DefaultInstance { - get { return defaultInstance; } - } - - public override ServiceOptions DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override ServiceOptions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_ServiceOptions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_ServiceOptions__FieldAccessorTable; } - } - - public const int UninterpretedOptionFieldNumber = 999; - private pbc::PopsicleList uninterpretedOption_ = new pbc::PopsicleList(); - public scg::IList UninterpretedOptionList { - get { return uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return uninterpretedOption_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return uninterpretedOption_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - if (!element.IsInitialized) return false; - } - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _serviceOptionsFieldNames; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - if (uninterpretedOption_.Count > 0) { - output.WriteMessageArray(999, field_names[0], uninterpretedOption_); - } - extensionWriter.WriteUntil(536870912, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - size += pb::CodedOutputStream.ComputeMessageSize(999, element); - } - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static ServiceOptions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ServiceOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ServiceOptions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ServiceOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ServiceOptions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ServiceOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ServiceOptions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ServiceOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ServiceOptions ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ServiceOptions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private ServiceOptions MakeReadOnly() { - uninterpretedOption_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ServiceOptions prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(ServiceOptions cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private ServiceOptions result; - - private ServiceOptions PrepareBuilder() { - if (resultIsReadOnly) { - ServiceOptions original = result; - result = new ServiceOptions(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override ServiceOptions MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions.Descriptor; } - } - - public override ServiceOptions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions.DefaultInstance; } - } - - public override ServiceOptions BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ServiceOptions) { - return MergeFrom((ServiceOptions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ServiceOptions other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions.DefaultInstance) return this; - PrepareBuilder(); - if (other.uninterpretedOption_.Count != 0) { - result.uninterpretedOption_.Add(other.uninterpretedOption_); - } - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_serviceOptionsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _serviceOptionsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 7994: { - input.ReadMessageArray(tag, field_name, result.uninterpretedOption_, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.DefaultInstance, extensionRegistry); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public pbc::IPopsicleList UninterpretedOptionList { - get { return PrepareBuilder().uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return result.UninterpretedOptionCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return result.GetUninterpretedOption(index); - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.uninterpretedOption_[index] = value; - return this; - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.uninterpretedOption_[index] = builderForValue.Build(); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.uninterpretedOption_.Add(value); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.uninterpretedOption_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeUninterpretedOption(scg::IEnumerable values) { - PrepareBuilder(); - result.uninterpretedOption_.Add(values); - return this; - } - public Builder ClearUninterpretedOption() { - PrepareBuilder(); - result.uninterpretedOption_.Clear(); - return this; - } - } - static ServiceOptions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MethodOptions : pb::ExtendableMessage { - private MethodOptions() { } - private static readonly MethodOptions defaultInstance = new MethodOptions().MakeReadOnly(); - private static readonly string[] _methodOptionsFieldNames = new string[] { "uninterpreted_option" }; - private static readonly uint[] _methodOptionsFieldTags = new uint[] { 7994 }; - public static MethodOptions DefaultInstance { - get { return defaultInstance; } - } - - public override MethodOptions DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override MethodOptions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_MethodOptions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_MethodOptions__FieldAccessorTable; } - } - - public const int UninterpretedOptionFieldNumber = 999; - private pbc::PopsicleList uninterpretedOption_ = new pbc::PopsicleList(); - public scg::IList UninterpretedOptionList { - get { return uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return uninterpretedOption_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return uninterpretedOption_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - if (!element.IsInitialized) return false; - } - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _methodOptionsFieldNames; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - if (uninterpretedOption_.Count > 0) { - output.WriteMessageArray(999, field_names[0], uninterpretedOption_); - } - extensionWriter.WriteUntil(536870912, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - size += pb::CodedOutputStream.ComputeMessageSize(999, element); - } - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static MethodOptions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static MethodOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static MethodOptions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static MethodOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static MethodOptions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static MethodOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static MethodOptions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static MethodOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static MethodOptions ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static MethodOptions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private MethodOptions MakeReadOnly() { - uninterpretedOption_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(MethodOptions prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(MethodOptions cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private MethodOptions result; - - private MethodOptions PrepareBuilder() { - if (resultIsReadOnly) { - MethodOptions original = result; - result = new MethodOptions(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override MethodOptions MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions.Descriptor; } - } - - public override MethodOptions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions.DefaultInstance; } - } - - public override MethodOptions BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is MethodOptions) { - return MergeFrom((MethodOptions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(MethodOptions other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions.DefaultInstance) return this; - PrepareBuilder(); - if (other.uninterpretedOption_.Count != 0) { - result.uninterpretedOption_.Add(other.uninterpretedOption_); - } - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_methodOptionsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _methodOptionsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 7994: { - input.ReadMessageArray(tag, field_name, result.uninterpretedOption_, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.DefaultInstance, extensionRegistry); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public pbc::IPopsicleList UninterpretedOptionList { - get { return PrepareBuilder().uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return result.UninterpretedOptionCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return result.GetUninterpretedOption(index); - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.uninterpretedOption_[index] = value; - return this; - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.uninterpretedOption_[index] = builderForValue.Build(); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.uninterpretedOption_.Add(value); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.uninterpretedOption_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeUninterpretedOption(scg::IEnumerable values) { - PrepareBuilder(); - result.uninterpretedOption_.Add(values); - return this; - } - public Builder ClearUninterpretedOption() { - PrepareBuilder(); - result.uninterpretedOption_.Clear(); - return this; - } - } - static MethodOptions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class UninterpretedOption : pb::GeneratedMessage { - private UninterpretedOption() { } - private static readonly UninterpretedOption defaultInstance = new UninterpretedOption().MakeReadOnly(); - private static readonly string[] _uninterpretedOptionFieldNames = new string[] { "aggregate_value", "double_value", "identifier_value", "name", "negative_int_value", "positive_int_value", "string_value" }; - private static readonly uint[] _uninterpretedOptionFieldTags = new uint[] { 66, 49, 26, 18, 40, 32, 58 }; - public static UninterpretedOption DefaultInstance { - get { return defaultInstance; } - } - - public override UninterpretedOption DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override UninterpretedOption ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_UninterpretedOption__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_UninterpretedOption__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class NamePart : pb::GeneratedMessage { - private NamePart() { } - private static readonly NamePart defaultInstance = new NamePart().MakeReadOnly(); - private static readonly string[] _namePartFieldNames = new string[] { "is_extension", "name_part" }; - private static readonly uint[] _namePartFieldTags = new uint[] { 16, 10 }; - public static NamePart DefaultInstance { - get { return defaultInstance; } - } - - public override NamePart DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override NamePart ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_UninterpretedOption_NamePart__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_UninterpretedOption_NamePart__FieldAccessorTable; } - } - - public const int NamePart_FieldNumber = 1; - private bool hasNamePart_; - private string namePart_ = ""; - public bool HasNamePart_ { - get { return hasNamePart_; } - } - public string NamePart_ { - get { return namePart_; } - } - - public const int IsExtensionFieldNumber = 2; - private bool hasIsExtension; - private bool isExtension_; - public bool HasIsExtension { - get { return hasIsExtension; } - } - public bool IsExtension { - get { return isExtension_; } - } - - public override bool IsInitialized { - get { - if (!hasNamePart_) return false; - if (!hasIsExtension) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _namePartFieldNames; - if (hasNamePart_) { - output.WriteString(1, field_names[1], NamePart_); - } - if (hasIsExtension) { - output.WriteBool(2, field_names[0], IsExtension); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasNamePart_) { - size += pb::CodedOutputStream.ComputeStringSize(1, NamePart_); - } - if (hasIsExtension) { - size += pb::CodedOutputStream.ComputeBoolSize(2, IsExtension); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static NamePart ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NamePart ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NamePart ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NamePart ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NamePart ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NamePart ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static NamePart ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static NamePart ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static NamePart ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NamePart ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private NamePart MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(NamePart prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(NamePart cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private NamePart result; - - private NamePart PrepareBuilder() { - if (resultIsReadOnly) { - NamePart original = result; - result = new NamePart(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override NamePart MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart.Descriptor; } - } - - public override NamePart DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart.DefaultInstance; } - } - - public override NamePart BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is NamePart) { - return MergeFrom((NamePart) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(NamePart other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasNamePart_) { - NamePart_ = other.NamePart_; - } - if (other.HasIsExtension) { - IsExtension = other.IsExtension; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_namePartFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _namePartFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasNamePart_ = input.ReadString(ref result.namePart_); - break; - } - case 16: { - result.hasIsExtension = input.ReadBool(ref result.isExtension_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasNamePart_ { - get { return result.hasNamePart_; } - } - public string NamePart_ { - get { return result.NamePart_; } - set { SetNamePart_(value); } - } - public Builder SetNamePart_(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasNamePart_ = true; - result.namePart_ = value; - return this; - } - public Builder ClearNamePart_() { - PrepareBuilder(); - result.hasNamePart_ = false; - result.namePart_ = ""; - return this; - } - - public bool HasIsExtension { - get { return result.hasIsExtension; } - } - public bool IsExtension { - get { return result.IsExtension; } - set { SetIsExtension(value); } - } - public Builder SetIsExtension(bool value) { - PrepareBuilder(); - result.hasIsExtension = true; - result.isExtension_ = value; - return this; - } - public Builder ClearIsExtension() { - PrepareBuilder(); - result.hasIsExtension = false; - result.isExtension_ = false; - return this; - } - } - static NamePart() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - } - #endregion - - public const int NameFieldNumber = 2; - private pbc::PopsicleList name_ = new pbc::PopsicleList(); - public scg::IList NameList { - get { return name_; } - } - public int NameCount { - get { return name_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart GetName(int index) { - return name_[index]; - } - - public const int IdentifierValueFieldNumber = 3; - private bool hasIdentifierValue; - private string identifierValue_ = ""; - public bool HasIdentifierValue { - get { return hasIdentifierValue; } - } - public string IdentifierValue { - get { return identifierValue_; } - } - - public const int PositiveIntValueFieldNumber = 4; - private bool hasPositiveIntValue; - private ulong positiveIntValue_; - public bool HasPositiveIntValue { - get { return hasPositiveIntValue; } - } - [global::System.CLSCompliant(false)] - public ulong PositiveIntValue { - get { return positiveIntValue_; } - } - - public const int NegativeIntValueFieldNumber = 5; - private bool hasNegativeIntValue; - private long negativeIntValue_; - public bool HasNegativeIntValue { - get { return hasNegativeIntValue; } - } - public long NegativeIntValue { - get { return negativeIntValue_; } - } - - public const int DoubleValueFieldNumber = 6; - private bool hasDoubleValue; - private double doubleValue_; - public bool HasDoubleValue { - get { return hasDoubleValue; } - } - public double DoubleValue { - get { return doubleValue_; } - } - - public const int StringValueFieldNumber = 7; - private bool hasStringValue; - private pb::ByteString stringValue_ = pb::ByteString.Empty; - public bool HasStringValue { - get { return hasStringValue; } - } - public pb::ByteString StringValue { - get { return stringValue_; } - } - - public const int AggregateValueFieldNumber = 8; - private bool hasAggregateValue; - private string aggregateValue_ = ""; - public bool HasAggregateValue { - get { return hasAggregateValue; } - } - public string AggregateValue { - get { return aggregateValue_; } - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart element in NameList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _uninterpretedOptionFieldNames; - if (name_.Count > 0) { - output.WriteMessageArray(2, field_names[3], name_); - } - if (hasIdentifierValue) { - output.WriteString(3, field_names[2], IdentifierValue); - } - if (hasPositiveIntValue) { - output.WriteUInt64(4, field_names[5], PositiveIntValue); - } - if (hasNegativeIntValue) { - output.WriteInt64(5, field_names[4], NegativeIntValue); - } - if (hasDoubleValue) { - output.WriteDouble(6, field_names[1], DoubleValue); - } - if (hasStringValue) { - output.WriteBytes(7, field_names[6], StringValue); - } - if (hasAggregateValue) { - output.WriteString(8, field_names[0], AggregateValue); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart element in NameList) { - size += pb::CodedOutputStream.ComputeMessageSize(2, element); - } - if (hasIdentifierValue) { - size += pb::CodedOutputStream.ComputeStringSize(3, IdentifierValue); - } - if (hasPositiveIntValue) { - size += pb::CodedOutputStream.ComputeUInt64Size(4, PositiveIntValue); - } - if (hasNegativeIntValue) { - size += pb::CodedOutputStream.ComputeInt64Size(5, NegativeIntValue); - } - if (hasDoubleValue) { - size += pb::CodedOutputStream.ComputeDoubleSize(6, DoubleValue); - } - if (hasStringValue) { - size += pb::CodedOutputStream.ComputeBytesSize(7, StringValue); - } - if (hasAggregateValue) { - size += pb::CodedOutputStream.ComputeStringSize(8, AggregateValue); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static UninterpretedOption ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static UninterpretedOption ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static UninterpretedOption ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static UninterpretedOption ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static UninterpretedOption ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static UninterpretedOption ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static UninterpretedOption ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static UninterpretedOption ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static UninterpretedOption ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static UninterpretedOption ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private UninterpretedOption MakeReadOnly() { - name_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(UninterpretedOption prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(UninterpretedOption cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private UninterpretedOption result; - - private UninterpretedOption PrepareBuilder() { - if (resultIsReadOnly) { - UninterpretedOption original = result; - result = new UninterpretedOption(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override UninterpretedOption MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Descriptor; } - } - - public override UninterpretedOption DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.DefaultInstance; } - } - - public override UninterpretedOption BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is UninterpretedOption) { - return MergeFrom((UninterpretedOption) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(UninterpretedOption other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.DefaultInstance) return this; - PrepareBuilder(); - if (other.name_.Count != 0) { - result.name_.Add(other.name_); - } - if (other.HasIdentifierValue) { - IdentifierValue = other.IdentifierValue; - } - if (other.HasPositiveIntValue) { - PositiveIntValue = other.PositiveIntValue; - } - if (other.HasNegativeIntValue) { - NegativeIntValue = other.NegativeIntValue; - } - if (other.HasDoubleValue) { - DoubleValue = other.DoubleValue; - } - if (other.HasStringValue) { - StringValue = other.StringValue; - } - if (other.HasAggregateValue) { - AggregateValue = other.AggregateValue; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_uninterpretedOptionFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _uninterpretedOptionFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 18: { - input.ReadMessageArray(tag, field_name, result.name_, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart.DefaultInstance, extensionRegistry); - break; - } - case 26: { - result.hasIdentifierValue = input.ReadString(ref result.identifierValue_); - break; - } - case 32: { - result.hasPositiveIntValue = input.ReadUInt64(ref result.positiveIntValue_); - break; - } - case 40: { - result.hasNegativeIntValue = input.ReadInt64(ref result.negativeIntValue_); - break; - } - case 49: { - result.hasDoubleValue = input.ReadDouble(ref result.doubleValue_); - break; - } - case 58: { - result.hasStringValue = input.ReadBytes(ref result.stringValue_); - break; - } - case 66: { - result.hasAggregateValue = input.ReadString(ref result.aggregateValue_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public pbc::IPopsicleList NameList { - get { return PrepareBuilder().name_; } - } - public int NameCount { - get { return result.NameCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart GetName(int index) { - return result.GetName(index); - } - public Builder SetName(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.name_[index] = value; - return this; - } - public Builder SetName(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.name_[index] = builderForValue.Build(); - return this; - } - public Builder AddName(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.name_.Add(value); - return this; - } - public Builder AddName(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.name_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeName(scg::IEnumerable values) { - PrepareBuilder(); - result.name_.Add(values); - return this; - } - public Builder ClearName() { - PrepareBuilder(); - result.name_.Clear(); - return this; - } - - public bool HasIdentifierValue { - get { return result.hasIdentifierValue; } - } - public string IdentifierValue { - get { return result.IdentifierValue; } - set { SetIdentifierValue(value); } - } - public Builder SetIdentifierValue(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasIdentifierValue = true; - result.identifierValue_ = value; - return this; - } - public Builder ClearIdentifierValue() { - PrepareBuilder(); - result.hasIdentifierValue = false; - result.identifierValue_ = ""; - return this; - } - - public bool HasPositiveIntValue { - get { return result.hasPositiveIntValue; } - } - [global::System.CLSCompliant(false)] - public ulong PositiveIntValue { - get { return result.PositiveIntValue; } - set { SetPositiveIntValue(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetPositiveIntValue(ulong value) { - PrepareBuilder(); - result.hasPositiveIntValue = true; - result.positiveIntValue_ = value; - return this; - } - public Builder ClearPositiveIntValue() { - PrepareBuilder(); - result.hasPositiveIntValue = false; - result.positiveIntValue_ = 0UL; - return this; - } - - public bool HasNegativeIntValue { - get { return result.hasNegativeIntValue; } - } - public long NegativeIntValue { - get { return result.NegativeIntValue; } - set { SetNegativeIntValue(value); } - } - public Builder SetNegativeIntValue(long value) { - PrepareBuilder(); - result.hasNegativeIntValue = true; - result.negativeIntValue_ = value; - return this; - } - public Builder ClearNegativeIntValue() { - PrepareBuilder(); - result.hasNegativeIntValue = false; - result.negativeIntValue_ = 0L; - return this; - } - - public bool HasDoubleValue { - get { return result.hasDoubleValue; } - } - public double DoubleValue { - get { return result.DoubleValue; } - set { SetDoubleValue(value); } - } - public Builder SetDoubleValue(double value) { - PrepareBuilder(); - result.hasDoubleValue = true; - result.doubleValue_ = value; - return this; - } - public Builder ClearDoubleValue() { - PrepareBuilder(); - result.hasDoubleValue = false; - result.doubleValue_ = 0D; - return this; - } - - public bool HasStringValue { - get { return result.hasStringValue; } - } - public pb::ByteString StringValue { - get { return result.StringValue; } - set { SetStringValue(value); } - } - public Builder SetStringValue(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasStringValue = true; - result.stringValue_ = value; - return this; - } - public Builder ClearStringValue() { - PrepareBuilder(); - result.hasStringValue = false; - result.stringValue_ = pb::ByteString.Empty; - return this; - } - - public bool HasAggregateValue { - get { return result.hasAggregateValue; } - } - public string AggregateValue { - get { return result.AggregateValue; } - set { SetAggregateValue(value); } - } - public Builder SetAggregateValue(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasAggregateValue = true; - result.aggregateValue_ = value; - return this; - } - public Builder ClearAggregateValue() { - PrepareBuilder(); - result.hasAggregateValue = false; - result.aggregateValue_ = ""; - return this; - } - } - static UninterpretedOption() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class SourceCodeInfo : pb::GeneratedMessage { - private SourceCodeInfo() { } - private static readonly SourceCodeInfo defaultInstance = new SourceCodeInfo().MakeReadOnly(); - private static readonly string[] _sourceCodeInfoFieldNames = new string[] { "location" }; - private static readonly uint[] _sourceCodeInfoFieldTags = new uint[] { 10 }; - public static SourceCodeInfo DefaultInstance { - get { return defaultInstance; } - } - - public override SourceCodeInfo DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override SourceCodeInfo ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_SourceCodeInfo__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_SourceCodeInfo__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Location : pb::GeneratedMessage { - private Location() { } - private static readonly Location defaultInstance = new Location().MakeReadOnly(); - private static readonly string[] _locationFieldNames = new string[] { "path", "span" }; - private static readonly uint[] _locationFieldTags = new uint[] { 10, 18 }; - public static Location DefaultInstance { - get { return defaultInstance; } - } - - public override Location DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override Location ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_SourceCodeInfo_Location__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_SourceCodeInfo_Location__FieldAccessorTable; } - } - - public const int PathFieldNumber = 1; - private int pathMemoizedSerializedSize; - private pbc::PopsicleList path_ = new pbc::PopsicleList(); - public scg::IList PathList { - get { return pbc::Lists.AsReadOnly(path_); } - } - public int PathCount { - get { return path_.Count; } - } - public int GetPath(int index) { - return path_[index]; - } - - public const int SpanFieldNumber = 2; - private int spanMemoizedSerializedSize; - private pbc::PopsicleList span_ = new pbc::PopsicleList(); - public scg::IList SpanList { - get { return pbc::Lists.AsReadOnly(span_); } - } - public int SpanCount { - get { return span_.Count; } - } - public int GetSpan(int index) { - return span_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _locationFieldNames; - if (path_.Count > 0) { - output.WritePackedInt32Array(1, field_names[0], pathMemoizedSerializedSize, path_); - } - if (span_.Count > 0) { - output.WritePackedInt32Array(2, field_names[1], spanMemoizedSerializedSize, span_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - foreach (int element in PathList) { - dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); - } - size += dataSize; - if (path_.Count != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - pathMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - foreach (int element in SpanList) { - dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); - } - size += dataSize; - if (span_.Count != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - spanMemoizedSerializedSize = dataSize; - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static Location ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Location ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Location ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Location ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Location ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Location ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Location ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Location ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Location ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Location ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private Location MakeReadOnly() { - path_.MakeReadOnly(); - span_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Location prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(Location cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private Location result; - - private Location PrepareBuilder() { - if (resultIsReadOnly) { - Location original = result; - result = new Location(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override Location MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Types.Location.Descriptor; } - } - - public override Location DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Types.Location.DefaultInstance; } - } - - public override Location BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Location) { - return MergeFrom((Location) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Location other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Types.Location.DefaultInstance) return this; - PrepareBuilder(); - if (other.path_.Count != 0) { - result.path_.Add(other.path_); - } - if (other.span_.Count != 0) { - result.span_.Add(other.span_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_locationFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _locationFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: - case 8: { - input.ReadInt32Array(tag, field_name, result.path_); - break; - } - case 18: - case 16: { - input.ReadInt32Array(tag, field_name, result.span_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public pbc::IPopsicleList PathList { - get { return PrepareBuilder().path_; } - } - public int PathCount { - get { return result.PathCount; } - } - public int GetPath(int index) { - return result.GetPath(index); - } - public Builder SetPath(int index, int value) { - PrepareBuilder(); - result.path_[index] = value; - return this; - } - public Builder AddPath(int value) { - PrepareBuilder(); - result.path_.Add(value); - return this; - } - public Builder AddRangePath(scg::IEnumerable values) { - PrepareBuilder(); - result.path_.Add(values); - return this; - } - public Builder ClearPath() { - PrepareBuilder(); - result.path_.Clear(); - return this; - } - - public pbc::IPopsicleList SpanList { - get { return PrepareBuilder().span_; } - } - public int SpanCount { - get { return result.SpanCount; } - } - public int GetSpan(int index) { - return result.GetSpan(index); - } - public Builder SetSpan(int index, int value) { - PrepareBuilder(); - result.span_[index] = value; - return this; - } - public Builder AddSpan(int value) { - PrepareBuilder(); - result.span_.Add(value); - return this; - } - public Builder AddRangeSpan(scg::IEnumerable values) { - PrepareBuilder(); - result.span_.Add(values); - return this; - } - public Builder ClearSpan() { - PrepareBuilder(); - result.span_.Clear(); - return this; - } - } - static Location() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - } - #endregion - - public const int LocationFieldNumber = 1; - private pbc::PopsicleList location_ = new pbc::PopsicleList(); - public scg::IList LocationList { - get { return location_; } - } - public int LocationCount { - get { return location_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Types.Location GetLocation(int index) { - return location_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _sourceCodeInfoFieldNames; - if (location_.Count > 0) { - output.WriteMessageArray(1, field_names[0], location_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Types.Location element in LocationList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static SourceCodeInfo ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SourceCodeInfo ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SourceCodeInfo ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SourceCodeInfo ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SourceCodeInfo ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SourceCodeInfo ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SourceCodeInfo ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SourceCodeInfo ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SourceCodeInfo ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SourceCodeInfo ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private SourceCodeInfo MakeReadOnly() { - location_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SourceCodeInfo prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(SourceCodeInfo cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private SourceCodeInfo result; - - private SourceCodeInfo PrepareBuilder() { - if (resultIsReadOnly) { - SourceCodeInfo original = result; - result = new SourceCodeInfo(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override SourceCodeInfo MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Descriptor; } - } - - public override SourceCodeInfo DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.DefaultInstance; } - } - - public override SourceCodeInfo BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SourceCodeInfo) { - return MergeFrom((SourceCodeInfo) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SourceCodeInfo other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.DefaultInstance) return this; - PrepareBuilder(); - if (other.location_.Count != 0) { - result.location_.Add(other.location_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_sourceCodeInfoFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _sourceCodeInfoFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - input.ReadMessageArray(tag, field_name, result.location_, global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Types.Location.DefaultInstance, extensionRegistry); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public pbc::IPopsicleList LocationList { - get { return PrepareBuilder().location_; } - } - public int LocationCount { - get { return result.LocationCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Types.Location GetLocation(int index) { - return result.GetLocation(index); - } - public Builder SetLocation(int index, global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Types.Location value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.location_[index] = value; - return this; - } - public Builder SetLocation(int index, global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Types.Location.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.location_[index] = builderForValue.Build(); - return this; - } - public Builder AddLocation(global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Types.Location value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.location_.Add(value); - return this; - } - public Builder AddLocation(global::Google.ProtocolBuffers.DescriptorProtos.SourceCodeInfo.Types.Location.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.location_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeLocation(scg::IEnumerable values) { - PrepareBuilder(); - result.location_.Add(values); - return this; - } - public Builder ClearLocation() { - PrepareBuilder(); - result.location_.Clear(); - return this; - } - } - static SourceCodeInfo() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/ProtocolBuffers/DescriptorProtos/IDescriptorProto.cs b/src/ProtocolBuffers/DescriptorProtos/IDescriptorProto.cs deleted file mode 100644 index c894d32..0000000 --- a/src/ProtocolBuffers/DescriptorProtos/IDescriptorProto.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -namespace Google.ProtocolBuffers.DescriptorProtos -{ - /// - /// Interface implemented by all DescriptorProtos. The generator doesn't - /// emit the interface implementation claim, so PartialClasses.cs contains - /// partial class declarations for each of them. - /// - /// The associated options protocol buffer type - public interface IDescriptorProto - { - /// - /// The brief name of the descriptor's target. - /// - string Name { get; } - - /// - /// The options for this descriptor. - /// - TOptions Options { get; } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/DescriptorProtos/PartialClasses.cs b/src/ProtocolBuffers/DescriptorProtos/PartialClasses.cs deleted file mode 100644 index adc2afb..0000000 --- a/src/ProtocolBuffers/DescriptorProtos/PartialClasses.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// This file just contains partial classes for each of the -// autogenerated classes, so that they implement -// IDescriptorProto -namespace Google.ProtocolBuffers.DescriptorProtos -{ - public partial class DescriptorProto : IDescriptorProto - { - } - - public partial class EnumDescriptorProto : IDescriptorProto - { - } - - public partial class EnumValueDescriptorProto : IDescriptorProto - { - } - - public partial class FieldDescriptorProto : IDescriptorProto - { - } - - public partial class FileDescriptorProto : IDescriptorProto - { - } - - public partial class MethodDescriptorProto : IDescriptorProto - { - } - - public partial class ServiceDescriptorProto : IDescriptorProto - { - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/Descriptors/DescriptorBase.cs b/src/ProtocolBuffers/Descriptors/DescriptorBase.cs deleted file mode 100644 index 59006f8..0000000 --- a/src/ProtocolBuffers/Descriptors/DescriptorBase.cs +++ /dev/null @@ -1,115 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -using Google.ProtocolBuffers.DescriptorProtos; - -namespace Google.ProtocolBuffers.Descriptors -{ - /// - /// Base class for nearly all descriptors, providing common functionality. - /// - /// Type of the protocol buffer form of this descriptor - /// Type of the options protocol buffer for this descriptor - public abstract class DescriptorBase : IDescriptor - where TProto : IMessage, IDescriptorProto - { - private TProto proto; - private readonly FileDescriptor file; - private readonly string fullName; - - protected DescriptorBase(TProto proto, FileDescriptor file, string fullName) - { - this.proto = proto; - this.file = file; - this.fullName = fullName; - } - - internal virtual void ReplaceProto(TProto newProto) - { - this.proto = newProto; - } - - protected static string ComputeFullName(FileDescriptor file, MessageDescriptor parent, string name) - { - if (parent != null) - { - return parent.FullName + "." + name; - } - if (file.Package.Length > 0) - { - return file.Package + "." + name; - } - return name; - } - - IMessage IDescriptor.Proto - { - get { return proto; } - } - - /// - /// Returns the protocol buffer form of this descriptor. - /// - public TProto Proto - { - get { return proto; } - } - - public TOptions Options - { - get { return proto.Options; } - } - - /// - /// The fully qualified name of the descriptor's target. - /// - public string FullName - { - get { return fullName; } - } - - /// - /// The brief name of the descriptor's target. - /// - public string Name - { - get { return proto.Name; } - } - - /// - /// The file this descriptor was declared in. - /// - public FileDescriptor File - { - get { return file; } - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/Descriptors/DescriptorPool.cs b/src/ProtocolBuffers/Descriptors/DescriptorPool.cs deleted file mode 100644 index ae81980..0000000 --- a/src/ProtocolBuffers/Descriptors/DescriptorPool.cs +++ /dev/null @@ -1,352 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -using System; -using System.Collections.Generic; -using System.Text; -using System.Text.RegularExpressions; - -namespace Google.ProtocolBuffers.Descriptors -{ - /// - /// Contains lookup tables containing all the descriptors defined in a particular file. - /// - internal sealed class DescriptorPool - { - private readonly IDictionary descriptorsByName = - new Dictionary(); - - private readonly IDictionary fieldsByNumber = - new Dictionary(); - - private readonly IDictionary enumValuesByNumber = - new Dictionary(); - - private readonly DescriptorPool[] dependencies; - - internal DescriptorPool(FileDescriptor[] dependencyFiles) - { - dependencies = new DescriptorPool[dependencyFiles.Length]; - for (int i = 0; i < dependencyFiles.Length; i++) - { - dependencies[i] = dependencyFiles[i].DescriptorPool; - } - - foreach (FileDescriptor dependency in dependencyFiles) - { - AddPackage(dependency.Package, dependency); - } - } - - /// - /// Finds a symbol of the given name within the pool. - /// - /// The type of symbol to look for - /// Fully-qualified name to look up - /// The symbol with the given name and type, - /// or null if the symbol doesn't exist or has the wrong type - internal T FindSymbol(string fullName) where T : class, IDescriptor - { - IDescriptor result; - descriptorsByName.TryGetValue(fullName, out result); - T descriptor = result as T; - if (descriptor != null) - { - return descriptor; - } - - foreach (DescriptorPool dependency in dependencies) - { - dependency.descriptorsByName.TryGetValue(fullName, out result); - descriptor = result as T; - if (descriptor != null) - { - return descriptor; - } - } - - return null; - } - - /// - /// Adds a package to the symbol tables. If a package by the same name - /// already exists, that is fine, but if some other kind of symbol - /// exists under the same name, an exception is thrown. If the package - /// has multiple components, this also adds the parent package(s). - /// - internal void AddPackage(string fullName, FileDescriptor file) - { - int dotpos = fullName.LastIndexOf('.'); - String name; - if (dotpos != -1) - { - AddPackage(fullName.Substring(0, dotpos), file); - name = fullName.Substring(dotpos + 1); - } - else - { - name = fullName; - } - - IDescriptor old; - if (descriptorsByName.TryGetValue(fullName, out old)) - { - if (!(old is PackageDescriptor)) - { - throw new DescriptorValidationException(file, - "\"" + name + - "\" is already defined (as something other than a " + - "package) in file \"" + old.File.Name + "\"."); - } - } - descriptorsByName[fullName] = new PackageDescriptor(name, fullName, file); - } - - /// - /// Adds a symbol to the symbol table. - /// - /// The symbol already existed - /// in the symbol table. - internal void AddSymbol(IDescriptor descriptor) - { - ValidateSymbolName(descriptor); - String fullName = descriptor.FullName; - - IDescriptor old; - if (descriptorsByName.TryGetValue(fullName, out old)) - { - int dotPos = fullName.LastIndexOf('.'); - string message; - if (descriptor.File == old.File) - { - if (dotPos == -1) - { - message = "\"" + fullName + "\" is already defined."; - } - else - { - message = "\"" + fullName.Substring(dotPos + 1) + "\" is already defined in \"" + - fullName.Substring(0, dotPos) + "\"."; - } - } - else - { - message = "\"" + fullName + "\" is already defined in file \"" + old.File.Name + "\"."; - } - throw new DescriptorValidationException(descriptor, message); - } - descriptorsByName[fullName] = descriptor; - } - - private static readonly Regex ValidationRegex = new Regex("^[_A-Za-z][_A-Za-z0-9]*$", - FrameworkPortability.CompiledRegexWhereAvailable); - - /// - /// Verifies that the descriptor's name is valid (i.e. it contains - /// only letters, digits and underscores, and does not start with a digit). - /// - /// - private static void ValidateSymbolName(IDescriptor descriptor) - { - if (descriptor.Name == "") - { - throw new DescriptorValidationException(descriptor, "Missing name."); - } - if (!ValidationRegex.IsMatch(descriptor.Name)) - { - throw new DescriptorValidationException(descriptor, - "\"" + descriptor.Name + "\" is not a valid identifier."); - } - } - - /// - /// Returns the field with the given number in the given descriptor, - /// or null if it can't be found. - /// - internal FieldDescriptor FindFieldByNumber(MessageDescriptor messageDescriptor, int number) - { - FieldDescriptor ret; - fieldsByNumber.TryGetValue(new DescriptorIntPair(messageDescriptor, number), out ret); - return ret; - } - - internal EnumValueDescriptor FindEnumValueByNumber(EnumDescriptor enumDescriptor, int number) - { - EnumValueDescriptor ret; - enumValuesByNumber.TryGetValue(new DescriptorIntPair(enumDescriptor, number), out ret); - return ret; - } - - /// - /// Adds a field to the fieldsByNumber table. - /// - /// A field with the same - /// containing type and number already exists. - internal void AddFieldByNumber(FieldDescriptor field) - { - DescriptorIntPair key = new DescriptorIntPair(field.ContainingType, field.FieldNumber); - FieldDescriptor old; - if (fieldsByNumber.TryGetValue(key, out old)) - { - throw new DescriptorValidationException(field, "Field number " + field.FieldNumber + - "has already been used in \"" + - field.ContainingType.FullName + - "\" by field \"" + old.Name + "\"."); - } - fieldsByNumber[key] = field; - } - - /// - /// Adds an enum value to the enumValuesByNumber table. If an enum value - /// with the same type and number already exists, this method does nothing. - /// (This is allowed; the first value defined with the number takes precedence.) - /// - internal void AddEnumValueByNumber(EnumValueDescriptor enumValue) - { - DescriptorIntPair key = new DescriptorIntPair(enumValue.EnumDescriptor, enumValue.Number); - if (!enumValuesByNumber.ContainsKey(key)) - { - enumValuesByNumber[key] = enumValue; - } - } - - /// - /// Looks up a descriptor by name, relative to some other descriptor. - /// The name may be fully-qualified (with a leading '.'), partially-qualified, - /// or unqualified. C++-like name lookup semantics are used to search for the - /// matching descriptor. - /// - public IDescriptor LookupSymbol(string name, IDescriptor relativeTo) - { - // TODO(jonskeet): This could be optimized in a number of ways. - - IDescriptor result; - if (name.StartsWith(".")) - { - // Fully-qualified name. - result = FindSymbol(name.Substring(1)); - } - else - { - // If "name" is a compound identifier, we want to search for the - // first component of it, then search within it for the rest. - int firstPartLength = name.IndexOf('.'); - string firstPart = firstPartLength == -1 ? name : name.Substring(0, firstPartLength); - - // We will search each parent scope of "relativeTo" looking for the - // symbol. - StringBuilder scopeToTry = new StringBuilder(relativeTo.FullName); - - while (true) - { - // Chop off the last component of the scope. - - // TODO(jonskeet): Make this more efficient. May not be worth using StringBuilder at all - int dotpos = scopeToTry.ToString().LastIndexOf("."); - if (dotpos == -1) - { - result = FindSymbol(name); - break; - } - else - { - scopeToTry.Length = dotpos + 1; - - // Append firstPart and try to find. - scopeToTry.Append(firstPart); - result = FindSymbol(scopeToTry.ToString()); - - if (result != null) - { - if (firstPartLength != -1) - { - // We only found the first part of the symbol. Now look for - // the whole thing. If this fails, we *don't* want to keep - // searching parent scopes. - scopeToTry.Length = dotpos + 1; - scopeToTry.Append(name); - result = FindSymbol(scopeToTry.ToString()); - } - break; - } - - // Not found. Remove the name so we can try again. - scopeToTry.Length = dotpos; - } - } - } - - if (result == null) - { - throw new DescriptorValidationException(relativeTo, "\"" + name + "\" is not defined."); - } - else - { - return result; - } - } - - /// - /// Struct used to hold the keys for the fieldByNumber table. - /// - private struct DescriptorIntPair : IEquatable - { - private readonly int number; - private readonly IDescriptor descriptor; - - internal DescriptorIntPair(IDescriptor descriptor, int number) - { - this.number = number; - this.descriptor = descriptor; - } - - public bool Equals(DescriptorIntPair other) - { - return descriptor == other.descriptor - && number == other.number; - } - - public override bool Equals(object obj) - { - if (obj is DescriptorIntPair) - { - return Equals((DescriptorIntPair) obj); - } - return false; - } - - public override int GetHashCode() - { - return descriptor.GetHashCode()*((1 << 16) - 1) + number; - } - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/Descriptors/DescriptorUtil.cs b/src/ProtocolBuffers/Descriptors/DescriptorUtil.cs deleted file mode 100644 index 00efdbe..0000000 --- a/src/ProtocolBuffers/Descriptors/DescriptorUtil.cs +++ /dev/null @@ -1,64 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -using System.Collections.Generic; -using Google.ProtocolBuffers.Collections; - -namespace Google.ProtocolBuffers.Descriptors -{ - /// - /// Internal class containing utility methods when working with descriptors. - /// - internal static class DescriptorUtil - { - /// - /// Equivalent to Func[TInput, int, TOutput] but usable in .NET 2.0. Only used to convert - /// arrays. - /// - internal delegate TOutput IndexedConverter(TInput element, int index); - - /// - /// Converts the given array into a read-only list, applying the specified conversion to - /// each input element. - /// - internal static IList ConvertAndMakeReadOnly(IList input, - IndexedConverter - converter) - { - TOutput[] array = new TOutput[input.Count]; - for (int i = 0; i < array.Length; i++) - { - array[i] = converter(input[i], i); - } - return Lists.AsReadOnly(array); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/Descriptors/DescriptorValidationException.cs b/src/ProtocolBuffers/Descriptors/DescriptorValidationException.cs deleted file mode 100644 index d05d60d..0000000 --- a/src/ProtocolBuffers/Descriptors/DescriptorValidationException.cs +++ /dev/null @@ -1,90 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -using System; - -namespace Google.ProtocolBuffers.Descriptors -{ - /// - /// Thrown when building descriptors fails because the source DescriptorProtos - /// are not valid. - /// - public sealed class DescriptorValidationException : Exception - { - private readonly String name; - private readonly IMessage proto; - private readonly string description; - - /// - /// The full name of the descriptor where the error occurred. - /// - public String ProblemSymbolName - { - get { return name; } - } - - /// - /// The protocol message representation of the invalid descriptor. - /// - public IMessage ProblemProto - { - get { return proto; } - } - - /// - /// A human-readable description of the error. (The Message property - /// is made up of the descriptor's name and this description.) - /// - public string Description - { - get { return description; } - } - - internal DescriptorValidationException(IDescriptor problemDescriptor, string description) : - base(problemDescriptor.FullName + ": " + description) - { - // Note that problemDescriptor may be partially uninitialized, so we - // don't want to expose it directly to the user. So, we only provide - // the name and the original proto. - name = problemDescriptor.FullName; - proto = problemDescriptor.Proto; - this.description = description; - } - - internal DescriptorValidationException(IDescriptor problemDescriptor, string description, Exception cause) : - base(problemDescriptor.FullName + ": " + description, cause) - { - name = problemDescriptor.FullName; - proto = problemDescriptor.Proto; - this.description = description; - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/Descriptors/EnumDescriptor.cs b/src/ProtocolBuffers/Descriptors/EnumDescriptor.cs deleted file mode 100644 index a0b81b6..0000000 --- a/src/ProtocolBuffers/Descriptors/EnumDescriptor.cs +++ /dev/null @@ -1,126 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -using System.Collections.Generic; -using Google.ProtocolBuffers.DescriptorProtos; - -namespace Google.ProtocolBuffers.Descriptors -{ - /// - /// Descriptor for an enum type in a .proto file. - /// - public sealed class EnumDescriptor : IndexedDescriptorBase, - IEnumLiteMap - { - private readonly MessageDescriptor containingType; - private readonly IList values; - - internal EnumDescriptor(EnumDescriptorProto proto, FileDescriptor file, MessageDescriptor parent, int index) - : base(proto, file, ComputeFullName(file, parent, proto.Name), index) - { - containingType = parent; - - if (proto.ValueCount == 0) - { - // We cannot allow enums with no values because this would mean there - // would be no valid default value for fields of this type. - throw new DescriptorValidationException(this, "Enums must contain at least one value."); - } - - values = DescriptorUtil.ConvertAndMakeReadOnly(proto.ValueList, - (value, i) => new EnumValueDescriptor(value, file, this, i)); - - File.DescriptorPool.AddSymbol(this); - } - - /// - /// If this is a nested type, get the outer descriptor, otherwise null. - /// - public MessageDescriptor ContainingType - { - get { return containingType; } - } - - /// - /// An unmodifiable list of defined value descriptors for this enum. - /// - public IList Values - { - get { return values; } - } - - /// - /// Logic moved from FieldSet to continue current behavior - /// - public bool IsValidValue(IEnumLite value) - { - return value is EnumValueDescriptor && ((EnumValueDescriptor) value).EnumDescriptor == this; - } - - /// - /// Finds an enum value by number. If multiple enum values have the - /// same number, this returns the first defined value with that number. - /// - public EnumValueDescriptor FindValueByNumber(int number) - { - return File.DescriptorPool.FindEnumValueByNumber(this, number); - } - - IEnumLite IEnumLiteMap.FindValueByNumber(int number) - { - return FindValueByNumber(number); - } - - IEnumLite IEnumLiteMap.FindValueByName(string name) - { - return FindValueByName(name); - } - - /// - /// Finds an enum value by name. - /// - /// The unqualified name of the value (e.g. "FOO"). - /// The value's descriptor, or null if not found. - public EnumValueDescriptor FindValueByName(string name) - { - return File.DescriptorPool.FindSymbol(FullName + "." + name); - } - - internal override void ReplaceProto(EnumDescriptorProto newProto) - { - base.ReplaceProto(newProto); - for (int i = 0; i < values.Count; i++) - { - values[i].ReplaceProto(newProto.GetValue(i)); - } - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/Descriptors/EnumValueDescriptor.cs b/src/ProtocolBuffers/Descriptors/EnumValueDescriptor.cs deleted file mode 100644 index afb9cbb..0000000 --- a/src/ProtocolBuffers/Descriptors/EnumValueDescriptor.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -using Google.ProtocolBuffers.DescriptorProtos; - -namespace Google.ProtocolBuffers.Descriptors -{ - /// - /// Descriptor for a single enum value within an enum in a .proto file. - /// - public sealed class EnumValueDescriptor : IndexedDescriptorBase, - IEnumLite - { - private readonly EnumDescriptor enumDescriptor; - - internal EnumValueDescriptor(EnumValueDescriptorProto proto, FileDescriptor file, - EnumDescriptor parent, int index) - : base(proto, file, parent.FullName + "." + proto.Name, index) - { - enumDescriptor = parent; - file.DescriptorPool.AddSymbol(this); - file.DescriptorPool.AddEnumValueByNumber(this); - } - - public int Number - { - get { return Proto.Number; } - } - - public EnumDescriptor EnumDescriptor - { - get { return enumDescriptor; } - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/Descriptors/FieldDescriptor.cs b/src/ProtocolBuffers/Descriptors/FieldDescriptor.cs deleted file mode 100644 index 6d17ae2..0000000 --- a/src/ProtocolBuffers/Descriptors/FieldDescriptor.cs +++ /dev/null @@ -1,671 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -using System; -using System.Collections.Generic; -using System.Reflection; -using Google.ProtocolBuffers.Collections; -using Google.ProtocolBuffers.DescriptorProtos; - -namespace Google.ProtocolBuffers.Descriptors -{ - /// - /// Descriptor for a field or extension within a message in a .proto file. - /// - public sealed class FieldDescriptor : IndexedDescriptorBase, - IComparable, IFieldDescriptorLite - { - private readonly MessageDescriptor extensionScope; - private EnumDescriptor enumType; - private MessageDescriptor messageType; - private MessageDescriptor containingType; - private object defaultValue; - private FieldType fieldType; - private MappedType mappedType; - - private CSharpFieldOptions csharpFieldOptions; - private readonly object optionsLock = new object(); - - internal FieldDescriptor(FieldDescriptorProto proto, FileDescriptor file, - MessageDescriptor parent, int index, bool isExtension) - : base(proto, file, ComputeFullName(file, parent, proto.Name), index) - { - if (proto.HasType) - { - fieldType = GetFieldTypeFromProtoType(proto.Type); - mappedType = FieldTypeToMappedTypeMap[fieldType]; - } - - if (FieldNumber <= 0) - { - throw new DescriptorValidationException(this, - "Field numbers must be positive integers."); - } - - if (isExtension) - { - if (!proto.HasExtendee) - { - throw new DescriptorValidationException(this, - "FieldDescriptorProto.Extendee not set for extension field."); - } - containingType = null; // Will be filled in when cross-linking - if (parent != null) - { - extensionScope = parent; - } - else - { - extensionScope = null; - } - } - else - { - if (proto.HasExtendee) - { - throw new DescriptorValidationException(this, - "FieldDescriptorProto.Extendee set for non-extension field."); - } - containingType = parent; - extensionScope = null; - } - - file.DescriptorPool.AddSymbol(this); - } - - private CSharpFieldOptions BuildOrFakeCSharpOptions() - { - // TODO(jonskeet): Check if we could use FileDescriptorProto.Descriptor.Name - interesting bootstrap issues - if (File.Proto.Name == "google/protobuf/csharp_options.proto") - { - if (Name == "csharp_field_options") - { - return new CSharpFieldOptions.Builder {PropertyName = "CSharpFieldOptions"}.Build(); - } - if (Name == "csharp_file_options") - { - return new CSharpFieldOptions.Builder {PropertyName = "CSharpFileOptions"}.Build(); - } - } - CSharpFieldOptions.Builder builder = CSharpFieldOptions.CreateBuilder(); - if (Proto.Options.HasExtension(DescriptorProtos.CSharpOptions.CSharpFieldOptions)) - { - builder.MergeFrom(Proto.Options.GetExtension(DescriptorProtos.CSharpOptions.CSharpFieldOptions)); - } - if (!builder.HasPropertyName) - { - string fieldName = FieldType == FieldType.Group ? MessageType.Name : Name; - string propertyName = NameHelpers.UnderscoresToPascalCase(fieldName); - if (propertyName == ContainingType.Name) - { - propertyName += "_"; - } - builder.PropertyName = propertyName; - } - return builder.Build(); - } - - /// - /// Maps a field type as included in the .proto file to a FieldType. - /// - private static FieldType GetFieldTypeFromProtoType(FieldDescriptorProto.Types.Type type) - { - switch (type) - { - case FieldDescriptorProto.Types.Type.TYPE_DOUBLE: - return FieldType.Double; - case FieldDescriptorProto.Types.Type.TYPE_FLOAT: - return FieldType.Float; - case FieldDescriptorProto.Types.Type.TYPE_INT64: - return FieldType.Int64; - case FieldDescriptorProto.Types.Type.TYPE_UINT64: - return FieldType.UInt64; - case FieldDescriptorProto.Types.Type.TYPE_INT32: - return FieldType.Int32; - case FieldDescriptorProto.Types.Type.TYPE_FIXED64: - return FieldType.Fixed64; - case FieldDescriptorProto.Types.Type.TYPE_FIXED32: - return FieldType.Fixed32; - case FieldDescriptorProto.Types.Type.TYPE_BOOL: - return FieldType.Bool; - case FieldDescriptorProto.Types.Type.TYPE_STRING: - return FieldType.String; - case FieldDescriptorProto.Types.Type.TYPE_GROUP: - return FieldType.Group; - case FieldDescriptorProto.Types.Type.TYPE_MESSAGE: - return FieldType.Message; - case FieldDescriptorProto.Types.Type.TYPE_BYTES: - return FieldType.Bytes; - case FieldDescriptorProto.Types.Type.TYPE_UINT32: - return FieldType.UInt32; - case FieldDescriptorProto.Types.Type.TYPE_ENUM: - return FieldType.Enum; - case FieldDescriptorProto.Types.Type.TYPE_SFIXED32: - return FieldType.SFixed32; - case FieldDescriptorProto.Types.Type.TYPE_SFIXED64: - return FieldType.SFixed64; - case FieldDescriptorProto.Types.Type.TYPE_SINT32: - return FieldType.SInt32; - case FieldDescriptorProto.Types.Type.TYPE_SINT64: - return FieldType.SInt64; - default: - throw new ArgumentException("Invalid type specified"); - } - } - - /// - /// Returns the default value for a mapped type. - /// - private static object GetDefaultValueForMappedType(MappedType type) - { - switch (type) - { - case MappedType.Int32: - return 0; - case MappedType.Int64: - return (long) 0; - case MappedType.UInt32: - return (uint) 0; - case MappedType.UInt64: - return (ulong) 0; - case MappedType.Single: - return (float) 0; - case MappedType.Double: - return (double) 0; - case MappedType.Boolean: - return false; - case MappedType.String: - return ""; - case MappedType.ByteString: - return ByteString.Empty; - case MappedType.Message: - return null; - case MappedType.Enum: - return null; - default: - throw new ArgumentException("Invalid type specified"); - } - } - - public bool IsRequired - { - get { return Proto.Label == FieldDescriptorProto.Types.Label.LABEL_REQUIRED; } - } - - public bool IsOptional - { - get { return Proto.Label == FieldDescriptorProto.Types.Label.LABEL_OPTIONAL; } - } - - public bool IsRepeated - { - get { return Proto.Label == FieldDescriptorProto.Types.Label.LABEL_REPEATED; } - } - - public bool IsPacked - { - get { return Proto.Options.Packed; } - } - - /// - /// Indicates whether or not the field had an explicitly-defined default value. - /// - public bool HasDefaultValue - { - get { return Proto.HasDefaultValue; } - } - - /// - /// The field's default value. Valid for all types except messages - /// and groups. For all other types, the object returned is of the - /// same class that would be returned by IMessage[this]. - /// For repeated fields this will always be an empty immutable list compatible with IList[object]. - /// For message fields it will always be null. For singular values, it will depend on the descriptor. - /// - public object DefaultValue - { - get - { - if (MappedType == MappedType.Message) - { - throw new InvalidOperationException( - "FieldDescriptor.DefaultValue called on an embedded message field."); - } - return defaultValue; - } - } - - /// - /// Indicates whether or not this field is an extension. - /// - public bool IsExtension - { - get { return Proto.HasExtendee; } - } - - /* - * Get the field's containing type. For extensions, this is the type being - * extended, not the location where the extension was defined. See - * {@link #getExtensionScope()}. - */ - - /// - /// Get the field's containing type. For extensions, this is the type being - /// extended, not the location where the extension was defined. See - /// . - /// - public MessageDescriptor ContainingType - { - get { return containingType; } - } - - /// - /// Returns the C#-specific options for this field descriptor. This will always be - /// completely filled in. - /// - public CSharpFieldOptions CSharpOptions - { - get - { - lock (optionsLock) - { - if (csharpFieldOptions == null) - { - csharpFieldOptions = BuildOrFakeCSharpOptions(); - } - } - return csharpFieldOptions; - } - } - - /// - /// For extensions defined nested within message types, gets - /// the outer type. Not valid for non-extension fields. - /// - /// - /// - /// message Foo { - /// extensions 1000 to max; - /// } - /// extend Foo { - /// optional int32 baz = 1234; - /// } - /// message Bar { - /// extend Foo { - /// optional int32 qux = 4321; - /// } - /// } - /// - /// The containing type for both baz and qux is Foo. - /// However, the extension scope for baz is null while - /// the extension scope for qux is Bar. - /// - public MessageDescriptor ExtensionScope - { - get - { - if (!IsExtension) - { - throw new InvalidOperationException("This field is not an extension."); - } - return extensionScope; - } - } - - public MappedType MappedType - { - get { return mappedType; } - } - - public FieldType FieldType - { - get { return fieldType; } - } - - public bool IsCLSCompliant - { - get - { - return mappedType != MappedType.UInt32 && - mappedType != MappedType.UInt64 && - !NameHelpers.UnderscoresToPascalCase(Name).StartsWith("_"); - } - } - - public int FieldNumber - { - get { return Proto.Number; } - } - - /// - /// Compares this descriptor with another one, ordering in "canonical" order - /// which simply means ascending order by field number. - /// must be a field of the same type, i.e. the of - /// both fields must be the same. - /// - public int CompareTo(FieldDescriptor other) - { - if (other.containingType != containingType) - { - throw new ArgumentException("FieldDescriptors can only be compared to other FieldDescriptors " + - "for fields of the same message type."); - } - return FieldNumber - other.FieldNumber; - } - - /// - /// Compares this descriptor with another one, ordering in "canonical" order - /// which simply means ascending order by field number. - /// must be a field of the same type, i.e. the of - /// both fields must be the same. - /// - public int CompareTo(IFieldDescriptorLite other) - { - return FieldNumber - other.FieldNumber; - } - - IEnumLiteMap IFieldDescriptorLite.EnumType - { - get { return EnumType; } - } - - bool IFieldDescriptorLite.MessageSetWireFormat - { - get { return ContainingType.Options.MessageSetWireFormat; } - } - - /// - /// For enum fields, returns the field's type. - /// - public EnumDescriptor EnumType - { - get - { - if (MappedType != MappedType.Enum) - { - throw new InvalidOperationException("EnumType is only valid for enum fields."); - } - return enumType; - } - } - - /// - /// For embedded message and group fields, returns the field's type. - /// - public MessageDescriptor MessageType - { - get - { - if (MappedType != MappedType.Message) - { - throw new InvalidOperationException("MessageType is only valid for enum fields."); - } - return messageType; - } - } - - /// - /// Immutable mapping from field type to mapped type. Built using the attributes on - /// FieldType values. - /// - public static readonly IDictionary FieldTypeToMappedTypeMap = MapFieldTypes(); - - private static IDictionary MapFieldTypes() - { - var map = new Dictionary(); - foreach (FieldInfo field in typeof(FieldType).GetFields(BindingFlags.Static | BindingFlags.Public)) - { - FieldType fieldType = (FieldType) field.GetValue(null); - FieldMappingAttribute mapping = - (FieldMappingAttribute) field.GetCustomAttributes(typeof(FieldMappingAttribute), false)[0]; - map[fieldType] = mapping.MappedType; - } - return Dictionaries.AsReadOnly(map); - } - - /// - /// Look up and cross-link all field types etc. - /// - internal void CrossLink() - { - if (Proto.HasExtendee) - { - IDescriptor extendee = File.DescriptorPool.LookupSymbol(Proto.Extendee, this); - if (!(extendee is MessageDescriptor)) - { - throw new DescriptorValidationException(this, "\"" + Proto.Extendee + "\" is not a message type."); - } - containingType = (MessageDescriptor) extendee; - - if (!containingType.IsExtensionNumber(FieldNumber)) - { - throw new DescriptorValidationException(this, - "\"" + containingType.FullName + "\" does not declare " + - FieldNumber + " as an extension number."); - } - } - - if (Proto.HasTypeName) - { - IDescriptor typeDescriptor = - File.DescriptorPool.LookupSymbol(Proto.TypeName, this); - - if (!Proto.HasType) - { - // Choose field type based on symbol. - if (typeDescriptor is MessageDescriptor) - { - fieldType = FieldType.Message; - mappedType = MappedType.Message; - } - else if (typeDescriptor is EnumDescriptor) - { - fieldType = FieldType.Enum; - mappedType = MappedType.Enum; - } - else - { - throw new DescriptorValidationException(this, "\"" + Proto.TypeName + "\" is not a type."); - } - } - - if (MappedType == MappedType.Message) - { - if (!(typeDescriptor is MessageDescriptor)) - { - throw new DescriptorValidationException(this, - "\"" + Proto.TypeName + "\" is not a message type."); - } - messageType = (MessageDescriptor) typeDescriptor; - - if (Proto.HasDefaultValue) - { - throw new DescriptorValidationException(this, "Messages can't have default values."); - } - } - else if (MappedType == Descriptors.MappedType.Enum) - { - if (!(typeDescriptor is EnumDescriptor)) - { - throw new DescriptorValidationException(this, "\"" + Proto.TypeName + "\" is not an enum type."); - } - enumType = (EnumDescriptor) typeDescriptor; - } - else - { - throw new DescriptorValidationException(this, "Field with primitive type has type_name."); - } - } - else - { - if (MappedType == MappedType.Message || MappedType == MappedType.Enum) - { - throw new DescriptorValidationException(this, "Field with message or enum type missing type_name."); - } - } - - // We don't attempt to parse the default value until here because for - // enums we need the enum type's descriptor. - if (Proto.HasDefaultValue) - { - if (IsRepeated) - { - throw new DescriptorValidationException(this, "Repeated fields cannot have default values."); - } - - try - { - switch (FieldType) - { - case FieldType.Int32: - case FieldType.SInt32: - case FieldType.SFixed32: - defaultValue = TextFormat.ParseInt32(Proto.DefaultValue); - break; - case FieldType.UInt32: - case FieldType.Fixed32: - defaultValue = TextFormat.ParseUInt32(Proto.DefaultValue); - break; - case FieldType.Int64: - case FieldType.SInt64: - case FieldType.SFixed64: - defaultValue = TextFormat.ParseInt64(Proto.DefaultValue); - break; - case FieldType.UInt64: - case FieldType.Fixed64: - defaultValue = TextFormat.ParseUInt64(Proto.DefaultValue); - break; - case FieldType.Float: - defaultValue = TextFormat.ParseFloat(Proto.DefaultValue); - break; - case FieldType.Double: - defaultValue = TextFormat.ParseDouble(Proto.DefaultValue); - break; - case FieldType.Bool: - if (Proto.DefaultValue == "true") - { - defaultValue = true; - } - else if (Proto.DefaultValue == "false") - { - defaultValue = false; - } - else - { - throw new FormatException("Boolean values must be \"true\" or \"false\""); - } - break; - case FieldType.String: - defaultValue = Proto.DefaultValue; - break; - case FieldType.Bytes: - try - { - defaultValue = TextFormat.UnescapeBytes(Proto.DefaultValue); - } - catch (FormatException e) - { - throw new DescriptorValidationException(this, - "Couldn't parse default value: " + e.Message); - } - break; - case FieldType.Enum: - defaultValue = enumType.FindValueByName(Proto.DefaultValue); - if (defaultValue == null) - { - throw new DescriptorValidationException(this, - "Unknown enum default value: \"" + - Proto.DefaultValue + "\""); - } - break; - case FieldType.Message: - case FieldType.Group: - throw new DescriptorValidationException(this, "Message type had default value."); - } - } - catch (FormatException e) - { - DescriptorValidationException validationException = - new DescriptorValidationException(this, - "Could not parse default value: \"" + Proto.DefaultValue + - "\"", e); - throw validationException; - } - } - else - { - // Determine the default default for this field. - if (IsRepeated) - { - defaultValue = Lists.Empty; - } - else - { - switch (MappedType) - { - case MappedType.Enum: - // We guarantee elsewhere that an enum type always has at least - // one possible value. - defaultValue = enumType.Values[0]; - break; - case MappedType.Message: - defaultValue = null; - break; - default: - defaultValue = GetDefaultValueForMappedType(MappedType); - break; - } - } - } - - if (!IsExtension) - { - File.DescriptorPool.AddFieldByNumber(this); - } - - if (containingType != null && containingType.Options.MessageSetWireFormat) - { - if (IsExtension) - { - if (!IsOptional || FieldType != FieldType.Message) - { - throw new DescriptorValidationException(this, - "Extensions of MessageSets must be optional messages."); - } - } - else - { - throw new DescriptorValidationException(this, "MessageSets cannot have fields, only extensions."); - } - } - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/Descriptors/FieldMappingAttribute.cs b/src/ProtocolBuffers/Descriptors/FieldMappingAttribute.cs deleted file mode 100644 index fc58d04..0000000 --- a/src/ProtocolBuffers/Descriptors/FieldMappingAttribute.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -using System; -using System.Collections.Generic; -using System.Reflection; -using Google.ProtocolBuffers.Collections; - -namespace Google.ProtocolBuffers.Descriptors -{ - /// - /// Defined specifically for the enumeration, - /// this allows each field type to specify the mapped type and wire type. - /// - [CLSCompliant(false)] - [AttributeUsage(AttributeTargets.Field)] - public sealed class FieldMappingAttribute : Attribute - { - public FieldMappingAttribute(MappedType mappedType, WireFormat.WireType wireType) - { - MappedType = mappedType; - WireType = wireType; - } - - public MappedType MappedType { get; private set; } - public WireFormat.WireType WireType { get; private set; } - - - /// - /// Immutable mapping from field type to mapped type. Built using the attributes on - /// FieldType values. - /// - private static readonly IDictionary FieldTypeToMappedTypeMap = MapFieldTypes(); - - private static IDictionary MapFieldTypes() - { - var map = new Dictionary(); - foreach (FieldInfo field in typeof(FieldType).GetFields(BindingFlags.Static | BindingFlags.Public)) - { - FieldType fieldType = (FieldType) field.GetValue(null); - FieldMappingAttribute mapping = - (FieldMappingAttribute) field.GetCustomAttributes(typeof(FieldMappingAttribute), false)[0]; - map[fieldType] = mapping; - } - return Dictionaries.AsReadOnly(map); - } - - internal static MappedType MappedTypeFromFieldType(FieldType type) - { - return FieldTypeToMappedTypeMap[type].MappedType; - } - - internal static WireFormat.WireType WireTypeFromFieldType(FieldType type, bool packed) - { - return packed ? WireFormat.WireType.LengthDelimited : FieldTypeToMappedTypeMap[type].WireType; - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/Descriptors/FieldType.cs b/src/ProtocolBuffers/Descriptors/FieldType.cs deleted file mode 100644 index 056d3d4..0000000 --- a/src/ProtocolBuffers/Descriptors/FieldType.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -namespace Google.ProtocolBuffers.Descriptors -{ - /// - /// Enumeration of all the possible field types. The odd formatting is to make it very clear - /// which attribute applies to which value, while maintaining a compact format. - /// - public enum FieldType - { - [FieldMapping(MappedType.Double, WireFormat.WireType.Fixed64)] Double, - [FieldMapping(MappedType.Single, WireFormat.WireType.Fixed32)] Float, - [FieldMapping(MappedType.Int64, WireFormat.WireType.Varint)] Int64, - [FieldMapping(MappedType.UInt64, WireFormat.WireType.Varint)] UInt64, - [FieldMapping(MappedType.Int32, WireFormat.WireType.Varint)] Int32, - [FieldMapping(MappedType.UInt64, WireFormat.WireType.Fixed64)] Fixed64, - [FieldMapping(MappedType.UInt32, WireFormat.WireType.Fixed32)] Fixed32, - [FieldMapping(MappedType.Boolean, WireFormat.WireType.Varint)] Bool, - [FieldMapping(MappedType.String, WireFormat.WireType.LengthDelimited)] String, - [FieldMapping(MappedType.Message, WireFormat.WireType.StartGroup)] Group, - [FieldMapping(MappedType.Message, WireFormat.WireType.LengthDelimited)] Message, - [FieldMapping(MappedType.ByteString, WireFormat.WireType.LengthDelimited)] Bytes, - [FieldMapping(MappedType.UInt32, WireFormat.WireType.Varint)] UInt32, - [FieldMapping(MappedType.Int32, WireFormat.WireType.Fixed32)] SFixed32, - [FieldMapping(MappedType.Int64, WireFormat.WireType.Fixed64)] SFixed64, - [FieldMapping(MappedType.Int32, WireFormat.WireType.Varint)] SInt32, - [FieldMapping(MappedType.Int64, WireFormat.WireType.Varint)] SInt64, - [FieldMapping(MappedType.Enum, WireFormat.WireType.Varint)] Enum - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/Descriptors/FileDescriptor.cs b/src/ProtocolBuffers/Descriptors/FileDescriptor.cs deleted file mode 100644 index d7075e3..0000000 --- a/src/ProtocolBuffers/Descriptors/FileDescriptor.cs +++ /dev/null @@ -1,498 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.IO; -using Google.ProtocolBuffers.DescriptorProtos; -using FileOptions = Google.ProtocolBuffers.DescriptorProtos.FileOptions; - -namespace Google.ProtocolBuffers.Descriptors -{ - /// - /// Describes a .proto file, including everything defined within. - /// IDescriptor is implemented such that the File property returns this descriptor, - /// and the FullName is the same as the Name. - /// - public sealed class FileDescriptor : IDescriptor - { - private FileDescriptorProto proto; - private readonly IList messageTypes; - private readonly IList enumTypes; - private readonly IList services; - private readonly IList extensions; - private readonly IList dependencies; - private readonly DescriptorPool pool; - private CSharpFileOptions csharpFileOptions; - private readonly object optionsLock = new object(); - - private FileDescriptor(FileDescriptorProto proto, FileDescriptor[] dependencies, DescriptorPool pool) - { - this.pool = pool; - this.proto = proto; - this.dependencies = new ReadOnlyCollection((FileDescriptor[]) dependencies.Clone()); - - pool.AddPackage(Package, this); - - messageTypes = DescriptorUtil.ConvertAndMakeReadOnly(proto.MessageTypeList, - (message, index) => - new MessageDescriptor(message, this, null, index)); - - enumTypes = DescriptorUtil.ConvertAndMakeReadOnly(proto.EnumTypeList, - (enumType, index) => - new EnumDescriptor(enumType, this, null, index)); - - services = DescriptorUtil.ConvertAndMakeReadOnly(proto.ServiceList, - (service, index) => - new ServiceDescriptor(service, this, index)); - - extensions = DescriptorUtil.ConvertAndMakeReadOnly(proto.ExtensionList, - (field, index) => - new FieldDescriptor(field, this, null, index, true)); - } - - - /// - /// Allows a file descriptor to be configured with a set of external options, e.g. from the - /// command-line arguments to protogen. - /// - public void ConfigureWithDefaultOptions(CSharpFileOptions options) - { - csharpFileOptions = BuildOrFakeWithDefaultOptions(options); - } - - static readonly char[] PathSeperators = new char[] { '/', '\\' }; - private CSharpFileOptions BuildOrFakeWithDefaultOptions(CSharpFileOptions defaultOptions) - { - // Fix for being able to relocate these files to any directory structure - if (proto.Package == "google.protobuf") - { - int ixslash = proto.Name.LastIndexOfAny(PathSeperators); - string filename = ixslash < 0 ? proto.Name : proto.Name.Substring(ixslash + 1); - // TODO(jonskeet): Check if we could use FileDescriptorProto.Descriptor.Name - interesting bootstrap issues) - if (filename == "descriptor.proto") - { - return new CSharpFileOptions.Builder - { - Namespace = "Google.ProtocolBuffers.DescriptorProtos", - UmbrellaClassname = "DescriptorProtoFile", - NestClasses = false, - MultipleFiles = false, - PublicClasses = true, - OutputDirectory = defaultOptions.OutputDirectory, - IgnoreGoogleProtobuf = defaultOptions.IgnoreGoogleProtobuf - }.Build(); - } - if (filename == "csharp_options.proto") - { - return new CSharpFileOptions.Builder - { - Namespace = "Google.ProtocolBuffers.DescriptorProtos", - UmbrellaClassname = "CSharpOptions", - NestClasses = false, - MultipleFiles = false, - PublicClasses = true, - OutputDirectory = defaultOptions.OutputDirectory, - IgnoreGoogleProtobuf = defaultOptions.IgnoreGoogleProtobuf - }.Build(); - } - } - CSharpFileOptions.Builder builder = defaultOptions.ToBuilder(); - if (proto.Options.HasExtension(DescriptorProtos.CSharpOptions.CSharpFileOptions)) - { - builder.MergeFrom(proto.Options.GetExtension(DescriptorProtos.CSharpOptions.CSharpFileOptions)); - } - if (!builder.HasNamespace) - { - builder.Namespace = Package; - } - if (!builder.HasUmbrellaClassname) - { - int lastSlash = Name.LastIndexOf('/'); - string baseName = Name.Substring(lastSlash + 1); - builder.UmbrellaClassname = NameHelpers.UnderscoresToPascalCase(NameHelpers.StripProto(baseName)); - } - - // Auto-fix for name collision by placing umbrella class into a new namespace. This - // still won't fix the collisions with nesting enabled; however, you have to turn that on explicitly anyway. - if (!builder.NestClasses && !builder.HasUmbrellaNamespace) - { - bool collision = false; - foreach (IDescriptor d in MessageTypes) - { - collision |= d.Name == builder.UmbrellaClassname; - } - foreach (IDescriptor d in Services) - { - collision |= d.Name == builder.UmbrellaClassname; - } - foreach (IDescriptor d in EnumTypes) - { - collision |= d.Name == builder.UmbrellaClassname; - } - if (collision) - { - builder.UmbrellaNamespace = "Proto"; - } - } - - return builder.Build(); - } - - /// - /// The descriptor in its protocol message representation. - /// - public FileDescriptorProto Proto - { - get { return proto; } - } - - /// - /// The defined in descriptor.proto. - /// - public FileOptions Options - { - get { return proto.Options; } - } - - /// - /// Returns the C#-specific options for this file descriptor. This will always be - /// completely filled in. - /// - public CSharpFileOptions CSharpOptions - { - get - { - lock (optionsLock) - { - if (csharpFileOptions == null) - { - csharpFileOptions = BuildOrFakeWithDefaultOptions(CSharpFileOptions.DefaultInstance); - } - } - return csharpFileOptions; - } - } - - /// - /// The file name. - /// - public string Name - { - get { return proto.Name; } - } - - /// - /// The package as declared in the .proto file. This may or may not - /// be equivalent to the .NET namespace of the generated classes. - /// - public string Package - { - get { return proto.Package; } - } - - /// - /// Unmodifiable list of top-level message types declared in this file. - /// - public IList MessageTypes - { - get { return messageTypes; } - } - - /// - /// Unmodifiable list of top-level enum types declared in this file. - /// - public IList EnumTypes - { - get { return enumTypes; } - } - - /// - /// Unmodifiable list of top-level services declared in this file. - /// - public IList Services - { - get { return services; } - } - - /// - /// Unmodifiable list of top-level extensions declared in this file. - /// - public IList Extensions - { - get { return extensions; } - } - - /// - /// Unmodifiable list of this file's dependencies (imports). - /// - public IList Dependencies - { - get { return dependencies; } - } - - /// - /// Implementation of IDescriptor.FullName - just returns the same as Name. - /// - string IDescriptor.FullName - { - get { return Name; } - } - - /// - /// Implementation of IDescriptor.File - just returns this descriptor. - /// - FileDescriptor IDescriptor.File - { - get { return this; } - } - - /// - /// Protocol buffer describing this descriptor. - /// - IMessage IDescriptor.Proto - { - get { return Proto; } - } - - /// - /// Pool containing symbol descriptors. - /// - internal DescriptorPool DescriptorPool - { - get { return pool; } - } - - /// - /// Finds a type (message, enum, service or extension) in the file by name. Does not find nested types. - /// - /// The unqualified type name to look for. - /// The type of descriptor to look for (or ITypeDescriptor for any) - /// The type's descriptor, or null if not found. - public T FindTypeByName(String name) - where T : class, IDescriptor - { - // Don't allow looking up nested types. This will make optimization - // easier later. - if (name.IndexOf('.') != -1) - { - return null; - } - if (Package.Length > 0) - { - name = Package + "." + name; - } - T result = pool.FindSymbol(name); - if (result != null && result.File == this) - { - return result; - } - return null; - } - - /// - /// Builds a FileDescriptor from its protocol buffer representation. - /// - /// The protocol message form of the FileDescriptor. - /// FileDescriptors corresponding to all of the - /// file's dependencies, in the exact order listed in the .proto file. May be null, - /// in which case it is treated as an empty array. - /// If is not - /// a valid descriptor. This can occur for a number of reasons, such as a field - /// having an undefined type or because two messages were defined with the same name. - public static FileDescriptor BuildFrom(FileDescriptorProto proto, FileDescriptor[] dependencies) - { - // Building descriptors involves two steps: translating and linking. - // In the translation step (implemented by FileDescriptor's - // constructor), we build an object tree mirroring the - // FileDescriptorProto's tree and put all of the descriptors into the - // DescriptorPool's lookup tables. In the linking step, we look up all - // type references in the DescriptorPool, so that, for example, a - // FieldDescriptor for an embedded message contains a pointer directly - // to the Descriptor for that message's type. We also detect undefined - // types in the linking step. - if (dependencies == null) - { - dependencies = new FileDescriptor[0]; - } - - DescriptorPool pool = new DescriptorPool(dependencies); - FileDescriptor result = new FileDescriptor(proto, dependencies, pool); - - if (dependencies.Length != proto.DependencyCount) - { - throw new DescriptorValidationException(result, - "Dependencies passed to FileDescriptor.BuildFrom() don't match " + - "those listed in the FileDescriptorProto."); - } - for (int i = 0; i < proto.DependencyCount; i++) - { - if (dependencies[i].Name != proto.DependencyList[i]) - { - throw new DescriptorValidationException(result, - "Dependencies passed to FileDescriptor.BuildFrom() don't match " + - "those listed in the FileDescriptorProto."); - } - } - - result.CrossLink(); - return result; - } - - private void CrossLink() - { - foreach (MessageDescriptor message in messageTypes) - { - message.CrossLink(); - } - - foreach (ServiceDescriptor service in services) - { - service.CrossLink(); - } - - foreach (FieldDescriptor extension in extensions) - { - extension.CrossLink(); - } - - foreach (MessageDescriptor message in messageTypes) - { - message.CheckRequiredFields(); - } - } - - /// - /// This method is to be called by generated code only. It is equivalent - /// to BuildFrom except that the FileDescriptorProto is encoded in - /// protocol buffer wire format. This overload is maintained for backward - /// compatibility with source code generated before the custom options were available - /// (and working). - /// - public static FileDescriptor InternalBuildGeneratedFileFrom(byte[] descriptorData, FileDescriptor[] dependencies) - { - return InternalBuildGeneratedFileFrom(descriptorData, dependencies, x => null); - } - - /// - /// This delegate should be used by generated code only. When calling - /// FileDescriptor.InternalBuildGeneratedFileFrom, the caller can provide - /// a callback which assigns the global variables defined in the generated code - /// which point at parts of the FileDescriptor. The callback returns an - /// Extension Registry which contains any extensions which might be used in - /// the descriptor - that is, extensions of the various "Options" messages defined - /// in descriptor.proto. The callback may also return null to indicate that - /// no extensions are used in the descriptor. - /// - /// - /// - public delegate ExtensionRegistry InternalDescriptorAssigner(FileDescriptor descriptor); - - public static FileDescriptor InternalBuildGeneratedFileFrom(byte[] descriptorData, - FileDescriptor[] dependencies, - InternalDescriptorAssigner descriptorAssigner) - { - FileDescriptorProto proto; - try - { - proto = FileDescriptorProto.ParseFrom(descriptorData); - } - catch (InvalidProtocolBufferException e) - { - throw new ArgumentException("Failed to parse protocol buffer descriptor for generated code.", e); - } - - FileDescriptor result; - try - { - result = BuildFrom(proto, dependencies); - } - catch (DescriptorValidationException e) - { - throw new ArgumentException("Invalid embedded descriptor for \"" + proto.Name + "\".", e); - } - - ExtensionRegistry registry = descriptorAssigner(result); - - if (registry != null) - { - // We must re-parse the proto using the registry. - try - { - proto = FileDescriptorProto.ParseFrom(descriptorData, registry); - } - catch (InvalidProtocolBufferException e) - { - throw new ArgumentException("Failed to parse protocol buffer descriptor for generated code.", e); - } - - result.ReplaceProto(proto); - } - return result; - } - - /// - /// Replace our FileDescriptorProto with the given one, which is - /// identical except that it might contain extensions that weren't present - /// in the original. This method is needed for bootstrapping when a file - /// defines custom options. The options may be defined in the file itself, - /// so we can't actually parse them until we've constructed the descriptors, - /// but to construct the decsriptors we have to have parsed the descriptor - /// protos. So, we have to parse the descriptor protos a second time after - /// constructing the descriptors. - /// - private void ReplaceProto(FileDescriptorProto newProto) - { - proto = newProto; - - for (int i = 0; i < messageTypes.Count; i++) - { - messageTypes[i].ReplaceProto(proto.GetMessageType(i)); - } - - for (int i = 0; i < enumTypes.Count; i++) - { - enumTypes[i].ReplaceProto(proto.GetEnumType(i)); - } - - for (int i = 0; i < services.Count; i++) - { - services[i].ReplaceProto(proto.GetService(i)); - } - - for (int i = 0; i < extensions.Count; i++) - { - extensions[i].ReplaceProto(proto.GetExtension(i)); - } - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/Descriptors/IDescriptor.cs b/src/ProtocolBuffers/Descriptors/IDescriptor.cs deleted file mode 100644 index 899c156..0000000 --- a/src/ProtocolBuffers/Descriptors/IDescriptor.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -namespace Google.ProtocolBuffers.Descriptors -{ - /// - /// The non-generic form of the IDescriptor interface. Useful for describing a general - /// descriptor. - /// - public interface IDescriptor - { - string Name { get; } - string FullName { get; } - FileDescriptor File { get; } - IMessage Proto { get; } - } - - /// - /// Strongly-typed form of the IDescriptor interface. - /// - /// Protocol buffer type underlying this descriptor type - public interface IDescriptor : IDescriptor where TProto : IMessage - { - new TProto Proto { get; } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/Descriptors/IndexedDescriptorBase.cs b/src/ProtocolBuffers/Descriptors/IndexedDescriptorBase.cs deleted file mode 100644 index bdb4eb8..0000000 --- a/src/ProtocolBuffers/Descriptors/IndexedDescriptorBase.cs +++ /dev/null @@ -1,64 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -using Google.ProtocolBuffers.DescriptorProtos; - -namespace Google.ProtocolBuffers.Descriptors -{ - /// - /// Base class for descriptors which are also indexed. This is all of them other than - /// . - /// - public abstract class IndexedDescriptorBase : DescriptorBase - where TProto : IMessage, IDescriptorProto - { - private readonly int index; - - protected IndexedDescriptorBase(TProto proto, FileDescriptor file, string fullName, int index) - : base(proto, file, fullName) - { - this.index = index; - } - - /// - /// The index of this descriptor within its parent descriptor. - /// - /// - /// This returns the index of this descriptor within its parent, for - /// this descriptor's type. (There can be duplicate values for different - /// types, e.g. one enum type with index 0 and one message type with index 0.) - /// - public int Index - { - get { return index; } - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/Descriptors/MappedType.cs b/src/ProtocolBuffers/Descriptors/MappedType.cs deleted file mode 100644 index 0a55530..0000000 --- a/src/ProtocolBuffers/Descriptors/MappedType.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -namespace Google.ProtocolBuffers.Descriptors -{ - /// - /// Type as it's mapped onto a .NET type. - /// - public enum MappedType - { - Int32, - Int64, - UInt32, - UInt64, - Single, - Double, - Boolean, - String, - ByteString, - Message, - Enum - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/Descriptors/MessageDescriptor.cs b/src/ProtocolBuffers/Descriptors/MessageDescriptor.cs deleted file mode 100644 index d438c0f..0000000 --- a/src/ProtocolBuffers/Descriptors/MessageDescriptor.cs +++ /dev/null @@ -1,288 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -using System; -using System.Collections.Generic; -using Google.ProtocolBuffers.DescriptorProtos; - -namespace Google.ProtocolBuffers.Descriptors -{ - /// - /// Describes a message type. - /// - public sealed class MessageDescriptor : IndexedDescriptorBase - { - private readonly MessageDescriptor containingType; - private readonly IList nestedTypes; - private readonly IList enumTypes; - private readonly IList fields; - private readonly IList extensions; - private bool hasRequiredFields; - - internal MessageDescriptor(DescriptorProto proto, FileDescriptor file, MessageDescriptor parent, int typeIndex) - : base(proto, file, ComputeFullName(file, parent, proto.Name), typeIndex) - { - containingType = parent; - - nestedTypes = DescriptorUtil.ConvertAndMakeReadOnly(proto.NestedTypeList, - (type, index) => - new MessageDescriptor(type, file, this, index)); - - enumTypes = DescriptorUtil.ConvertAndMakeReadOnly(proto.EnumTypeList, - (type, index) => - new EnumDescriptor(type, file, this, index)); - - // TODO(jonskeet): Sort fields first? - fields = DescriptorUtil.ConvertAndMakeReadOnly(proto.FieldList, - (field, index) => - new FieldDescriptor(field, file, this, index, false)); - - extensions = DescriptorUtil.ConvertAndMakeReadOnly(proto.ExtensionList, - (field, index) => - new FieldDescriptor(field, file, this, index, true)); - - file.DescriptorPool.AddSymbol(this); - } - - /// - /// If this is a nested type, get the outer descriptor, otherwise null. - /// - public MessageDescriptor ContainingType - { - get { return containingType; } - } - - /// - /// An unmodifiable list of this message type's fields. - /// - public IList Fields - { - get { return fields; } - } - - /// - /// An unmodifiable list of this message type's extensions. - /// - public IList Extensions - { - get { return extensions; } - } - - /// - /// An unmodifiable list of this message type's nested types. - /// - public IList NestedTypes - { - get { return nestedTypes; } - } - - /// - /// An unmodifiable list of this message type's enum types. - /// - public IList EnumTypes - { - get { return enumTypes; } - } - - /// - /// Returns a pre-computed result as to whether this message - /// has required fields. This includes optional fields which are - /// message types which in turn have required fields, and any - /// extension fields. - /// - internal bool HasRequiredFields - { - get { return hasRequiredFields; } - } - - /// - /// Determines if the given field number is an extension. - /// - public bool IsExtensionNumber(int number) - { - foreach (DescriptorProto.Types.ExtensionRange range in Proto.ExtensionRangeList) - { - if (range.Start <= number && number < range.End) - { - return true; - } - } - return false; - } - - /// - /// Finds a field by field name. - /// - /// The unqualified name of the field (e.g. "foo"). - /// The field's descriptor, or null if not found. - public FieldDescriptor FindFieldByName(String name) - { - return File.DescriptorPool.FindSymbol(FullName + "." + name); - } - - /// - /// Finds a field by field number. - /// - /// The field number within this message type. - /// The field's descriptor, or null if not found. - public FieldDescriptor FindFieldByNumber(int number) - { - return File.DescriptorPool.FindFieldByNumber(this, number); - } - - /// - /// Finds a field by its property name, as it would be generated by protogen. - /// - /// The property name within this message type. - /// The field's descriptor, or null if not found. - public FieldDescriptor FindFieldByPropertyName(string propertyName) - { - // For reasonably short messages, this will be more efficient than a dictionary - // lookup. It also means we don't need to do things lazily with locks etc. - foreach (FieldDescriptor field in Fields) - { - if (field.CSharpOptions.PropertyName == propertyName) - { - return field; - } - } - return null; - } - - /// - /// Finds a nested descriptor by name. The is valid for fields, nested - /// message types and enums. - /// - /// The unqualified name of the descriptor, e.g. "Foo" - /// The descriptor, or null if not found. - public T FindDescriptor(string name) - where T : class, IDescriptor - { - return File.DescriptorPool.FindSymbol(FullName + "." + name); - } - - /// - /// Looks up and cross-links all fields, nested types, and extensions. - /// - internal void CrossLink() - { - foreach (MessageDescriptor message in nestedTypes) - { - message.CrossLink(); - } - - foreach (FieldDescriptor field in fields) - { - field.CrossLink(); - } - - foreach (FieldDescriptor extension in extensions) - { - extension.CrossLink(); - } - } - - internal void CheckRequiredFields() - { - IDictionary alreadySeen = new Dictionary(); - hasRequiredFields = CheckRequiredFields(alreadySeen); - } - - private bool CheckRequiredFields(IDictionary alreadySeen) - { - if (alreadySeen.ContainsKey(this)) - { - // The type is already in the cache. This means that either: - // a. The type has no required fields. - // b. We are in the midst of checking if the type has required fields, - // somewhere up the stack. In this case, we know that if the type - // has any required fields, they'll be found when we return to it, - // and the whole call to HasRequiredFields() will return true. - // Therefore, we don't have to check if this type has required fields - // here. - return false; - } - alreadySeen[this] = 0; // Value is irrelevant; we want set semantics - - // If the type allows extensions, an extension with message type could contain - // required fields, so we have to be conservative and assume such an - // extension exists. - if (Proto.ExtensionRangeCount != 0) - { - return true; - } - - foreach (FieldDescriptor field in Fields) - { - if (field.IsRequired) - { - return true; - } - if (field.MappedType == MappedType.Message) - { - if (field.MessageType.CheckRequiredFields(alreadySeen)) - { - return true; - } - } - } - return false; - } - - /// - /// See FileDescriptor.ReplaceProto - /// - internal override void ReplaceProto(DescriptorProto newProto) - { - base.ReplaceProto(newProto); - - for (int i = 0; i < nestedTypes.Count; i++) - { - nestedTypes[i].ReplaceProto(newProto.GetNestedType(i)); - } - - for (int i = 0; i < enumTypes.Count; i++) - { - enumTypes[i].ReplaceProto(newProto.GetEnumType(i)); - } - - for (int i = 0; i < fields.Count; i++) - { - fields[i].ReplaceProto(newProto.GetField(i)); - } - - for (int i = 0; i < extensions.Count; i++) - { - extensions[i].ReplaceProto(newProto.GetExtension(i)); - } - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/Descriptors/MethodDescriptor.cs b/src/ProtocolBuffers/Descriptors/MethodDescriptor.cs deleted file mode 100644 index f9ede24..0000000 --- a/src/ProtocolBuffers/Descriptors/MethodDescriptor.cs +++ /dev/null @@ -1,94 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -using Google.ProtocolBuffers.DescriptorProtos; - -namespace Google.ProtocolBuffers.Descriptors -{ - /// - /// Describes a single method in a service. - /// - public sealed class MethodDescriptor : IndexedDescriptorBase - { - private readonly ServiceDescriptor service; - private MessageDescriptor inputType; - private MessageDescriptor outputType; - - /// - /// The service this method belongs to. - /// - public ServiceDescriptor Service - { - get { return service; } - } - - /// - /// The method's input type. - /// - public MessageDescriptor InputType - { - get { return inputType; } - } - - /// - /// The method's input type. - /// - public MessageDescriptor OutputType - { - get { return outputType; } - } - - internal MethodDescriptor(MethodDescriptorProto proto, FileDescriptor file, - ServiceDescriptor parent, int index) - : base(proto, file, parent.FullName + "." + proto.Name, index) - { - service = parent; - file.DescriptorPool.AddSymbol(this); - } - - internal void CrossLink() - { - IDescriptor lookup = File.DescriptorPool.LookupSymbol(Proto.InputType, this); - if (!(lookup is MessageDescriptor)) - { - throw new DescriptorValidationException(this, "\"" + Proto.InputType + "\" is not a message type."); - } - inputType = (MessageDescriptor) lookup; - - lookup = File.DescriptorPool.LookupSymbol(Proto.OutputType, this); - if (!(lookup is MessageDescriptor)) - { - throw new DescriptorValidationException(this, "\"" + Proto.OutputType + "\" is not a message type."); - } - outputType = (MessageDescriptor) lookup; - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/Descriptors/PackageDescriptor.cs b/src/ProtocolBuffers/Descriptors/PackageDescriptor.cs deleted file mode 100644 index 02549f9..0000000 --- a/src/ProtocolBuffers/Descriptors/PackageDescriptor.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -namespace Google.ProtocolBuffers.Descriptors -{ - /// - /// Represents a package in the symbol table. We use PackageDescriptors - /// just as placeholders so that someone cannot define, say, a message type - /// that has the same name as an existing package. - /// - internal sealed class PackageDescriptor : IDescriptor - { - private readonly string name; - private readonly string fullName; - private readonly FileDescriptor file; - - internal PackageDescriptor(string name, string fullName, FileDescriptor file) - { - this.file = file; - this.fullName = fullName; - this.name = name; - } - - public IMessage Proto - { - get { return file.Proto; } - } - - public string Name - { - get { return name; } - } - - public string FullName - { - get { return fullName; } - } - - public FileDescriptor File - { - get { return file; } - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/Descriptors/ServiceDescriptor.cs b/src/ProtocolBuffers/Descriptors/ServiceDescriptor.cs deleted file mode 100644 index 417c083..0000000 --- a/src/ProtocolBuffers/Descriptors/ServiceDescriptor.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -using System; -using System.Collections.Generic; -using Google.ProtocolBuffers.DescriptorProtos; - -namespace Google.ProtocolBuffers.Descriptors -{ - /// - /// Describes a service type. - /// - public sealed class ServiceDescriptor : IndexedDescriptorBase - { - private readonly IList methods; - - public ServiceDescriptor(ServiceDescriptorProto proto, FileDescriptor file, int index) - : base(proto, file, ComputeFullName(file, null, proto.Name), index) - { - methods = DescriptorUtil.ConvertAndMakeReadOnly(proto.MethodList, - (method, i) => new MethodDescriptor(method, file, this, i)); - - file.DescriptorPool.AddSymbol(this); - } - - /// - /// An unmodifiable list of methods in this service. - /// - public IList Methods - { - get { return methods; } - } - - /// - /// Finds a method by name. - /// - /// The unqualified name of the method (e.g. "Foo"). - /// The method's decsriptor, or null if not found. - public MethodDescriptor FindMethodByName(String name) - { - return File.DescriptorPool.FindSymbol(FullName + "." + name); - } - - internal void CrossLink() - { - foreach (MethodDescriptor method in methods) - { - method.CrossLink(); - } - } - - internal override void ReplaceProto(ServiceDescriptorProto newProto) - { - base.ReplaceProto(newProto); - for (int i = 0; i < methods.Count; i++) - { - methods[i].ReplaceProto(newProto.GetMethod(i)); - } - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/DynamicMessage.cs b/src/ProtocolBuffers/DynamicMessage.cs deleted file mode 100644 index e39efb1..0000000 --- a/src/ProtocolBuffers/DynamicMessage.cs +++ /dev/null @@ -1,512 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using System.IO; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers -{ - /// - /// An implementation of IMessage that can represent arbitrary types, given a MessageaDescriptor. - /// - public sealed partial class DynamicMessage : AbstractMessage - { - private readonly MessageDescriptor type; - private readonly FieldSet fields; - private readonly UnknownFieldSet unknownFields; - private int memoizedSize = -1; - - /// - /// Creates a DynamicMessage with the given FieldSet. - /// - /// - /// - /// - private DynamicMessage(MessageDescriptor type, FieldSet fields, UnknownFieldSet unknownFields) - { - this.type = type; - this.fields = fields; - this.unknownFields = unknownFields; - } - - /// - /// Returns a DynamicMessage representing the default instance of the given type. - /// - /// - /// - public static DynamicMessage GetDefaultInstance(MessageDescriptor type) - { - return new DynamicMessage(type, FieldSet.DefaultInstance, UnknownFieldSet.DefaultInstance); - } - - /// - /// Parses a message of the given type from the given stream. - /// - public static DynamicMessage ParseFrom(MessageDescriptor type, ICodedInputStream input) - { - Builder builder = CreateBuilder(type); - Builder dynamicBuilder = builder.MergeFrom(input); - return dynamicBuilder.BuildParsed(); - } - - /// - /// Parse a message of the given type from the given stream and extension registry. - /// - /// - /// - /// - /// - public static DynamicMessage ParseFrom(MessageDescriptor type, ICodedInputStream input, - ExtensionRegistry extensionRegistry) - { - Builder builder = CreateBuilder(type); - Builder dynamicBuilder = builder.MergeFrom(input, extensionRegistry); - return dynamicBuilder.BuildParsed(); - } - - /// - /// Parses a message of the given type from the given stream. - /// - public static DynamicMessage ParseFrom(MessageDescriptor type, Stream input) - { - Builder builder = CreateBuilder(type); - Builder dynamicBuilder = builder.MergeFrom(input); - return dynamicBuilder.BuildParsed(); - } - - /// - /// Parse a message of the given type from the given stream and extension registry. - /// - /// - /// - /// - /// - public static DynamicMessage ParseFrom(MessageDescriptor type, Stream input, ExtensionRegistry extensionRegistry) - { - Builder builder = CreateBuilder(type); - Builder dynamicBuilder = builder.MergeFrom(input, extensionRegistry); - return dynamicBuilder.BuildParsed(); - } - - /// - /// Parse as a message of the given type and return it. - /// - public static DynamicMessage ParseFrom(MessageDescriptor type, ByteString data) - { - Builder builder = CreateBuilder(type); - Builder dynamicBuilder = builder.MergeFrom(data); - return dynamicBuilder.BuildParsed(); - } - - /// - /// Parse as a message of the given type and return it. - /// - public static DynamicMessage ParseFrom(MessageDescriptor type, ByteString data, - ExtensionRegistry extensionRegistry) - { - Builder builder = CreateBuilder(type); - Builder dynamicBuilder = builder.MergeFrom(data, extensionRegistry); - return dynamicBuilder.BuildParsed(); - } - - /// - /// Parse as a message of the given type and return it. - /// - public static DynamicMessage ParseFrom(MessageDescriptor type, byte[] data) - { - Builder builder = CreateBuilder(type); - Builder dynamicBuilder = builder.MergeFrom(data); - return dynamicBuilder.BuildParsed(); - } - - /// - /// Parse as a message of the given type and return it. - /// - public static DynamicMessage ParseFrom(MessageDescriptor type, byte[] data, ExtensionRegistry extensionRegistry) - { - Builder builder = CreateBuilder(type); - Builder dynamicBuilder = builder.MergeFrom(data, extensionRegistry); - return dynamicBuilder.BuildParsed(); - } - - /// - /// Constructs a builder for the given type. - /// - public static Builder CreateBuilder(MessageDescriptor type) - { - return new Builder(type); - } - - /// - /// Constructs a builder for a message of the same type as , - /// and initializes it with the same contents. - /// - /// - /// - public static Builder CreateBuilder(IMessage prototype) - { - return new Builder(prototype.DescriptorForType).MergeFrom(prototype); - } - - // ----------------------------------------------------------------- - // Implementation of IMessage interface. - - public override MessageDescriptor DescriptorForType - { - get { return type; } - } - - public override DynamicMessage DefaultInstanceForType - { - get { return GetDefaultInstance(type); } - } - - public override IDictionary AllFields - { - get { return fields.AllFieldDescriptors; } - } - - public override bool HasField(FieldDescriptor field) - { - VerifyContainingType(field); - return fields.HasField(field); - } - - public override object this[FieldDescriptor field] - { - get - { - VerifyContainingType(field); - object result = fields[field]; - if (result == null) - { - result = GetDefaultInstance(field.MessageType); - } - return result; - } - } - - public override int GetRepeatedFieldCount(FieldDescriptor field) - { - VerifyContainingType(field); - return fields.GetRepeatedFieldCount(field); - } - - public override object this[FieldDescriptor field, int index] - { - get - { - VerifyContainingType(field); - return fields[field, index]; - } - } - - public override UnknownFieldSet UnknownFields - { - get { return unknownFields; } - } - - public bool Initialized - { - get { return fields.IsInitializedWithRespectTo(type.Fields); } - } - - public override void WriteTo(ICodedOutputStream output) - { - fields.WriteTo(output); - if (type.Options.MessageSetWireFormat) - { - unknownFields.WriteAsMessageSetTo(output); - } - else - { - unknownFields.WriteTo(output); - } - } - - public override int SerializedSize - { - get - { - int size = memoizedSize; - if (size != -1) - { - return size; - } - - size = fields.SerializedSize; - if (type.Options.MessageSetWireFormat) - { - size += unknownFields.SerializedSizeAsMessageSet; - } - else - { - size += unknownFields.SerializedSize; - } - - memoizedSize = size; - return size; - } - } - - public override Builder CreateBuilderForType() - { - return new Builder(type); - } - - public override Builder ToBuilder() - { - return CreateBuilderForType().MergeFrom(this); - } - - /// - /// Verifies that the field is a field of this message. - /// - private void VerifyContainingType(FieldDescriptor field) - { - if (field.ContainingType != type) - { - throw new ArgumentException("FieldDescriptor does not match message type."); - } - } - - /// - /// Builder for dynamic messages. Instances are created with DynamicMessage.CreateBuilder. - /// - public sealed partial class Builder : AbstractBuilder - { - private readonly MessageDescriptor type; - private FieldSet fields; - private UnknownFieldSet unknownFields; - - internal Builder(MessageDescriptor type) - { - this.type = type; - this.fields = FieldSet.CreateInstance(); - this.unknownFields = UnknownFieldSet.DefaultInstance; - } - - protected override Builder ThisBuilder - { - get { return this; } - } - - public override Builder Clear() - { - fields.Clear(); - return this; - } - - public override Builder MergeFrom(IMessage other) - { - if (other.DescriptorForType != type) - { - throw new ArgumentException("MergeFrom(IMessage) can only merge messages of the same type."); - } - fields.MergeFrom(other); - MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(DynamicMessage other) - { - IMessage downcast = other; - return MergeFrom(downcast); - } - - public override DynamicMessage Build() - { - if (fields != null && !IsInitialized) - { - throw new UninitializedMessageException(new DynamicMessage(type, fields, unknownFields)); - } - return BuildPartial(); - } - - /// - /// Helper for DynamicMessage.ParseFrom() methods to call. Throws - /// InvalidProtocolBufferException - /// - /// - internal DynamicMessage BuildParsed() - { - if (!IsInitialized) - { - throw new UninitializedMessageException(new DynamicMessage(type, fields, unknownFields)). - AsInvalidProtocolBufferException(); - } - return BuildPartial(); - } - - public override DynamicMessage BuildPartial() - { - if (fields == null) - { - throw new InvalidOperationException("Build() has already been called on this Builder."); - } - fields.MakeImmutable(); - DynamicMessage result = new DynamicMessage(type, fields, unknownFields); - fields = null; - unknownFields = null; - return result; - } - - public override Builder Clone() - { - Builder result = new Builder(type); - result.fields.MergeFrom(fields); - return result; - } - - public override bool IsInitialized - { - get { return fields.IsInitializedWithRespectTo(type.Fields); } - } - - public override Builder MergeFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry) - { - UnknownFieldSet.Builder unknownFieldsBuilder = UnknownFieldSet.CreateBuilder(unknownFields); - unknownFieldsBuilder.MergeFrom(input, extensionRegistry, this); - unknownFields = unknownFieldsBuilder.Build(); - return this; - } - - public override MessageDescriptor DescriptorForType - { - get { return type; } - } - - public override DynamicMessage DefaultInstanceForType - { - get { return GetDefaultInstance(type); } - } - - public override IDictionary AllFields - { - get { return fields.AllFieldDescriptors; } - } - - public override IBuilder CreateBuilderForField(FieldDescriptor field) - { - VerifyContainingType(field); - if (field.MappedType != MappedType.Message) - { - throw new ArgumentException("CreateBuilderForField is only valid for fields with message type."); - } - return new Builder(field.MessageType); - } - - public override bool HasField(FieldDescriptor field) - { - VerifyContainingType(field); - return fields.HasField(field); - } - - public override object this[FieldDescriptor field, int index] - { - get - { - VerifyContainingType(field); - return fields[field, index]; - } - set - { - VerifyContainingType(field); - fields[field, index] = value; - } - } - - public override object this[FieldDescriptor field] - { - get - { - VerifyContainingType(field); - object result = fields[field]; - if (result == null) - { - result = GetDefaultInstance(field.MessageType); - } - return result; - } - set - { - VerifyContainingType(field); - fields[field] = value; - } - } - - public override Builder ClearField(FieldDescriptor field) - { - VerifyContainingType(field); - fields.ClearField(field); - return this; - } - - public override int GetRepeatedFieldCount(FieldDescriptor field) - { - VerifyContainingType(field); - return fields.GetRepeatedFieldCount(field); - } - - public override Builder AddRepeatedField(FieldDescriptor field, object value) - { - VerifyContainingType(field); - fields.AddRepeatedField(field, value); - return this; - } - - public override UnknownFieldSet UnknownFields - { - get { return unknownFields; } - set { unknownFields = value; } - } - - /// - /// Verifies that the field is a field of this message. - /// - /// - private void VerifyContainingType(FieldDescriptor field) - { - if (field.ContainingType != type) - { - throw new ArgumentException("FieldDescriptor does not match message type."); - } - } - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/EnumLite.cs b/src/ProtocolBuffers/EnumLite.cs deleted file mode 100644 index 1301ec2..0000000 --- a/src/ProtocolBuffers/EnumLite.cs +++ /dev/null @@ -1,234 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; - -namespace Google.ProtocolBuffers -{ - /// - ///Interface for an enum value or value descriptor, to be used in FieldSet. - ///The lite library stores enum values directly in FieldSets but the full - ///library stores EnumValueDescriptors in order to better support reflection. - /// - public interface IEnumLite - { - int Number { get; } - string Name { get; } - } - - /// - ///Interface for an object which maps integers to {@link EnumLite}s. - ///{@link Descriptors.EnumDescriptor} implements this interface by mapping - ///numbers to {@link Descriptors.EnumValueDescriptor}s. Additionally, - ///every generated enum type has a static method internalGetValueMap() which - ///returns an implementation of this type that maps numbers to enum values. - /// - public interface IEnumLiteMap : IEnumLiteMap - where T : IEnumLite - { - new T FindValueByNumber(int number); - } - - public interface IEnumLiteMap - { - bool IsValidValue(IEnumLite value); - IEnumLite FindValueByNumber(int number); - IEnumLite FindValueByName(string name); - } - - public class EnumLiteMap : IEnumLiteMap - where TEnum : struct, IComparable, IFormattable - { - private struct EnumValue : IEnumLite - { - private readonly TEnum value; - - public EnumValue(TEnum value) - { - this.value = value; - } - - int IEnumLite.Number - { - get { return Convert.ToInt32(value); } - } - - string IEnumLite.Name - { - get { return value.ToString(); } - } - } - - public IEnumLite FindValueByNumber(int number) - { - TEnum val = default(TEnum); - if (EnumParser.TryConvert(number, ref val)) - { - return new EnumValue(val); - } - return null; - } - - public IEnumLite FindValueByName(string name) - { - TEnum val = default(TEnum); - if (EnumParser.TryConvert(name, ref val)) - { - return new EnumValue(val); - } - return null; - } - - public bool IsValidValue(IEnumLite value) - { - TEnum val = default(TEnum); - return EnumParser.TryConvert(value.Number, ref val); - } - } - - public static class EnumParser where T : struct, IComparable, IFormattable - { - private static readonly Dictionary _byNumber; - private static Dictionary _byName; - - static EnumParser() - { - int[] array; - try - { -#if CLIENTPROFILE - // It will actually be a T[], but the CLR will let us convert. - array = (int[])Enum.GetValues(typeof(T)); -#else - var temp = new List(); - foreach (var fld in typeof (T).GetFields(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static)) - { - if (fld.IsLiteral && fld.FieldType == typeof(T)) - { - temp.Add((T)fld.GetValue(null)); - } - } - array = (int[])(object)temp.ToArray(); -#endif - } - catch - { - _byNumber = null; - return; - } - - _byNumber = new Dictionary(array.Length); - foreach (int i in array) - { - _byNumber[i] = (T)(object)i; - } - } - - public static bool TryConvert(object input, ref T value) - { - if (input is int || input is T) - { - return TryConvert((int)input, ref value); - } - if (input is string) - { - return TryConvert((string)input, ref value); - } - return false; - } - - /// - /// Tries to convert an integer to its enum representation. This would take an out parameter, - /// but the caller uses ref, so this approach is simpler. - /// - public static bool TryConvert(int number, ref T value) - { - // null indicates an exception at construction, use native IsDefined. - if (_byNumber == null) - { - return Enum.IsDefined(typeof(T), number); - } - T converted; - if (_byNumber != null && _byNumber.TryGetValue(number, out converted)) - { - value = converted; - return true; - } - - return false; - } - - /// - /// Tries to convert a string to its enum representation. This would take an out parameter, - /// but the caller uses ref, so this approach is simpler. - /// - public static bool TryConvert(string name, ref T value) - { - // null indicates an exception at construction, use native IsDefined/Parse. - if (_byNumber == null) - { - if (Enum.IsDefined(typeof(T), name)) - { - value = (T)Enum.Parse(typeof(T), name, false); - return true; - } - return false; - } - - // known race, possible multiple threads each build their own copy; however, last writer will win - var map = _byName; - if (map == null) - { - map = new Dictionary(StringComparer.Ordinal); - foreach (var possible in _byNumber.Values) - { - map[possible.ToString()] = possible; - } - _byName = map; - } - - T converted; - if (map.TryGetValue(name, out converted)) - { - value = converted; - return true; - } - - return false; - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/ExtendableBuilder.cs b/src/ProtocolBuffers/ExtendableBuilder.cs deleted file mode 100644 index 111ff57..0000000 --- a/src/ProtocolBuffers/ExtendableBuilder.cs +++ /dev/null @@ -1,213 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers -{ - public abstract partial class ExtendableBuilder : GeneratedBuilder - where TMessage : ExtendableMessage - where TBuilder : GeneratedBuilder, new() - { - protected ExtendableBuilder() - { - } - - /// - /// Checks if a singular extension is present - /// - public bool HasExtension(GeneratedExtensionBase extension) - { - return MessageBeingBuilt.HasExtension(extension); - } - - /// - /// Returns the number of elements in a repeated extension. - /// - public int GetExtensionCount(GeneratedExtensionBase> extension) - { - return MessageBeingBuilt.GetExtensionCount(extension); - } - - /// - /// Returns the value of an extension. - /// - public TExtension GetExtension(GeneratedExtensionBase extension) - { - return MessageBeingBuilt.GetExtension(extension); - } - - /// - /// Returns one element of a repeated extension. - /// - public TExtension GetExtension(GeneratedExtensionBase> extension, int index) - { - return MessageBeingBuilt.GetExtension(extension, index); - } - - /// - /// Sets the value of an extension. - /// - public TBuilder SetExtension(GeneratedExtensionBase extension, TExtension value) - { - ExtendableMessage message = MessageBeingBuilt; - message.VerifyExtensionContainingType(extension); - message.Extensions[extension.Descriptor] = extension.ToReflectionType(value); - return ThisBuilder; - } - - /// - /// Sets the value of one element of a repeated extension. - /// - public TBuilder SetExtension(GeneratedExtensionBase> extension, int index, - TExtension value) - { - ExtendableMessage message = MessageBeingBuilt; - message.VerifyExtensionContainingType(extension); - message.Extensions[extension.Descriptor, index] = extension.SingularToReflectionType(value); - return ThisBuilder; - } - - /// - /// Appends a value to a repeated extension. - /// - public TBuilder AddExtension(GeneratedExtensionBase> extension, TExtension value) - { - ExtendableMessage message = MessageBeingBuilt; - message.VerifyExtensionContainingType(extension); - message.Extensions.AddRepeatedField(extension.Descriptor, extension.SingularToReflectionType(value)); - return ThisBuilder; - } - - /// - /// Clears an extension. - /// - public TBuilder ClearExtension(GeneratedExtensionBase extension) - { - ExtendableMessage message = MessageBeingBuilt; - message.VerifyExtensionContainingType(extension); - message.Extensions.ClearField(extension.Descriptor); - return ThisBuilder; - } - - /// - /// Called by subclasses to parse an unknown field or an extension. - /// - /// true unless the tag is an end-group tag - [CLSCompliant(false)] - protected override bool ParseUnknownField(ICodedInputStream input, UnknownFieldSet.Builder unknownFields, - ExtensionRegistry extensionRegistry, uint tag, string fieldName) - { - return unknownFields.MergeFieldFrom(input, extensionRegistry, this, tag, fieldName); - } - - // --------------------------------------------------------------- - // Reflection - - - public override object this[FieldDescriptor field, int index] - { - set - { - if (field.IsExtension) - { - ExtendableMessage message = MessageBeingBuilt; - message.VerifyContainingType(field); - message.Extensions[field, index] = value; - } - else - { - base[field, index] = value; - } - } - } - - - public override object this[FieldDescriptor field] - { - set - { - if (field.IsExtension) - { - ExtendableMessage message = MessageBeingBuilt; - message.VerifyContainingType(field); - message.Extensions[field] = value; - } - else - { - base[field] = value; - } - } - } - - public override TBuilder ClearField(FieldDescriptor field) - { - if (field.IsExtension) - { - ExtendableMessage message = MessageBeingBuilt; - message.VerifyContainingType(field); - message.Extensions.ClearField(field); - return ThisBuilder; - } - else - { - return base.ClearField(field); - } - } - - public override TBuilder AddRepeatedField(FieldDescriptor field, object value) - { - if (field.IsExtension) - { - ExtendableMessage message = MessageBeingBuilt; - message.VerifyContainingType(field); - message.Extensions.AddRepeatedField(field, value); - return ThisBuilder; - } - else - { - return base.AddRepeatedField(field, value); - } - } - - protected void MergeExtensionFields(ExtendableMessage other) - { - MessageBeingBuilt.Extensions.MergeFrom(other.Extensions); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/ExtendableBuilderLite.cs b/src/ProtocolBuffers/ExtendableBuilderLite.cs deleted file mode 100644 index 2a71aa4..0000000 --- a/src/ProtocolBuffers/ExtendableBuilderLite.cs +++ /dev/null @@ -1,346 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers -{ - public abstract partial class ExtendableBuilderLite : GeneratedBuilderLite - where TMessage : ExtendableMessageLite - where TBuilder : GeneratedBuilderLite - { - protected ExtendableBuilderLite() - { - } - - /// - /// Checks if a singular extension is present - /// - public bool HasExtension(GeneratedExtensionLite extension) - { - return MessageBeingBuilt.HasExtension(extension); - } - - /// - /// Returns the number of elements in a repeated extension. - /// - public int GetExtensionCount(GeneratedExtensionLite> extension) - { - return MessageBeingBuilt.GetExtensionCount(extension); - } - - /// - /// Returns the value of an extension. - /// - public TExtension GetExtension(GeneratedExtensionLite extension) - { - return MessageBeingBuilt.GetExtension(extension); - } - - /// - /// Returns one element of a repeated extension. - /// - public TExtension GetExtension(GeneratedExtensionLite> extension, - int index) - { - return MessageBeingBuilt.GetExtension(extension, index); - } - - /// - /// Sets the value of an extension. - /// - public TBuilder SetExtension(GeneratedExtensionLite extension, - TExtension value) - { - ExtendableMessageLite message = MessageBeingBuilt; - message.VerifyExtensionContainingType(extension); - message.Extensions[extension.Descriptor] = extension.ToReflectionType(value); - return ThisBuilder; - } - - /// - /// Sets the value of one element of a repeated extension. - /// - public TBuilder SetExtension(GeneratedExtensionLite> extension, - int index, TExtension value) - { - ExtendableMessageLite message = MessageBeingBuilt; - message.VerifyExtensionContainingType(extension); - message.Extensions[extension.Descriptor, index] = extension.SingularToReflectionType(value); - return ThisBuilder; - } - - /// - /// Appends a value to a repeated extension. - /// - public TBuilder AddExtension(GeneratedExtensionLite> extension, - TExtension value) - { - ExtendableMessageLite message = MessageBeingBuilt; - message.VerifyExtensionContainingType(extension); - message.Extensions.AddRepeatedField(extension.Descriptor, extension.SingularToReflectionType(value)); - return ThisBuilder; - } - - /// - /// Clears an extension. - /// - public TBuilder ClearExtension(GeneratedExtensionLite extension) - { - ExtendableMessageLite message = MessageBeingBuilt; - message.VerifyExtensionContainingType(extension); - message.Extensions.ClearField(extension.Descriptor); - return ThisBuilder; - } - - /// - /// Called by subclasses to parse an unknown field or an extension. - /// - /// true unless the tag is an end-group tag - [CLSCompliant(false)] - protected override bool ParseUnknownField(ICodedInputStream input, - ExtensionRegistry extensionRegistry, uint tag, string fieldName) - { - FieldSet extensions = MessageBeingBuilt.Extensions; - - WireFormat.WireType wireType = WireFormat.GetTagWireType(tag); - int fieldNumber = WireFormat.GetTagFieldNumber(tag); - IGeneratedExtensionLite extension = extensionRegistry[DefaultInstanceForType, fieldNumber]; - - if (extension == null) //unknown field - { - return input.SkipField(); - } - - IFieldDescriptorLite field = extension.Descriptor; - - - // Unknown field or wrong wire type. Skip. - if (field == null) - { - return input.SkipField(); - } - WireFormat.WireType expectedType = field.IsPacked - ? WireFormat.WireType.LengthDelimited - : WireFormat.GetWireType(field.FieldType); - if (wireType != expectedType) - { - expectedType = WireFormat.GetWireType(field.FieldType); - if (wireType == expectedType) - { - //Allowed as of 2.3, this is unpacked data for a packed array - } - else if (field.IsRepeated && wireType == WireFormat.WireType.LengthDelimited && - (expectedType == WireFormat.WireType.Varint || expectedType == WireFormat.WireType.Fixed32 || - expectedType == WireFormat.WireType.Fixed64)) - { - //Allowed as of 2.3, this is packed data for an unpacked array - } - else - { - return input.SkipField(); - } - } - if (!field.IsRepeated && wireType != WireFormat.GetWireType(field.FieldType)) //invalid wire type - { - return input.SkipField(); - } - - switch (field.FieldType) - { - case FieldType.Group: - case FieldType.Message: - { - if (!field.IsRepeated) - { - IMessageLite message = extensions[extension.Descriptor] as IMessageLite; - IBuilderLite subBuilder = (message ?? extension.MessageDefaultInstance).WeakToBuilder(); - - if (field.FieldType == FieldType.Group) - { - input.ReadGroup(field.FieldNumber, subBuilder, extensionRegistry); - } - else - { - input.ReadMessage(subBuilder, extensionRegistry); - } - - extensions[field] = subBuilder.WeakBuild(); - } - else - { - List list = new List(); - if (field.FieldType == FieldType.Group) - { - input.ReadGroupArray(tag, fieldName, list, extension.MessageDefaultInstance, - extensionRegistry); - } - else - { - input.ReadMessageArray(tag, fieldName, list, extension.MessageDefaultInstance, - extensionRegistry); - } - - foreach (IMessageLite m in list) - { - extensions.AddRepeatedField(field, m); - } - return true; - } - break; - } - case FieldType.Enum: - { - if (!field.IsRepeated) - { - object unknown; - IEnumLite value = null; - if (input.ReadEnum(ref value, out unknown, field.EnumType)) - { - extensions[field] = value; - } - } - else - { - ICollection unknown; - List list = new List(); - input.ReadEnumArray(tag, fieldName, list, out unknown, field.EnumType); - - foreach (IEnumLite en in list) - { - extensions.AddRepeatedField(field, en); - } - } - break; - } - default: - { - if (!field.IsRepeated) - { - object value = null; - if (input.ReadPrimitiveField(field.FieldType, ref value)) - { - extensions[field] = value; - } - } - else - { - List list = new List(); - input.ReadPrimitiveArray(field.FieldType, tag, fieldName, list); - foreach (object oval in list) - { - extensions.AddRepeatedField(field, oval); - } - } - break; - } - } - - return true; - } - - #region Reflection - - public object this[IFieldDescriptorLite field, int index] - { - set - { - if (field.IsExtension) - { - ExtendableMessageLite message = MessageBeingBuilt; - message.Extensions[field, index] = value; - } - else - { - throw new NotSupportedException("Not supported in the lite runtime."); - } - } - } - - public object this[IFieldDescriptorLite field] - { - set - { - if (field.IsExtension) - { - ExtendableMessageLite message = MessageBeingBuilt; - message.Extensions[field] = value; - } - else - { - throw new NotSupportedException("Not supported in the lite runtime."); - } - } - } - - public TBuilder ClearField(IFieldDescriptorLite field) - { - if (field.IsExtension) - { - ExtendableMessageLite message = MessageBeingBuilt; - message.Extensions.ClearField(field); - return ThisBuilder; - } - else - { - throw new NotSupportedException("Not supported in the lite runtime."); - } - } - - public TBuilder AddRepeatedField(IFieldDescriptorLite field, object value) - { - if (field.IsExtension) - { - ExtendableMessageLite message = MessageBeingBuilt; - message.Extensions.AddRepeatedField(field, value); - return ThisBuilder; - } - else - { - throw new NotSupportedException("Not supported in the lite runtime."); - } - } - - protected void MergeExtensionFields(ExtendableMessageLite other) - { - MessageBeingBuilt.Extensions.MergeFrom(other.Extensions); - } - - #endregion - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/ExtendableMessage.cs b/src/ProtocolBuffers/ExtendableMessage.cs deleted file mode 100644 index 71cd1b3..0000000 --- a/src/ProtocolBuffers/ExtendableMessage.cs +++ /dev/null @@ -1,274 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using Google.ProtocolBuffers.Collections; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers -{ - public abstract partial class ExtendableMessage : GeneratedMessage - where TMessage : GeneratedMessage - where TBuilder : GeneratedBuilder, new() - { - protected ExtendableMessage() - { - } - - private readonly FieldSet extensions = FieldSet.CreateInstance(); - - /// - /// Access for the builder. - /// - internal FieldSet Extensions - { - get { return extensions; } - } - - /// - /// Checks if a singular extension is present. - /// - public bool HasExtension(GeneratedExtensionBase extension) - { - return extensions.HasField(extension.Descriptor); - } - - /// - /// Returns the number of elements in a repeated extension. - /// - public int GetExtensionCount(GeneratedExtensionBase> extension) - { - return extensions.GetRepeatedFieldCount(extension.Descriptor); - } - - /// - /// Returns the value of an extension. - /// - public TExtension GetExtension(GeneratedExtensionBase extension) - { - object value = extensions[extension.Descriptor]; - if (value == null) - { - return (TExtension) extension.MessageDefaultInstance; - } - else - { - return (TExtension) extension.FromReflectionType(value); - } - } - - /// - /// Returns one element of a repeated extension. - /// - public TExtension GetExtension(GeneratedExtensionBase> extension, int index) - { - return (TExtension) extension.SingularFromReflectionType(extensions[extension.Descriptor, index]); - } - - /// - /// Called to check if all extensions are initialized. - /// - protected bool ExtensionsAreInitialized - { - get { return extensions.IsInitialized; } - } - - public override bool IsInitialized - { - get { return base.IsInitialized && ExtensionsAreInitialized; } - } - - #region Reflection - - public override IDictionary AllFields - { - get - { - IDictionary result = GetMutableFieldMap(); - foreach (KeyValuePair entry in extensions.AllFields) - { - result[(FieldDescriptor) entry.Key] = entry.Value; - } - return Dictionaries.AsReadOnly(result); - } - } - - public override bool HasField(FieldDescriptor field) - { - if (field.IsExtension) - { - VerifyContainingType(field); - return extensions.HasField(field); - } - else - { - return base.HasField(field); - } - } - - public override object this[FieldDescriptor field] - { - get - { - if (field.IsExtension) - { - VerifyContainingType(field); - object value = extensions[field]; - if (value == null) - { - // Lacking an ExtensionRegistry, we have no way to determine the - // extension's real type, so we return a DynamicMessage. - // TODO(jonskeet): Work out what this means - return DynamicMessage.GetDefaultInstance(field.MessageType); - } - else - { - return value; - } - } - else - { - return base[field]; - } - } - } - - public override int GetRepeatedFieldCount(FieldDescriptor field) - { - if (field.IsExtension) - { - VerifyContainingType(field); - return extensions.GetRepeatedFieldCount(field); - } - else - { - return base.GetRepeatedFieldCount(field); - } - } - - public override object this[FieldDescriptor field, int index] - { - get - { - if (field.IsExtension) - { - VerifyContainingType(field); - return extensions[field, index]; - } - else - { - return base[field, index]; - } - } - } - - internal void VerifyContainingType(FieldDescriptor field) - { - if (field.ContainingType != DescriptorForType) - { - throw new ArgumentException("FieldDescriptor does not match message type."); - } - } - - #endregion - - /// - /// Used by subclasses to serialize extensions. Extension ranges may be - /// interleaves with field numbers, but we must write them in canonical - /// (sorted by field number) order. This class helps us to write individual - /// ranges of extensions at once. - /// - /// TODO(jonskeet): See if we can improve this in terms of readability. - /// - protected class ExtensionWriter - { - private readonly IEnumerator> iterator; - private readonly FieldSet extensions; - private KeyValuePair? next = null; - - internal ExtensionWriter(ExtendableMessage message) - { - extensions = message.extensions; - iterator = message.extensions.GetEnumerator(); - if (iterator.MoveNext()) - { - next = iterator.Current; - } - } - - public void WriteUntil(int end, ICodedOutputStream output) - { - while (next != null && next.Value.Key.FieldNumber < end) - { - extensions.WriteField(next.Value.Key, next.Value.Value, output); - if (iterator.MoveNext()) - { - next = iterator.Current; - } - else - { - next = null; - } - } - } - } - - protected ExtensionWriter CreateExtensionWriter(ExtendableMessage message) - { - return new ExtensionWriter(message); - } - - /// - /// Called by subclasses to compute the size of extensions. - /// - protected int ExtensionsSerializedSize - { - get { return extensions.SerializedSize; } - } - - internal void VerifyExtensionContainingType(GeneratedExtensionBase extension) - { - if (extension.Descriptor.ContainingType != DescriptorForType) - { - // This can only happen if someone uses unchecked operations. - throw new ArgumentException("Extension is for type \"" + extension.Descriptor.ContainingType.FullName - + "\" which does not match message type \"" + DescriptorForType.FullName + - "\"."); - } - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/ExtendableMessageLite.cs b/src/ProtocolBuffers/ExtendableMessageLite.cs deleted file mode 100644 index e682475..0000000 --- a/src/ProtocolBuffers/ExtendableMessageLite.cs +++ /dev/null @@ -1,221 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using Google.ProtocolBuffers.Collections; - -namespace Google.ProtocolBuffers -{ - public abstract partial class ExtendableMessageLite : GeneratedMessageLite - where TMessage : GeneratedMessageLite - where TBuilder : GeneratedBuilderLite - { - protected ExtendableMessageLite() - { - } - - private readonly FieldSet extensions = FieldSet.CreateInstance(); - - /// - /// Access for the builder. - /// - internal FieldSet Extensions - { - get { return extensions; } - } - - public override bool Equals(object obj) - { - ExtendableMessageLite other = obj as ExtendableMessageLite; - return !ReferenceEquals(null, other) && - Dictionaries.Equals(extensions.AllFields, other.extensions.AllFields); - } - - public override int GetHashCode() - { - return Dictionaries.GetHashCode(extensions.AllFields); - } - - /// - /// writes the extensions to the text stream - /// - public override void PrintTo(TextWriter writer) - { - foreach (KeyValuePair entry in extensions.AllFields) - { - string fn = string.Format("[{0}]", entry.Key.FullName); - if (entry.Key.IsRepeated) - { - foreach (object o in ((IEnumerable) entry.Value)) - { - PrintField(fn, true, o, writer); - } - } - else - { - PrintField(fn, true, entry.Value, writer); - } - } - } - - /// - /// Checks if a singular extension is present. - /// - public bool HasExtension(GeneratedExtensionLite extension) - { - VerifyExtensionContainingType(extension); - return extensions.HasField(extension.Descriptor); - } - - /// - /// Returns the number of elements in a repeated extension. - /// - public int GetExtensionCount(GeneratedExtensionLite> extension) - { - VerifyExtensionContainingType(extension); - return extensions.GetRepeatedFieldCount(extension.Descriptor); - } - - /// - /// Returns the value of an extension. - /// - public TExtension GetExtension(GeneratedExtensionLite extension) - { - VerifyExtensionContainingType(extension); - object value = extensions[extension.Descriptor]; - if (value == null) - { - return extension.DefaultValue; - } - else - { - return (TExtension) extension.FromReflectionType(value); - } - } - - /// - /// Returns one element of a repeated extension. - /// - public TExtension GetExtension(GeneratedExtensionLite> extension, - int index) - { - VerifyExtensionContainingType(extension); - return (TExtension) extension.SingularFromReflectionType(extensions[extension.Descriptor, index]); - } - - /// - /// Called to check if all extensions are initialized. - /// - protected bool ExtensionsAreInitialized - { - get { return extensions.IsInitialized; } - } - - public override bool IsInitialized - { - get { return ExtensionsAreInitialized; } - } - - /// - /// Used by subclasses to serialize extensions. Extension ranges may be - /// interleaves with field numbers, but we must write them in canonical - /// (sorted by field number) order. This class helps us to write individual - /// ranges of extensions at once. - /// - /// TODO(jonskeet): See if we can improve this in terms of readability. - /// - protected class ExtensionWriter - { - private readonly IEnumerator> iterator; - private readonly FieldSet extensions; - private KeyValuePair? next = null; - - internal ExtensionWriter(ExtendableMessageLite message) - { - extensions = message.extensions; - iterator = message.extensions.GetEnumerator(); - if (iterator.MoveNext()) - { - next = iterator.Current; - } - } - - public void WriteUntil(int end, ICodedOutputStream output) - { - while (next != null && next.Value.Key.FieldNumber < end) - { - extensions.WriteField(next.Value.Key, next.Value.Value, output); - if (iterator.MoveNext()) - { - next = iterator.Current; - } - else - { - next = null; - } - } - } - } - - protected ExtensionWriter CreateExtensionWriter(ExtendableMessageLite message) - { - return new ExtensionWriter(message); - } - - /// - /// Called by subclasses to compute the size of extensions. - /// - protected int ExtensionsSerializedSize - { - get { return extensions.SerializedSize; } - } - - internal void VerifyExtensionContainingType(GeneratedExtensionLite extension) - { - if (!ReferenceEquals(extension.ContainingTypeDefaultInstance, DefaultInstanceForType)) - { - // This can only happen if someone uses unchecked operations. - throw new ArgumentException( - String.Format("Extension is for type \"{0}\" which does not match message type \"{1}\".", - extension.ContainingTypeDefaultInstance, DefaultInstanceForType - )); - } - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/ExtensionInfo.cs b/src/ProtocolBuffers/ExtensionInfo.cs deleted file mode 100644 index 4f11d3b..0000000 --- a/src/ProtocolBuffers/ExtensionInfo.cs +++ /dev/null @@ -1,88 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers -{ - public sealed class ExtensionInfo : IGeneratedExtensionLite - { - /// - /// The extension's descriptor - /// - public FieldDescriptor Descriptor { get; private set; } - - IFieldDescriptorLite IGeneratedExtensionLite.Descriptor - { - get { return Descriptor; } - } - - /// - /// A default instance of the extensions's type, if it has a message type, - /// or null otherwise. - /// - public IMessageLite DefaultInstance { get; private set; } - - internal ExtensionInfo(FieldDescriptor descriptor) : this(descriptor, null) - { - } - - internal ExtensionInfo(FieldDescriptor descriptor, IMessageLite defaultInstance) - { - Descriptor = descriptor; - DefaultInstance = defaultInstance; - } - - #region IGeneratedExtensionLite Members - - int IGeneratedExtensionLite.Number - { - get { return Descriptor.FieldNumber; } - } - - object IGeneratedExtensionLite.ContainingType - { - get { return Descriptor.ContainingType; } - } - - IMessageLite IGeneratedExtensionLite.MessageDefaultInstance - { - get { return DefaultInstance; } - } - - #endregion - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/ExtensionRegistry.cs b/src/ProtocolBuffers/ExtensionRegistry.cs deleted file mode 100644 index 7c9467b..0000000 --- a/src/ProtocolBuffers/ExtensionRegistry.cs +++ /dev/null @@ -1,215 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers -{ - /// - /// A table of known extensions, searchable by name or field number. When - /// parsing a protocol message that might have extensions, you must provide - /// an in which you have registered any extensions - /// that you want to be able to parse. Otherwise, those extensions will just - /// be treated like unknown fields. - /// - /// - /// For example, if you had the .proto file: - /// - /// option java_class = "MyProto"; - /// - /// message Foo { - /// extensions 1000 to max; - /// } - /// - /// extend Foo { - /// optional int32 bar; - /// } - /// - /// - /// Then you might write code like: - /// - /// - /// ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); - /// registry.Add(MyProto.Bar); - /// MyProto.Foo message = MyProto.Foo.ParseFrom(input, registry); - /// - /// - /// - /// - /// You might wonder why this is necessary. Two alternatives might come to - /// mind. First, you might imagine a system where generated extensions are - /// automatically registered when their containing classes are loaded. This - /// is a popular technique, but is bad design; among other things, it creates a - /// situation where behavior can change depending on what classes happen to be - /// loaded. It also introduces a security vulnerability, because an - /// unprivileged class could cause its code to be called unexpectedly from a - /// privileged class by registering itself as an extension of the right type. - /// - /// Another option you might consider is lazy parsing: do not parse an - /// extension until it is first requested, at which point the caller must - /// provide a type to use. This introduces a different set of problems. First, - /// it would require a mutex lock any time an extension was accessed, which - /// would be slow. Second, corrupt data would not be detected until first - /// access, at which point it would be much harder to deal with it. Third, it - /// could violate the expectation that message objects are immutable, since the - /// type provided could be any arbitrary message class. An unprivileged user - /// could take advantage of this to inject a mutable object into a message - /// belonging to privileged code and create mischief. - /// - public sealed partial class ExtensionRegistry - { - /// - /// Finds an extension by fully-qualified field name, in the - /// proto namespace, i.e. result.Descriptor.FullName will match - /// if a match is found. A null - /// reference is returned if the extension can't be found. - /// - [Obsolete("Please use the FindByName method instead.", true)] - public ExtensionInfo this[string fullName] - { - get - { - foreach (IGeneratedExtensionLite ext in extensionsByNumber.Values) - { - if (StringComparer.Ordinal.Equals(ext.Descriptor.FullName, fullName)) - { - return ext as ExtensionInfo; - } - } - return null; - } - } - -#if !LITE - /// - /// Finds an extension by containing type and field number. - /// A null reference is returned if the extension can't be found. - /// - public ExtensionInfo this[MessageDescriptor containingType, int fieldNumber] - { - get - { - IGeneratedExtensionLite ret; - extensionsByNumber.TryGetValue(new ExtensionIntPair(containingType, fieldNumber), out ret); - return ret as ExtensionInfo; - } - } - - public ExtensionInfo FindByName(MessageDescriptor containingType, string fieldName) - { - return FindExtensionByName(containingType, fieldName) as ExtensionInfo; - } -#endif - - /// - /// Add an extension from a generated file to the registry. - /// - public void Add(GeneratedExtensionBase extension) - { - if (extension.Descriptor.MappedType == MappedType.Message) - { - Add(new ExtensionInfo(extension.Descriptor, extension.MessageDefaultInstance)); - } - else - { - Add(new ExtensionInfo(extension.Descriptor, null)); - } - } - - /// - /// Adds a non-message-type extension to the registry by descriptor. - /// - /// - public void Add(FieldDescriptor type) - { - if (type.MappedType == MappedType.Message) - { - throw new ArgumentException("ExtensionRegistry.Add() must be provided a default instance " - + "when adding an embedded message extension."); - } - Add(new ExtensionInfo(type, null)); - } - - /// - /// Adds a message-type-extension to the registry by descriptor. - /// - /// - /// - public void Add(FieldDescriptor type, IMessage defaultInstance) - { - if (type.MappedType != MappedType.Message) - { - throw new ArgumentException("ExtensionRegistry.Add() provided a default instance for a " - + "non-message extension."); - } - Add(new ExtensionInfo(type, defaultInstance)); - } - - private void Add(ExtensionInfo extension) - { - if (readOnly) - { - throw new InvalidOperationException("Cannot add entries to a read-only extension registry"); - } - if (!extension.Descriptor.IsExtension) - { - throw new ArgumentException("ExtensionRegistry.add() was given a FieldDescriptor for a " - + "regular (non-extension) field."); - } - - IGeneratedExtensionLite liteExtension = extension; - Add(liteExtension); - - FieldDescriptor field = extension.Descriptor; - if (field.ContainingType.Options.MessageSetWireFormat - && field.FieldType == FieldType.Message - && field.IsOptional - && field.ExtensionScope == field.MessageType) - { - // This is an extension of a MessageSet type defined within the extension - // type's own scope. For backwards-compatibility, allow it to be looked - // up by type name. - Dictionary map; - if (extensionsByName.TryGetValue(liteExtension.ContainingType, out map)) - { - map[field.MessageType.FullName] = extension; - } - } - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/ExtensionRegistryLite.cs b/src/ProtocolBuffers/ExtensionRegistryLite.cs deleted file mode 100644 index d1220e9..0000000 --- a/src/ProtocolBuffers/ExtensionRegistryLite.cs +++ /dev/null @@ -1,220 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using ExtensionByNameMap = System.Collections.Generic.Dictionary>; -using ExtensionByIdMap = System.Collections.Generic.Dictionary; - -namespace Google.ProtocolBuffers -{ - /// - /// A table of known extensions, searchable by name or field number. When - /// parsing a protocol message that might have extensions, you must provide - /// an in which you have registered any extensions - /// that you want to be able to parse. Otherwise, those extensions will just - /// be treated like unknown fields. - /// - /// - /// For example, if you had the .proto file: - /// - /// option java_class = "MyProto"; - /// - /// message Foo { - /// extensions 1000 to max; - /// } - /// - /// extend Foo { - /// optional int32 bar; - /// } - /// - /// - /// Then you might write code like: - /// - /// - /// extensionRegistry registry = extensionRegistry.CreateInstance(); - /// registry.Add(MyProto.Bar); - /// MyProto.Foo message = MyProto.Foo.ParseFrom(input, registry); - /// - /// - /// - /// - /// You might wonder why this is necessary. Two alternatives might come to - /// mind. First, you might imagine a system where generated extensions are - /// automatically registered when their containing classes are loaded. This - /// is a popular technique, but is bad design; among other things, it creates a - /// situation where behavior can change depending on what classes happen to be - /// loaded. It also introduces a security vulnerability, because an - /// unprivileged class could cause its code to be called unexpectedly from a - /// privileged class by registering itself as an extension of the right type. - /// - /// Another option you might consider is lazy parsing: do not parse an - /// extension until it is first requested, at which point the caller must - /// provide a type to use. This introduces a different set of problems. First, - /// it would require a mutex lock any time an extension was accessed, which - /// would be slow. Second, corrupt data would not be detected until first - /// access, at which point it would be much harder to deal with it. Third, it - /// could violate the expectation that message objects are immutable, since the - /// type provided could be any arbitrary message class. An unprivileged user - /// could take advantage of this to inject a mutable object into a message - /// belonging to privileged code and create mischief. - /// - public sealed partial class ExtensionRegistry - { - private static readonly ExtensionRegistry empty = new ExtensionRegistry( - new ExtensionByNameMap(), - new ExtensionByIdMap(), - true); - - private readonly ExtensionByNameMap extensionsByName; - private readonly ExtensionByIdMap extensionsByNumber; - - private readonly bool readOnly; - - private ExtensionRegistry(ExtensionByNameMap byName, ExtensionByIdMap byNumber, bool readOnly) - { - this.extensionsByName = byName; - this.extensionsByNumber = byNumber; - this.readOnly = readOnly; - } - - /// - /// Construct a new, empty instance. - /// - public static ExtensionRegistry CreateInstance() - { - return new ExtensionRegistry(new ExtensionByNameMap(), new ExtensionByIdMap(), false); - } - - public ExtensionRegistry AsReadOnly() - { - return new ExtensionRegistry(extensionsByName, extensionsByNumber, true); - } - - /// - /// Get the unmodifiable singleton empty instance. - /// - public static ExtensionRegistry Empty - { - get { return empty; } - } - - /// - /// Finds an extension by containing type and field number. - /// A null reference is returned if the extension can't be found. - /// - public IGeneratedExtensionLite this[IMessageLite containingType, int fieldNumber] - { - get - { - IGeneratedExtensionLite ret; - extensionsByNumber.TryGetValue(new ExtensionIntPair(containingType, fieldNumber), out ret); - return ret; - } - } - - public IGeneratedExtensionLite FindByName(IMessageLite defaultInstanceOfType, string fieldName) - { - return FindExtensionByName(defaultInstanceOfType, fieldName); - } - - private IGeneratedExtensionLite FindExtensionByName(object forwhat, string fieldName) - { - IGeneratedExtensionLite extension = null; - Dictionary map; - if (extensionsByName.TryGetValue(forwhat, out map) && map.TryGetValue(fieldName, out extension)) - { - return extension; - } - return null; - } - - /// - /// Add an extension from a generated file to the registry. - /// - public void Add(IGeneratedExtensionLite extension) - { - if (readOnly) - { - throw new InvalidOperationException("Cannot add entries to a read-only extension registry"); - } - extensionsByNumber.Add(new ExtensionIntPair(extension.ContainingType, extension.Number), extension); - - Dictionary map; - if (!extensionsByName.TryGetValue(extension.ContainingType, out map)) - { - extensionsByName.Add(extension.ContainingType, map = new Dictionary()); - } - map[extension.Descriptor.Name] = extension; - map[extension.Descriptor.FullName] = extension; - } - - /// - /// Nested type just used to represent a pair of MessageDescriptor and int, as - /// the key into the "by number" map. - /// - internal struct ExtensionIntPair : IEquatable - { - private readonly object msgType; - private readonly int number; - - internal ExtensionIntPair(object msgType, int number) - { - this.msgType = msgType; - this.number = number; - } - - public override int GetHashCode() - { - return msgType.GetHashCode()*((1 << 16) - 1) + number; - } - - public override bool Equals(object obj) - { - if (!(obj is ExtensionIntPair)) - { - return false; - } - return Equals((ExtensionIntPair) obj); - } - - public bool Equals(ExtensionIntPair other) - { - return msgType.Equals(other.msgType) && number == other.number; - } - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/FieldAccess/FieldAccessorTable.cs b/src/ProtocolBuffers/FieldAccess/FieldAccessorTable.cs deleted file mode 100644 index 6ba039c..0000000 --- a/src/ProtocolBuffers/FieldAccess/FieldAccessorTable.cs +++ /dev/null @@ -1,126 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -using System; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.FieldAccess -{ - /// - /// Provides access to fields in generated messages via reflection. - /// This type is public to allow it to be used by generated messages, which - /// create appropriate instances in the .proto file description class. - /// TODO(jonskeet): See if we can hide it somewhere... - /// - public sealed class FieldAccessorTable - where TMessage : IMessage - where TBuilder : IBuilder - { - private readonly IFieldAccessor[] accessors; - - private readonly MessageDescriptor descriptor; - - public MessageDescriptor Descriptor - { - get { return descriptor; } - } - - /// - /// Constructs a FieldAccessorTable for a particular message class. - /// Only one FieldAccessorTable should be constructed per class. - /// The property names should all actually correspond with the field descriptor's - /// CSharpOptions.PropertyName property, but bootstrapping issues currently - /// prevent us from using that. This may be addressed at a future time, in which case - /// we can keep this constructor for backwards compatibility, just ignoring the parameter. - /// TODO(jonskeet): Make it so. - /// - /// The type's descriptor - /// The Pascal-case names of all the field-based properties in the message. - public FieldAccessorTable(MessageDescriptor descriptor, String[] propertyNames) - { - this.descriptor = descriptor; - accessors = new IFieldAccessor[descriptor.Fields.Count]; - for (int i = 0; i < accessors.Length; i++) - { - accessors[i] = CreateAccessor(descriptor.Fields[i], propertyNames[i]); - } - } - - /// - /// Creates an accessor for a single field - /// - private static IFieldAccessor CreateAccessor(FieldDescriptor field, string name) - { - if (field.IsRepeated) - { - switch (field.MappedType) - { - case MappedType.Message: - return new RepeatedMessageAccessor(name); - case MappedType.Enum: - return new RepeatedEnumAccessor(field, name); - default: - return new RepeatedPrimitiveAccessor(name); - } - } - else - { - switch (field.MappedType) - { - case MappedType.Message: - return new SingleMessageAccessor(name); - case MappedType.Enum: - return new SingleEnumAccessor(field, name); - default: - return new SinglePrimitiveAccessor(name); - } - } - } - - internal IFieldAccessor this[FieldDescriptor field] - { - get - { - if (field.ContainingType != descriptor) - { - throw new ArgumentException("FieldDescriptor does not match message type."); - } - else if (field.IsExtension) - { - // If this type had extensions, it would subclass ExtendableMessage, - // which overrides the reflection interface to handle extensions. - throw new ArgumentException("This type does not have extensions."); - } - return accessors[field.Index]; - } - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/FieldAccess/IFieldAccessor.cs b/src/ProtocolBuffers/FieldAccess/IFieldAccessor.cs deleted file mode 100644 index 39d3b85..0000000 --- a/src/ProtocolBuffers/FieldAccess/IFieldAccessor.cs +++ /dev/null @@ -1,95 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -namespace Google.ProtocolBuffers.FieldAccess -{ - /// - /// Allows fields to be reflectively accessed in a smart manner. - /// The property descriptors for each field are created once and then cached. - /// In addition, this interface holds knowledge of repeated fields, builders etc. - /// - internal interface IFieldAccessor - where TMessage : IMessage - where TBuilder : IBuilder - { - /// - /// Indicates whether the specified message contains the field. - /// - bool Has(TMessage message); - - /// - /// Gets the count of the repeated field in the specified message. - /// - int GetRepeatedCount(TMessage message); - - /// - /// Clears the field in the specified builder. - /// - /// - void Clear(TBuilder builder); - - /// - /// Creates a builder for the type of this field (which must be a message field). - /// - IBuilder CreateBuilder(); - - /// - /// Accessor for single fields - /// - object GetValue(TMessage message); - - /// - /// Mutator for single fields - /// - void SetValue(TBuilder builder, object value); - - /// - /// Accessor for repeated fields - /// - object GetRepeatedValue(TMessage message, int index); - - /// - /// Mutator for repeated fields - /// - void SetRepeated(TBuilder builder, int index, object value); - - /// - /// Adds the specified value to the field in the given builder. - /// - void AddRepeated(TBuilder builder, object value); - - /// - /// Returns a read-only wrapper around the value of a repeated field. - /// - object GetRepeatedWrapper(TBuilder builder); - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/FieldAccess/ReflectionUtil.cs b/src/ProtocolBuffers/FieldAccess/ReflectionUtil.cs deleted file mode 100644 index 798f0dd..0000000 --- a/src/ProtocolBuffers/FieldAccess/ReflectionUtil.cs +++ /dev/null @@ -1,189 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -using System; -using System.Reflection; - -namespace Google.ProtocolBuffers.FieldAccess -{ - /// - /// The methods in this class are somewhat evil, and should not be tampered with lightly. - /// Basically they allow the creation of relatively weakly typed delegates from MethodInfos - /// which are more strongly typed. They do this by creating an appropriate strongly typed - /// delegate from the MethodInfo, and then calling that within an anonymous method. - /// Mind-bending stuff (at least to your humble narrator) but the resulting delegates are - /// very fast compared with calling Invoke later on. - /// - internal static class ReflectionUtil - { - /// - /// Empty Type[] used when calling GetProperty to force property instead of indexer fetching. - /// - internal static readonly Type[] EmptyTypes = new Type[0]; - - /// - /// Creates a delegate which will execute the given method and then return - /// the result as an object. - /// - public static Func CreateUpcastDelegate(MethodInfo method) - { - // The tricky bit is invoking CreateCreateUpcastDelegateImpl with the right type parameters - MethodInfo openImpl = typeof(ReflectionUtil).GetMethod("CreateUpcastDelegateImpl"); - MethodInfo closedImpl = openImpl.MakeGenericMethod(typeof(T), method.ReturnType); - return (Func) closedImpl.Invoke(null, new object[] {method}); - } - - /// - /// Method used solely for implementing CreateUpcastDelegate. Public to avoid trust issues - /// in low-trust scenarios. - /// - public static Func CreateUpcastDelegateImpl(MethodInfo method) - { - // Convert the reflection call into an open delegate, i.e. instead of calling x.Method() - // we'll call getter(x). - Func getter = ReflectionUtil.CreateDelegateFunc(method); - - // Implicit upcast to object (within the delegate) - return delegate(TSource source) { return getter(source); }; - } - - /// - /// Creates a delegate which will execute the given method after casting the parameter - /// down from object to the required parameter type. - /// - public static Action CreateDowncastDelegate(MethodInfo method) - { - MethodInfo openImpl = typeof(ReflectionUtil).GetMethod("CreateDowncastDelegateImpl"); - MethodInfo closedImpl = openImpl.MakeGenericMethod(typeof(T), method.GetParameters()[0].ParameterType); - return (Action) closedImpl.Invoke(null, new object[] {method}); - } - - public static Action CreateDowncastDelegateImpl(MethodInfo method) - { - // Convert the reflection call into an open delegate, i.e. instead of calling x.Method(y) we'll - // call Method(x, y) - Action call = ReflectionUtil.CreateDelegateAction(method); - - return delegate(TSource source, object parameter) { call(source, (TParam) parameter); }; - } - - /// - /// Creates a delegate which will execute the given method after casting the parameter - /// down from object to the required parameter type. - /// - public static Action CreateDowncastDelegateIgnoringReturn(MethodInfo method) - { - MethodInfo openImpl = typeof(ReflectionUtil).GetMethod("CreateDowncastDelegateIgnoringReturnImpl"); - MethodInfo closedImpl = openImpl.MakeGenericMethod(typeof(T), method.GetParameters()[0].ParameterType, - method.ReturnType); - return (Action) closedImpl.Invoke(null, new object[] {method}); - } - - public static Action CreateDowncastDelegateIgnoringReturnImpl( - MethodInfo method) - { - // Convert the reflection call into an open delegate, i.e. instead of calling x.Method(y) we'll - // call Method(x, y) - Func call = ReflectionUtil.CreateDelegateFunc(method); - - return delegate(TSource source, object parameter) { call(source, (TParam) parameter); }; - } - - /// - /// Creates a delegate which will execute the given static method and cast the result up to IBuilder. - /// - public static Func CreateStaticUpcastDelegate(MethodInfo method) - { - MethodInfo openImpl = typeof(ReflectionUtil).GetMethod("CreateStaticUpcastDelegateImpl"); - MethodInfo closedImpl = openImpl.MakeGenericMethod(method.ReturnType); - return (Func) closedImpl.Invoke(null, new object[] {method}); - } - - public static Func CreateStaticUpcastDelegateImpl(MethodInfo method) - { - Func call = ReflectionUtil.CreateDelegateFunc(method); - return delegate { return (IBuilder) call(); }; - } - - - internal static Func CreateDelegateFunc(MethodInfo method) - { -#if !CF20 - object tdelegate = Delegate.CreateDelegate(typeof(Func), null, method); - return (Func)tdelegate; -#else - return delegate() { return (TResult)method.Invoke(null, null); }; -#endif - } - - internal static Func CreateDelegateFunc(MethodInfo method) - { -#if !CF20 - object tdelegate = Delegate.CreateDelegate(typeof(Func), null, method); - return (Func)tdelegate; -#else - if (method.IsStatic) - { - return delegate(T arg1) { return (TResult) method.Invoke(null, new object[] {arg1}); }; - } - return delegate(T arg1) { return (TResult)method.Invoke(arg1, null); }; -#endif - } - - internal static Func CreateDelegateFunc(MethodInfo method) - { -#if !CF20 - object tdelegate = Delegate.CreateDelegate(typeof(Func), null, method); - return (Func)tdelegate; -#else - if (method.IsStatic) - { - return delegate(T1 arg1, T2 arg2) { return (TResult) method.Invoke(null, new object[] {arg1, arg2}); }; - } - return delegate(T1 arg1, T2 arg2) { return (TResult)method.Invoke(arg1, new object[] { arg2 }); }; -#endif - } - - internal static Action CreateDelegateAction(MethodInfo method) - { -#if !CF20 - object tdelegate = Delegate.CreateDelegate(typeof(Action), null, method); - return (Action)tdelegate; -#else - if (method.IsStatic) - { - return delegate(T1 arg1, T2 arg2) { method.Invoke(null, new object[] {arg1, arg2}); }; - } - return delegate(T1 arg1, T2 arg2) { method.Invoke(arg1, new object[] { arg2 }); }; -#endif - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/FieldAccess/RepeatedEnumAccessor.cs b/src/ProtocolBuffers/FieldAccess/RepeatedEnumAccessor.cs deleted file mode 100644 index 152c2e0..0000000 --- a/src/ProtocolBuffers/FieldAccess/RepeatedEnumAccessor.cs +++ /dev/null @@ -1,83 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -using System.Collections; -using System.Collections.Generic; -using Google.ProtocolBuffers.Collections; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.FieldAccess -{ - /// - /// Accessor for a repeated enum field. - /// - internal sealed class RepeatedEnumAccessor : RepeatedPrimitiveAccessor - where TMessage : IMessage - where TBuilder : IBuilder - { - private readonly EnumDescriptor enumDescriptor; - - internal RepeatedEnumAccessor(FieldDescriptor field, string name) : base(name) - { - enumDescriptor = field.EnumType; - } - - public override object GetValue(TMessage message) - { - List ret = new List(); - foreach (int rawValue in (IEnumerable) base.GetValue(message)) - { - ret.Add(enumDescriptor.FindValueByNumber(rawValue)); - } - return Lists.AsReadOnly(ret); - } - - public override object GetRepeatedValue(TMessage message, int index) - { - // Note: This relies on the fact that the CLR allows unboxing from an enum to - // its underlying value - int rawValue = (int) base.GetRepeatedValue(message, index); - return enumDescriptor.FindValueByNumber(rawValue); - } - - public override void AddRepeated(TBuilder builder, object value) - { - ThrowHelper.ThrowIfNull(value, "value"); - base.AddRepeated(builder, ((EnumValueDescriptor) value).Number); - } - - public override void SetRepeated(TBuilder builder, int index, object value) - { - ThrowHelper.ThrowIfNull(value, "value"); - base.SetRepeated(builder, index, ((EnumValueDescriptor) value).Number); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/FieldAccess/RepeatedMessageAccessor.cs b/src/ProtocolBuffers/FieldAccess/RepeatedMessageAccessor.cs deleted file mode 100644 index fd18b90..0000000 --- a/src/ProtocolBuffers/FieldAccess/RepeatedMessageAccessor.cs +++ /dev/null @@ -1,97 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -using System; -using System.Reflection; - -namespace Google.ProtocolBuffers.FieldAccess -{ - /// - /// Accessor for a repeated message field. - /// - /// TODO(jonskeet): Try to extract the commonality between this and SingleMessageAccessor. - /// We almost want multiple inheritance... - /// - internal sealed class RepeatedMessageAccessor : RepeatedPrimitiveAccessor - where TMessage : IMessage - where TBuilder : IBuilder - { - /// - /// The static method to create a builder for the property type. For example, - /// in a message type "Foo", a field called "bar" might be of type "Baz". This - /// method is Baz.CreateBuilder. - /// - private readonly Func createBuilderDelegate; - - internal RepeatedMessageAccessor(string name) : base(name) - { - MethodInfo createBuilderMethod = ClrType.GetMethod("CreateBuilder", EmptyTypes); - if (createBuilderMethod == null) - { - throw new ArgumentException("No public static CreateBuilder method declared in " + ClrType.Name); - } - createBuilderDelegate = ReflectionUtil.CreateStaticUpcastDelegate(createBuilderMethod); - } - - /// - /// Creates a message of the appropriate CLR type from the given value, - /// which may already be of the right type or may be a dynamic message. - /// - private object CoerceType(object value) - { - ThrowHelper.ThrowIfNull(value, "value"); - // If it's already of the right type, we're done - if (ClrType.IsInstanceOfType(value)) - { - return value; - } - - // No... so let's create a builder of the right type, and merge the value in. - IMessageLite message = (IMessageLite) value; - return CreateBuilder().WeakMergeFrom(message).WeakBuild(); - } - - public override void SetRepeated(TBuilder builder, int index, object value) - { - base.SetRepeated(builder, index, CoerceType(value)); - } - - public override IBuilder CreateBuilder() - { - return createBuilderDelegate(); - } - - public override void AddRepeated(TBuilder builder, object value) - { - base.AddRepeated(builder, CoerceType(value)); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/FieldAccess/RepeatedPrimitiveAccessor.cs b/src/ProtocolBuffers/FieldAccess/RepeatedPrimitiveAccessor.cs deleted file mode 100644 index d3b926b..0000000 --- a/src/ProtocolBuffers/FieldAccess/RepeatedPrimitiveAccessor.cs +++ /dev/null @@ -1,158 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -using System; -using System.Collections; -using System.Reflection; - -namespace Google.ProtocolBuffers.FieldAccess -{ - /// - /// Accessor for a repeated field of type int, ByteString etc. - /// - internal class RepeatedPrimitiveAccessor : IFieldAccessor - where TMessage : IMessage - where TBuilder : IBuilder - { - private readonly Type clrType; - private readonly Func getValueDelegate; - private readonly Func clearDelegate; - private readonly Action addValueDelegate; - private readonly Func getRepeatedWrapperDelegate; - private readonly Func countDelegate; - private readonly MethodInfo getElementMethod; - private readonly MethodInfo setElementMethod; - - // Replacement for Type.EmptyTypes which apparently isn't available on the compact framework - internal static readonly Type[] EmptyTypes = new Type[0]; - - /// - /// The CLR type of the field (int, the enum type, ByteString, the message etc). - /// This is taken from the return type of the method used to retrieve a single - /// value. - /// - protected Type ClrType - { - get { return clrType; } - } - - internal RepeatedPrimitiveAccessor(string name) - { - PropertyInfo messageProperty = typeof(TMessage).GetProperty(name + "List"); - PropertyInfo builderProperty = typeof(TBuilder).GetProperty(name + "List"); - PropertyInfo countProperty = typeof(TMessage).GetProperty(name + "Count"); - MethodInfo clearMethod = typeof(TBuilder).GetMethod("Clear" + name, EmptyTypes); - getElementMethod = typeof(TMessage).GetMethod("Get" + name, new Type[] {typeof(int)}); - clrType = getElementMethod.ReturnType; - MethodInfo addMethod = typeof(TBuilder).GetMethod("Add" + name, new Type[] {ClrType}); - setElementMethod = typeof(TBuilder).GetMethod("Set" + name, new Type[] {typeof(int), ClrType}); - if (messageProperty == null - || builderProperty == null - || countProperty == null - || clearMethod == null - || addMethod == null - || getElementMethod == null - || setElementMethod == null) - { - throw new ArgumentException("Not all required properties/methods available"); - } - clearDelegate = ReflectionUtil.CreateDelegateFunc(clearMethod); - countDelegate = ReflectionUtil.CreateDelegateFunc(countProperty.GetGetMethod()); - getValueDelegate = ReflectionUtil.CreateUpcastDelegate(messageProperty.GetGetMethod()); - addValueDelegate = ReflectionUtil.CreateDowncastDelegateIgnoringReturn(addMethod); - getRepeatedWrapperDelegate = ReflectionUtil.CreateUpcastDelegate(builderProperty.GetGetMethod()); - } - - public bool Has(TMessage message) - { - throw new InvalidOperationException(); - } - - public virtual IBuilder CreateBuilder() - { - throw new InvalidOperationException(); - } - - public virtual object GetValue(TMessage message) - { - return getValueDelegate(message); - } - - public void SetValue(TBuilder builder, object value) - { - // Add all the elements individually. This serves two purposes: - // 1) Verifies that each element has the correct type. - // 2) Insures that the caller cannot modify the list later on and - // have the modifications be reflected in the message. - Clear(builder); - foreach (object element in (IEnumerable) value) - { - AddRepeated(builder, element); - } - } - - public void Clear(TBuilder builder) - { - clearDelegate(builder); - } - - public int GetRepeatedCount(TMessage message) - { - return countDelegate(message); - } - - public virtual object GetRepeatedValue(TMessage message, int index) - { - return getElementMethod.Invoke(message, new object[] {index}); - } - - public virtual void SetRepeated(TBuilder builder, int index, object value) - { - ThrowHelper.ThrowIfNull(value, "value"); - setElementMethod.Invoke(builder, new object[] {index, value}); - } - - public virtual void AddRepeated(TBuilder builder, object value) - { - ThrowHelper.ThrowIfNull(value, "value"); - addValueDelegate(builder, value); - } - - /// - /// The builder class's accessor already builds a read-only wrapper for - /// us, which is exactly what we want. - /// - public object GetRepeatedWrapper(TBuilder builder) - { - return getRepeatedWrapperDelegate(builder); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/FieldAccess/SingleEnumAccessor.cs b/src/ProtocolBuffers/FieldAccess/SingleEnumAccessor.cs deleted file mode 100644 index 6327cc5..0000000 --- a/src/ProtocolBuffers/FieldAccess/SingleEnumAccessor.cs +++ /dev/null @@ -1,74 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers.FieldAccess -{ - /// - /// Accessor for fields representing a non-repeated enum value. - /// - internal sealed class SingleEnumAccessor : SinglePrimitiveAccessor - where TMessage : IMessage - where TBuilder : IBuilder - { - private readonly EnumDescriptor enumDescriptor; - - internal SingleEnumAccessor(FieldDescriptor field, string name) : base(name) - { - enumDescriptor = field.EnumType; - } - - /// - /// Returns an EnumValueDescriptor representing the value in the builder. - /// Note that if an enum has multiple values for the same number, the descriptor - /// for the first value with that number will be returned. - /// - public override object GetValue(TMessage message) - { - // Note: This relies on the fact that the CLR allows unboxing from an enum to - // its underlying value - int rawValue = (int) base.GetValue(message); - return enumDescriptor.FindValueByNumber(rawValue); - } - - /// - /// Sets the value as an enum (via an int) in the builder, - /// from an EnumValueDescriptor parameter. - /// - public override void SetValue(TBuilder builder, object value) - { - ThrowHelper.ThrowIfNull(value, "value"); - EnumValueDescriptor valueDescriptor = (EnumValueDescriptor) value; - base.SetValue(builder, valueDescriptor.Number); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/FieldAccess/SingleMessageAccessor.cs b/src/ProtocolBuffers/FieldAccess/SingleMessageAccessor.cs deleted file mode 100644 index 6bf48a0..0000000 --- a/src/ProtocolBuffers/FieldAccess/SingleMessageAccessor.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -using System; -using System.Reflection; - -namespace Google.ProtocolBuffers.FieldAccess -{ - /// - /// Accessor for fields representing a non-repeated message value. - /// - internal sealed class SingleMessageAccessor : SinglePrimitiveAccessor - where TMessage : IMessage - where TBuilder : IBuilder - { - /// - /// The static method to create a builder for the property type. For example, - /// in a message type "Foo", a field called "bar" might be of type "Baz". This - /// method is Baz.CreateBuilder. - /// - private readonly Func createBuilderDelegate; - - internal SingleMessageAccessor(string name) : base(name) - { - MethodInfo createBuilderMethod = ClrType.GetMethod("CreateBuilder", ReflectionUtil.EmptyTypes); - if (createBuilderMethod == null) - { - throw new ArgumentException("No public static CreateBuilder method declared in " + ClrType.Name); - } - createBuilderDelegate = ReflectionUtil.CreateStaticUpcastDelegate(createBuilderMethod); - } - - /// - /// Creates a message of the appropriate CLR type from the given value, - /// which may already be of the right type or may be a dynamic message. - /// - private object CoerceType(object value) - { - ThrowHelper.ThrowIfNull(value, "value"); - // If it's already of the right type, we're done - if (ClrType.IsInstanceOfType(value)) - { - return value; - } - - // No... so let's create a builder of the right type, and merge the value in. - IMessageLite message = (IMessageLite) value; - return CreateBuilder().WeakMergeFrom(message).WeakBuild(); - } - - public override void SetValue(TBuilder builder, object value) - { - base.SetValue(builder, CoerceType(value)); - } - - public override IBuilder CreateBuilder() - { - return createBuilderDelegate(); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/FieldAccess/SinglePrimitiveAccessor.cs b/src/ProtocolBuffers/FieldAccess/SinglePrimitiveAccessor.cs deleted file mode 100644 index e5a0754..0000000 --- a/src/ProtocolBuffers/FieldAccess/SinglePrimitiveAccessor.cs +++ /dev/null @@ -1,133 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -using System; -using System.Reflection; - -namespace Google.ProtocolBuffers.FieldAccess -{ - /// - /// Access for a non-repeated field of a "primitive" type (i.e. not another message or an enum). - /// - internal class SinglePrimitiveAccessor : IFieldAccessor - where TMessage : IMessage - where TBuilder : IBuilder - { - private readonly Type clrType; - private readonly Func getValueDelegate; - private readonly Action setValueDelegate; - private readonly Func hasDelegate; - private readonly Func clearDelegate; - - /// - /// The CLR type of the field (int, the enum type, ByteString, the message etc). - /// As declared by the property. - /// - protected Type ClrType - { - get { return clrType; } - } - - internal SinglePrimitiveAccessor(string name) - { - PropertyInfo messageProperty = typeof(TMessage).GetProperty(name, null, ReflectionUtil.EmptyTypes); - PropertyInfo builderProperty = typeof(TBuilder).GetProperty(name, null, ReflectionUtil.EmptyTypes); - PropertyInfo hasProperty = typeof(TMessage).GetProperty("Has" + name); - MethodInfo clearMethod = typeof(TBuilder).GetMethod("Clear" + name); - if (messageProperty == null || builderProperty == null || hasProperty == null || clearMethod == null) - { - throw new ArgumentException("Not all required properties/methods available"); - } - clrType = messageProperty.PropertyType; - hasDelegate = ReflectionUtil.CreateDelegateFunc(hasProperty.GetGetMethod()); - clearDelegate = ReflectionUtil.CreateDelegateFunc(clearMethod); - getValueDelegate = ReflectionUtil.CreateUpcastDelegate(messageProperty.GetGetMethod()); - setValueDelegate = ReflectionUtil.CreateDowncastDelegate(builderProperty.GetSetMethod()); - } - - public bool Has(TMessage message) - { - return hasDelegate(message); - } - - public void Clear(TBuilder builder) - { - clearDelegate(builder); - } - - /// - /// Only valid for message types - this implementation throws InvalidOperationException. - /// - public virtual IBuilder CreateBuilder() - { - throw new InvalidOperationException(); - } - - public virtual object GetValue(TMessage message) - { - return getValueDelegate(message); - } - - public virtual void SetValue(TBuilder builder, object value) - { - setValueDelegate(builder, value); - } - - #region Methods only related to repeated values - - public int GetRepeatedCount(TMessage message) - { - throw new InvalidOperationException(); - } - - public object GetRepeatedValue(TMessage message, int index) - { - throw new InvalidOperationException(); - } - - public void SetRepeated(TBuilder builder, int index, object value) - { - throw new InvalidOperationException(); - } - - public void AddRepeated(TBuilder builder, object value) - { - throw new InvalidOperationException(); - } - - public object GetRepeatedWrapper(TBuilder builder) - { - throw new InvalidOperationException(); - } - - #endregion - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/FieldSet.cs b/src/ProtocolBuffers/FieldSet.cs deleted file mode 100644 index f3c08cf..0000000 --- a/src/ProtocolBuffers/FieldSet.cs +++ /dev/null @@ -1,632 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections; -using System.Collections.Generic; -using Google.ProtocolBuffers.Collections; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers -{ - public interface IFieldDescriptorLite : IComparable - { - bool IsRepeated { get; } - bool IsRequired { get; } - bool IsPacked { get; } - bool IsExtension { get; } - bool MessageSetWireFormat { get; } //field.ContainingType.Options.MessageSetWireFormat - int FieldNumber { get; } - string Name { get; } - string FullName { get; } - IEnumLiteMap EnumType { get; } - FieldType FieldType { get; } - MappedType MappedType { get; } - object DefaultValue { get; } - } - - /// - /// A class which represents an arbitrary set of fields of some message type. - /// This is used to implement DynamicMessage, and also to represent extensions - /// in GeneratedMessage. This class is internal, since outside users should probably - /// be using DynamicMessage. - /// - /// As in the Java implementation, this class goes against the rest of the framework - /// in terms of mutability. Instead of having a mutable Builder class and an immutable - /// FieldSet class, FieldSet just has a MakeImmutable() method. This is safe so long as - /// all callers are careful not to let a mutable FieldSet escape into the open. This would - /// be impossible to guarantee if this were a public class, of course. - /// - /// All repeated fields are stored as IList[object] even - /// TODO(jonskeet): Finish this comment! - /// - internal sealed class FieldSet - { - private static readonly FieldSet defaultInstance = - new FieldSet(new Dictionary()).MakeImmutable(); - - private IDictionary fields; - - private FieldSet(IDictionary fields) - { - this.fields = fields; - } - - public static FieldSet CreateInstance() - { - // Use SortedList to keep fields in the canonical order - return new FieldSet(new SortedList()); - } - - /// - /// Makes this FieldSet immutable, and returns it for convenience. Any - /// mutable repeated fields are made immutable, as well as the map itself. - /// - internal FieldSet MakeImmutable() - { - // First check if we have any repeated values - bool hasRepeats = false; - foreach (object value in fields.Values) - { - IList list = value as IList; - if (list != null && !list.IsReadOnly) - { - hasRepeats = true; - break; - } - } - - if (hasRepeats) - { - var tmp = new SortedList(); - foreach (KeyValuePair entry in fields) - { - IList list = entry.Value as IList; - tmp[entry.Key] = list == null ? entry.Value : Lists.AsReadOnly(list); - } - fields = tmp; - } - - fields = Dictionaries.AsReadOnly(fields); - - return this; - } - - /// - /// Returns the default, immutable instance with no fields defined. - /// - internal static FieldSet DefaultInstance - { - get { return defaultInstance; } - } - - /// - /// Returns an immutable mapping of fields. Note that although the mapping itself - /// is immutable, the entries may not be (i.e. any repeated values are represented by - /// mutable lists). The behaviour is not specified if the contents are mutated. - /// - internal IDictionary AllFields - { - get { return Dictionaries.AsReadOnly(fields); } - } - -#if !LITE - /// - /// Force coercion to full descriptor dictionary. - /// - internal IDictionary AllFieldDescriptors - { - get - { - SortedList copy = - new SortedList(); - foreach (KeyValuePair fd in fields) - { - copy.Add((FieldDescriptor) fd.Key, fd.Value); - } - return Dictionaries.AsReadOnly(copy); - } - } -#endif - - /// - /// See . - /// - public bool HasField(IFieldDescriptorLite field) - { - if (field.IsRepeated) - { - throw new ArgumentException("HasField() can only be called on non-repeated fields."); - } - - return fields.ContainsKey(field); - } - - /// - /// Clears all fields. - /// - internal void Clear() - { - fields.Clear(); - } - - /// - /// See - /// - /// - /// If the field is not set, the behaviour when fetching this property varies by field type: - /// - /// For singular message values, null is returned. - /// For singular non-message values, the default value of the field is returned. - /// For repeated values, an empty immutable list is returned. This will be compatible - /// with IList[object], regardless of the type of the repeated item. - /// - /// This method returns null if the field is a singular message type - /// and is not set; in this case it is up to the caller to fetch the - /// message's default instance. For repeated fields of message types, - /// an empty collection is returned. For repeated fields of non-message - /// types, null is returned. - /// - /// When setting this property, any list values are copied, and each element is checked - /// to ensure it is of an appropriate type. - /// - /// - internal object this[IFieldDescriptorLite field] - { - get - { - object result; - if (fields.TryGetValue(field, out result)) - { - return result; - } - if (field.MappedType == MappedType.Message) - { - if (field.IsRepeated) - { - return new List(); - } - else - { - return null; - } - } - return field.DefaultValue; - } - set - { - if (field.IsRepeated) - { - List list = value as List; - if (list == null) - { - throw new ArgumentException("Wrong object type used with protocol message reflection."); - } - - // Wrap the contents in a new list so that the caller cannot change - // the list's contents after setting it. - List newList = new List(list); - foreach (object element in newList) - { - VerifyType(field, element); - } - value = newList; - } - else - { - VerifyType(field, value); - } - fields[field] = value; - } - } - - /// - /// See - /// - internal object this[IFieldDescriptorLite field, int index] - { - get - { - if (!field.IsRepeated) - { - throw new ArgumentException( - "Indexer specifying field and index can only be called on repeated fields."); - } - - return ((IList) this[field])[index]; - } - set - { - if (!field.IsRepeated) - { - throw new ArgumentException( - "Indexer specifying field and index can only be called on repeated fields."); - } - VerifyType(field, value); - object list; - if (!fields.TryGetValue(field, out list)) - { - throw new ArgumentOutOfRangeException(); - } - ((IList) list)[index] = value; - } - } - - /// - /// See - /// - internal void AddRepeatedField(IFieldDescriptorLite field, object value) - { - if (!field.IsRepeated) - { - throw new ArgumentException("AddRepeatedField can only be called on repeated fields."); - } - VerifyType(field, value); - object list; - if (!fields.TryGetValue(field, out list)) - { - list = new List(); - fields[field] = list; - } - ((IList) list).Add(value); - } - - /// - /// Returns an enumerator for the field map. Used to write the fields out. - /// - internal IEnumerator> GetEnumerator() - { - return fields.GetEnumerator(); - } - - /// - /// See - /// - /// - /// Since FieldSet itself does not have any way of knowing about - /// required fields that aren't actually present in the set, it is up - /// to the caller to check for genuinely required fields. This property - /// merely checks that any messages present are themselves initialized. - /// - internal bool IsInitialized - { - get - { - foreach (KeyValuePair entry in fields) - { - IFieldDescriptorLite field = entry.Key; - if (field.MappedType == MappedType.Message) - { - if (field.IsRepeated) - { - foreach (IMessageLite message in (IEnumerable) entry.Value) - { - if (!message.IsInitialized) - { - return false; - } - } - } - else - { - if (!((IMessageLite) entry.Value).IsInitialized) - { - return false; - } - } - } - } - return true; - } - } - - /// - /// Verifies whether all the required fields in the specified message - /// descriptor are present in this field set, as well as whether - /// all the embedded messages are themselves initialized. - /// - internal bool IsInitializedWithRespectTo(IEnumerable typeFields) - { - foreach (IFieldDescriptorLite field in typeFields) - { - if (field.IsRequired && !HasField(field)) - { - return false; - } - } - return IsInitialized; - } - - /// - /// See - /// - public void ClearField(IFieldDescriptorLite field) - { - fields.Remove(field); - } - - /// - /// See - /// - public int GetRepeatedFieldCount(IFieldDescriptorLite field) - { - if (!field.IsRepeated) - { - throw new ArgumentException("GetRepeatedFieldCount() can only be called on repeated fields."); - } - - return ((IList) this[field]).Count; - } - -#if !LITE - /// - /// See - /// - public void MergeFrom(IMessage other) - { - foreach (KeyValuePair fd in other.AllFields) - { - MergeField(fd.Key, fd.Value); - } - } -#endif - - /// - /// Implementation of both MergeFrom methods. - /// - /// - public void MergeFrom(FieldSet other) - { - // Note: We don't attempt to verify that other's fields have valid - // types. Doing so would be a losing battle. We'd have to verify - // all sub-messages as well, and we'd have to make copies of all of - // them to insure that they don't change after verification (since - // the IMessageLite interface itself cannot enforce immutability of - // implementations). - // TODO(jonskeet): Provide a function somewhere called MakeDeepCopy() - // which allows people to make secure deep copies of messages. - - foreach (KeyValuePair entry in other.fields) - { - MergeField(entry.Key, entry.Value); - } - } - - private void MergeField(IFieldDescriptorLite field, object mergeValue) - { - object existingValue; - fields.TryGetValue(field, out existingValue); - if (field.IsRepeated) - { - if (existingValue == null) - { - existingValue = new List(); - fields[field] = existingValue; - } - IList list = (IList) existingValue; - foreach (object otherValue in (IEnumerable) mergeValue) - { - list.Add(otherValue); - } - } - else if (field.MappedType == MappedType.Message && existingValue != null) - { - IMessageLite existingMessage = (IMessageLite) existingValue; - IMessageLite merged = existingMessage.WeakToBuilder() - .WeakMergeFrom((IMessageLite) mergeValue) - .WeakBuild(); - this[field] = merged; - } - else - { - this[field] = mergeValue; - } - } - - /// - /// See . - /// - public void WriteTo(ICodedOutputStream output) - { - foreach (KeyValuePair entry in fields) - { - WriteField(entry.Key, entry.Value, output); - } - } - - /// - /// Writes a single field to a CodedOutputStream. - /// - public void WriteField(IFieldDescriptorLite field, Object value, ICodedOutputStream output) - { - if (field.IsExtension && field.MessageSetWireFormat) - { - output.WriteMessageSetExtension(field.FieldNumber, field.Name, (IMessageLite) value); - } - else - { - if (field.IsRepeated) - { - IEnumerable valueList = (IEnumerable) value; - if (field.IsPacked) - { - output.WritePackedArray(field.FieldType, field.FieldNumber, field.Name, valueList); - } - else - { - output.WriteArray(field.FieldType, field.FieldNumber, field.Name, valueList); - } - } - else - { - output.WriteField(field.FieldType, field.FieldNumber, field.Name, value); - } - } - } - - /// - /// See . It's up to the caller to - /// cache the resulting size if desired. - /// - public int SerializedSize - { - get - { - int size = 0; - foreach (KeyValuePair entry in fields) - { - IFieldDescriptorLite field = entry.Key; - object value = entry.Value; - - if (field.IsExtension && field.MessageSetWireFormat) - { - size += CodedOutputStream.ComputeMessageSetExtensionSize(field.FieldNumber, (IMessageLite) value); - } - else - { - if (field.IsRepeated) - { - IEnumerable valueList = (IEnumerable) value; - if (field.IsPacked) - { - int dataSize = 0; - foreach (object element in valueList) - { - dataSize += CodedOutputStream.ComputeFieldSizeNoTag(field.FieldType, element); - } - size += dataSize + CodedOutputStream.ComputeTagSize(field.FieldNumber) + - CodedOutputStream.ComputeRawVarint32Size((uint) dataSize); - } - else - { - foreach (object element in valueList) - { - size += CodedOutputStream.ComputeFieldSize(field.FieldType, field.FieldNumber, - element); - } - } - } - else - { - size += CodedOutputStream.ComputeFieldSize(field.FieldType, field.FieldNumber, value); - } - } - } - return size; - } - } - - /// - /// Verifies that the given object is of the correct type to be a valid - /// value for the given field. - /// - /// - /// For repeated fields, this checks if the object is of the right - /// element type, not whether it's a list. - /// - /// The value is not of the right type. - /// The value is null. - private static void VerifyType(IFieldDescriptorLite field, object value) - { - ThrowHelper.ThrowIfNull(value, "value"); - bool isValid = false; - switch (field.MappedType) - { - case MappedType.Int32: - isValid = value is int; - break; - case MappedType.Int64: - isValid = value is long; - break; - case MappedType.UInt32: - isValid = value is uint; - break; - case MappedType.UInt64: - isValid = value is ulong; - break; - case MappedType.Single: - isValid = value is float; - break; - case MappedType.Double: - isValid = value is double; - break; - case MappedType.Boolean: - isValid = value is bool; - break; - case MappedType.String: - isValid = value is string; - break; - case MappedType.ByteString: - isValid = value is ByteString; - break; - case MappedType.Enum: - IEnumLite enumValue = value as IEnumLite; - isValid = enumValue != null && field.EnumType.IsValidValue(enumValue); - break; - case MappedType.Message: - IMessageLite messageValue = value as IMessageLite; - isValid = messageValue != null; -#if !LITE - if (isValid && messageValue is IMessage && field is FieldDescriptor) - { - isValid = ((IMessage) messageValue).DescriptorForType == ((FieldDescriptor) field).MessageType; - } -#endif - break; - } - - if (!isValid) - { - // When chaining calls to SetField(), it can be hard to tell from - // the stack trace which exact call failed, since the whole chain is - // considered one line of code. So, let's make sure to include the - // field name and other useful info in the exception. - string message = "Wrong object type used with protocol message reflection."; -#if !LITE - FieldDescriptor fieldinfo = - field as FieldDescriptor; - if (fieldinfo != null) - { - message += "Message type \"" + fieldinfo.ContainingType.FullName; - message += "\", field \"" + (fieldinfo.IsExtension ? fieldinfo.FullName : fieldinfo.Name); - message += "\", value was type \"" + value.GetType().Name + "\"."; - } -#endif - throw new ArgumentException(message); - } - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/FrameworkPortability.cs b/src/ProtocolBuffers/FrameworkPortability.cs deleted file mode 100644 index 8ce8198..0000000 --- a/src/ProtocolBuffers/FrameworkPortability.cs +++ /dev/null @@ -1,111 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Globalization; -using System.Reflection; -using System.Text.RegularExpressions; - -namespace Google.ProtocolBuffers -{ - /// - /// Class containing helpful workarounds for various platform compatibility - /// - internal static class FrameworkPortability - { -#if COMPACT_FRAMEWORK - internal const string NewLine = "\n"; -#else - internal static readonly string NewLine = System.Environment.NewLine; -#endif - -#if CLIENTPROFILE - internal const RegexOptions CompiledRegexWhereAvailable = RegexOptions.Compiled; -#else - internal const RegexOptions CompiledRegexWhereAvailable = RegexOptions.None; -#endif - - internal static CultureInfo InvariantCulture - { - get { return CultureInfo.InvariantCulture; } - } - - internal static double Int64ToDouble(long value) - { -#if CLIENTPROFILE - return BitConverter.Int64BitsToDouble(value); -#else - double[] arresult = new double[1]; - Buffer.BlockCopy(new[] { value }, 0, arresult, 0, 8); - return arresult[0]; -#endif - } - - internal static long DoubleToInt64(double value) - { -#if CLIENTPROFILE - return BitConverter.DoubleToInt64Bits(value); -#else - long[] arresult = new long[1]; - Buffer.BlockCopy(new[] { value }, 0, arresult, 0, 8); - return arresult[0]; -#endif - } - - internal static bool TryParseInt32(string text, out int number) - { - return TryParseInt32(text, NumberStyles.Any, InvariantCulture, out number); - } - - internal static bool TryParseInt32(string text, NumberStyles style, IFormatProvider format, out int number) - { -#if COMPACT_FRAMEWORK - try - { - number = int.Parse(text, style, format); - return true; - } - catch - { - number = 0; - return false; - } -#else - return int.TryParse(text, style, format, out number); -#endif - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/GeneratedBuilder.cs b/src/ProtocolBuffers/GeneratedBuilder.cs deleted file mode 100644 index fd6fe4d..0000000 --- a/src/ProtocolBuffers/GeneratedBuilder.cs +++ /dev/null @@ -1,215 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections; -using System.Collections.Generic; -using Google.ProtocolBuffers.Descriptors; -using Google.ProtocolBuffers.FieldAccess; - -namespace Google.ProtocolBuffers -{ - /// - /// All generated protocol message builder classes extend this class. It implements - /// most of the IBuilder interface using reflection. Users can ignore this class - /// as an implementation detail. - /// - public abstract partial class GeneratedBuilder : AbstractBuilder - where TMessage : GeneratedMessage - where TBuilder : GeneratedBuilder, new() - { - /// - /// Returns the message being built at the moment. - /// - protected abstract TMessage MessageBeingBuilt { get; } - - protected internal FieldAccessorTable InternalFieldAccessors - { - get { return DefaultInstanceForType.FieldAccessorsFromBuilder; } - } - - public override IDictionary AllFields - { - get { return MessageBeingBuilt.AllFields; } - } - - public override object this[FieldDescriptor field] - { - get - { - // For repeated fields, the underlying list object is still modifiable at this point. - // Make sure not to expose the modifiable list to the caller. - return field.IsRepeated - ? InternalFieldAccessors[field].GetRepeatedWrapper(ThisBuilder) - : MessageBeingBuilt[field]; - } - set { InternalFieldAccessors[field].SetValue(ThisBuilder, value); } - } - - /// - /// Called by derived classes to parse an unknown field. - /// - /// true unless the tag is an end-group tag - [CLSCompliant(false)] - protected virtual bool ParseUnknownField(ICodedInputStream input, UnknownFieldSet.Builder unknownFields, - ExtensionRegistry extensionRegistry, uint tag, string fieldName) - { - return unknownFields.MergeFieldFrom(tag, input); - } - - public override MessageDescriptor DescriptorForType - { - get { return DefaultInstanceForType.DescriptorForType; } - } - - public override int GetRepeatedFieldCount(FieldDescriptor field) - { - return MessageBeingBuilt.GetRepeatedFieldCount(field); - } - - public override object this[FieldDescriptor field, int index] - { - get { return MessageBeingBuilt[field, index]; } - set { InternalFieldAccessors[field].SetRepeated(ThisBuilder, index, value); } - } - - public override bool HasField(FieldDescriptor field) - { - return MessageBeingBuilt.HasField(field); - } - - public override IBuilder CreateBuilderForField(FieldDescriptor field) - { - return InternalFieldAccessors[field].CreateBuilder(); - } - - public override TBuilder ClearField(FieldDescriptor field) - { - InternalFieldAccessors[field].Clear(ThisBuilder); - return ThisBuilder; - } - - public override TBuilder MergeFrom(TMessage other) - { - if (other.DescriptorForType != InternalFieldAccessors.Descriptor) - { - throw new ArgumentException("Message type mismatch"); - } - - foreach (KeyValuePair entry in other.AllFields) - { - FieldDescriptor field = entry.Key; - if (field.IsRepeated) - { - // Concatenate repeated fields - foreach (object element in (IEnumerable) entry.Value) - { - AddRepeatedField(field, element); - } - } - else if (field.MappedType == MappedType.Message && HasField(field)) - { - // Merge singular embedded messages - IMessageLite oldValue = (IMessageLite) this[field]; - this[field] = oldValue.WeakCreateBuilderForType() - .WeakMergeFrom(oldValue) - .WeakMergeFrom((IMessageLite) entry.Value) - .WeakBuildPartial(); - } - else - { - // Just overwrite - this[field] = entry.Value; - } - } - - //Fix for unknown fields not merging, see java's AbstractMessage.Builder line 236 - MergeUnknownFields(other.UnknownFields); - - return ThisBuilder; - } - - public override TBuilder MergeUnknownFields(UnknownFieldSet unknownFields) - { - if (unknownFields != UnknownFieldSet.DefaultInstance) - { - TMessage result = MessageBeingBuilt; - result.SetUnknownFields(UnknownFieldSet.CreateBuilder(result.UnknownFields) - .MergeFrom(unknownFields) - .Build()); - } - return ThisBuilder; - } - - public override TBuilder AddRepeatedField(FieldDescriptor field, object value) - { - InternalFieldAccessors[field].AddRepeated(ThisBuilder, value); - return ThisBuilder; - } - - /// - /// Like Build(), but will wrap UninitializedMessageException in - /// InvalidProtocolBufferException. - /// - public TMessage BuildParsed() - { - if (!IsInitialized) - { - throw new UninitializedMessageException(MessageBeingBuilt).AsInvalidProtocolBufferException(); - } - return BuildPartial(); - } - - /// - /// Implementation of . - /// - public override TMessage Build() - { - // If the message is null, we'll throw a more appropriate exception in BuildPartial. - if (!IsInitialized) - { - throw new UninitializedMessageException(MessageBeingBuilt); - } - return BuildPartial(); - } - - public override UnknownFieldSet UnknownFields - { - get { return MessageBeingBuilt.UnknownFields; } - set { MessageBeingBuilt.SetUnknownFields(value); } - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/GeneratedBuilderLite.cs b/src/ProtocolBuffers/GeneratedBuilderLite.cs deleted file mode 100644 index 4030e80..0000000 --- a/src/ProtocolBuffers/GeneratedBuilderLite.cs +++ /dev/null @@ -1,101 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; - -namespace Google.ProtocolBuffers -{ - /// - /// All generated protocol message builder classes extend this class. It implements - /// most of the IBuilder interface using reflection. Users can ignore this class - /// as an implementation detail. - /// - public abstract partial class GeneratedBuilderLite : AbstractBuilderLite - where TMessage : GeneratedMessageLite - where TBuilder : GeneratedBuilderLite - { - /// - /// Returns the message being built at the moment. - /// - protected abstract TMessage MessageBeingBuilt { get; } - - public override TBuilder MergeFrom(IMessageLite other) - { - //do nothing, Lite runtime does not support cross-message merges - return ThisBuilder; - } - - public abstract TBuilder MergeFrom(TMessage other); - - /// - /// Called by derived classes to parse an unknown field. - /// - /// true unless the tag is an end-group tag - [CLSCompliant(false)] - protected virtual bool ParseUnknownField(ICodedInputStream input, - ExtensionRegistry extensionRegistry, uint tag, string fieldName) - { - return input.SkipField(); - } - - /// - /// Like Build(), but will wrap UninitializedMessageException in - /// InvalidProtocolBufferException. - /// - public TMessage BuildParsed() - { - if (!IsInitialized) - { - throw new UninitializedMessageException(MessageBeingBuilt).AsInvalidProtocolBufferException(); - } - return BuildPartial(); - } - - /// - /// Implementation of . - /// - public override TMessage Build() - { - // If the message is null, we'll throw a more appropriate exception in BuildPartial. - if (!IsInitialized) - { - throw new UninitializedMessageException(MessageBeingBuilt); - } - return BuildPartial(); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/GeneratedExtensionBase.cs b/src/ProtocolBuffers/GeneratedExtensionBase.cs deleted file mode 100644 index 424b981..0000000 --- a/src/ProtocolBuffers/GeneratedExtensionBase.cs +++ /dev/null @@ -1,185 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers -{ - /// - /// Base type for all generated extensions. - /// - /// - /// The protocol compiler generates a static singleton instance of this - /// class for each extension. For exmaple, imagine a .proto file with: - /// - /// message Foo { - /// extensions 1000 to max - /// } - /// - /// extend Foo { - /// optional int32 bar; - /// } - /// - /// Then MyProto.Foo.Bar has type GeneratedExtensionBase<MyProto.Foo,int>. - /// - /// In general, users should ignore the details of this type, and - /// simply use the static singletons as parameters to the extension accessors - /// in ExtendableMessage and ExtendableBuilder. - /// The interface implemented by both GeneratedException and GeneratedRepeatException, - /// to make it easier to cope with repeats separately. - /// - public abstract class GeneratedExtensionBase - { - private readonly FieldDescriptor descriptor; - private readonly IMessageLite messageDefaultInstance; - - protected GeneratedExtensionBase(FieldDescriptor descriptor, Type singularExtensionType) - { - if (!descriptor.IsExtension) - { - throw new ArgumentException("GeneratedExtension given a regular (non-extension) field."); - } - - this.descriptor = descriptor; - if (descriptor.MappedType == MappedType.Message) - { - PropertyInfo defaultInstanceProperty = singularExtensionType - .GetProperty("DefaultInstance", BindingFlags.Static | BindingFlags.Public); - if (defaultInstanceProperty == null) - { - throw new ArgumentException("No public static DefaultInstance property for type " + - typeof(TExtension).Name); - } - - messageDefaultInstance = (IMessageLite) defaultInstanceProperty.GetValue(null, null); - } - } - - public FieldDescriptor Descriptor - { - get { return descriptor; } - } - - public int Number - { - get { return Descriptor.FieldNumber; } - } - - /// - /// Returns the default message instance for extensions which are message types. - /// - public IMessageLite MessageDefaultInstance - { - get { return messageDefaultInstance; } - } - - public object SingularFromReflectionType(object value) - { - switch (Descriptor.MappedType) - { - case MappedType.Message: - if (value is TExtension) - { - return value; - } - else - { - // It seems the copy of the embedded message stored inside the - // extended message is not of the exact type the user was - // expecting. This can happen if a user defines a - // GeneratedExtension manually and gives it a different type. - // This should not happen in normal use. But, to be nice, we'll - // copy the message to whatever type the caller was expecting. - return MessageDefaultInstance.WeakCreateBuilderForType() - .WeakMergeFrom((IMessageLite) value).WeakBuild(); - } - case MappedType.Enum: - // Just return a boxed int - that can be unboxed to the enum - EnumValueDescriptor enumValue = (EnumValueDescriptor) value; - return enumValue.Number; - default: - return value; - } - } - - /// - /// Converts from the type used by the native accessors to the type - /// used by reflection accessors. For example, the reflection accessors - /// for enums use EnumValueDescriptors but the native accessors use - /// the generated enum type. - /// - public object ToReflectionType(object value) - { - if (descriptor.IsRepeated) - { - if (descriptor.MappedType == MappedType.Enum) - { - // Must convert the whole list. - IList result = new List(); - foreach (object element in (IEnumerable) value) - { - result.Add(SingularToReflectionType(element)); - } - return result; - } - else - { - return value; - } - } - else - { - return SingularToReflectionType(value); - } - } - - /// - /// Like ToReflectionType(object) but for a single element. - /// - internal Object SingularToReflectionType(object value) - { - return descriptor.MappedType == MappedType.Enum - ? descriptor.EnumType.FindValueByNumber((int) value) - : value; - } - - public abstract object FromReflectionType(object value); - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/GeneratedExtensionLite.cs b/src/ProtocolBuffers/GeneratedExtensionLite.cs deleted file mode 100644 index a162334..0000000 --- a/src/ProtocolBuffers/GeneratedExtensionLite.cs +++ /dev/null @@ -1,354 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System.Collections; -using System.Collections.Generic; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers -{ - public interface IGeneratedExtensionLite - { - int Number { get; } - object ContainingType { get; } - IMessageLite MessageDefaultInstance { get; } - IFieldDescriptorLite Descriptor { get; } - } - - public class ExtensionDescriptorLite : IFieldDescriptorLite - { - private readonly string fullName; - private readonly IEnumLiteMap enumTypeMap; - private readonly int number; - private readonly FieldType type; - private readonly bool isRepeated; - private readonly bool isPacked; - private readonly MappedType mapType; - private readonly object defaultValue; - - public ExtensionDescriptorLite(string fullName, IEnumLiteMap enumTypeMap, int number, FieldType type, - object defaultValue, bool isRepeated, bool isPacked) - { - this.fullName = fullName; - this.enumTypeMap = enumTypeMap; - this.number = number; - this.type = type; - this.mapType = FieldMappingAttribute.MappedTypeFromFieldType(type); - this.isRepeated = isRepeated; - this.isPacked = isPacked; - this.defaultValue = defaultValue; - } - - public string Name - { - get - { - string name = fullName; - int offset = name.LastIndexOf('.'); - if (offset >= 0) - { - name = name.Substring(offset); - } - return name; - } - } - - public string FullName - { - get { return fullName; } - } - - public bool IsRepeated - { - get { return isRepeated; } - } - - public bool IsRequired - { - get { return false; } - } - - public bool IsPacked - { - get { return isPacked; } - } - - public bool IsExtension - { - get { return true; } - } - - /// - /// This is not supported and assertions are made to ensure this does not exist on extensions of Lite types - /// - public bool MessageSetWireFormat - { - get { return false; } - } - - public int FieldNumber - { - get { return number; } - } - - public IEnumLiteMap EnumType - { - get { return enumTypeMap; } - } - - public FieldType FieldType - { - get { return type; } - } - - public MappedType MappedType - { - get { return mapType; } - } - - public object DefaultValue - { - get { return defaultValue; } - } - - public int CompareTo(IFieldDescriptorLite other) - { - return FieldNumber.CompareTo(other.FieldNumber); - } - } - - public class GeneratedRepeatExtensionLite : - GeneratedExtensionLite> - where TContainingType : IMessageLite - { - public GeneratedRepeatExtensionLite(string fullName, TContainingType containingTypeDefaultInstance, - IMessageLite messageDefaultInstance, IEnumLiteMap enumTypeMap, int number, - FieldType type, bool isPacked) : - base( - fullName, containingTypeDefaultInstance, new List(), - messageDefaultInstance, enumTypeMap, number, type, isPacked) - { - } - - public override object ToReflectionType(object value) - { - IList result = new List(); - foreach (object element in (IEnumerable) value) - { - result.Add(SingularToReflectionType(element)); - } - return result; - } - - public override object FromReflectionType(object value) - { - // Must convert the whole list. - List result = new List(); - foreach (object element in (IEnumerable) value) - { - result.Add((TExtensionType) SingularFromReflectionType(element)); - } - return result; - } - } - - public class GeneratedExtensionLite : IGeneratedExtensionLite - where TContainingType : IMessageLite - { - private readonly TContainingType containingTypeDefaultInstance; - private readonly TExtensionType defaultValue; - private readonly IMessageLite messageDefaultInstance; - private readonly ExtensionDescriptorLite descriptor; - - // We can't always initialize a GeneratedExtension when we first construct - // it due to initialization order difficulties (namely, the default - // instances may not have been constructed yet). So, we construct an - // uninitialized GeneratedExtension once, then call internalInit() on it - // later. Generated code will always call internalInit() on all extensions - // as part of the static initialization code, and internalInit() throws an - // exception if called more than once, so this method is useless to users. - protected GeneratedExtensionLite( - TContainingType containingTypeDefaultInstance, - TExtensionType defaultValue, - IMessageLite messageDefaultInstance, - ExtensionDescriptorLite descriptor) - { - this.containingTypeDefaultInstance = containingTypeDefaultInstance; - this.messageDefaultInstance = messageDefaultInstance; - this.defaultValue = defaultValue; - this.descriptor = descriptor; - } - - /** For use by generated code only. */ - - public GeneratedExtensionLite( - string fullName, - TContainingType containingTypeDefaultInstance, - TExtensionType defaultValue, - IMessageLite messageDefaultInstance, - IEnumLiteMap enumTypeMap, - int number, - FieldType type) - : this(containingTypeDefaultInstance, defaultValue, messageDefaultInstance, - new ExtensionDescriptorLite(fullName, enumTypeMap, number, type, defaultValue, - false /* isRepeated */, false /* isPacked */)) - { - } - - private static readonly IList Empty = new object[0]; - /** Repeating fields: For use by generated code only. */ - - protected GeneratedExtensionLite( - string fullName, - TContainingType containingTypeDefaultInstance, - TExtensionType defaultValue, - IMessageLite messageDefaultInstance, - IEnumLiteMap enumTypeMap, - int number, - FieldType type, - bool isPacked) - : this(containingTypeDefaultInstance, defaultValue, messageDefaultInstance, - new ExtensionDescriptorLite(fullName, enumTypeMap, number, type, Empty, - true /* isRepeated */, isPacked)) - { - } - - /// - /// Returns information about this extension - /// - public IFieldDescriptorLite Descriptor - { - get { return descriptor; } - } - - /// - /// Returns the default value for this extension - /// - public TExtensionType DefaultValue - { - get { return defaultValue; } - } - - /// - /// used for the extension registry - /// - object IGeneratedExtensionLite.ContainingType - { - get { return ContainingTypeDefaultInstance; } - } - - /** - * Default instance of the type being extended, used to identify that type. - */ - - public TContainingType ContainingTypeDefaultInstance - { - get { return containingTypeDefaultInstance; } - } - - /** Get the field number. */ - - public int Number - { - get { return descriptor.FieldNumber; } - } - - /** - * If the extension is an embedded message, this is the default instance of - * that type. - */ - - public IMessageLite MessageDefaultInstance - { - get { return messageDefaultInstance; } - } - - /// - /// Converts from the type used by the native accessors to the type - /// used by reflection accessors. For example, the reflection accessors - /// for enums use EnumValueDescriptors but the native accessors use - /// the generated enum type. - /// - public virtual object ToReflectionType(object value) - { - return SingularToReflectionType(value); - } - - /// - /// Like ToReflectionType(object) but for a single element. - /// - public object SingularToReflectionType(object value) - { - return descriptor.MappedType == MappedType.Enum - ? descriptor.EnumType.FindValueByNumber((int) value) - : value; - } - - public virtual object FromReflectionType(object value) - { - return SingularFromReflectionType(value); - } - - public object SingularFromReflectionType(object value) - { - switch (Descriptor.MappedType) - { - case MappedType.Message: - if (value is TExtensionType) - { - return value; - } - else - { - // It seems the copy of the embedded message stored inside the - // extended message is not of the exact type the user was - // expecting. This can happen if a user defines a - // GeneratedExtension manually and gives it a different type. - // This should not happen in normal use. But, to be nice, we'll - // copy the message to whatever type the caller was expecting. - return MessageDefaultInstance.WeakCreateBuilderForType() - .WeakMergeFrom((IMessageLite) value).WeakBuild(); - } - case MappedType.Enum: - // Just return a boxed int - that can be unboxed to the enum - IEnumLite enumValue = (IEnumLite) value; - return enumValue.Number; - default: - return value; - } - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/GeneratedMessage.cs b/src/ProtocolBuffers/GeneratedMessage.cs deleted file mode 100644 index 6f4b665..0000000 --- a/src/ProtocolBuffers/GeneratedMessage.cs +++ /dev/null @@ -1,181 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Xml; -using Google.ProtocolBuffers.Collections; -using Google.ProtocolBuffers.Descriptors; -using Google.ProtocolBuffers.FieldAccess; - -namespace Google.ProtocolBuffers -{ - /// - /// All generated protocol message classes extend this class. It implements - /// most of the IMessage interface using reflection. Users - /// can ignore this class as an implementation detail. - /// - public abstract partial class GeneratedMessage : AbstractMessage - where TMessage : GeneratedMessage - where TBuilder : GeneratedBuilder, new() - { - private UnknownFieldSet unknownFields = UnknownFieldSet.DefaultInstance; - - /// - /// Returns the message as a TMessage. - /// - protected abstract TMessage ThisMessage { get; } - - internal FieldAccessorTable FieldAccessorsFromBuilder - { - get { return InternalFieldAccessors; } - } - - protected abstract FieldAccessorTable InternalFieldAccessors { get; } - - public override MessageDescriptor DescriptorForType - { - get { return InternalFieldAccessors.Descriptor; } - } - - internal IDictionary GetMutableFieldMap() - { - // Use a SortedList so we'll end up serializing fields in order - var ret = new SortedList(); - MessageDescriptor descriptor = DescriptorForType; - foreach (FieldDescriptor field in descriptor.Fields) - { - IFieldAccessor accessor = InternalFieldAccessors[field]; - if (field.IsRepeated) - { - if (accessor.GetRepeatedCount(ThisMessage) != 0) - { - ret[field] = accessor.GetValue(ThisMessage); - } - } - else if (HasField(field)) - { - ret[field] = accessor.GetValue(ThisMessage); - } - } - return ret; - } - - public override bool IsInitialized - { - get - { - foreach (FieldDescriptor field in DescriptorForType.Fields) - { - // Check that all required fields are present. - if (field.IsRequired && !HasField(field)) - { - return false; - } - // Check that embedded messages are initialized. - // This code is similar to that in AbstractMessage, but we don't - // fetch all the field values - just the ones we need to. - if (field.MappedType == MappedType.Message) - { - if (field.IsRepeated) - { - // We know it's an IList, but not the exact type - so - // IEnumerable is the best we can do. (C# generics aren't covariant yet.) - foreach (IMessageLite element in (IEnumerable) this[field]) - { - if (!element.IsInitialized) - { - return false; - } - } - } - else - { - if (HasField(field) && !((IMessageLite) this[field]).IsInitialized) - { - return false; - } - } - } - } - return true; - } - } - - public override IDictionary AllFields - { - get { return Dictionaries.AsReadOnly(GetMutableFieldMap()); } - } - - public override bool HasField(FieldDescriptor field) - { - return InternalFieldAccessors[field].Has(ThisMessage); - } - - public override int GetRepeatedFieldCount(FieldDescriptor field) - { - return InternalFieldAccessors[field].GetRepeatedCount(ThisMessage); - } - - public override object this[FieldDescriptor field, int index] - { - get { return InternalFieldAccessors[field].GetRepeatedValue(ThisMessage, index); } - } - - public override object this[FieldDescriptor field] - { - get { return InternalFieldAccessors[field].GetValue(ThisMessage); } - } - - public override UnknownFieldSet UnknownFields - { - get { return unknownFields; } - } - - /// - /// Replaces the set of unknown fields for this message. This should - /// only be used before a message is built, by the builder. (In the - /// Java code it is private, but the builder is nested so has access - /// to it.) - /// - internal void SetUnknownFields(UnknownFieldSet fieldSet) - { - unknownFields = fieldSet; - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/GeneratedMessageLite.cs b/src/ProtocolBuffers/GeneratedMessageLite.cs deleted file mode 100644 index 0dfc976..0000000 --- a/src/ProtocolBuffers/GeneratedMessageLite.cs +++ /dev/null @@ -1,182 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Text; - -namespace Google.ProtocolBuffers -{ - /// - /// All generated protocol message classes extend this class. It implements - /// most of the IMessage interface using reflection. Users - /// can ignore this class as an implementation detail. - /// - public abstract partial class GeneratedMessageLite : AbstractMessageLite - where TMessage : GeneratedMessageLite - where TBuilder : GeneratedBuilderLite - { - protected abstract TMessage ThisMessage { get; } - - public override sealed string ToString() - { - using (StringWriter wtr = new StringWriter()) - { - PrintTo(wtr); - return wtr.ToString(); - } - } - - /// - /// PrintTo() helper methods for Lite Runtime - /// - protected static void PrintField(string name, IList value, TextWriter writer) - { - foreach (T item in value) - { - PrintField(name, true, (object) item, writer); - } - } - - /// - /// PrintTo() helper methods for Lite Runtime - /// - protected static void PrintField(string name, bool hasValue, object value, TextWriter writer) - { - if (!hasValue) - { - return; - } - if (value is IMessageLite) - { - writer.WriteLine("{0} {{", name); - ((IMessageLite) value).PrintTo(writer); - writer.WriteLine("}"); - } - else if (value is ByteString || value is String) - { - writer.Write("{0}: \"", name); - if (value is String) - { - EscapeBytes(Encoding.UTF8.GetBytes((string) value), writer); - } - else - { - EscapeBytes(((ByteString) value), writer); - } - writer.WriteLine("\""); - } - else if (value is bool) - { - writer.WriteLine("{0}: {1}", name, (bool) value ? "true" : "false"); - } - else if (value is IEnumLite) - { - writer.WriteLine("{0}: {1}", name, ((IEnumLite) value).Name); - } - else - { - writer.WriteLine("{0}: {1}", name, ((IConvertible)value).ToString(FrameworkPortability.InvariantCulture)); - } - } - - /// - /// COPIED from TextFormat - /// Escapes bytes in the format used in protocol buffer text format, which - /// is the same as the format used for C string literals. All bytes - /// that are not printable 7-bit ASCII characters are escaped, as well as - /// backslash, single-quote, and double-quote characters. Characters for - /// which no defined short-hand escape sequence is defined will be escaped - /// using 3-digit octal sequences. - /// The returned value is guaranteed to be entirely ASCII. - /// - private static void EscapeBytes(IEnumerable input, TextWriter writer) - { - foreach (byte b in input) - { - switch (b) - { - // C# does not use \a or \v - case 0x07: - writer.Write("\\a"); - break; - case (byte) '\b': - writer.Write("\\b"); - break; - case (byte) '\f': - writer.Write("\\f"); - break; - case (byte) '\n': - writer.Write("\\n"); - break; - case (byte) '\r': - writer.Write("\\r"); - break; - case (byte) '\t': - writer.Write("\\t"); - break; - case 0x0b: - writer.Write("\\v"); - break; - case (byte) '\\': - writer.Write("\\\\"); - break; - case (byte) '\'': - writer.Write("\\\'"); - break; - case (byte) '"': - writer.Write("\\\""); - break; - default: - if (b >= 0x20 && b < 128) - { - writer.Write((char) b); - } - else - { - writer.Write('\\'); - writer.Write((char) ('0' + ((b >> 6) & 3))); - writer.Write((char) ('0' + ((b >> 3) & 7))); - writer.Write((char) ('0' + (b & 7))); - } - break; - } - } - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/GeneratedRepeatExtension.cs b/src/ProtocolBuffers/GeneratedRepeatExtension.cs deleted file mode 100644 index 7e7b088..0000000 --- a/src/ProtocolBuffers/GeneratedRepeatExtension.cs +++ /dev/null @@ -1,88 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections; -using System.Collections.Generic; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers -{ - /// - /// Class used to represent repeat extensions in generated classes. - /// - public sealed class GeneratedRepeatExtension : GeneratedExtensionBase> - { - private GeneratedRepeatExtension(FieldDescriptor field) : base(field, typeof(TExtensionElement)) - { - } - - public static GeneratedExtensionBase> CreateInstance(FieldDescriptor descriptor) - { - if (!descriptor.IsRepeated) - { - throw new ArgumentException("Must call GeneratedRepeatExtension.CreateInstance() for repeated types."); - } - return new GeneratedRepeatExtension(descriptor); - } - - /// - /// Converts the list to the right type. - /// TODO(jonskeet): Check where this is used, and whether we need to convert - /// for primitive types. - /// - /// - /// - public override object FromReflectionType(object value) - { - if (Descriptor.MappedType == MappedType.Message || - Descriptor.MappedType == MappedType.Enum) - { - // Must convert the whole list. - List result = new List(); - foreach (object element in (IEnumerable) value) - { - result.Add((TExtensionElement) SingularFromReflectionType(element)); - } - return result; - } - else - { - return value; - } - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/GeneratedSingleExtension.cs b/src/ProtocolBuffers/GeneratedSingleExtension.cs deleted file mode 100644 index f0f1979..0000000 --- a/src/ProtocolBuffers/GeneratedSingleExtension.cs +++ /dev/null @@ -1,65 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers -{ - /// - /// Generated extension for a singular field. - /// - public sealed class GeneratedSingleExtension : GeneratedExtensionBase - { - internal GeneratedSingleExtension(FieldDescriptor descriptor) : base(descriptor, typeof(TExtension)) - { - } - - public static GeneratedSingleExtension CreateInstance(FieldDescriptor descriptor) - { - if (descriptor.IsRepeated) - { - throw new ArgumentException("Must call GeneratedRepeateExtension.CreateInstance() for repeated types."); - } - return new GeneratedSingleExtension(descriptor); - } - - public override object FromReflectionType(object value) - { - return base.SingularFromReflectionType(value); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/IBuilder.cs b/src/ProtocolBuffers/IBuilder.cs deleted file mode 100644 index f9c0df6..0000000 --- a/src/ProtocolBuffers/IBuilder.cs +++ /dev/null @@ -1,309 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using System.IO; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers -{ - /// - /// Non-generic interface for all members whose signatures don't require knowledge of - /// the type being built. The generic interface extends this one. Some methods return - /// either an IBuilder or an IMessage; in these cases the generic interface redeclares - /// the same method with a type-specific signature. Implementations are encouraged to - /// use explicit interface implemenation for the non-generic form. This mirrors - /// how IEnumerable and IEnumerable<T> work. - /// - public interface IBuilder : IBuilderLite - { - /// - /// Returns true iff all required fields in the message and all - /// embedded messages are set. - /// - new bool IsInitialized { get; } - - /// - /// Only present in the nongeneric interface - useful for tests, but - /// not as much in real life. - /// - IBuilder SetField(FieldDescriptor field, object value); - - /// - /// Only present in the nongeneric interface - useful for tests, but - /// not as much in real life. - /// - IBuilder SetRepeatedField(FieldDescriptor field, int index, object value); - - /// - /// Behaves like the equivalent property in IMessage<T>. - /// The returned map may or may not reflect future changes to the builder. - /// Either way, the returned map is unmodifiable. - /// - IDictionary AllFields { get; } - - /// - /// Allows getting and setting of a field. - /// - /// - /// - /// - object this[FieldDescriptor field] { get; set; } - - /// - /// Get the message's type descriptor. - /// - /// - MessageDescriptor DescriptorForType { get; } - - /// - /// - /// - /// - /// - int GetRepeatedFieldCount(FieldDescriptor field); - - /// - /// Allows getting and setting of a repeated field value. - /// - /// - object this[FieldDescriptor field, int index] { get; set; } - - /// - /// - /// - bool HasField(FieldDescriptor field); - - /// - /// - /// - UnknownFieldSet UnknownFields { get; set; } - - /// - /// Create a builder for messages of the appropriate type for the given field. - /// Messages built with this can then be passed to the various mutation properties - /// and methods. - /// - IBuilder CreateBuilderForField(FieldDescriptor field); - - #region Methods which are like those of the generic form, but without any knowledge of the type parameters - - IBuilder WeakAddRepeatedField(FieldDescriptor field, object value); - new IBuilder WeakClear(); - IBuilder WeakClearField(FieldDescriptor field); - IBuilder WeakMergeFrom(IMessage message); - new IBuilder WeakMergeFrom(ByteString data); - new IBuilder WeakMergeFrom(ByteString data, ExtensionRegistry registry); - new IBuilder WeakMergeFrom(ICodedInputStream input); - new IBuilder WeakMergeFrom(ICodedInputStream input, ExtensionRegistry registry); - new IMessage WeakBuild(); - new IMessage WeakBuildPartial(); - new IBuilder WeakClone(); - new IMessage WeakDefaultInstanceForType { get; } - - #endregion - } - - /// - /// Interface implemented by Protocol Message builders. - /// TODO(jonskeet): Consider "SetXXX" methods returning the builder, as well as the properties. - /// - /// Type of message - /// Type of builder - public interface IBuilder : IBuilder, IBuilderLite - where TMessage : IMessage - where TBuilder : IBuilder - { - TBuilder SetUnknownFields(UnknownFieldSet unknownFields); - - /// - /// Resets all fields to their default values. - /// - new TBuilder Clear(); - - /// - /// Merge the specified other message which may be a different implementation of - /// the same message descriptor. - /// - TBuilder MergeFrom(IMessage other); - - /// - /// Constructs the final message. Once this is called, this Builder instance - /// is no longer valid, and calling any other method may throw a - /// NullReferenceException. If you need to continue working with the builder - /// after calling Build, call Clone first. - /// - /// the message - /// is missing one or more required fields; use BuildPartial to bypass - /// this check - new TMessage Build(); - - /// - /// Like Build(), but does not throw an exception if the message is missing - /// required fields. Instead, a partial message is returned. - /// - new TMessage BuildPartial(); - - /// - /// Clones this builder. - /// TODO(jonskeet): Explain depth of clone. - /// - new TBuilder Clone(); - - /// - /// Parses a message of this type from the input and merges it with this - /// message, as if using MergeFrom(IMessage<T>). - /// - /// - /// Warning: This does not verify that all required fields are present - /// in the input message. If you call Build() without setting all - /// required fields, it will throw an UninitializedMessageException. - /// There are a few good ways to deal with this: - /// - /// Call IsInitialized to verify to verify that all required fields are - /// set before building. - /// Parse the message separately using one of the static ParseFrom - /// methods, then use MergeFrom(IMessage<T>) to merge it with - /// this one. ParseFrom will throw an InvalidProtocolBufferException - /// (an IOException) if some required fields are missing. - /// Use BuildPartial to build, which ignores missing required fields. - /// - /// - new TBuilder MergeFrom(ICodedInputStream input); - - /// - /// Like MergeFrom(ICodedInputStream), but also parses extensions. - /// The extensions that you want to be able to parse must be registered - /// in . Extensions not in the registry - /// will be treated as unknown fields. - /// - new TBuilder MergeFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry); - - /// - /// Get's the message's type's default instance. - /// - /// - new TMessage DefaultInstanceForType { get; } - - /// - /// Clears the field. This is exactly equivalent to calling the generated - /// Clear method corresponding to the field. - /// - /// - /// - TBuilder ClearField(FieldDescriptor field); - - /// - /// Appends the given value as a new element for the specified repeated field. - /// - /// the field is not a repeated field, - /// the field does not belong to this builder's type, or the value is - /// of the incorrect type - /// - TBuilder AddRepeatedField(FieldDescriptor field, object value); - - /// - /// Merge some unknown fields into the set for this message. - /// - TBuilder MergeUnknownFields(UnknownFieldSet unknownFields); - - /// - /// Like MergeFrom(Stream), but does not read until the end of the file. - /// Instead, the size of the message (encoded as a varint) is read first, - /// then the message data. Use Message.WriteDelimitedTo(Stream) to - /// write messages in this format. - /// - /// - new TBuilder MergeDelimitedFrom(Stream input); - - /// - /// Like MergeDelimitedFrom(Stream) but supporting extensions. - /// - new TBuilder MergeDelimitedFrom(Stream input, ExtensionRegistry extensionRegistry); - - #region Convenience methods - - /// - /// Parse as a message of this type and merge - /// it with the message being built. This is just a small wrapper around - /// MergeFrom(ICodedInputStream). - /// - new TBuilder MergeFrom(ByteString data); - - /// - /// Parse as a message of this type and merge - /// it with the message being built. This is just a small wrapper around - /// MergeFrom(ICodedInputStream, extensionRegistry). - /// - new TBuilder MergeFrom(ByteString data, ExtensionRegistry extensionRegistry); - - /// - /// Parse as a message of this type and merge - /// it with the message being built. This is just a small wrapper around - /// MergeFrom(ICodedInputStream). - /// - new TBuilder MergeFrom(byte[] data); - - /// - /// Parse as a message of this type and merge - /// it with the message being built. This is just a small wrapper around - /// MergeFrom(ICodedInputStream, extensionRegistry). - /// - new TBuilder MergeFrom(byte[] data, ExtensionRegistry extensionRegistry); - - /// - /// Parse as a message of this type and merge - /// it with the message being built. This is just a small wrapper around - /// MergeFrom(ICodedInputStream). Note that this method always reads - /// the entire input (unless it throws an exception). If you want it to - /// stop earlier, you will need to wrap the input in a wrapper - /// stream which limits reading. Or, use IMessage.WriteDelimitedTo(Stream) - /// to write your message and MmergeDelimitedFrom(Stream) to read it. - /// Despite usually reading the entire stream, this method never closes the stream. - /// - new TBuilder MergeFrom(Stream input); - - /// - /// Parse as a message of this type and merge - /// it with the message being built. This is just a small wrapper around - /// MergeFrom(ICodedInputStream, extensionRegistry). - /// - new TBuilder MergeFrom(Stream input, ExtensionRegistry extensionRegistry); - - #endregion - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/IBuilderLite.cs b/src/ProtocolBuffers/IBuilderLite.cs deleted file mode 100644 index 330fe49..0000000 --- a/src/ProtocolBuffers/IBuilderLite.cs +++ /dev/null @@ -1,213 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System.IO; - -namespace Google.ProtocolBuffers -{ - /// - /// Non-generic interface for all members whose signatures don't require knowledge of - /// the type being built. The generic interface extends this one. Some methods return - /// either an IBuilder or an IMessage; in these cases the generic interface redeclares - /// the same method with a type-specific signature. Implementations are encouraged to - /// use explicit interface implemenation for the non-generic form. This mirrors - /// how IEnumerable and IEnumerable<T> work. - /// - public partial interface IBuilderLite - { - /// - /// Returns true iff all required fields in the message and all - /// embedded messages are set. - /// - bool IsInitialized { get; } - - IBuilderLite WeakClear(); - IBuilderLite WeakMergeFrom(IMessageLite message); - IBuilderLite WeakMergeFrom(ByteString data); - IBuilderLite WeakMergeFrom(ByteString data, ExtensionRegistry registry); - IBuilderLite WeakMergeFrom(ICodedInputStream input); - IBuilderLite WeakMergeFrom(ICodedInputStream input, ExtensionRegistry registry); - IMessageLite WeakBuild(); - IMessageLite WeakBuildPartial(); - IBuilderLite WeakClone(); - IMessageLite WeakDefaultInstanceForType { get; } - } - - /// - /// Interface implemented by Protocol Message builders. - /// TODO(jonskeet): Consider "SetXXX" methods returning the builder, as well as the properties. - /// - /// Type of message - /// Type of builder - public interface IBuilderLite : IBuilderLite - where TMessage : IMessageLite - where TBuilder : IBuilderLite - { - /// - /// Resets all fields to their default values. - /// - TBuilder Clear(); - - /// - /// Merge the specified other message which may be a different implementation of - /// the same message descriptor. - /// - TBuilder MergeFrom(IMessageLite other); - - /// - /// Constructs the final message. Once this is called, this Builder instance - /// is no longer valid, and calling any other method may throw a - /// NullReferenceException. If you need to continue working with the builder - /// after calling Build, call Clone first. - /// - /// the message - /// is missing one or more required fields; use BuildPartial to bypass - /// this check - TMessage Build(); - - /// - /// Like Build(), but does not throw an exception if the message is missing - /// required fields. Instead, a partial message is returned. - /// - TMessage BuildPartial(); - - /// - /// Clones this builder. - /// TODO(jonskeet): Explain depth of clone. - /// - TBuilder Clone(); - - /// - /// Parses a message of this type from the input and merges it with this - /// message, as if using MergeFrom(IMessage<T>). - /// - /// - /// Warning: This does not verify that all required fields are present - /// in the input message. If you call Build() without setting all - /// required fields, it will throw an UninitializedMessageException. - /// There are a few good ways to deal with this: - /// - /// Call IsInitialized to verify to verify that all required fields are - /// set before building. - /// Parse the message separately using one of the static ParseFrom - /// methods, then use MergeFrom(IMessage<T>) to merge it with - /// this one. ParseFrom will throw an InvalidProtocolBufferException - /// (an IOException) if some required fields are missing. - /// Use BuildPartial to build, which ignores missing required fields. - /// - /// - TBuilder MergeFrom(ICodedInputStream input); - - /// - /// Like MergeFrom(ICodedInputStream), but also parses extensions. - /// The extensions that you want to be able to parse must be registered - /// in . Extensions not in the registry - /// will be treated as unknown fields. - /// - TBuilder MergeFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry); - - /// - /// Get's the message's type's default instance. - /// - /// - TMessage DefaultInstanceForType { get; } - - /// - /// Like MergeFrom(Stream), but does not read until the end of the file. - /// Instead, the size of the message (encoded as a varint) is read first, - /// then the message data. Use Message.WriteDelimitedTo(Stream) to - /// write messages in this format. - /// - /// - TBuilder MergeDelimitedFrom(Stream input); - - /// - /// Like MergeDelimitedFrom(Stream) but supporting extensions. - /// - TBuilder MergeDelimitedFrom(Stream input, ExtensionRegistry extensionRegistry); - - #region Convenience methods - - /// - /// Parse as a message of this type and merge - /// it with the message being built. This is just a small wrapper around - /// MergeFrom(ICodedInputStream). - /// - TBuilder MergeFrom(ByteString data); - - /// - /// Parse as a message of this type and merge - /// it with the message being built. This is just a small wrapper around - /// MergeFrom(ICodedInputStream, ExtensionRegistry). - /// - TBuilder MergeFrom(ByteString data, ExtensionRegistry extensionRegistry); - - /// - /// Parse as a message of this type and merge - /// it with the message being built. This is just a small wrapper around - /// MergeFrom(ICodedInputStream). - /// - TBuilder MergeFrom(byte[] data); - - /// - /// Parse as a message of this type and merge - /// it with the message being built. This is just a small wrapper around - /// MergeFrom(ICodedInputStream, ExtensionRegistry). - /// - TBuilder MergeFrom(byte[] data, ExtensionRegistry extensionRegistry); - - /// - /// Parse as a message of this type and merge - /// it with the message being built. This is just a small wrapper around - /// MergeFrom(ICodedInputStream). Note that this method always reads - /// the entire input (unless it throws an exception). If you want it to - /// stop earlier, you will need to wrap the input in a wrapper - /// stream which limits reading. Or, use IMessage.WriteDelimitedTo(Stream) - /// to write your message and MmergeDelimitedFrom(Stream) to read it. - /// Despite usually reading the entire stream, this method never closes the stream. - /// - TBuilder MergeFrom(Stream input); - - /// - /// Parse as a message of this type and merge - /// it with the message being built. This is just a small wrapper around - /// MergeFrom(ICodedInputStream, ExtensionRegistry). - /// - TBuilder MergeFrom(Stream input, ExtensionRegistry extensionRegistry); - - #endregion - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/ICodedInputStream.cs b/src/ProtocolBuffers/ICodedInputStream.cs deleted file mode 100644 index b39b602..0000000 --- a/src/ProtocolBuffers/ICodedInputStream.cs +++ /dev/null @@ -1,345 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using Google.ProtocolBuffers.Descriptors; - -//Disable warning CS3010: CLS-compliant interfaces must have only CLS-compliant members -#pragma warning disable 3010 - -namespace Google.ProtocolBuffers -{ - public interface ICodedInputStream - { - /// - /// Reads any message initialization data expected from the input stream - /// - /// - /// This is primarily used by text formats and unnecessary for protobuffers' own - /// binary format. The API for MessageStart/End was added for consistent handling - /// of output streams regardless of the actual writer implementation. - /// - void ReadMessageStart(); - /// - /// Reads any message finalization data expected from the input stream - /// - /// - /// This is primarily used by text formats and unnecessary for protobuffers' own - /// binary format. The API for MessageStart/End was added for consistent handling - /// of output streams regardless of the actual writer implementation. - /// - void ReadMessageEnd(); - /// - /// Attempt to read a field tag, returning false if we have reached the end - /// of the input data. - /// - /// - /// - /// If fieldTag is non-zero and ReadTag returns true then the value in fieldName - /// may or may not be populated. However, if fieldTag is zero and ReadTag returns - /// true, then fieldName should be populated with a non-null field name. - /// - /// In other words if ReadTag returns true then either fieldTag will be non-zero OR - /// fieldName will be non-zero. In some cases both may be populated, however the - /// builders will always prefer the fieldTag over fieldName. - /// - /// - [CLSCompliant(false)] - bool ReadTag(out uint fieldTag, out string fieldName); - - /// - /// Read a double field from the stream. - /// - bool ReadDouble(ref double value); - - /// - /// Read a float field from the stream. - /// - bool ReadFloat(ref float value); - - /// - /// Read a uint64 field from the stream. - /// - [CLSCompliant(false)] - bool ReadUInt64(ref ulong value); - - /// - /// Read an int64 field from the stream. - /// - bool ReadInt64(ref long value); - - /// - /// Read an int32 field from the stream. - /// - bool ReadInt32(ref int value); - - /// - /// Read a fixed64 field from the stream. - /// - [CLSCompliant(false)] - bool ReadFixed64(ref ulong value); - - /// - /// Read a fixed32 field from the stream. - /// - [CLSCompliant(false)] - bool ReadFixed32(ref uint value); - - /// - /// Read a bool field from the stream. - /// - bool ReadBool(ref bool value); - - /// - /// Reads a string field from the stream. - /// - bool ReadString(ref string value); - - /// - /// Reads a group field value from the stream. - /// - void ReadGroup(int fieldNumber, IBuilderLite builder, - ExtensionRegistry extensionRegistry); - - /// - /// Reads a group field value from the stream and merges it into the given - /// UnknownFieldSet. - /// - [Obsolete] - void ReadUnknownGroup(int fieldNumber, IBuilderLite builder); - - /// - /// Reads an embedded message field value from the stream. - /// - void ReadMessage(IBuilderLite builder, ExtensionRegistry extensionRegistry); - - /// - /// Reads a bytes field value from the stream. - /// - bool ReadBytes(ref ByteString value); - - /// - /// Reads a uint32 field value from the stream. - /// - [CLSCompliant(false)] - bool ReadUInt32(ref uint value); - - /// - /// Reads an enum field value from the stream. The caller is responsible - /// for converting the numeric value to an actual enum. - /// - bool ReadEnum(ref IEnumLite value, out object unknown, IEnumLiteMap mapping); - - /// - /// Reads an enum field value from the stream. If the enum is valid for type T, - /// then the ref value is set and it returns true. Otherwise the unkown output - /// value is set and this method returns false. - /// - [CLSCompliant(false)] - bool ReadEnum(ref T value, out object unknown) - where T : struct, IComparable, IFormattable; - - /// - /// Reads an sfixed32 field value from the stream. - /// - bool ReadSFixed32(ref int value); - - /// - /// Reads an sfixed64 field value from the stream. - /// - bool ReadSFixed64(ref long value); - - /// - /// Reads an sint32 field value from the stream. - /// - bool ReadSInt32(ref int value); - - /// - /// Reads an sint64 field value from the stream. - /// - bool ReadSInt64(ref long value); - - /// - /// Reads an array of primitive values into the list, if the wire-type of fieldTag is length-prefixed and the - /// type is numeric, it will read a packed array. - /// - [CLSCompliant(false)] - void ReadPrimitiveArray(FieldType fieldType, uint fieldTag, string fieldName, ICollection list); - - /// - /// Reads an array of primitive values into the list, if the wire-type of fieldTag is length-prefixed, it will - /// read a packed array. - /// - [CLSCompliant(false)] - void ReadEnumArray(uint fieldTag, string fieldName, ICollection list, out ICollection unknown, - IEnumLiteMap mapping); - - /// - /// Reads an array of primitive values into the list, if the wire-type of fieldTag is length-prefixed, it will - /// read a packed array. - /// - [CLSCompliant(false)] - void ReadEnumArray(uint fieldTag, string fieldName, ICollection list, out ICollection unknown) - where T : struct, IComparable, IFormattable; - - /// - /// Reads a set of messages using the as a template. T is not guaranteed to be - /// the most derived type, it is only the type specifier for the collection. - /// - [CLSCompliant(false)] - void ReadMessageArray(uint fieldTag, string fieldName, ICollection list, T messageType, - ExtensionRegistry registry) where T : IMessageLite; - - /// - /// Reads a set of messages using the as a template. - /// - [CLSCompliant(false)] - void ReadGroupArray(uint fieldTag, string fieldName, ICollection list, T messageType, - ExtensionRegistry registry) where T : IMessageLite; - - /// - /// Reads a field of any primitive type. Enums, groups and embedded - /// messages are not handled by this method. - /// - bool ReadPrimitiveField(FieldType fieldType, ref object value); - - /// - /// Returns true if the stream has reached the end of the input. This is the - /// case if either the end of the underlying input source has been reached or - /// the stream has reached a limit created using PushLimit. - /// - bool IsAtEnd { get; } - - /// - /// Reads and discards a single field, given its tag value. - /// - /// false if the tag is an end-group tag, in which case - /// nothing is skipped. Otherwise, returns true. - [CLSCompliant(false)] - bool SkipField(); - - /// - /// Reads one or more repeated string field values from the stream. - /// - [CLSCompliant(false)] - void ReadStringArray(uint fieldTag, string fieldName, ICollection list); - - /// - /// Reads one or more repeated ByteString field values from the stream. - /// - [CLSCompliant(false)] - void ReadBytesArray(uint fieldTag, string fieldName, ICollection list); - - /// - /// Reads one or more repeated boolean field values from the stream. - /// - [CLSCompliant(false)] - void ReadBoolArray(uint fieldTag, string fieldName, ICollection list); - - /// - /// Reads one or more repeated Int32 field values from the stream. - /// - [CLSCompliant(false)] - void ReadInt32Array(uint fieldTag, string fieldName, ICollection list); - - /// - /// Reads one or more repeated SInt32 field values from the stream. - /// - [CLSCompliant(false)] - void ReadSInt32Array(uint fieldTag, string fieldName, ICollection list); - - /// - /// Reads one or more repeated UInt32 field values from the stream. - /// - [CLSCompliant(false)] - void ReadUInt32Array(uint fieldTag, string fieldName, ICollection list); - - /// - /// Reads one or more repeated Fixed32 field values from the stream. - /// - [CLSCompliant(false)] - void ReadFixed32Array(uint fieldTag, string fieldName, ICollection list); - - /// - /// Reads one or more repeated SFixed32 field values from the stream. - /// - [CLSCompliant(false)] - void ReadSFixed32Array(uint fieldTag, string fieldName, ICollection list); - - /// - /// Reads one or more repeated Int64 field values from the stream. - /// - [CLSCompliant(false)] - void ReadInt64Array(uint fieldTag, string fieldName, ICollection list); - - /// - /// Reads one or more repeated SInt64 field values from the stream. - /// - [CLSCompliant(false)] - void ReadSInt64Array(uint fieldTag, string fieldName, ICollection list); - - /// - /// Reads one or more repeated UInt64 field values from the stream. - /// - [CLSCompliant(false)] - void ReadUInt64Array(uint fieldTag, string fieldName, ICollection list); - - /// - /// Reads one or more repeated Fixed64 field values from the stream. - /// - [CLSCompliant(false)] - void ReadFixed64Array(uint fieldTag, string fieldName, ICollection list); - - /// - /// Reads one or more repeated SFixed64 field values from the stream. - /// - [CLSCompliant(false)] - void ReadSFixed64Array(uint fieldTag, string fieldName, ICollection list); - - /// - /// Reads one or more repeated Double field values from the stream. - /// - [CLSCompliant(false)] - void ReadDoubleArray(uint fieldTag, string fieldName, ICollection list); - - /// - /// Reads one or more repeated Float field values from the stream. - /// - [CLSCompliant(false)] - void ReadFloatArray(uint fieldTag, string fieldName, ICollection list); - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/ICodedOutputStream.cs b/src/ProtocolBuffers/ICodedOutputStream.cs deleted file mode 100644 index 64c8065..0000000 --- a/src/ProtocolBuffers/ICodedOutputStream.cs +++ /dev/null @@ -1,374 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections; -using System.Collections.Generic; -using Google.ProtocolBuffers.Descriptors; - -//Disable warning CS3010: CLS-compliant interfaces must have only CLS-compliant members -#pragma warning disable 3010 - -namespace Google.ProtocolBuffers -{ - /// - /// Provides an interface that is used write a message. Most often proto buffers are written - /// in their binary form by creating a instance via the CodedOutputStream.CreateInstance - /// static factory. - /// - public interface ICodedOutputStream - { - /// - /// Writes any message initialization data needed to the output stream - /// - /// - /// This is primarily used by text formats and unnecessary for protobuffers' own - /// binary format. The API for MessageStart/End was added for consistent handling - /// of output streams regardless of the actual writer implementation. - /// - void WriteMessageStart(); - /// - /// Writes any message finalization data needed to the output stream - /// - /// - /// This is primarily used by text formats and unnecessary for protobuffers' own - /// binary format. The API for MessageStart/End was added for consistent handling - /// of output streams regardless of the actual writer implementation. - /// - void WriteMessageEnd(); - /// - /// Indicates that all temporary buffers be written to the final output. - /// - void Flush(); - /// - /// Writes an unknown message as a group - /// - [Obsolete] - void WriteUnknownGroup(int fieldNumber, IMessageLite value); - /// - /// Writes an unknown field value of bytes - /// - void WriteUnknownBytes(int fieldNumber, ByteString value); - /// - /// Writes an unknown field of a primitive type - /// - [CLSCompliant(false)] - void WriteUnknownField(int fieldNumber, WireFormat.WireType wireType, ulong value); - /// - /// Writes an extension as a message-set group - /// - void WriteMessageSetExtension(int fieldNumber, string fieldName, IMessageLite value); - /// - /// Writes an unknown extension as a message-set group - /// - void WriteMessageSetExtension(int fieldNumber, string fieldName, ByteString value); - - /// - /// Writes a field value, including tag, to the stream. - /// - void WriteField(FieldType fieldType, int fieldNumber, string fieldName, object value); - - /// - /// Writes a double field value, including tag, to the stream. - /// - void WriteDouble(int fieldNumber, string fieldName, double value); - - /// - /// Writes a float field value, including tag, to the stream. - /// - void WriteFloat(int fieldNumber, string fieldName, float value); - - /// - /// Writes a uint64 field value, including tag, to the stream. - /// - [CLSCompliant(false)] - void WriteUInt64(int fieldNumber, string fieldName, ulong value); - - /// - /// Writes an int64 field value, including tag, to the stream. - /// - void WriteInt64(int fieldNumber, string fieldName, long value); - - /// - /// Writes an int32 field value, including tag, to the stream. - /// - void WriteInt32(int fieldNumber, string fieldName, int value); - - /// - /// Writes a fixed64 field value, including tag, to the stream. - /// - [CLSCompliant(false)] - void WriteFixed64(int fieldNumber, string fieldName, ulong value); - - /// - /// Writes a fixed32 field value, including tag, to the stream. - /// - [CLSCompliant(false)] - void WriteFixed32(int fieldNumber, string fieldName, uint value); - - /// - /// Writes a bool field value, including tag, to the stream. - /// - void WriteBool(int fieldNumber, string fieldName, bool value); - - /// - /// Writes a string field value, including tag, to the stream. - /// - void WriteString(int fieldNumber, string fieldName, string value); - - /// - /// Writes a group field value, including tag, to the stream. - /// - void WriteGroup(int fieldNumber, string fieldName, IMessageLite value); - - /// - /// Writes a message field value, including tag, to the stream. - /// - void WriteMessage(int fieldNumber, string fieldName, IMessageLite value); - - /// - /// Writes a byte array field value, including tag, to the stream. - /// - void WriteBytes(int fieldNumber, string fieldName, ByteString value); - - /// - /// Writes a UInt32 field value, including tag, to the stream. - /// - [CLSCompliant(false)] - void WriteUInt32(int fieldNumber, string fieldName, uint value); - - /// - /// Writes an enum field value, including tag, to the stream. - /// - void WriteEnum(int fieldNumber, string fieldName, int value, object rawValue); - - /// - /// Writes a fixed 32-bit field value, including tag, to the stream. - /// - void WriteSFixed32(int fieldNumber, string fieldName, int value); - - /// - /// Writes a signed fixed 64-bit field value, including tag, to the stream. - /// - void WriteSFixed64(int fieldNumber, string fieldName, long value); - - /// - /// Writes a signed 32-bit field value, including tag, to the stream. - /// - void WriteSInt32(int fieldNumber, string fieldName, int value); - - /// - /// Writes a signed 64-bit field value, including tag, to the stream. - /// - void WriteSInt64(int fieldNumber, string fieldName, long value); - - /// - /// Writes a repeated field value, including tag(s), to the stream. - /// - void WriteArray(FieldType fieldType, int fieldNumber, string fieldName, IEnumerable list); - - /// - /// Writes a repeated group value, including tag(s), to the stream. - /// - void WriteGroupArray(int fieldNumber, string fieldName, IEnumerable list) - where T : IMessageLite; - - /// - /// Writes a repeated message value, including tag(s), to the stream. - /// - void WriteMessageArray(int fieldNumber, string fieldName, IEnumerable list) - where T : IMessageLite; - - /// - /// Writes a repeated string value, including tag(s), to the stream. - /// - void WriteStringArray(int fieldNumber, string fieldName, IEnumerable list); - - /// - /// Writes a repeated ByteString value, including tag(s), to the stream. - /// - void WriteBytesArray(int fieldNumber, string fieldName, IEnumerable list); - - /// - /// Writes a repeated boolean value, including tag(s), to the stream. - /// - void WriteBoolArray(int fieldNumber, string fieldName, IEnumerable list); - - /// - /// Writes a repeated Int32 value, including tag(s), to the stream. - /// - void WriteInt32Array(int fieldNumber, string fieldName, IEnumerable list); - - /// - /// Writes a repeated SInt32 value, including tag(s), to the stream. - /// - void WriteSInt32Array(int fieldNumber, string fieldName, IEnumerable list); - - /// - /// Writes a repeated UInt32 value, including tag(s), to the stream. - /// - void WriteUInt32Array(int fieldNumber, string fieldName, IEnumerable list); - - /// - /// Writes a repeated Fixed32 value, including tag(s), to the stream. - /// - void WriteFixed32Array(int fieldNumber, string fieldName, IEnumerable list); - - /// - /// Writes a repeated SFixed32 value, including tag(s), to the stream. - /// - void WriteSFixed32Array(int fieldNumber, string fieldName, IEnumerable list); - - /// - /// Writes a repeated Int64 value, including tag(s), to the stream. - /// - void WriteInt64Array(int fieldNumber, string fieldName, IEnumerable list); - - /// - /// Writes a repeated SInt64 value, including tag(s), to the stream. - /// - void WriteSInt64Array(int fieldNumber, string fieldName, IEnumerable list); - - /// - /// Writes a repeated UInt64 value, including tag(s), to the stream. - /// - void WriteUInt64Array(int fieldNumber, string fieldName, IEnumerable list); - - /// - /// Writes a repeated Fixed64 value, including tag(s), to the stream. - /// - void WriteFixed64Array(int fieldNumber, string fieldName, IEnumerable list); - - /// - /// Writes a repeated SFixed64 value, including tag(s), to the stream. - /// - void WriteSFixed64Array(int fieldNumber, string fieldName, IEnumerable list); - - /// - /// Writes a repeated Double value, including tag(s), to the stream. - /// - void WriteDoubleArray(int fieldNumber, string fieldName, IEnumerable list); - - /// - /// Writes a repeated Float value, including tag(s), to the stream. - /// - void WriteFloatArray(int fieldNumber, string fieldName, IEnumerable list); - - /// - /// Writes a repeated enumeration value of type T, including tag(s), to the stream. - /// - [CLSCompliant(false)] - void WriteEnumArray(int fieldNumber, string fieldName, IEnumerable list) - where T : struct, IComparable, IFormattable; - - /// - /// Writes a packed repeated primitive, including tag and length, to the stream. - /// - void WritePackedArray(FieldType fieldType, int fieldNumber, string fieldName, IEnumerable list); - - /// - /// Writes a packed repeated boolean, including tag and length, to the stream. - /// - void WritePackedBoolArray(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list); - - /// - /// Writes a packed repeated Int32, including tag and length, to the stream. - /// - void WritePackedInt32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list); - - /// - /// Writes a packed repeated SInt32, including tag and length, to the stream. - /// - void WritePackedSInt32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list); - - /// - /// Writes a packed repeated UInt32, including tag and length, to the stream. - /// - void WritePackedUInt32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list); - - /// - /// Writes a packed repeated Fixed32, including tag and length, to the stream. - /// - void WritePackedFixed32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list); - - /// - /// Writes a packed repeated SFixed32, including tag and length, to the stream. - /// - void WritePackedSFixed32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list); - - /// - /// Writes a packed repeated Int64, including tag and length, to the stream. - /// - void WritePackedInt64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list); - - /// - /// Writes a packed repeated SInt64, including tag and length, to the stream. - /// - void WritePackedSInt64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list); - - /// - /// Writes a packed repeated UInt64, including tag and length, to the stream. - /// - void WritePackedUInt64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list); - - /// - /// Writes a packed repeated Fixed64, including tag and length, to the stream. - /// - void WritePackedFixed64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list); - - /// - /// Writes a packed repeated SFixed64, including tag and length, to the stream. - /// - void WritePackedSFixed64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list); - - /// - /// Writes a packed repeated Double, including tag and length, to the stream. - /// - void WritePackedDoubleArray(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list); - - /// - /// Writes a packed repeated Float, including tag and length, to the stream. - /// - void WritePackedFloatArray(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list); - - /// - /// Writes a packed repeated enumeration of type T, including tag and length, to the stream. - /// - [CLSCompliant(false)] - void WritePackedEnumArray(int fieldNumber, string fieldName, int calculatedSize, IEnumerable list) - where T : struct, IComparable, IFormattable; - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/IMessage.cs b/src/ProtocolBuffers/IMessage.cs deleted file mode 100644 index c23bc3f..0000000 --- a/src/ProtocolBuffers/IMessage.cs +++ /dev/null @@ -1,249 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using System.IO; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers -{ - /// - /// Non-generic interface used for all parts of the API which don't require - /// any type knowledge. - /// - public interface IMessage : IMessageLite - { - /// - /// Returns the message's type's descriptor. This differs from the - /// Descriptor property of each generated message class in that this - /// method is an abstract method of IMessage whereas Descriptor is - /// a static property of a specific class. They return the same thing. - /// - MessageDescriptor DescriptorForType { get; } - - /// - /// Returns a collection of all the fields in this message which are set - /// and their corresponding values. A singular ("required" or "optional") - /// field is set iff HasField() returns true for that field. A "repeated" - /// field is set iff GetRepeatedFieldSize() is greater than zero. The - /// values are exactly what would be returned by calling - /// GetField(FieldDescriptor) for each field. The map - /// is guaranteed to be a sorted map, so iterating over it will return fields - /// in order by field number. - /// - IDictionary AllFields { get; } - - /// - /// Returns true if the given field is set. This is exactly equivalent - /// to calling the generated "Has" property corresponding to the field. - /// - /// the field is a repeated field, - /// or it's not a field of this type - bool HasField(FieldDescriptor field); - - /// - /// Obtains the value of the given field, or the default value if - /// it isn't set. For value type fields, the boxed value is returned. - /// For enum fields, the EnumValueDescriptor for the enum is returned. - /// For embedded message fields, the sub-message - /// is returned. For repeated fields, an IList<T> is returned. - /// - object this[FieldDescriptor field] { get; } - - /// - /// Returns the number of elements of a repeated field. This is - /// exactly equivalent to calling the generated "Count" property - /// corresponding to the field. - /// - /// the field is not a repeated field, - /// or it's not a field of this type - int GetRepeatedFieldCount(FieldDescriptor field); - - /// - /// Gets an element of a repeated field. For value type fields - /// excluding enums, the boxed value is returned. For embedded - /// message fields, the sub-message is returned. For enums, the - /// relevant EnumValueDescriptor is returned. - /// - /// the field is not a repeated field, - /// or it's not a field of this type - /// the index is out of - /// range for the repeated field's value - object this[FieldDescriptor field, int index] { get; } - - /// - /// Returns the unknown fields for this message. - /// - UnknownFieldSet UnknownFields { get; } - - /// - /// Returns true iff all required fields in the message and all embedded - /// messages are set. - /// - new bool IsInitialized { get; } - - /// - /// Serializes the message and writes it to the given output stream. - /// This does not flush or close the stream. - /// - /// - /// Protocol Buffers are not self-delimiting. Therefore, if you write - /// any more data to the stream after the message, you must somehow ensure - /// that the parser on the receiving end does not interpret this as being - /// part of the protocol message. One way of doing this is by writing the size - /// of the message before the data, then making sure you limit the input to - /// that size when receiving the data. Alternatively, use WriteDelimitedTo(Stream). - /// - new void WriteTo(ICodedOutputStream output); - - /// - /// Like WriteTo(Stream) but writes the size of the message as a varint before - /// writing the data. This allows more data to be written to the stream after the - /// message without the need to delimit the message data yourself. Use - /// IBuilder.MergeDelimitedFrom(Stream) or the static method - /// YourMessageType.ParseDelimitedFrom(Stream) to parse messages written by this method. - /// - /// - new void WriteDelimitedTo(Stream output); - - /// - /// Returns the number of bytes required to encode this message. - /// The result is only computed on the first call and memoized after that. - /// - new int SerializedSize { get; } - - #region Comparison and hashing - - /// - /// Compares the specified object with this message for equality. - /// Returns true iff the given object is a message of the same type - /// (as defined by DescriptorForType) and has identical values - /// for all its fields. - /// - new bool Equals(object other); - - /// - /// Returns the hash code value for this message. - /// TODO(jonskeet): Specify the hash algorithm, but better than the Java one! - /// - new int GetHashCode(); - - #endregion - - #region Convenience methods - - /// - /// Converts the message to a string in protocol buffer text format. - /// This is just a trivial wrapper around TextFormat.PrintToString. - /// - new string ToString(); - - /// - /// Serializes the message to a ByteString. This is a trivial wrapper - /// around WriteTo(ICodedOutputStream). - /// - new ByteString ToByteString(); - - /// - /// Serializes the message to a byte array. This is a trivial wrapper - /// around WriteTo(ICodedOutputStream). - /// - new byte[] ToByteArray(); - - /// - /// Serializes the message and writes it to the given stream. - /// This is just a wrapper around WriteTo(ICodedOutputStream). This - /// does not flush or close the stream. - /// - /// - new void WriteTo(Stream output); - - #endregion - - /// - /// Creates a builder for the type, but in a weakly typed manner. This - /// is typically implemented by strongly typed messages by just returning - /// the result of CreateBuilderForType. - /// - new IBuilder WeakCreateBuilderForType(); - - /// - /// Creates a builder with the same contents as this message. This - /// is typically implemented by strongly typed messages by just returning - /// the result of ToBuilder. - /// - new IBuilder WeakToBuilder(); - - new IMessage WeakDefaultInstanceForType { get; } - } - - public interface IMessage : IMessage, IMessageLite - { - /// - /// Returns an instance of this message type with all fields set to - /// their default values. This may or may not be a singleton. This differs - /// from the DefaultInstance property of each generated message class in that this - /// method is an abstract method of IMessage whereas DefaultInstance is - /// a static property of a specific class. They return the same thing. - /// - new TMessage DefaultInstanceForType { get; } - } - - /// - /// Type-safe interface for all generated messages to implement. - /// - public interface IMessage : IMessage, IMessageLite - where TMessage : IMessage - where TBuilder : IBuilder - { - #region Builders - - /// - /// Constructs a new builder for a message of the same type as this message. - /// - new TBuilder CreateBuilderForType(); - - /// - /// Creates a builder with the same contents as this current instance. - /// This is typically implemented by strongly typed messages by just - /// returning the result of ToBuilder(). - /// - new TBuilder ToBuilder(); - - #endregion - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/IMessageLite.cs b/src/ProtocolBuffers/IMessageLite.cs deleted file mode 100644 index ea5d994..0000000 --- a/src/ProtocolBuffers/IMessageLite.cs +++ /dev/null @@ -1,188 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System.IO; - -namespace Google.ProtocolBuffers -{ - /// - /// Non-generic interface used for all parts of the API which don't require - /// any type knowledge. - /// - public partial interface IMessageLite - { - /// - /// Returns true iff all required fields in the message and all embedded - /// messages are set. - /// - bool IsInitialized { get; } - - /// - /// Serializes the message and writes it to the given output stream. - /// This does not flush or close the stream. - /// - /// - /// Protocol Buffers are not self-delimiting. Therefore, if you write - /// any more data to the stream after the message, you must somehow ensure - /// that the parser on the receiving end does not interpret this as being - /// part of the protocol message. One way of doing this is by writing the size - /// of the message before the data, then making sure you limit the input to - /// that size when receiving the data. Alternatively, use WriteDelimitedTo(Stream). - /// - void WriteTo(ICodedOutputStream output); - - /// - /// Like WriteTo(Stream) but writes the size of the message as a varint before - /// writing the data. This allows more data to be written to the stream after the - /// message without the need to delimit the message data yourself. Use - /// IBuilder.MergeDelimitedFrom(Stream) or the static method - /// YourMessageType.ParseDelimitedFrom(Stream) to parse messages written by this method. - /// - /// - void WriteDelimitedTo(Stream output); - - /// - /// Returns the number of bytes required to encode this message. - /// The result is only computed on the first call and memoized after that. - /// - int SerializedSize { get; } - - #region Comparison and hashing - - /// - /// Compares the specified object with this message for equality. - /// Returns true iff the given object is a message of the same type - /// (as defined by DescriptorForType) and has identical values - /// for all its fields. - /// - bool Equals(object other); - - /// - /// Returns the hash code value for this message. - /// TODO(jonskeet): Specify the hash algorithm, but better than the Java one! - /// - int GetHashCode(); - - #endregion - - #region Convenience methods - - /// - /// Converts the message to a string in protocol buffer text format. - /// This is just a trivial wrapper around TextFormat.PrintToString. - /// - string ToString(); - - /// - /// Converts the message to a string. - /// - void PrintTo(TextWriter writer); - - /// - /// Serializes the message to a ByteString. This is a trivial wrapper - /// around WriteTo(ICodedOutputStream). - /// - ByteString ToByteString(); - - /// - /// Serializes the message to a byte array. This is a trivial wrapper - /// around WriteTo(ICodedOutputStream). - /// - byte[] ToByteArray(); - - /// - /// Serializes the message and writes it to the given stream. - /// This is just a wrapper around WriteTo(ICodedOutputStream). This - /// does not flush or close the stream. - /// - /// - void WriteTo(Stream output); - - #endregion - - /// - /// Creates a builder for the type, but in a weakly typed manner. This - /// is typically implemented by strongly typed messages by just returning - /// the result of CreateBuilderForType. - /// - IBuilderLite WeakCreateBuilderForType(); - - /// - /// Creates a builder with the same contents as this message. This - /// is typically implemented by strongly typed messages by just returning - /// the result of ToBuilder. - /// - IBuilderLite WeakToBuilder(); - - IMessageLite WeakDefaultInstanceForType { get; } - } - - public interface IMessageLite : IMessageLite - { - /// - /// Returns an instance of this message type with all fields set to - /// their default values. This may or may not be a singleton. This differs - /// from the DefaultInstance property of each generated message class in that this - /// method is an abstract method of IMessage whereas DefaultInstance is - /// a static property of a specific class. They return the same thing. - /// - TMessage DefaultInstanceForType { get; } - } - - /// - /// Type-safe interface for all generated messages to implement. - /// - public interface IMessageLite : IMessageLite - where TMessage : IMessageLite - where TBuilder : IBuilderLite - { - #region Builders - - /// - /// Constructs a new builder for a message of the same type as this message. - /// - TBuilder CreateBuilderForType(); - - /// - /// Creates a builder with the same contents as this current instance. - /// This is typically implemented by strongly typed messages by just - /// returning the result of ToBuilder(). - /// - TBuilder ToBuilder(); - - #endregion - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/IRpcChannel.cs b/src/ProtocolBuffers/IRpcChannel.cs deleted file mode 100644 index 4ca24ea..0000000 --- a/src/ProtocolBuffers/IRpcChannel.cs +++ /dev/null @@ -1,63 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers -{ - /// - /// Interface for an RPC channel. A channel represents a communication line to - /// a service (IService implementation) which can be used to call that service's - /// methods. The service may be running on another machine. Normally, you should - /// not call an IRpcChannel directly, but instead construct a stub wrapping it. - /// Generated service classes contain a CreateStub method for precisely this purpose. - /// - public interface IRpcChannel - { - /// - /// Calls the given method of the remote service. This method is similar - /// to with one important difference: the - /// caller decides the types of the IMessage objects, not the implementation. - /// The request may be of any type as long as request.Descriptor == method.InputType. - /// The response passed to the callback will be of the same type as - /// (which must be such that - /// responsePrototype.Descriptor == method.OutputType). - /// - void CallMethod(MethodDescriptor method, IRpcController controller, - IMessage request, IMessage responsePrototype, Action done); - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/IRpcController.cs b/src/ProtocolBuffers/IRpcController.cs deleted file mode 100644 index b155bec..0000000 --- a/src/ProtocolBuffers/IRpcController.cs +++ /dev/null @@ -1,125 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; - -namespace Google.ProtocolBuffers -{ - /// - /// Mediates a single method call. The primary purpose of the controller - /// is to provide a way to manipulate settings specific to the - /// RPC implementation and to find out about RPC-level errors. - /// - /// The methods provided by this interface are intended to be a "least - /// common denominator" set of features which we expect all implementations to - /// support. Specific implementations may provide more advanced features, - /// (e.g. deadline propagation). - /// - public interface IRpcController - { - #region Client side calls - - // These calls may be made from the client side only. Their results - // are undefined on the server side (may throw exceptions). - - /// - /// Resets the controller to its initial state so that it may be reused in - /// a new call. This can be called from the client side only. It must not - /// be called while an RPC is in progress. - /// - void Reset(); - - /// - /// After a call has finished, returns true if the call failed. The possible - /// reasons for failure depend on the RPC implementation. Failed must - /// only be called on the client side, and must not be called before a call has - /// finished. - /// - bool Failed { get; } - - /// - /// If Failed is true, ErrorText returns a human-readable description of the error. - /// - string ErrorText { get; } - - /// - /// Advises the RPC system that the caller desires that the RPC call be - /// canceled. The RPC system may cancel it immediately, may wait awhile and - /// then cancel it, or may not even cancel the call at all. If the call is - /// canceled, the "done" callback will still be called and the RpcController - /// will indicate that the call failed at that time. - /// - void StartCancel(); - - #endregion - - #region Server side calls - - // These calls may be made from the server side only. Their results - // are undefined on the client side (may throw exceptions). - - /// - /// Causes Failed to return true on the client side. - /// will be incorporated into the message returned by ErrorText. - /// If you find you need to return machine-readable information about - /// failures, you should incorporate it into your response protocol buffer - /// and should *not* call SetFailed. - /// - void SetFailed(string reason); - - /// - /// If true, indicates that the client canceled the RPC, so the server may as - /// well give up on replying to it. This method must be called on the server - /// side only. The server should still call the final "done" callback. - /// - bool IsCanceled(); - - /// - /// Requests that the given callback be called when the RPC is canceled. - /// The parameter passed to the callback will always be null. The callback will - /// be called exactly once. If the RPC completes without being canceled, the - /// callback will be called after completion. If the RPC has already been canceled - /// when NotifyOnCancel is called, the callback will be called immediately. - /// - /// NotifyOnCancel must be called no more than once per request. It must be - /// called on the server side only. - /// - /// - void NotifyOnCancel(Action callback); - - #endregion - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/IRpcDispatch.cs b/src/ProtocolBuffers/IRpcDispatch.cs deleted file mode 100644 index 524838e..0000000 --- a/src/ProtocolBuffers/IRpcDispatch.cs +++ /dev/null @@ -1,78 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; - -namespace Google.ProtocolBuffers -{ - /// - /// Provides an entry-point for transport listeners to call a specified method on a service - /// - public interface IRpcServerStub : IDisposable - { - /// - /// Calls the method identified by methodName and returns the message - /// - /// The method name on the service descriptor (case-sensitive) - /// The ICodedInputStream to deserialize the call parameter from - /// The extension registry to use when deserializing the call parameter - /// The message that was returned from the service's method - IMessageLite CallMethod(string methodName, ICodedInputStream input, ExtensionRegistry registry); - } - - /// - /// Used to forward an invocation of a service method to a transport sender implementation - /// - public interface IRpcDispatch - { - /// - /// Calls the service member on the endpoint connected. This is generally done by serializing - /// the message, sending the bytes over a transport, and then deserializing the call parameter - /// to invoke the service's actual implementation via IRpcServerStub. Once the call has - /// completed the result message is serialized and returned to the originating endpoint. - /// - /// The type of the response message - /// The type of of the response builder - /// The name of the method on the service - /// The message instance provided to the service call - /// The builder used to deserialize the response - /// The resulting message of the service call - TMessage CallMethod(string method, IMessageLite request, - IBuilderLite response) - where TMessage : IMessageLite - where TBuilder : IBuilderLite; - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/IService.cs b/src/ProtocolBuffers/IService.cs deleted file mode 100644 index 61af35c..0000000 --- a/src/ProtocolBuffers/IService.cs +++ /dev/null @@ -1,102 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers -{ - /// - /// Base interface for protocol-buffer-based RPC services. Services themselves - /// are abstract classes (implemented either by servers or as stubs) but they - /// implement this itnerface. The methods of this interface can be used to call - /// the methods of the service without knowing its exact type at compile time - /// (analagous to the IMessage interface). - /// - public interface IService - { - /// - /// The ServiceDescriptor describing this service and its methods. - /// - ServiceDescriptor DescriptorForType { get; } - - /// - /// Call a method of the service specified by MethodDescriptor. This is - /// normally implemented as a simple switch that calls the standard - /// definitions of the service's methods. - /// - /// Preconditions - /// - /// method.Service == DescriptorForType - /// request is of the exact same class as the object returned by GetRequestPrototype(method) - /// controller is of the correct type for the RPC implementation being used by this service. - /// For stubs, the "correct type" depends on the IRpcChannel which the stub is using. Server-side - /// implementations are expected to accept whatever type of IRpcController the server-side RPC implementation - /// uses. - /// - /// - /// - /// Postconditions - /// - /// will be called when the method is complete. - /// This may before CallMethod returns or it may be at some point in the future. - /// The parameter to is the response. It will be of the - /// exact same type as would be returned by . - /// If the RPC failed, the parameter to will be null. - /// Further details about the failure can be found by querying . - /// - /// - /// - void CallMethod(MethodDescriptor method, IRpcController controller, - IMessage request, Action done); - - /// - /// CallMethod requires that the request passed in is of a particular implementation - /// of IMessage. This method gets the default instance of this type of a given method. - /// You can then call WeakCreateBuilderForType to create a builder to build an object which - /// you can then pass to CallMethod. - /// - IMessage GetRequestPrototype(MethodDescriptor method); - - /// - /// Like GetRequestPrototype, but returns a prototype of the response message. - /// This is generally not needed because the IService implementation contructs - /// the response message itself, but it may be useful in some cases to know ahead - /// of time what type of object will be returned. - /// - IMessage GetResponsePrototype(MethodDescriptor method); - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/InvalidProtocolBufferException.cs b/src/ProtocolBuffers/InvalidProtocolBufferException.cs deleted file mode 100644 index 67d7b37..0000000 --- a/src/ProtocolBuffers/InvalidProtocolBufferException.cs +++ /dev/null @@ -1,112 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System.IO; - -namespace Google.ProtocolBuffers -{ - /// - /// Thrown when a protocol message being parsed is invalid in some way, - /// e.g. it contains a malformed varint or a negative byte length. - /// - public sealed class InvalidProtocolBufferException : IOException - { - internal InvalidProtocolBufferException(string message) - : base(message) - { - } - - public static InvalidProtocolBufferException TruncatedMessage() - { - return new InvalidProtocolBufferException( - "While parsing a protocol message, the input ended unexpectedly " + - "in the middle of a field. This could mean either than the " + - "input has been truncated or that an embedded message " + - "misreported its own length."); - } - - internal static InvalidProtocolBufferException NegativeSize() - { - return new InvalidProtocolBufferException( - "CodedInputStream encountered an embedded string or message " + - "which claimed to have negative size."); - } - - public static InvalidProtocolBufferException MalformedVarint() - { - return new InvalidProtocolBufferException( - "CodedInputStream encountered a malformed varint."); - } - - public static InvalidProtocolBufferException InvalidTag() - { - return new InvalidProtocolBufferException( - "Protocol message contained an invalid tag (zero)."); - } - - internal static InvalidProtocolBufferException InvalidEndTag() - { - return new InvalidProtocolBufferException( - "Protocol message end-group tag did not match expected tag."); - } - - internal static InvalidProtocolBufferException InvalidWireType() - { - return new InvalidProtocolBufferException( - "Protocol message tag had invalid wire type."); - } - - internal static InvalidProtocolBufferException RecursionLimitExceeded() - { - return new InvalidProtocolBufferException( - "Protocol message had too many levels of nesting. May be malicious. " + - "Use CodedInputStream.SetRecursionLimit() to increase the depth limit."); - } - - internal static InvalidProtocolBufferException SizeLimitExceeded() - { - return new InvalidProtocolBufferException( - "Protocol message was too large. May be malicious. " + - "Use CodedInputStream.SetSizeLimit() to increase the size limit."); - } - - internal static InvalidProtocolBufferException InvalidMessageStreamTag() - { - return new InvalidProtocolBufferException( - "Stream of protocol messages had invalid tag. Expected tag is length-delimited field 1."); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/MessageStreamIterator.cs b/src/ProtocolBuffers/MessageStreamIterator.cs deleted file mode 100644 index 32d697c..0000000 --- a/src/ProtocolBuffers/MessageStreamIterator.cs +++ /dev/null @@ -1,170 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; - -namespace Google.ProtocolBuffers -{ - /// - /// Iterates over data created using a . - /// Unlike MessageStreamWriter, this class is not usually constructed directly with - /// a stream; instead it is provided with a way of opening a stream when iteration - /// is started. The stream is closed when the iteration is completed or the enumerator - /// is disposed. (This occurs naturally when using foreach.) - /// - public class MessageStreamIterator : IEnumerable - where TMessage : IMessage - { - private readonly StreamProvider streamProvider; - private readonly ExtensionRegistry extensionRegistry; - private readonly int sizeLimit; - - /// - /// The default instance of TMessage type used to construct builders while reading - /// - private static readonly TMessage defaultMessageInstance = CreateDefaultInstance(); - /// - /// Any exception (within reason) thrown in type ctor is caught and rethrown in the constructor. - /// This makes life a lot simpler for the caller. - /// - private static Exception typeInitializationException; - - - /// - /// Vastly simplified the reflection to simply obtain the default instance and use it to construct - /// the weak builder while simply casting the result. Ideally this class should have required a - /// TBuilder type argument with a new() constraint to construct the initial instance thereby the - /// reflection could be eliminated. - /// - private static TMessage CreateDefaultInstance() - { - try - { - return (TMessage)typeof(TMessage) - .GetProperty("DefaultInstance", typeof(TMessage), new Type[0]) - .GetValue(null, null); - } - catch (Exception e) - { - typeInitializationException = e; - return default(TMessage); - } - } - - private static readonly uint ExpectedTag = WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited); - - private MessageStreamIterator(StreamProvider streamProvider, ExtensionRegistry extensionRegistry, int sizeLimit) - { - if (ReferenceEquals(defaultMessageInstance, null)) - { - throw new System.Reflection.TargetInvocationException(typeInitializationException); - } - this.streamProvider = streamProvider; - this.extensionRegistry = extensionRegistry; - this.sizeLimit = sizeLimit; - } - - private MessageStreamIterator(StreamProvider streamProvider, ExtensionRegistry extensionRegistry) - : this(streamProvider, extensionRegistry, CodedInputStream.DefaultSizeLimit) - { - } - - /// - /// Creates a new instance which uses the same stream provider as this one, - /// but the specified extension registry. - /// - public MessageStreamIterator WithExtensionRegistry(ExtensionRegistry newRegistry) - { - return new MessageStreamIterator(streamProvider, newRegistry, sizeLimit); - } - - /// - /// Creates a new instance which uses the same stream provider and extension registry as this one, - /// but with the specified size limit. Note that this must be big enough for the largest message - /// and the tag and size preceding it. - /// - public MessageStreamIterator WithSizeLimit(int newSizeLimit) - { - return new MessageStreamIterator(streamProvider, extensionRegistry, newSizeLimit); - } - -#if CLIENTPROFILE - public static MessageStreamIterator FromFile(string file) - { - return new MessageStreamIterator(() => File.OpenRead(file), ExtensionRegistry.Empty); - } -#endif - - public static MessageStreamIterator FromStreamProvider(StreamProvider streamProvider) - { - return new MessageStreamIterator(streamProvider, ExtensionRegistry.Empty); - } - - public IEnumerator GetEnumerator() - { - using (Stream stream = streamProvider()) - { - CodedInputStream input = CodedInputStream.CreateInstance(stream); - input.SetSizeLimit(sizeLimit); - uint tag; - string name; - while (input.ReadTag(out tag, out name)) - { - if ((tag == 0 && name == "item") || (tag == ExpectedTag)) - { - IBuilder builder = defaultMessageInstance.WeakCreateBuilderForType(); - input.ReadMessage(builder, extensionRegistry); - yield return (TMessage)builder.WeakBuild(); - } - else - { - throw InvalidProtocolBufferException.InvalidMessageStreamTag(); - } - - input.ResetSizeCounter(); - } - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/MessageStreamWriter.cs b/src/ProtocolBuffers/MessageStreamWriter.cs deleted file mode 100644 index 3430e13..0000000 --- a/src/ProtocolBuffers/MessageStreamWriter.cs +++ /dev/null @@ -1,70 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System.IO; - -namespace Google.ProtocolBuffers -{ - /// - /// Writes multiple messages to the same stream. Each message is written - /// as if it were an element of a repeated field 1 in a larger protocol buffer. - /// This class takes no ownership of the stream it is given; it never closes the - /// stream. - /// - public sealed class MessageStreamWriter where T : IMessage - { - private readonly CodedOutputStream codedOutput; - - /// - /// Creates an instance which writes to the given stream. - /// - /// Stream to write messages to. - public MessageStreamWriter(Stream output) - { - codedOutput = CodedOutputStream.CreateInstance(output); - } - - public void Write(T message) - { - codedOutput.WriteMessage(1, "item", message); - } - - public void Flush() - { - codedOutput.Flush(); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/MessageUtil.cs b/src/ProtocolBuffers/MessageUtil.cs deleted file mode 100644 index d120d20..0000000 --- a/src/ProtocolBuffers/MessageUtil.cs +++ /dev/null @@ -1,109 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Reflection; - -namespace Google.ProtocolBuffers -{ - /// - /// Utilities for arbitrary messages of an unknown type. This class does not use - /// generics precisely because it is designed for dynamically discovered types. - /// - public static class MessageUtil - { - /// - /// Returns the default message for the given type. If an exception is thrown - /// (directly from this code), the message will be suitable to be displayed to a user. - /// - /// - /// The type parameter is null. - /// The type doesn't implement IMessage, or doesn't - /// have a static DefaultMessage property of the same type, or is generic or abstract. - /// - public static IMessage GetDefaultMessage(Type type) - { - if (type == null) - { - throw new ArgumentNullException("type", "No type specified."); - } - if (type.IsAbstract || type.IsGenericTypeDefinition) - { - throw new ArgumentException("Unable to get a default message for an abstract or generic type (" + - type.FullName + ")"); - } - if (!typeof(IMessage).IsAssignableFrom(type)) - { - throw new ArgumentException("Unable to get a default message for non-message type (" + type.FullName + - ")"); - } - PropertyInfo property = type.GetProperty("DefaultInstance", - BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); - if (property == null) - { - throw new ArgumentException(type.FullName + " doesn't have a static DefaultInstance property"); - } - if (property.PropertyType != type) - { - throw new ArgumentException(type.FullName + ".DefaultInstance property is of the wrong type"); - } - return (IMessage) property.GetValue(null, null); - } - - /// - /// Returns the default message for the type with the given name. This is just - /// a convenience wrapper around calling Type.GetType and then GetDefaultMessage. - /// If an exception is thrown, the message will be suitable to be displayed to a user. - /// - /// - /// The typeName parameter is null. - /// The type doesn't implement IMessage, or doesn't - /// have a static DefaultMessage property of the same type, or can't be found. - public static IMessage GetDefaultMessage(string typeName) - { - if (typeName == null) - { - throw new ArgumentNullException("typeName", "No type name specified."); - } - Type type = Type.GetType(typeName); - if (type == null) - { - throw new ArgumentException("Unable to load type " + typeName); - } - return GetDefaultMessage(type); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/NameHelpers.cs b/src/ProtocolBuffers/NameHelpers.cs deleted file mode 100644 index 80a1f9a..0000000 --- a/src/ProtocolBuffers/NameHelpers.cs +++ /dev/null @@ -1,140 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Text.RegularExpressions; - -namespace Google.ProtocolBuffers -{ - /// - /// Helpers for converting names to pascal case etc. - /// - public class NameHelpers - { - /// - /// All characters that are not alpha-numeric - /// - private static readonly Regex NonAlphaNumericCharacters = new Regex(@"[^a-zA-Z0-9]+"); - - /// - /// Matches lower-case character that follow either an underscore, or a number - /// - private static readonly Regex UnderscoreOrNumberWithLowerCase = new Regex(@"[0-9_][a-z]"); - - /// - /// Removes non alpha numeric characters while capitalizing letters that follow - /// a number or underscore. The first letter is always upper case. - /// - public static string UnderscoresToPascalCase(string input) - { - string name = UnderscoresToUpperCase(input); - - // Pascal case always begins with upper-case letter - if (Char.IsLower(name[0])) - { - char[] chars = name.ToCharArray(); - chars[0] = char.ToUpper(chars[0]); - return new string(chars); - } - return name; - } - - /// - /// Removes non alpha numeric characters while capitalizing letters that follow - /// a number or underscore. The first letter is always lower case. - /// - public static string UnderscoresToCamelCase(string input) - { - string name = UnderscoresToUpperCase(input); - - // Camel case always begins with lower-case letter - if (Char.IsUpper(name[0])) - { - char[] chars = name.ToCharArray(); - chars[0] = char.ToLower(chars[0]); - return new string(chars); - } - return name; - } - - /// - /// Capitalizes any characters following an '_' or a number '0' - '9' and removes - /// all non alpha-numeric characters. If the resulting string begins with a number - /// an '_' will be prefixed. - /// - private static string UnderscoresToUpperCase(string input) - { - string name = UnderscoreOrNumberWithLowerCase.Replace(input, x => x.Value.ToUpper()); - name = NonAlphaNumericCharacters.Replace(name, String.Empty); - - if (name.Length == 0) - { - throw new ArgumentException(String.Format("The field name '{0}' is invalid.", input)); - } - - // Fields can not start with a number - if (Char.IsNumber(name[0])) - { - name = '_' + name; - } - - return name; - } - - internal static string StripProto(string text) - { - if (!StripSuffix(ref text, ".protodevel")) - { - StripSuffix(ref text, ".proto"); - } - return text; - } - - /// - /// Attempts to strip a suffix from a string, returning whether - /// or not the suffix was actually present. - /// - public static bool StripSuffix(ref string text, string suffix) - { - if (text.EndsWith(suffix)) - { - text = text.Substring(0, text.Length - suffix.Length); - return true; - } - return false; - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/Properties/AssemblyInfo.cs b/src/ProtocolBuffers/Properties/AssemblyInfo.cs deleted file mode 100644 index cbab444..0000000 --- a/src/ProtocolBuffers/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,72 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -using System; -using System.Reflection; -using System.Runtime.InteropServices; -using System.Runtime.CompilerServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -using System.Security; - -[assembly: AssemblyTitle("ProtocolBuffers")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ProtocolBuffers")] -[assembly: AssemblyCopyright("Copyright © 2008")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("2.4.1.555")] - -[assembly: AssemblyVersion("2.4.1.555")] - -#if !NOFILEVERSION -[assembly: AssemblyFileVersion("2.4.1.555")] -#endif - -[assembly: CLSCompliant(true)] - -#if CLIENTPROFILE // ROK - not defined in SL, CF, or PL -[assembly: AllowPartiallyTrustedCallers] -#endif diff --git a/src/ProtocolBuffers/ProtocolBuffers.CF20.csproj b/src/ProtocolBuffers/ProtocolBuffers.CF20.csproj deleted file mode 100644 index bfadf16..0000000 --- a/src/ProtocolBuffers/ProtocolBuffers.CF20.csproj +++ /dev/null @@ -1,166 +0,0 @@ - - - COMPACT_FRAMEWORK - CF20 - Debug - AnyCPU - 9.0.30729 - 2.0 - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffers - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Smartphone - f27da329-3269-4191-98e0-c87d3d7f1db9 - - - true - full - false - bin\CF20\Debug - obj\CF20\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION;NOEXTENSIONS - prompt - 4 - true - Off - true - - - pdbonly - true - bin\CF20\Release - obj\CF20\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION;NOEXTENSIONS - prompt - 4 - true - Off - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers/ProtocolBuffers.CF35.csproj b/src/ProtocolBuffers/ProtocolBuffers.CF35.csproj deleted file mode 100644 index 72e35c1..0000000 --- a/src/ProtocolBuffers/ProtocolBuffers.CF35.csproj +++ /dev/null @@ -1,167 +0,0 @@ - - - COMPACT_FRAMEWORK - CF35 - Debug - AnyCPU - 9.0.30729 - 2.0 - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffers - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Smartphone - f27da329-3269-4191-98e0-c87d3d7f1db9 - - - true - full - false - bin\CF35\Debug - obj\CF35\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION - prompt - 4 - true - Off - true - - - pdbonly - true - bin\CF35\Release - obj\CF35\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION - prompt - 4 - true - Off - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers/ProtocolBuffers.NET20.csproj b/src/ProtocolBuffers/ProtocolBuffers.NET20.csproj deleted file mode 100644 index 9bba728..0000000 --- a/src/ProtocolBuffers/ProtocolBuffers.NET20.csproj +++ /dev/null @@ -1,154 +0,0 @@ - - - CLIENTPROFILE - NET20 - Debug - AnyCPU - 9.0.30729 - 2.0 - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffers - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET20\Debug - obj\NET20\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOEXTENSIONS - prompt - 4 - true - Off - - - pdbonly - true - bin\NET20\Release - obj\NET20\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOEXTENSIONS - prompt - 4 - true - Off - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers/ProtocolBuffers.NET35.csproj b/src/ProtocolBuffers/ProtocolBuffers.NET35.csproj deleted file mode 100644 index 6a79d92..0000000 --- a/src/ProtocolBuffers/ProtocolBuffers.NET35.csproj +++ /dev/null @@ -1,155 +0,0 @@ - - - CLIENTPROFILE - NET35 - Debug - AnyCPU - 9.0.30729 - 2.0 - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffers - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET35\Debug - obj\NET35\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - pdbonly - true - bin\NET35\Release - obj\NET35\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers/ProtocolBuffers.NET40.csproj b/src/ProtocolBuffers/ProtocolBuffers.NET40.csproj deleted file mode 100644 index 7495778..0000000 --- a/src/ProtocolBuffers/ProtocolBuffers.NET40.csproj +++ /dev/null @@ -1,155 +0,0 @@ - - - CLIENTPROFILE - NET40 - Debug - AnyCPU - 9.0.30729 - 2.0 - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffers - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET40\Debug - obj\NET40\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - pdbonly - true - bin\NET40\Release - obj\NET40\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers/ProtocolBuffers.PL40.csproj b/src/ProtocolBuffers/ProtocolBuffers.PL40.csproj deleted file mode 100644 index 00ffddb..0000000 --- a/src/ProtocolBuffers/ProtocolBuffers.PL40.csproj +++ /dev/null @@ -1,158 +0,0 @@ - - - PORTABLE_LIBRARY - PL40 - Debug - AnyCPU - 9.0.30729 - 2.0 - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffers - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - 10.0 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Profile1 - - - true - full - false - bin\PL40\Debug - obj\PL40\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - - - pdbonly - true - bin\PL40\Release - obj\PL40\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers/ProtocolBuffers.SL20.csproj b/src/ProtocolBuffers/ProtocolBuffers.SL20.csproj deleted file mode 100644 index 10fc828..0000000 --- a/src/ProtocolBuffers/ProtocolBuffers.SL20.csproj +++ /dev/null @@ -1,169 +0,0 @@ - - - SILVERLIGHT - SL20 - Debug - AnyCPU - 9.0.30729 - 2.0 - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffers - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - false - false - false - - - true - full - false - bin\SL20\Debug - obj\SL20\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST;NOEXTENSIONS - prompt - 4 - true - Off - true - - - pdbonly - true - bin\SL20\Release - obj\SL20\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST;NOEXTENSIONS - prompt - 4 - true - Off - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OfflineApplication - - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers/ProtocolBuffers.SL30.csproj b/src/ProtocolBuffers/ProtocolBuffers.SL30.csproj deleted file mode 100644 index 4fe571c..0000000 --- a/src/ProtocolBuffers/ProtocolBuffers.SL30.csproj +++ /dev/null @@ -1,170 +0,0 @@ - - - SILVERLIGHT - SL30 - Debug - AnyCPU - 9.0.30729 - 2.0 - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffers - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - false - false - false - - - true - full - false - bin\SL30\Debug - obj\SL30\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - true - - - pdbonly - true - bin\SL30\Release - obj\SL30\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OfflineApplication - - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers/ProtocolBuffers.SL40.csproj b/src/ProtocolBuffers/ProtocolBuffers.SL40.csproj deleted file mode 100644 index 3664e47..0000000 --- a/src/ProtocolBuffers/ProtocolBuffers.SL40.csproj +++ /dev/null @@ -1,171 +0,0 @@ - - - SILVERLIGHT - SL40 - Debug - AnyCPU - 9.0.30729 - 2.0 - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffers - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - false - false - false - v4.0 - - - true - full - false - bin\SL40\Debug - obj\SL40\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - true - - - pdbonly - true - bin\SL40\Release - obj\SL40\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OfflineApplication - - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers/ProtocolBuffers.csproj b/src/ProtocolBuffers/ProtocolBuffers.csproj deleted file mode 100644 index fe1f04a..0000000 --- a/src/ProtocolBuffers/ProtocolBuffers.csproj +++ /dev/null @@ -1,155 +0,0 @@ - - - - CLIENTPROFILE - NET35 - Debug - AnyCPU - 9.0.30729 - 2.0 - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffers - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET35\Debug - obj\NET35\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - pdbonly - true - bin\NET35\Release - obj\NET35\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers/ProtocolBuffersLite.CF20.csproj b/src/ProtocolBuffers/ProtocolBuffersLite.CF20.csproj deleted file mode 100644 index 6cf373f..0000000 --- a/src/ProtocolBuffers/ProtocolBuffersLite.CF20.csproj +++ /dev/null @@ -1,111 +0,0 @@ - - - COMPACT_FRAMEWORK - CF20 - Debug - AnyCPU - 9.0.30729 - 2.0 - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersLite - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Smartphone - f27da329-3269-4191-98e0-c87d3d7f1db9 - - - true - full - false - bin\CF20\Debug - obj\CF20\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION;NOEXTENSIONS - prompt - 4 - true - Off - true - - - pdbonly - true - bin\CF20\Release - obj\CF20\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION;NOEXTENSIONS - prompt - 4 - true - Off - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers/ProtocolBuffersLite.CF35.csproj b/src/ProtocolBuffers/ProtocolBuffersLite.CF35.csproj deleted file mode 100644 index dad0071..0000000 --- a/src/ProtocolBuffers/ProtocolBuffersLite.CF35.csproj +++ /dev/null @@ -1,112 +0,0 @@ - - - COMPACT_FRAMEWORK - CF35 - Debug - AnyCPU - 9.0.30729 - 2.0 - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersLite - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Smartphone - f27da329-3269-4191-98e0-c87d3d7f1db9 - - - true - full - false - bin\CF35\Debug - obj\CF35\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION - prompt - 4 - true - Off - true - - - pdbonly - true - bin\CF35\Release - obj\CF35\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION - prompt - 4 - true - Off - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers/ProtocolBuffersLite.NET20.csproj b/src/ProtocolBuffers/ProtocolBuffersLite.NET20.csproj deleted file mode 100644 index d516776..0000000 --- a/src/ProtocolBuffers/ProtocolBuffersLite.NET20.csproj +++ /dev/null @@ -1,99 +0,0 @@ - - - CLIENTPROFILE - NET20 - Debug - AnyCPU - 9.0.30729 - 2.0 - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersLite - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET20\Debug - obj\NET20\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOEXTENSIONS - prompt - 4 - true - Off - - - pdbonly - true - bin\NET20\Release - obj\NET20\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOEXTENSIONS - prompt - 4 - true - Off - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers/ProtocolBuffersLite.NET35.csproj b/src/ProtocolBuffers/ProtocolBuffersLite.NET35.csproj deleted file mode 100644 index d811fb5..0000000 --- a/src/ProtocolBuffers/ProtocolBuffersLite.NET35.csproj +++ /dev/null @@ -1,100 +0,0 @@ - - - CLIENTPROFILE - NET35 - Debug - AnyCPU - 9.0.30729 - 2.0 - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersLite - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET35\Debug - obj\NET35\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - pdbonly - true - bin\NET35\Release - obj\NET35\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers/ProtocolBuffersLite.NET40.csproj b/src/ProtocolBuffers/ProtocolBuffersLite.NET40.csproj deleted file mode 100644 index ad3abc6..0000000 --- a/src/ProtocolBuffers/ProtocolBuffersLite.NET40.csproj +++ /dev/null @@ -1,100 +0,0 @@ - - - CLIENTPROFILE - NET40 - Debug - AnyCPU - 9.0.30729 - 2.0 - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersLite - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET40\Debug - obj\NET40\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - pdbonly - true - bin\NET40\Release - obj\NET40\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers/ProtocolBuffersLite.PL40.csproj b/src/ProtocolBuffers/ProtocolBuffersLite.PL40.csproj deleted file mode 100644 index 67f9093..0000000 --- a/src/ProtocolBuffers/ProtocolBuffersLite.PL40.csproj +++ /dev/null @@ -1,103 +0,0 @@ - - - PORTABLE_LIBRARY - PL40 - Debug - AnyCPU - 9.0.30729 - 2.0 - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersLite - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - 10.0 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Profile1 - - - true - full - false - bin\PL40\Debug - obj\PL40\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - - - pdbonly - true - bin\PL40\Release - obj\PL40\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers/ProtocolBuffersLite.SL20.csproj b/src/ProtocolBuffers/ProtocolBuffersLite.SL20.csproj deleted file mode 100644 index 1bbad18..0000000 --- a/src/ProtocolBuffers/ProtocolBuffersLite.SL20.csproj +++ /dev/null @@ -1,114 +0,0 @@ - - - SILVERLIGHT - SL20 - Debug - AnyCPU - 9.0.30729 - 2.0 - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersLite - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - false - false - false - - - true - full - false - bin\SL20\Debug - obj\SL20\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST;NOEXTENSIONS - prompt - 4 - true - Off - true - - - pdbonly - true - bin\SL20\Release - obj\SL20\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST;NOEXTENSIONS - prompt - 4 - true - Off - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OfflineApplication - - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers/ProtocolBuffersLite.SL30.csproj b/src/ProtocolBuffers/ProtocolBuffersLite.SL30.csproj deleted file mode 100644 index ab0e809..0000000 --- a/src/ProtocolBuffers/ProtocolBuffersLite.SL30.csproj +++ /dev/null @@ -1,115 +0,0 @@ - - - SILVERLIGHT - SL30 - Debug - AnyCPU - 9.0.30729 - 2.0 - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersLite - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - false - false - false - - - true - full - false - bin\SL30\Debug - obj\SL30\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - true - - - pdbonly - true - bin\SL30\Release - obj\SL30\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OfflineApplication - - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers/ProtocolBuffersLite.SL40.csproj b/src/ProtocolBuffers/ProtocolBuffersLite.SL40.csproj deleted file mode 100644 index 42e5be1..0000000 --- a/src/ProtocolBuffers/ProtocolBuffersLite.SL40.csproj +++ /dev/null @@ -1,116 +0,0 @@ - - - SILVERLIGHT - SL40 - Debug - AnyCPU - 9.0.30729 - 2.0 - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersLite - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - false - false - false - v4.0 - - - true - full - false - bin\SL40\Debug - obj\SL40\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - true - - - pdbonly - true - bin\SL40\Release - obj\SL40\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - Off - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OfflineApplication - - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers/ProtocolBuffersLite.csproj b/src/ProtocolBuffers/ProtocolBuffersLite.csproj deleted file mode 100644 index 4037c2b..0000000 --- a/src/ProtocolBuffers/ProtocolBuffersLite.csproj +++ /dev/null @@ -1,100 +0,0 @@ - - - - CLIENTPROFILE - NET35 - Debug - AnyCPU - 9.0.30729 - 2.0 - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersLite - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET35\Debug - obj\NET35\Debug\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - pdbonly - true - bin\NET35\Release - obj\NET35\Release\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - Off - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffers/RpcUtil.cs b/src/ProtocolBuffers/RpcUtil.cs deleted file mode 100644 index 4659d86..0000000 --- a/src/ProtocolBuffers/RpcUtil.cs +++ /dev/null @@ -1,79 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; - -namespace Google.ProtocolBuffers -{ - /// - /// Grab-bag of utility functions useful when dealing with RPCs. - /// - public static class RpcUtil - { - /// - /// Converts an Action[IMessage] to an Action[T]. - /// - public static Action SpecializeCallback(Action action) - where T : IMessage - { - return message => action(message); - } - - /// - /// Converts an Action[T] to an Action[IMessage]. - /// The generalized action will accept any message object which has - /// the same descriptor, and will convert it to the correct class - /// before calling the original action. However, if the generalized - /// callback is given a message with a different descriptor, an - /// exception will be thrown. - /// - public static Action GeneralizeCallback(Action action, - TMessage defaultInstance) - where TMessage : class, IMessage - where TBuilder : IBuilder - { - return message => - { - TMessage castMessage = message as TMessage; - if (castMessage == null) - { - castMessage = defaultInstance.CreateBuilderForType().MergeFrom(message).Build(); - } - action(castMessage); - }; - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/SortedList.cs b/src/ProtocolBuffers/SortedList.cs deleted file mode 100644 index 2dd7da9..0000000 --- a/src/ProtocolBuffers/SortedList.cs +++ /dev/null @@ -1,167 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -#if NOSORTEDLIST -using System.Collections; -using System.Collections.Generic; - -namespace Google.ProtocolBuffers -{ - /// - /// Dictionary implementation which always yields keys in sorted order. - /// This is not particularly efficient: it wraps a normal dictionary - /// for most operations, but sorts by key when either iterating or - /// fetching the Keys/Values properties. - /// - internal sealed class SortedList : IDictionary - { - private readonly IDictionary wrapped = new Dictionary(); - - public SortedList() - { - } - - public SortedList(IDictionary dictionary) - { - foreach (KeyValuePair entry in dictionary) - { - Add(entry.Key, entry.Value); - } - } - - public void Add(TKey key, TValue value) - { - wrapped.Add(key, value); - } - - public bool ContainsKey(TKey key) - { - return wrapped.ContainsKey(key); - } - - public ICollection Keys - { - get - { - List keys = new List(wrapped.Count); - foreach (var pair in this) - { - keys.Add(pair.Key); - } - return keys; - } - } - - public bool Remove(TKey key) - { - return wrapped.Remove(key); - } - - public bool TryGetValue(TKey key, out TValue value) - { - return wrapped.TryGetValue(key, out value); - } - - public ICollection Values - { - get - { - List values = new List(wrapped.Count); - foreach (var pair in this) - { - values.Add(pair.Value); - } - return values; - } - } - - public TValue this[TKey key] - { - get { return wrapped[key]; } - set { wrapped[key] = value; } - } - - public void Add(KeyValuePair item) - { - wrapped.Add(item); - } - - public void Clear() - { - wrapped.Clear(); - } - - public bool Contains(KeyValuePair item) - { - return wrapped.Contains(item); - } - - public void CopyTo(KeyValuePair[] array, int arrayIndex) - { - wrapped.CopyTo(array, arrayIndex); - } - - public int Count - { - get { return wrapped.Count; } - } - - public bool IsReadOnly - { - get { return wrapped.IsReadOnly; } - } - - public bool Remove(KeyValuePair item) - { - return wrapped.Remove(item); - } - - public IEnumerator> GetEnumerator() - { - IComparer comparer = Comparer.Default; - var list = new List>(wrapped); - list.Sort((x, y) => comparer.Compare(x.Key, y.Key)); - return list.GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } - } -} - -#endif \ No newline at end of file diff --git a/src/ProtocolBuffers/TextFormat.cs b/src/ProtocolBuffers/TextFormat.cs deleted file mode 100644 index 747dce4..0000000 --- a/src/ProtocolBuffers/TextFormat.cs +++ /dev/null @@ -1,899 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Text; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers -{ - /// - /// Provides ASCII text formatting support for messages. - /// TODO(jonskeet): Support for alternative line endings. - /// (Easy to print, via TextGenerator. Not sure about parsing.) - /// - public static class TextFormat - { - /// - /// Outputs a textual representation of the Protocol Message supplied into - /// the parameter output. - /// - public static void Print(IMessage message, TextWriter output) - { - TextGenerator generator = new TextGenerator(output, "\n"); - Print(message, generator); - } - - /// - /// Outputs a textual representation of the Protocol Message builder supplied into - /// the parameter output. - /// - public static void Print(IBuilder builder, TextWriter output) - { - TextGenerator generator = new TextGenerator(output, "\n"); - Print(builder, generator); - } - - /// - /// Outputs a textual representation of to . - /// - public static void Print(UnknownFieldSet fields, TextWriter output) - { - TextGenerator generator = new TextGenerator(output, "\n"); - PrintUnknownFields(fields, generator); - } - - public static string PrintToString(IMessage message) - { - StringWriter text = new StringWriter(); - Print(message, text); - return text.ToString(); - } - - public static string PrintToString(IBuilder builder) - { - StringWriter text = new StringWriter(); - Print(builder, text); - return text.ToString(); - } - - public static string PrintToString(UnknownFieldSet fields) - { - StringWriter text = new StringWriter(); - Print(fields, text); - return text.ToString(); - } - - private static void Print(IMessage message, TextGenerator generator) - { - foreach (KeyValuePair entry in message.AllFields) - { - PrintField(entry.Key, entry.Value, generator); - } - PrintUnknownFields(message.UnknownFields, generator); - } - - private static void Print(IBuilder message, TextGenerator generator) - { - foreach (KeyValuePair entry in message.AllFields) - { - PrintField(entry.Key, entry.Value, generator); - } - PrintUnknownFields(message.UnknownFields, generator); - } - - internal static void PrintField(FieldDescriptor field, object value, TextGenerator generator) - { - if (field.IsRepeated) - { - // Repeated field. Print each element. - foreach (object element in (IEnumerable) value) - { - PrintSingleField(field, element, generator); - } - } - else - { - PrintSingleField(field, value, generator); - } - } - - private static void PrintSingleField(FieldDescriptor field, Object value, TextGenerator generator) - { - if (field.IsExtension) - { - generator.Print("["); - // We special-case MessageSet elements for compatibility with proto1. - if (field.ContainingType.Options.MessageSetWireFormat - && field.FieldType == FieldType.Message - && field.IsOptional - // object equality (TODO(jonskeet): Work out what this comment means!) - && field.ExtensionScope == field.MessageType) - { - generator.Print(field.MessageType.FullName); - } - else - { - generator.Print(field.FullName); - } - generator.Print("]"); - } - else - { - if (field.FieldType == FieldType.Group) - { - // Groups must be serialized with their original capitalization. - generator.Print(field.MessageType.Name); - } - else - { - generator.Print(field.Name); - } - } - - if (field.MappedType == MappedType.Message) - { - generator.Print(" {\n"); - generator.Indent(); - } - else - { - generator.Print(": "); - } - - PrintFieldValue(field, value, generator); - - if (field.MappedType == MappedType.Message) - { - generator.Outdent(); - generator.Print("}"); - } - generator.Print("\n"); - } - - private static void PrintFieldValue(FieldDescriptor field, object value, TextGenerator generator) - { - switch (field.FieldType) - { - // The Float and Double types must specify the "r" format to preserve their precision, otherwise, - // the double to/from string will trim the precision to 6 places. As with other numeric formats - // below, always use the invariant culture so it's predictable. - case FieldType.Float: - generator.Print(((float)value).ToString("r", FrameworkPortability.InvariantCulture)); - break; - case FieldType.Double: - generator.Print(((double)value).ToString("r", FrameworkPortability.InvariantCulture)); - break; - - case FieldType.Int32: - case FieldType.Int64: - case FieldType.SInt32: - case FieldType.SInt64: - case FieldType.SFixed32: - case FieldType.SFixed64: - case FieldType.UInt32: - case FieldType.UInt64: - case FieldType.Fixed32: - case FieldType.Fixed64: - // The simple Object.ToString converts using the current culture. - // We want to always use the invariant culture so it's predictable. - generator.Print(((IConvertible)value).ToString(FrameworkPortability.InvariantCulture)); - break; - case FieldType.Bool: - // Explicitly use the Java true/false - generator.Print((bool) value ? "true" : "false"); - break; - - case FieldType.String: - generator.Print("\""); - generator.Print(EscapeText((string) value)); - generator.Print("\""); - break; - - case FieldType.Bytes: - { - generator.Print("\""); - generator.Print(EscapeBytes((ByteString) value)); - generator.Print("\""); - break; - } - - case FieldType.Enum: - { - if (value is IEnumLite && !(value is EnumValueDescriptor)) - { - throw new NotSupportedException("Lite enumerations are not supported."); - } - generator.Print(((EnumValueDescriptor) value).Name); - break; - } - - case FieldType.Message: - case FieldType.Group: - if (value is IMessageLite && !(value is IMessage)) - { - throw new NotSupportedException("Lite messages are not supported."); - } - Print((IMessage) value, generator); - break; - } - } - - private static void PrintUnknownFields(UnknownFieldSet unknownFields, TextGenerator generator) - { - foreach (KeyValuePair entry in unknownFields.FieldDictionary) - { - String prefix = entry.Key.ToString() + ": "; - UnknownField field = entry.Value; - - foreach (ulong value in field.VarintList) - { - generator.Print(prefix); - generator.Print(value.ToString()); - generator.Print("\n"); - } - foreach (uint value in field.Fixed32List) - { - generator.Print(prefix); - generator.Print(string.Format("0x{0:x8}", value)); - generator.Print("\n"); - } - foreach (ulong value in field.Fixed64List) - { - generator.Print(prefix); - generator.Print(string.Format("0x{0:x16}", value)); - generator.Print("\n"); - } - foreach (ByteString value in field.LengthDelimitedList) - { - generator.Print(entry.Key.ToString()); - generator.Print(": \""); - generator.Print(EscapeBytes(value)); - generator.Print("\"\n"); - } - foreach (UnknownFieldSet value in field.GroupList) - { - generator.Print(entry.Key.ToString()); - generator.Print(" {\n"); - generator.Indent(); - PrintUnknownFields(value, generator); - generator.Outdent(); - generator.Print("}\n"); - } - } - } - - [CLSCompliant(false)] - public static ulong ParseUInt64(string text) - { - return (ulong) ParseInteger(text, false, true); - } - - public static long ParseInt64(string text) - { - return ParseInteger(text, true, true); - } - - [CLSCompliant(false)] - public static uint ParseUInt32(string text) - { - return (uint) ParseInteger(text, false, false); - } - - public static int ParseInt32(string text) - { - return (int) ParseInteger(text, true, false); - } - - public static float ParseFloat(string text) - { - switch (text) - { - case "-inf": - case "-infinity": - case "-inff": - case "-infinityf": - return float.NegativeInfinity; - case "inf": - case "infinity": - case "inff": - case "infinityf": - return float.PositiveInfinity; - case "nan": - case "nanf": - return float.NaN; - default: - return float.Parse(text, FrameworkPortability.InvariantCulture); - } - } - - public static double ParseDouble(string text) - { - switch (text) - { - case "-inf": - case "-infinity": - return double.NegativeInfinity; - case "inf": - case "infinity": - return double.PositiveInfinity; - case "nan": - return double.NaN; - default: - return double.Parse(text, FrameworkPortability.InvariantCulture); - } - } - - /// - /// Parses an integer in hex (leading 0x), decimal (no prefix) or octal (leading 0). - /// Only a negative sign is permitted, and it must come before the radix indicator. - /// - private static long ParseInteger(string text, bool isSigned, bool isLong) - { - string original = text; - bool negative = false; - if (text.StartsWith("-")) - { - if (!isSigned) - { - throw new FormatException("Number must be positive: " + original); - } - negative = true; - text = text.Substring(1); - } - - int radix = 10; - if (text.StartsWith("0x")) - { - radix = 16; - text = text.Substring(2); - } - else if (text.StartsWith("0")) - { - radix = 8; - } - - ulong result; - try - { - // Workaround for https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=278448 - // We should be able to use Convert.ToUInt64 for all cases. - result = radix == 10 ? ulong.Parse(text) : Convert.ToUInt64(text, radix); - } - catch (OverflowException) - { - // Convert OverflowException to FormatException so there's a single exception type this method can throw. - string numberDescription = string.Format("{0}-bit {1}signed integer", isLong ? 64 : 32, - isSigned ? "" : "un"); - throw new FormatException("Number out of range for " + numberDescription + ": " + original); - } - - if (negative) - { - ulong max = isLong ? 0x8000000000000000UL : 0x80000000L; - if (result > max) - { - string numberDescription = string.Format("{0}-bit signed integer", isLong ? 64 : 32); - throw new FormatException("Number out of range for " + numberDescription + ": " + original); - } - return -((long) result); - } - else - { - ulong max = isSigned - ? (isLong ? (ulong) long.MaxValue : int.MaxValue) - : (isLong ? ulong.MaxValue : uint.MaxValue); - if (result > max) - { - string numberDescription = string.Format("{0}-bit {1}signed integer", isLong ? 64 : 32, - isSigned ? "" : "un"); - throw new FormatException("Number out of range for " + numberDescription + ": " + original); - } - return (long) result; - } - } - - /// - /// Tests a character to see if it's an octal digit. - /// - private static bool IsOctal(char c) - { - return '0' <= c && c <= '7'; - } - - /// - /// Tests a character to see if it's a hex digit. - /// - private static bool IsHex(char c) - { - return ('0' <= c && c <= '9') || - ('a' <= c && c <= 'f') || - ('A' <= c && c <= 'F'); - } - - /// - /// Interprets a character as a digit (in any base up to 36) and returns the - /// numeric value. - /// - private static int ParseDigit(char c) - { - if ('0' <= c && c <= '9') - { - return c - '0'; - } - else if ('a' <= c && c <= 'z') - { - return c - 'a' + 10; - } - else - { - return c - 'A' + 10; - } - } - - /// - /// Unescapes a text string as escaped using . - /// Two-digit hex escapes (starting with "\x" are also recognised. - /// - public static string UnescapeText(string input) - { - return UnescapeBytes(input).ToStringUtf8(); - } - - /// - /// Like but escapes a text string. - /// The string is first encoded as UTF-8, then each byte escaped individually. - /// The returned value is guaranteed to be entirely ASCII. - /// - public static string EscapeText(string input) - { - return EscapeBytes(ByteString.CopyFromUtf8(input)); - } - - /// - /// Escapes bytes in the format used in protocol buffer text format, which - /// is the same as the format used for C string literals. All bytes - /// that are not printable 7-bit ASCII characters are escaped, as well as - /// backslash, single-quote, and double-quote characters. Characters for - /// which no defined short-hand escape sequence is defined will be escaped - /// using 3-digit octal sequences. - /// The returned value is guaranteed to be entirely ASCII. - /// - public static String EscapeBytes(ByteString input) - { - StringBuilder builder = new StringBuilder(input.Length); - foreach (byte b in input) - { - switch (b) - { - // C# does not use \a or \v - case 0x07: - builder.Append("\\a"); - break; - case (byte) '\b': - builder.Append("\\b"); - break; - case (byte) '\f': - builder.Append("\\f"); - break; - case (byte) '\n': - builder.Append("\\n"); - break; - case (byte) '\r': - builder.Append("\\r"); - break; - case (byte) '\t': - builder.Append("\\t"); - break; - case 0x0b: - builder.Append("\\v"); - break; - case (byte) '\\': - builder.Append("\\\\"); - break; - case (byte) '\'': - builder.Append("\\\'"); - break; - case (byte) '"': - builder.Append("\\\""); - break; - default: - if (b >= 0x20 && b < 128) - { - builder.Append((char) b); - } - else - { - builder.Append('\\'); - builder.Append((char) ('0' + ((b >> 6) & 3))); - builder.Append((char) ('0' + ((b >> 3) & 7))); - builder.Append((char) ('0' + (b & 7))); - } - break; - } - } - return builder.ToString(); - } - - /// - /// Performs string unescaping from C style (octal, hex, form feeds, tab etc) into a byte string. - /// - public static ByteString UnescapeBytes(string input) - { - byte[] result = new byte[input.Length]; - int pos = 0; - for (int i = 0; i < input.Length; i++) - { - char c = input[i]; - if (c > 127 || c < 32) - { - throw new FormatException("Escaped string must only contain ASCII"); - } - if (c != '\\') - { - result[pos++] = (byte) c; - continue; - } - if (i + 1 >= input.Length) - { - throw new FormatException("Invalid escape sequence: '\\' at end of string."); - } - - i++; - c = input[i]; - if (c >= '0' && c <= '7') - { - // Octal escape. - int code = ParseDigit(c); - if (i + 1 < input.Length && IsOctal(input[i + 1])) - { - i++; - code = code*8 + ParseDigit(input[i]); - } - if (i + 1 < input.Length && IsOctal(input[i + 1])) - { - i++; - code = code*8 + ParseDigit(input[i]); - } - result[pos++] = (byte) code; - } - else - { - switch (c) - { - case 'a': - result[pos++] = 0x07; - break; - case 'b': - result[pos++] = (byte) '\b'; - break; - case 'f': - result[pos++] = (byte) '\f'; - break; - case 'n': - result[pos++] = (byte) '\n'; - break; - case 'r': - result[pos++] = (byte) '\r'; - break; - case 't': - result[pos++] = (byte) '\t'; - break; - case 'v': - result[pos++] = 0x0b; - break; - case '\\': - result[pos++] = (byte) '\\'; - break; - case '\'': - result[pos++] = (byte) '\''; - break; - case '"': - result[pos++] = (byte) '\"'; - break; - - case 'x': - // hex escape - int code; - if (i + 1 < input.Length && IsHex(input[i + 1])) - { - i++; - code = ParseDigit(input[i]); - } - else - { - throw new FormatException("Invalid escape sequence: '\\x' with no digits"); - } - if (i + 1 < input.Length && IsHex(input[i + 1])) - { - ++i; - code = code*16 + ParseDigit(input[i]); - } - result[pos++] = (byte) code; - break; - - default: - throw new FormatException("Invalid escape sequence: '\\" + c + "'"); - } - } - } - - return ByteString.CopyFrom(result, 0, pos); - } - - public static void Merge(string text, IBuilder builder) - { - Merge(text, ExtensionRegistry.Empty, builder); - } - - public static void Merge(TextReader reader, IBuilder builder) - { - Merge(reader, ExtensionRegistry.Empty, builder); - } - - public static void Merge(TextReader reader, ExtensionRegistry registry, IBuilder builder) - { - Merge(reader.ReadToEnd(), registry, builder); - } - - public static void Merge(string text, ExtensionRegistry registry, IBuilder builder) - { - TextTokenizer tokenizer = new TextTokenizer(text); - - while (!tokenizer.AtEnd) - { - MergeField(tokenizer, registry, builder); - } - } - - /// - /// Parses a single field from the specified tokenizer and merges it into - /// the builder. - /// - private static void MergeField(TextTokenizer tokenizer, ExtensionRegistry extensionRegistry, - IBuilder builder) - { - FieldDescriptor field; - MessageDescriptor type = builder.DescriptorForType; - ExtensionInfo extension = null; - - if (tokenizer.TryConsume("[")) - { - // An extension. - StringBuilder name = new StringBuilder(tokenizer.ConsumeIdentifier()); - while (tokenizer.TryConsume(".")) - { - name.Append("."); - name.Append(tokenizer.ConsumeIdentifier()); - } - - extension = extensionRegistry.FindByName(type, name.ToString()); - - if (extension == null) - { - throw tokenizer.CreateFormatExceptionPreviousToken("Extension \"" + name + - "\" not found in the ExtensionRegistry."); - } - else if (extension.Descriptor.ContainingType != type) - { - throw tokenizer.CreateFormatExceptionPreviousToken("Extension \"" + name + - "\" does not extend message type \"" + - type.FullName + "\"."); - } - - tokenizer.Consume("]"); - - field = extension.Descriptor; - } - else - { - String name = tokenizer.ConsumeIdentifier(); - field = type.FindDescriptor(name); - - // Group names are expected to be capitalized as they appear in the - // .proto file, which actually matches their type names, not their field - // names. - if (field == null) - { - // Explicitly specify the invariant culture so that this code does not break when - // executing in Turkey. -#if PORTABLE_LIBRARY - String lowerName = name.ToLowerInvariant(); -#else - String lowerName = name.ToLower(FrameworkPortability.InvariantCulture); -#endif - field = type.FindDescriptor(lowerName); - // If the case-insensitive match worked but the field is NOT a group, - // TODO(jonskeet): What? Java comment ends here! - if (field != null && field.FieldType != FieldType.Group) - { - field = null; - } - } - // Again, special-case group names as described above. - if (field != null && field.FieldType == FieldType.Group && field.MessageType.Name != name) - { - field = null; - } - - if (field == null) - { - throw tokenizer.CreateFormatExceptionPreviousToken( - "Message type \"" + type.FullName + "\" has no field named \"" + name + "\"."); - } - } - - object value = null; - - if (field.MappedType == MappedType.Message) - { - tokenizer.TryConsume(":"); // optional - - String endToken; - if (tokenizer.TryConsume("<")) - { - endToken = ">"; - } - else - { - tokenizer.Consume("{"); - endToken = "}"; - } - - IBuilder subBuilder; - if (extension == null) - { - subBuilder = builder.CreateBuilderForField(field); - } - else - { - subBuilder = extension.DefaultInstance.WeakCreateBuilderForType() as IBuilder; - if (subBuilder == null) - { - throw new NotSupportedException("Lite messages are not supported."); - } - } - - while (!tokenizer.TryConsume(endToken)) - { - if (tokenizer.AtEnd) - { - throw tokenizer.CreateFormatException("Expected \"" + endToken + "\"."); - } - MergeField(tokenizer, extensionRegistry, subBuilder); - } - - value = subBuilder.WeakBuild(); - } - else - { - tokenizer.Consume(":"); - - switch (field.FieldType) - { - case FieldType.Int32: - case FieldType.SInt32: - case FieldType.SFixed32: - value = tokenizer.ConsumeInt32(); - break; - - case FieldType.Int64: - case FieldType.SInt64: - case FieldType.SFixed64: - value = tokenizer.ConsumeInt64(); - break; - - case FieldType.UInt32: - case FieldType.Fixed32: - value = tokenizer.ConsumeUInt32(); - break; - - case FieldType.UInt64: - case FieldType.Fixed64: - value = tokenizer.ConsumeUInt64(); - break; - - case FieldType.Float: - value = tokenizer.ConsumeFloat(); - break; - - case FieldType.Double: - value = tokenizer.ConsumeDouble(); - break; - - case FieldType.Bool: - value = tokenizer.ConsumeBoolean(); - break; - - case FieldType.String: - value = tokenizer.ConsumeString(); - break; - - case FieldType.Bytes: - value = tokenizer.ConsumeByteString(); - break; - - case FieldType.Enum: - { - EnumDescriptor enumType = field.EnumType; - - if (tokenizer.LookingAtInteger()) - { - int number = tokenizer.ConsumeInt32(); - value = enumType.FindValueByNumber(number); - if (value == null) - { - throw tokenizer.CreateFormatExceptionPreviousToken( - "Enum type \"" + enumType.FullName + - "\" has no value with number " + number + "."); - } - } - else - { - String id = tokenizer.ConsumeIdentifier(); - value = enumType.FindValueByName(id); - if (value == null) - { - throw tokenizer.CreateFormatExceptionPreviousToken( - "Enum type \"" + enumType.FullName + - "\" has no value named \"" + id + "\"."); - } - } - - break; - } - - case FieldType.Message: - case FieldType.Group: - throw new InvalidOperationException("Can't get here."); - } - } - - if (field.IsRepeated) - { - builder.WeakAddRepeatedField(field, value); - } - else - { - builder.SetField(field, value); - } - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/TextGenerator.cs b/src/ProtocolBuffers/TextGenerator.cs deleted file mode 100644 index 30cbf0f..0000000 --- a/src/ProtocolBuffers/TextGenerator.cs +++ /dev/null @@ -1,159 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.IO; -using System.Text; - -namespace Google.ProtocolBuffers -{ - /// - /// Helper class to control indentation. Used for TextFormat and by ProtoGen. - /// - public sealed class TextGenerator - { - /// - /// The string to use at the end of each line. We assume that "Print" is only called using \n - /// to indicate a line break; that's what we use to detect when we need to indent etc, and - /// *just* the \n is replaced with the contents of lineBreak. - /// - private readonly string lineBreak; - - /// - /// Writer to write formatted text to. - /// - private readonly TextWriter writer; - - /// - /// Keeps track of whether the next piece of text should be indented - /// - private bool atStartOfLine = true; - - /// - /// Keeps track of the current level of indentation - /// - private readonly StringBuilder indent = new StringBuilder(); - - /// - /// Creates a generator writing to the given writer. The writer - /// is not closed by this class. - /// - public TextGenerator(TextWriter writer, string lineBreak) - { - this.writer = writer; - this.lineBreak = lineBreak; - } - - /// - /// Indents text by two spaces. After calling Indent(), two spaces - /// will be inserted at the beginning of each line of text. Indent() may - /// be called multiple times to produce deeper indents. - /// - public void Indent() - { - indent.Append(" "); - } - - /// - /// Reduces the current indent level by two spaces. - /// - public void Outdent() - { - if (indent.Length == 0) - { - throw new InvalidOperationException("Too many calls to Outdent()"); - } - indent.Length -= 2; - } - - public void WriteLine(string text) - { - Print(text); - Print("\n"); - } - - public void WriteLine(string format, params object[] args) - { - WriteLine(string.Format(format, args)); - } - - public void WriteLine() - { - WriteLine(""); - } - - /// - /// Prints the given text to the output stream, indenting at line boundaries. - /// - /// - public void Print(string text) - { - int pos = 0; - - for (int i = 0; i < text.Length; i++) - { - if (text[i] == '\n') - { - // Strip off the \n from what we write - Write(text.Substring(pos, i - pos)); - Write(lineBreak); - pos = i + 1; - atStartOfLine = true; - } - } - Write(text.Substring(pos)); - } - - public void Write(string format, params object[] args) - { - Write(string.Format(format, args)); - } - - private void Write(string data) - { - if (data.Length == 0) - { - return; - } - if (atStartOfLine) - { - atStartOfLine = false; - writer.Write(indent); - } - writer.Write(data); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/TextTokenizer.cs b/src/ProtocolBuffers/TextTokenizer.cs deleted file mode 100644 index 5bb27fd..0000000 --- a/src/ProtocolBuffers/TextTokenizer.cs +++ /dev/null @@ -1,501 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Globalization; -using System.Text.RegularExpressions; - -namespace Google.ProtocolBuffers -{ - /// - /// Represents a stream of tokens parsed from a string. - /// - internal sealed class TextTokenizer - { - private readonly string text; - private string currentToken; - - /// - /// The character index within the text to perform the next regex match at. - /// - private int matchPos = 0; - - /// - /// The character index within the text at which the current token begins. - /// - private int pos = 0; - - /// - /// The line number of the current token. - /// - private int line = 0; - - /// - /// The column number of the current token. - /// - private int column = 0; - - /// - /// The line number of the previous token. - /// - private int previousLine = 0; - - /// - /// The column number of the previous token. - /// - private int previousColumn = 0; - - // Note: atomic groups used to mimic possessive quantifiers in Java in both of these regexes - internal static readonly Regex WhitespaceAndCommentPattern = new Regex("\\G(?>(\\s|(#.*$))+)", - FrameworkPortability. - CompiledRegexWhereAvailable | - RegexOptions.Multiline); - - private static readonly Regex TokenPattern = new Regex( - "\\G[a-zA-Z_](?>[0-9a-zA-Z_+-]*)|" + // an identifier - "\\G[0-9+-](?>[0-9a-zA-Z_.+-]*)|" + // a number - "\\G\"(?>([^\"\\\n\\\\]|\\\\.)*)(\"|\\\\?$)|" + // a double-quoted string - "\\G\'(?>([^\"\\\n\\\\]|\\\\.)*)(\'|\\\\?$)", // a single-quoted string - FrameworkPortability.CompiledRegexWhereAvailable | RegexOptions.Multiline); - - private static readonly Regex DoubleInfinity = new Regex("^-?inf(inity)?$", - FrameworkPortability.CompiledRegexWhereAvailable | - RegexOptions.IgnoreCase); - - private static readonly Regex FloatInfinity = new Regex("^-?inf(inity)?f?$", - FrameworkPortability.CompiledRegexWhereAvailable | - RegexOptions.IgnoreCase); - - private static readonly Regex FloatNan = new Regex("^nanf?$", - FrameworkPortability.CompiledRegexWhereAvailable | - RegexOptions.IgnoreCase); - - /** Construct a tokenizer that parses tokens from the given text. */ - - public TextTokenizer(string text) - { - this.text = text; - SkipWhitespace(); - NextToken(); - } - - /// - /// Are we at the end of the input? - /// - public bool AtEnd - { - get { return currentToken.Length == 0; } - } - - /// - /// Advances to the next token. - /// - public void NextToken() - { - previousLine = line; - previousColumn = column; - - // Advance the line counter to the current position. - while (pos < matchPos) - { - if (text[pos] == '\n') - { - ++line; - column = 0; - } - else - { - ++column; - } - ++pos; - } - - // Match the next token. - if (matchPos == text.Length) - { - // EOF - currentToken = ""; - } - else - { - Match match = TokenPattern.Match(text, matchPos); - if (match.Success) - { - currentToken = match.Value; - matchPos += match.Length; - } - else - { - // Take one character. - currentToken = text[matchPos].ToString(); - matchPos++; - } - - SkipWhitespace(); - } - } - - /// - /// Skip over any whitespace so that matchPos starts at the next token. - /// - private void SkipWhitespace() - { - Match match = WhitespaceAndCommentPattern.Match(text, matchPos); - if (match.Success) - { - matchPos += match.Length; - } - } - - /// - /// If the next token exactly matches the given token, consume it and return - /// true. Otherwise, return false without doing anything. - /// - public bool TryConsume(string token) - { - if (currentToken == token) - { - NextToken(); - return true; - } - return false; - } - - /* - * If the next token exactly matches {@code token}, consume it. Otherwise, - * throw a {@link ParseException}. - */ - - /// - /// If the next token exactly matches the specified one, consume it. - /// Otherwise, throw a FormatException. - /// - /// - public void Consume(string token) - { - if (!TryConsume(token)) - { - throw CreateFormatException("Expected \"" + token + "\"."); - } - } - - /// - /// Returns true if the next token is an integer, but does not consume it. - /// - public bool LookingAtInteger() - { - if (currentToken.Length == 0) - { - return false; - } - - char c = currentToken[0]; - return ('0' <= c && c <= '9') || c == '-' || c == '+'; - } - - /// - /// If the next token is an identifier, consume it and return its value. - /// Otherwise, throw a FormatException. - /// - public string ConsumeIdentifier() - { - foreach (char c in currentToken) - { - if (('a' <= c && c <= 'z') || - ('A' <= c && c <= 'Z') || - ('0' <= c && c <= '9') || - (c == '_') || (c == '.')) - { - // OK - } - else - { - throw CreateFormatException("Expected identifier."); - } - } - - string result = currentToken; - NextToken(); - return result; - } - - /// - /// If the next token is a 32-bit signed integer, consume it and return its - /// value. Otherwise, throw a FormatException. - /// - public int ConsumeInt32() - { - try - { - int result = TextFormat.ParseInt32(currentToken); - NextToken(); - return result; - } - catch (FormatException e) - { - throw CreateIntegerParseException(e); - } - } - - /// - /// If the next token is a 32-bit unsigned integer, consume it and return its - /// value. Otherwise, throw a FormatException. - /// - public uint ConsumeUInt32() - { - try - { - uint result = TextFormat.ParseUInt32(currentToken); - NextToken(); - return result; - } - catch (FormatException e) - { - throw CreateIntegerParseException(e); - } - } - - /// - /// If the next token is a 64-bit signed integer, consume it and return its - /// value. Otherwise, throw a FormatException. - /// - public long ConsumeInt64() - { - try - { - long result = TextFormat.ParseInt64(currentToken); - NextToken(); - return result; - } - catch (FormatException e) - { - throw CreateIntegerParseException(e); - } - } - - /// - /// If the next token is a 64-bit unsigned integer, consume it and return its - /// value. Otherwise, throw a FormatException. - /// - public ulong ConsumeUInt64() - { - try - { - ulong result = TextFormat.ParseUInt64(currentToken); - NextToken(); - return result; - } - catch (FormatException e) - { - throw CreateIntegerParseException(e); - } - } - - /// - /// If the next token is a double, consume it and return its value. - /// Otherwise, throw a FormatException. - /// - public double ConsumeDouble() - { - // We need to parse infinity and nan separately because - // double.Parse() does not accept "inf", "infinity", or "nan". - if (DoubleInfinity.IsMatch(currentToken)) - { - bool negative = currentToken.StartsWith("-"); - NextToken(); - return negative ? double.NegativeInfinity : double.PositiveInfinity; - } - if (currentToken.Equals("nan", StringComparison.OrdinalIgnoreCase)) - { - NextToken(); - return Double.NaN; - } - - try - { - double result = double.Parse(currentToken, FrameworkPortability.InvariantCulture); - NextToken(); - return result; - } - catch (FormatException e) - { - throw CreateFloatParseException(e); - } - catch (OverflowException e) - { - throw CreateFloatParseException(e); - } - } - - /// - /// If the next token is a float, consume it and return its value. - /// Otherwise, throw a FormatException. - /// - public float ConsumeFloat() - { - // We need to parse infinity and nan separately because - // Float.parseFloat() does not accept "inf", "infinity", or "nan". - if (FloatInfinity.IsMatch(currentToken)) - { - bool negative = currentToken.StartsWith("-"); - NextToken(); - return negative ? float.NegativeInfinity : float.PositiveInfinity; - } - if (FloatNan.IsMatch(currentToken)) - { - NextToken(); - return float.NaN; - } - - if (currentToken.EndsWith("f")) - { - currentToken = currentToken.TrimEnd('f'); - } - - try - { - float result = float.Parse(currentToken, FrameworkPortability.InvariantCulture); - NextToken(); - return result; - } - catch (FormatException e) - { - throw CreateFloatParseException(e); - } - catch (OverflowException e) - { - throw CreateFloatParseException(e); - } - } - - /// - /// If the next token is a Boolean, consume it and return its value. - /// Otherwise, throw a FormatException. - /// - public bool ConsumeBoolean() - { - if (currentToken == "true") - { - NextToken(); - return true; - } - if (currentToken == "false") - { - NextToken(); - return false; - } - throw CreateFormatException("Expected \"true\" or \"false\"."); - } - - /// - /// If the next token is a string, consume it and return its (unescaped) value. - /// Otherwise, throw a FormatException. - /// - public string ConsumeString() - { - return ConsumeByteString().ToStringUtf8(); - } - - /// - /// If the next token is a string, consume it, unescape it as a - /// ByteString and return it. Otherwise, throw a FormatException. - /// - public ByteString ConsumeByteString() - { - char quote = currentToken.Length > 0 ? currentToken[0] : '\0'; - if (quote != '\"' && quote != '\'') - { - throw CreateFormatException("Expected string."); - } - - if (currentToken.Length < 2 || - currentToken[currentToken.Length - 1] != quote) - { - throw CreateFormatException("String missing ending quote."); - } - - try - { - string escaped = currentToken.Substring(1, currentToken.Length - 2); - ByteString result = TextFormat.UnescapeBytes(escaped); - NextToken(); - return result; - } - catch (FormatException e) - { - throw CreateFormatException(e.Message); - } - } - - /// - /// Returns a format exception with the current line and column numbers - /// in the description, suitable for throwing. - /// - public FormatException CreateFormatException(string description) - { - // Note: People generally prefer one-based line and column numbers. - return new FormatException((line + 1) + ":" + (column + 1) + ": " + description); - } - - /// - /// Returns a format exception with the line and column numbers of the - /// previous token in the description, suitable for throwing. - /// - public FormatException CreateFormatExceptionPreviousToken(string description) - { - // Note: People generally prefer one-based line and column numbers. - return new FormatException((previousLine + 1) + ":" + (previousColumn + 1) + ": " + description); - } - - /// - /// Constructs an appropriate FormatException for the given existing exception - /// when trying to parse an integer. - /// - private FormatException CreateIntegerParseException(FormatException e) - { - return CreateFormatException("Couldn't parse integer: " + e.Message); - } - - /// - /// Constructs an appropriate FormatException for the given existing exception - /// when trying to parse a float or double. - /// - private FormatException CreateFloatParseException(Exception e) - { - return CreateFormatException("Couldn't parse number: " + e.Message); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/ThrowHelper.cs b/src/ProtocolBuffers/ThrowHelper.cs deleted file mode 100644 index 69e5f56..0000000 --- a/src/ProtocolBuffers/ThrowHelper.cs +++ /dev/null @@ -1,92 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; - -namespace Google.ProtocolBuffers -{ - /// - /// Helper methods for throwing exceptions - /// - public static class ThrowHelper - { - /// - /// Throws an ArgumentNullException if the given value is null. - /// - public static void ThrowIfNull(object value, string name) - { - if (value == null) - { - throw new ArgumentNullException(name); - } - } - - /// - /// Throws an ArgumentNullException if the given value is null. - /// - public static void ThrowIfNull(object value) - { - if (value == null) - { - throw new ArgumentNullException(); - } - } - - /// - /// Throws an ArgumentNullException if the given value or any element within it is null. - /// - public static void ThrowIfAnyNull(IEnumerable sequence) - { - foreach (T t in sequence) - { - if (t == null) - { - throw new ArgumentNullException(); - } - } - } - - public static Exception CreateMissingMethod(Type type, string methodName) - { -#if CLIENTPROFILE - return new System.MissingMethodException(type.FullName, methodName); -#else - return new System.ArgumentException(String.Format("The method '{0}' was not found on type {1}.", methodName, type)); -#endif - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/UninitializedMessageException.cs b/src/ProtocolBuffers/UninitializedMessageException.cs deleted file mode 100644 index 9e4f856..0000000 --- a/src/ProtocolBuffers/UninitializedMessageException.cs +++ /dev/null @@ -1,208 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Text; - -#if !LITE -using Google.ProtocolBuffers.Collections; -using Google.ProtocolBuffers.Descriptors; - -#endif - -namespace Google.ProtocolBuffers -{ - /// - /// TODO(jonskeet): Write summary text. - /// - public sealed class UninitializedMessageException : Exception - { - private readonly IList missingFields; - - private UninitializedMessageException(IList missingFields) - : base(BuildDescription(missingFields)) - { - this.missingFields = new List(missingFields); - } - - /// - /// Returns a read-only list of human-readable names of - /// required fields missing from this message. Each name - /// is a full path to a field, e.g. "foo.bar[5].baz" - /// - public IList MissingFields - { - get { return missingFields; } - } - - /// - /// Converts this exception into an InvalidProtocolBufferException. - /// When a parsed message is missing required fields, this should be thrown - /// instead of UninitializedMessageException. - /// - public InvalidProtocolBufferException AsInvalidProtocolBufferException() - { - return new InvalidProtocolBufferException(Message); - } - - /// - /// Constructs the description string for a given list of missing fields. - /// - private static string BuildDescription(IEnumerable missingFields) - { - StringBuilder description = new StringBuilder("Message missing required fields: "); - bool first = true; - foreach (string field in missingFields) - { - if (first) - { - first = false; - } - else - { - description.Append(", "); - } - description.Append(field); - } - return description.ToString(); - } - - /// - /// For Lite exceptions that do not known how to enumerate missing fields - /// - public UninitializedMessageException(IMessageLite message) - : base(String.Format("Message {0} is missing required fields", message.GetType())) - { - missingFields = new List(); - } - -#if !LITE - public UninitializedMessageException(IMessage message) - : this(FindMissingFields(message)) - { - } - - /// - /// Returns a list of the full "paths" of missing required - /// fields in the specified message. - /// - private static IList FindMissingFields(IMessage message) - { - List results = new List(); - FindMissingFields(message, "", results); - return results; - } - - /// - /// Recursive helper implementing FindMissingFields. - /// - private static void FindMissingFields(IMessage message, String prefix, List results) - { - foreach (FieldDescriptor field in message.DescriptorForType.Fields) - { - if (field.IsRequired && !message.HasField(field)) - { - results.Add(prefix + field.Name); - } - } - - foreach (KeyValuePair entry in message.AllFields) - { - FieldDescriptor field = entry.Key; - object value = entry.Value; - - if (field.MappedType == MappedType.Message) - { - if (field.IsRepeated) - { - int i = 0; - foreach (object element in (IEnumerable) value) - { - if (element is IMessage) - { - FindMissingFields((IMessage) element, SubMessagePrefix(prefix, field, i++), results); - } - else - { - results.Add(prefix + field.Name); - } - } - } - else - { - if (message.HasField(field)) - { - if (value is IMessage) - { - FindMissingFields((IMessage) value, SubMessagePrefix(prefix, field, -1), results); - } - else - { - results.Add(prefix + field.Name); - } - } - } - } - } - } - - private static String SubMessagePrefix(String prefix, FieldDescriptor field, int index) - { - StringBuilder result = new StringBuilder(prefix); - if (field.IsExtension) - { - result.Append('(') - .Append(field.FullName) - .Append(')'); - } - else - { - result.Append(field.Name); - } - if (index != -1) - { - result.Append('[') - .Append(index) - .Append(']'); - } - result.Append('.'); - return result.ToString(); - } -#endif - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/UnknownField.cs b/src/ProtocolBuffers/UnknownField.cs deleted file mode 100644 index e03477f..0000000 --- a/src/ProtocolBuffers/UnknownField.cs +++ /dev/null @@ -1,418 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using Google.ProtocolBuffers.Collections; - -namespace Google.ProtocolBuffers -{ - /// - /// Represents a single field in an UnknownFieldSet. - /// - /// An UnknownField consists of five lists of values. The lists correspond - /// to the five "wire types" used in the protocol buffer binary format. - /// The wire type of each field can be determined from the encoded form alone, - /// without knowing the field's declared type. So, we are able to parse - /// unknown values at least this far and separate them. Normally, only one - /// of the five lists will contain any values, since it is impossible to - /// define a valid message type that declares two different types for the - /// same field number. However, the code is designed to allow for the case - /// where the same unknown field number is encountered using multiple different - /// wire types. - /// - /// UnknownField is an immutable class. To construct one, you must use an - /// UnknownField.Builder. - /// - public sealed class UnknownField - { - public const string UnknownFieldName = "unknown_field"; - private static readonly UnknownField defaultInstance = CreateBuilder().Build(); - private readonly ReadOnlyCollection varintList; - private readonly ReadOnlyCollection fixed32List; - private readonly ReadOnlyCollection fixed64List; - private readonly ReadOnlyCollection lengthDelimitedList; - private readonly ReadOnlyCollection groupList; - - private UnknownField(ReadOnlyCollection varintList, - ReadOnlyCollection fixed32List, - ReadOnlyCollection fixed64List, - ReadOnlyCollection lengthDelimitedList, - ReadOnlyCollection groupList) - { - this.varintList = varintList; - this.fixed32List = fixed32List; - this.fixed64List = fixed64List; - this.lengthDelimitedList = lengthDelimitedList; - this.groupList = groupList; - } - - public static UnknownField DefaultInstance - { - get { return defaultInstance; } - } - - /// - /// The list of varint values for this field. - /// - public IList VarintList - { - get { return varintList; } - } - - /// - /// The list of fixed32 values for this field. - /// - public IList Fixed32List - { - get { return fixed32List; } - } - - /// - /// The list of fixed64 values for this field. - /// - public IList Fixed64List - { - get { return fixed64List; } - } - - /// - /// The list of length-delimited values for this field. - /// - public IList LengthDelimitedList - { - get { return lengthDelimitedList; } - } - - /// - /// The list of embedded group values for this field. These - /// are represented using UnknownFieldSets rather than Messages - /// since the group's type is presumably unknown. - /// - public IList GroupList - { - get { return groupList; } - } - - public override bool Equals(object other) - { - if (ReferenceEquals(this, other)) - { - return true; - } - UnknownField otherField = other as UnknownField; - return otherField != null - && Lists.Equals(varintList, otherField.varintList) - && Lists.Equals(fixed32List, otherField.fixed32List) - && Lists.Equals(fixed64List, otherField.fixed64List) - && Lists.Equals(lengthDelimitedList, otherField.lengthDelimitedList) - && Lists.Equals(groupList, otherField.groupList); - } - - public override int GetHashCode() - { - int hash = 43; - hash = hash*47 + Lists.GetHashCode(varintList); - hash = hash*47 + Lists.GetHashCode(fixed32List); - hash = hash*47 + Lists.GetHashCode(fixed64List); - hash = hash*47 + Lists.GetHashCode(lengthDelimitedList); - hash = hash*47 + Lists.GetHashCode(groupList); - return hash; - } - - /// - /// Constructs a new Builder. - /// - public static Builder CreateBuilder() - { - return new Builder(); - } - - /// - /// Constructs a new Builder and initializes it to a copy of . - /// - public static Builder CreateBuilder(UnknownField copyFrom) - { - return new Builder().MergeFrom(copyFrom); - } - - /// - /// Serializes the field, including the field number, and writes it to - /// . - /// - public void WriteTo(int fieldNumber, ICodedOutputStream output) - { - foreach (ulong value in varintList) - { - output.WriteUnknownField(fieldNumber, WireFormat.WireType.Varint, value); - } - foreach (uint value in fixed32List) - { - output.WriteUnknownField(fieldNumber, WireFormat.WireType.Fixed32, value); - } - foreach (ulong value in fixed64List) - { - output.WriteUnknownField(fieldNumber, WireFormat.WireType.Fixed64, value); - } - foreach (ByteString value in lengthDelimitedList) - { - output.WriteUnknownBytes(fieldNumber, value); - } - foreach (UnknownFieldSet value in groupList) - { -#pragma warning disable 0612 - output.WriteUnknownGroup(fieldNumber, value); -#pragma warning restore 0612 - } - } - - /// - /// Computes the number of bytes required to encode this field, including field - /// number. - /// - public int GetSerializedSize(int fieldNumber) - { - int result = 0; - foreach (ulong value in varintList) - { - result += CodedOutputStream.ComputeUInt64Size(fieldNumber, value); - } - foreach (uint value in fixed32List) - { - result += CodedOutputStream.ComputeFixed32Size(fieldNumber, value); - } - foreach (ulong value in fixed64List) - { - result += CodedOutputStream.ComputeFixed64Size(fieldNumber, value); - } - foreach (ByteString value in lengthDelimitedList) - { - result += CodedOutputStream.ComputeBytesSize(fieldNumber, value); - } - foreach (UnknownFieldSet value in groupList) - { -#pragma warning disable 0612 - result += CodedOutputStream.ComputeUnknownGroupSize(fieldNumber, value); -#pragma warning restore 0612 - } - return result; - } - - /// - /// Serializes the length-delimited values of the field, including field - /// number, and writes them to using the MessageSet wire format. - /// - /// - /// - public void WriteAsMessageSetExtensionTo(int fieldNumber, ICodedOutputStream output) - { - foreach (ByteString value in lengthDelimitedList) - { - output.WriteMessageSetExtension(fieldNumber, UnknownFieldName, value); - } - } - - /// - /// Get the number of bytes required to encode this field, incuding field number, - /// using the MessageSet wire format. - /// - public int GetSerializedSizeAsMessageSetExtension(int fieldNumber) - { - int result = 0; - foreach (ByteString value in lengthDelimitedList) - { - result += CodedOutputStream.ComputeRawMessageSetExtensionSize(fieldNumber, value); - } - return result; - } - - /// - /// Used to build instances of UnknownField. - /// - public sealed class Builder - { - private List varintList; - private List fixed32List; - private List fixed64List; - private List lengthDelimitedList; - private List groupList; - - /// - /// Builds the field. After building, the builder is reset to an empty - /// state. (This is actually easier than making it unusable.) - /// - public UnknownField Build() - { - return new UnknownField(MakeReadOnly(ref varintList), - MakeReadOnly(ref fixed32List), - MakeReadOnly(ref fixed64List), - MakeReadOnly(ref lengthDelimitedList), - MakeReadOnly(ref groupList)); - } - - /// - /// Merge the values in into this field. For each list - /// of values, 's values are append to the ones in this - /// field. - /// - public Builder MergeFrom(UnknownField other) - { - varintList = AddAll(varintList, other.VarintList); - fixed32List = AddAll(fixed32List, other.Fixed32List); - fixed64List = AddAll(fixed64List, other.Fixed64List); - lengthDelimitedList = AddAll(lengthDelimitedList, other.LengthDelimitedList); - groupList = AddAll(groupList, other.GroupList); - return this; - } - - /// - /// Returns a new list containing all of the given specified values from - /// both the and lists. - /// If is null and is empty, - /// null is returned. Otherwise, either a new list is created (if - /// is null) or the elements of are added to . - /// - private static List AddAll(List current, IList extras) - { - if (extras.Count == 0) - { - return current; - } - if (current == null) - { - current = new List(extras); - } - else - { - current.AddRange(extras); - } - return current; - } - - /// - /// Clears the contents of this builder. - /// - public Builder Clear() - { - varintList = null; - fixed32List = null; - fixed64List = null; - lengthDelimitedList = null; - groupList = null; - return this; - } - - /// - /// Adds a varint value. - /// - [CLSCompliant(false)] - public Builder AddVarint(ulong value) - { - varintList = Add(varintList, value); - return this; - } - - /// - /// Adds a fixed32 value. - /// - [CLSCompliant(false)] - public Builder AddFixed32(uint value) - { - fixed32List = Add(fixed32List, value); - return this; - } - - /// - /// Adds a fixed64 value. - /// - [CLSCompliant(false)] - public Builder AddFixed64(ulong value) - { - fixed64List = Add(fixed64List, value); - return this; - } - - /// - /// Adds a length-delimited value. - /// - public Builder AddLengthDelimited(ByteString value) - { - lengthDelimitedList = Add(lengthDelimitedList, value); - return this; - } - - /// - /// Adds an embedded group. - /// - /// - /// - public Builder AddGroup(UnknownFieldSet value) - { - groupList = Add(groupList, value); - return this; - } - - /// - /// Adds to the , creating - /// a new list if is null. The list is returned - either - /// the original reference or the new list. - /// - private static List Add(List list, T value) - { - if (list == null) - { - list = new List(); - } - list.Add(value); - return list; - } - - /// - /// Returns a read-only version of the given IList, and clears - /// the field used for . If the value - /// is null, an empty list is produced using Lists.Empty. - /// - /// - private static ReadOnlyCollection MakeReadOnly(ref List list) - { - ReadOnlyCollection ret = list == null ? Lists.Empty : new ReadOnlyCollection(list); - list = null; - return ret; - } - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/UnknownFieldSet.cs b/src/ProtocolBuffers/UnknownFieldSet.cs deleted file mode 100644 index 09ed680..0000000 --- a/src/ProtocolBuffers/UnknownFieldSet.cs +++ /dev/null @@ -1,1043 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using System.IO; -using Google.ProtocolBuffers.Collections; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers -{ - /// - /// Used to keep track of fields which were seen when parsing a protocol message - /// but whose field numbers or types are unrecognized. This most frequently - /// occurs when new fields are added to a message type and then messages containing - /// those fields are read by old software that was built before the new types were - /// added. - /// - /// Every message contains an UnknownFieldSet. - /// - /// Most users will never need to use this class directly. - /// - public sealed partial class UnknownFieldSet : IMessageLite - { - private static readonly UnknownFieldSet defaultInstance = - new UnknownFieldSet(new Dictionary()); - - private readonly IDictionary fields; - - private UnknownFieldSet(IDictionary fields) - { - this.fields = fields; - } - - /// - /// Creates a new unknown field set builder. - /// - public static Builder CreateBuilder() - { - return new Builder(); - } - - /// - /// Creates a new unknown field set builder - /// and initialize it from . - /// - public static Builder CreateBuilder(UnknownFieldSet original) - { - return new Builder().MergeFrom(original); - } - - public static UnknownFieldSet DefaultInstance - { - get { return defaultInstance; } - } - - /// - /// Returns a read-only view of the mapping from field numbers to values. - /// - public IDictionary FieldDictionary - { - get { return Dictionaries.AsReadOnly(fields); } - } - - /// - /// Checks whether or not the given field number is present in the set. - /// - public bool HasField(int field) - { - return fields.ContainsKey(field); - } - - /// - /// Fetches a field by number, returning an empty field if not present. - /// Never returns null. - /// - public UnknownField this[int number] - { - get - { - UnknownField ret; - if (!fields.TryGetValue(number, out ret)) - { - ret = UnknownField.DefaultInstance; - } - return ret; - } - } - - /// - /// Serializes the set and writes it to . - /// - public void WriteTo(ICodedOutputStream output) - { - foreach (KeyValuePair entry in fields) - { - entry.Value.WriteTo(entry.Key, output); - } - } - - /// - /// Gets the number of bytes required to encode this set. - /// - public int SerializedSize - { - get - { - int result = 0; - foreach (KeyValuePair entry in fields) - { - result += entry.Value.GetSerializedSize(entry.Key); - } - return result; - } - } - - /// - /// Converts the set to a string in protocol buffer text format. This - /// is just a trivial wrapper around TextFormat.PrintToString. - /// - public override String ToString() - { - return TextFormat.PrintToString(this); - } - - /// - /// Converts the set to a string in protocol buffer text format. This - /// is just a trivial wrapper around TextFormat.PrintToString. - /// - public void PrintTo(TextWriter writer) - { - TextFormat.Print(this, writer); - } - - /// - /// Serializes the message to a ByteString and returns it. This is - /// just a trivial wrapper around WriteTo(ICodedOutputStream). - /// - /// - public ByteString ToByteString() - { - ByteString.CodedBuilder codedBuilder = new ByteString.CodedBuilder(SerializedSize); - WriteTo(codedBuilder.CodedOutput); - return codedBuilder.Build(); - } - - /// - /// Serializes the message to a byte array and returns it. This is - /// just a trivial wrapper around WriteTo(ICodedOutputStream). - /// - /// - public byte[] ToByteArray() - { - byte[] data = new byte[SerializedSize]; - CodedOutputStream output = CodedOutputStream.CreateInstance(data); - WriteTo(output); - output.CheckNoSpaceLeft(); - return data; - } - - /// - /// Serializes the message and writes it to . This is - /// just a trivial wrapper around WriteTo(ICodedOutputStream). - /// - /// - public void WriteTo(Stream output) - { - CodedOutputStream codedOutput = CodedOutputStream.CreateInstance(output); - WriteTo(codedOutput); - codedOutput.Flush(); - } - - /// - /// Serializes the set and writes it to using - /// the MessageSet wire format. - /// - public void WriteAsMessageSetTo(ICodedOutputStream output) - { - foreach (KeyValuePair entry in fields) - { - entry.Value.WriteAsMessageSetExtensionTo(entry.Key, output); - } - } - - /// - /// Gets the number of bytes required to encode this set using the MessageSet - /// wire format. - /// - public int SerializedSizeAsMessageSet - { - get - { - int result = 0; - foreach (KeyValuePair entry in fields) - { - result += entry.Value.GetSerializedSizeAsMessageSetExtension(entry.Key); - } - return result; - } - } - - public override bool Equals(object other) - { - if (ReferenceEquals(this, other)) - { - return true; - } - UnknownFieldSet otherSet = other as UnknownFieldSet; - return otherSet != null && Dictionaries.Equals(fields, otherSet.fields); - } - - public override int GetHashCode() - { - return Dictionaries.GetHashCode(fields); - } - - /// - /// Parses an UnknownFieldSet from the given input. - /// - public static UnknownFieldSet ParseFrom(ICodedInputStream input) - { - return CreateBuilder().MergeFrom(input).Build(); - } - - /// - /// Parses an UnknownFieldSet from the given data. - /// - public static UnknownFieldSet ParseFrom(ByteString data) - { - return CreateBuilder().MergeFrom(data).Build(); - } - - /// - /// Parses an UnknownFieldSet from the given data. - /// - public static UnknownFieldSet ParseFrom(byte[] data) - { - return CreateBuilder().MergeFrom(data).Build(); - } - - /// - /// Parses an UnknownFieldSet from the given input. - /// - public static UnknownFieldSet ParseFrom(Stream input) - { - return CreateBuilder().MergeFrom(input).Build(); - } - - #region IMessageLite Members - - public bool IsInitialized - { - get { return fields != null; } - } - - public void WriteDelimitedTo(Stream output) - { - CodedOutputStream codedOutput = CodedOutputStream.CreateInstance(output); - codedOutput.WriteRawVarint32((uint) SerializedSize); - WriteTo(codedOutput); - codedOutput.Flush(); - } - - public IBuilderLite WeakCreateBuilderForType() - { - return new Builder(); - } - - public IBuilderLite WeakToBuilder() - { - return new Builder(fields); - } - - public IMessageLite WeakDefaultInstanceForType - { - get { return defaultInstance; } - } - - #endregion - - /// - /// Builder for UnknownFieldSets. - /// - public sealed partial class Builder : IBuilderLite - { - /// - /// Mapping from number to field. Note that by using a SortedList we ensure - /// that the fields will be serialized in ascending order. - /// - private IDictionary fields; - - // Optimization: We keep around a builder for the last field that was - // modified so that we can efficiently add to it multiple times in a - // row (important when parsing an unknown repeated field). - private int lastFieldNumber; - private UnknownField.Builder lastField; - - internal Builder() - { - fields = new SortedList(); - } - - internal Builder(IDictionary dictionary) - { - fields = new SortedList(dictionary); - } - - /// - /// Returns a field builder for the specified field number, including any values - /// which already exist. - /// - private UnknownField.Builder GetFieldBuilder(int number) - { - if (lastField != null) - { - if (number == lastFieldNumber) - { - return lastField; - } - // Note: AddField() will reset lastField and lastFieldNumber. - AddField(lastFieldNumber, lastField.Build()); - } - if (number == 0) - { - return null; - } - - lastField = UnknownField.CreateBuilder(); - UnknownField existing; - if (fields.TryGetValue(number, out existing)) - { - lastField.MergeFrom(existing); - } - lastFieldNumber = number; - return lastField; - } - - /// - /// Build the UnknownFieldSet and return it. Once this method has been called, - /// this instance will no longer be usable. Calling any method after this - /// will throw a NullReferenceException. - /// - public UnknownFieldSet Build() - { - GetFieldBuilder(0); // Force lastField to be built. - UnknownFieldSet result = fields.Count == 0 ? DefaultInstance : new UnknownFieldSet(fields); - fields = null; - return result; - } - - /// - /// Adds a field to the set. If a field with the same number already exists, it - /// is replaced. - /// - public Builder AddField(int number, UnknownField field) - { - if (number == 0) - { - throw new ArgumentOutOfRangeException("number", "Zero is not a valid field number."); - } - if (lastField != null && lastFieldNumber == number) - { - // Discard this. - lastField = null; - lastFieldNumber = 0; - } - fields[number] = field; - return this; - } - - /// - /// Resets the builder to an empty set. - /// - public Builder Clear() - { - fields.Clear(); - lastFieldNumber = 0; - lastField = null; - return this; - } - - /// - /// Parse an entire message from and merge - /// its fields into this set. - /// - public Builder MergeFrom(ICodedInputStream input) - { - uint tag; - string name; - while (input.ReadTag(out tag, out name)) - { - if (tag == 0) - { - if (input.SkipField()) - { - continue; //can't merge unknown without field tag - } - break; - } - - if (!MergeFieldFrom(tag, input)) - { - break; - } - } - return this; - } - - /// - /// Parse a single field from and merge it - /// into this set. - /// - /// The field's tag number, which was already parsed. - /// The coded input stream containing the field - /// false if the tag is an "end group" tag, true otherwise - [CLSCompliant(false)] - public bool MergeFieldFrom(uint tag, ICodedInputStream input) - { - if (tag == 0) - { - input.SkipField(); - return true; - } - - int number = WireFormat.GetTagFieldNumber(tag); - switch (WireFormat.GetTagWireType(tag)) - { - case WireFormat.WireType.Varint: - { - ulong uint64 = 0; - if (input.ReadUInt64(ref uint64)) - { - GetFieldBuilder(number).AddVarint(uint64); - } - return true; - } - case WireFormat.WireType.Fixed32: - { - uint uint32 = 0; - if (input.ReadFixed32(ref uint32)) - { - GetFieldBuilder(number).AddFixed32(uint32); - } - return true; - } - case WireFormat.WireType.Fixed64: - { - ulong uint64 = 0; - if (input.ReadFixed64(ref uint64)) - { - GetFieldBuilder(number).AddFixed64(uint64); - } - return true; - } - case WireFormat.WireType.LengthDelimited: - { - ByteString bytes = null; - if (input.ReadBytes(ref bytes)) - { - GetFieldBuilder(number).AddLengthDelimited(bytes); - } - return true; - } - case WireFormat.WireType.StartGroup: - { - Builder subBuilder = CreateBuilder(); -#pragma warning disable 0612 - input.ReadUnknownGroup(number, subBuilder); -#pragma warning restore 0612 - GetFieldBuilder(number).AddGroup(subBuilder.Build()); - return true; - } - case WireFormat.WireType.EndGroup: - return false; - default: - throw InvalidProtocolBufferException.InvalidWireType(); - } - } - - /// - /// Parses as an UnknownFieldSet and merge it - /// with the set being built. This is just a small wrapper around - /// MergeFrom(ICodedInputStream). - /// - public Builder MergeFrom(Stream input) - { - CodedInputStream codedInput = CodedInputStream.CreateInstance(input); - MergeFrom(codedInput); - codedInput.CheckLastTagWas(0); - return this; - } - - /// - /// Parses as an UnknownFieldSet and merge it - /// with the set being built. This is just a small wrapper around - /// MergeFrom(ICodedInputStream). - /// - public Builder MergeFrom(ByteString data) - { - CodedInputStream input = data.CreateCodedInput(); - MergeFrom(input); - input.CheckLastTagWas(0); - return this; - } - - /// - /// Parses as an UnknownFieldSet and merge it - /// with the set being built. This is just a small wrapper around - /// MergeFrom(ICodedInputStream). - /// - public Builder MergeFrom(byte[] data) - { - CodedInputStream input = CodedInputStream.CreateInstance(data); - MergeFrom(input); - input.CheckLastTagWas(0); - return this; - } - - /// - /// Convenience method for merging a new field containing a single varint - /// value. This is used in particular when an unknown enum value is - /// encountered. - /// - [CLSCompliant(false)] - public Builder MergeVarintField(int number, ulong value) - { - if (number == 0) - { - throw new ArgumentOutOfRangeException("number", "Zero is not a valid field number."); - } - GetFieldBuilder(number).AddVarint(value); - return this; - } - - /// - /// Merges the fields from into this set. - /// If a field number exists in both sets, the values in - /// will be appended to the values in this set. - /// - public Builder MergeFrom(UnknownFieldSet other) - { - if (other != DefaultInstance) - { - foreach (KeyValuePair entry in other.fields) - { - MergeField(entry.Key, entry.Value); - } - } - return this; - } - - /// - /// Checks if the given field number is present in the set. - /// - public bool HasField(int number) - { - if (number == 0) - { - throw new ArgumentOutOfRangeException("number", "Zero is not a valid field number."); - } - return number == lastFieldNumber || fields.ContainsKey(number); - } - - /// - /// Adds a field to the unknown field set. If a field with the same - /// number already exists, the two are merged. - /// - public Builder MergeField(int number, UnknownField field) - { - if (number == 0) - { - throw new ArgumentOutOfRangeException("number", "Zero is not a valid field number."); - } - if (HasField(number)) - { - GetFieldBuilder(number).MergeFrom(field); - } - else - { - // Optimization: We could call getFieldBuilder(number).mergeFrom(field) - // in this case, but that would create a copy of the Field object. - // We'd rather reuse the one passed to us, so call AddField() instead. - AddField(number, field); - } - return this; - } - - internal void MergeFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry, IBuilder builder) - { - uint tag; - string name; - while (input.ReadTag(out tag, out name)) - { - if (tag == 0 && name != null) - { - FieldDescriptor fieldByName = builder.DescriptorForType.FindFieldByName(name); - if (fieldByName != null) - { - tag = WireFormat.MakeTag(fieldByName); - } - else - { - ExtensionInfo extension = extensionRegistry.FindByName(builder.DescriptorForType, name); - if (extension != null) - { - tag = WireFormat.MakeTag(extension.Descriptor); - } - } - } - if (tag == 0) - { - if (input.SkipField()) - { - continue; //can't merge unknown without field tag - } - break; - } - - if (!MergeFieldFrom(input, extensionRegistry, builder, tag, name)) - { - // end group tag - break; - } - } - } - - /// - /// Like - /// but parses a single field. - /// - /// The input to read the field from - /// Registry to use when an extension field is encountered - /// Builder to merge field into, if it's a known field - /// The tag, which should already have been read from the input - /// true unless the tag is an end-group tag - internal bool MergeFieldFrom(ICodedInputStream input, - ExtensionRegistry extensionRegistry, IBuilder builder, uint tag, - string fieldName) - { - if (tag == 0 && fieldName != null) - { - FieldDescriptor fieldByName = builder.DescriptorForType.FindFieldByName(fieldName); - if (fieldByName != null) - { - tag = WireFormat.MakeTag(fieldByName); - } - else - { - ExtensionInfo extension = extensionRegistry.FindByName(builder.DescriptorForType, fieldName); - if (extension != null) - { - tag = WireFormat.MakeTag(extension.Descriptor); - } - } - } - - MessageDescriptor type = builder.DescriptorForType; - if (type.Options.MessageSetWireFormat && tag == WireFormat.MessageSetTag.ItemStart) - { - MergeMessageSetExtensionFromCodedStream(input, extensionRegistry, builder); - return true; - } - - WireFormat.WireType wireType = WireFormat.GetTagWireType(tag); - int fieldNumber = WireFormat.GetTagFieldNumber(tag); - - FieldDescriptor field; - IMessageLite defaultFieldInstance = null; - - if (type.IsExtensionNumber(fieldNumber)) - { - ExtensionInfo extension = extensionRegistry[type, fieldNumber]; - if (extension == null) - { - field = null; - } - else - { - field = extension.Descriptor; - defaultFieldInstance = extension.DefaultInstance; - } - } - else - { - field = type.FindFieldByNumber(fieldNumber); - } - - // Unknown field or wrong wire type. Skip. - if (field == null) - { - return MergeFieldFrom(tag, input); - } - if (wireType != WireFormat.GetWireType(field)) - { - WireFormat.WireType expectedType = WireFormat.GetWireType(field.FieldType); - if (wireType == expectedType) - { - //Allowed as of 2.3, this is unpacked data for a packed array - } - else if (field.IsRepeated && wireType == WireFormat.WireType.LengthDelimited && - (expectedType == WireFormat.WireType.Varint || expectedType == WireFormat.WireType.Fixed32 || - expectedType == WireFormat.WireType.Fixed64)) - { - //Allowed as of 2.3, this is packed data for an unpacked array - } - else - { - return MergeFieldFrom(tag, input); - } - } - - switch (field.FieldType) - { - case FieldType.Group: - case FieldType.Message: - { - IBuilderLite subBuilder = (defaultFieldInstance != null) - ? defaultFieldInstance.WeakCreateBuilderForType() - : builder.CreateBuilderForField(field); - if (!field.IsRepeated) - { - subBuilder.WeakMergeFrom((IMessageLite) builder[field]); - if (field.FieldType == FieldType.Group) - { - input.ReadGroup(field.FieldNumber, subBuilder, extensionRegistry); - } - else - { - input.ReadMessage(subBuilder, extensionRegistry); - } - builder[field] = subBuilder.WeakBuild(); - } - else - { - List list = new List(); - if (field.FieldType == FieldType.Group) - { - input.ReadGroupArray(tag, fieldName, list, subBuilder.WeakDefaultInstanceForType, - extensionRegistry); - } - else - { - input.ReadMessageArray(tag, fieldName, list, subBuilder.WeakDefaultInstanceForType, - extensionRegistry); - } - - foreach (IMessageLite m in list) - { - builder.WeakAddRepeatedField(field, m); - } - return true; - } - break; - } - case FieldType.Enum: - { - if (!field.IsRepeated) - { - object unknown; - IEnumLite value = null; - if (input.ReadEnum(ref value, out unknown, field.EnumType)) - { - builder[field] = value; - } - else if (unknown is int) - { - MergeVarintField(fieldNumber, (ulong) (int) unknown); - } - } - else - { - ICollection unknown; - List list = new List(); - input.ReadEnumArray(tag, fieldName, list, out unknown, field.EnumType); - - foreach (IEnumLite en in list) - { - builder.WeakAddRepeatedField(field, en); - } - - if (unknown != null) - { - foreach (object oval in unknown) - { - if (oval is int) - { - MergeVarintField(fieldNumber, (ulong) (int) oval); - } - } - } - } - break; - } - default: - { - if (!field.IsRepeated) - { - object value = null; - if (input.ReadPrimitiveField(field.FieldType, ref value)) - { - builder[field] = value; - } - } - else - { - List list = new List(); - input.ReadPrimitiveArray(field.FieldType, tag, fieldName, list); - foreach (object oval in list) - { - builder.WeakAddRepeatedField(field, oval); - } - } - break; - } - } - return true; - } - - /// - /// Called by MergeFieldFrom to parse a MessageSet extension. - /// - private void MergeMessageSetExtensionFromCodedStream(ICodedInputStream input, - ExtensionRegistry extensionRegistry, IBuilder builder) - { - MessageDescriptor type = builder.DescriptorForType; - - // The wire format for MessageSet is: - // message MessageSet { - // repeated group Item = 1 { - // required int32 typeId = 2; - // required bytes message = 3; - // } - // } - // "typeId" is the extension's field number. The extension can only be - // a message type, where "message" contains the encoded bytes of that - // message. - // - // In practice, we will probably never see a MessageSet item in which - // the message appears before the type ID, or where either field does not - // appear exactly once. However, in theory such cases are valid, so we - // should be prepared to accept them. - - int typeId = 0; - ByteString rawBytes = null; // If we encounter "message" before "typeId" - IBuilderLite subBuilder = null; - FieldDescriptor field = null; - - uint lastTag = WireFormat.MessageSetTag.ItemStart; - uint tag; - string name; - while (input.ReadTag(out tag, out name)) - { - if (tag == 0 && name != null) - { - if (name == "type_id") - { - tag = WireFormat.MessageSetTag.TypeID; - } - else if (name == "message") - { - tag = WireFormat.MessageSetTag.Message; - } - } - if (tag == 0) - { - if (input.SkipField()) - { - continue; //can't merge unknown without field tag - } - break; - } - - lastTag = tag; - if (tag == WireFormat.MessageSetTag.TypeID) - { - typeId = 0; - // Zero is not a valid type ID. - if (input.ReadInt32(ref typeId) && typeId != 0) - { - ExtensionInfo extension = extensionRegistry[type, typeId]; - if (extension != null) - { - field = extension.Descriptor; - subBuilder = extension.DefaultInstance.WeakCreateBuilderForType(); - IMessageLite originalMessage = (IMessageLite) builder[field]; - if (originalMessage != null) - { - subBuilder.WeakMergeFrom(originalMessage); - } - if (rawBytes != null) - { - // We already encountered the message. Parse it now. - // TODO(jonskeet): Check this is okay. It's subtly different from the Java, as it doesn't create an input stream from rawBytes. - // In fact, why don't we just call MergeFrom(rawBytes)? And what about the extension registry? - subBuilder.WeakMergeFrom(rawBytes.CreateCodedInput()); - rawBytes = null; - } - } - else - { - // Unknown extension number. If we already saw data, put it - // in rawBytes. - if (rawBytes != null) - { - MergeField(typeId, UnknownField.CreateBuilder().AddLengthDelimited(rawBytes).Build()); - rawBytes = null; - } - } - } - } - else if (tag == WireFormat.MessageSetTag.Message) - { - if (subBuilder != null) - { - // We already know the type, so we can parse directly from the input - // with no copying. Hooray! - input.ReadMessage(subBuilder, extensionRegistry); - } - else if (input.ReadBytes(ref rawBytes)) - { - if (typeId != 0) - { - // We don't know how to parse this. Ignore it. - MergeField(typeId, - UnknownField.CreateBuilder().AddLengthDelimited(rawBytes).Build()); - } - } - } - else - { - // Unknown tag. Skip it. - if (!input.SkipField()) - { - break; // end of group - } - } - } - - if (lastTag != WireFormat.MessageSetTag.ItemEnd) - { - throw InvalidProtocolBufferException.InvalidEndTag(); - } - - if (subBuilder != null) - { - builder[field] = subBuilder.WeakBuild(); - } - } - - #region IBuilderLite Members - - bool IBuilderLite.IsInitialized - { - get { return fields != null; } - } - - IBuilderLite IBuilderLite.WeakClear() - { - return Clear(); - } - - IBuilderLite IBuilderLite.WeakMergeFrom(IMessageLite message) - { - return MergeFrom((UnknownFieldSet) message); - } - - IBuilderLite IBuilderLite.WeakMergeFrom(ByteString data) - { - return MergeFrom(data); - } - - IBuilderLite IBuilderLite.WeakMergeFrom(ByteString data, ExtensionRegistry registry) - { - return MergeFrom(data); - } - - IBuilderLite IBuilderLite.WeakMergeFrom(ICodedInputStream input) - { - return MergeFrom(input); - } - - IBuilderLite IBuilderLite.WeakMergeFrom(ICodedInputStream input, ExtensionRegistry registry) - { - return MergeFrom(input); - } - - IMessageLite IBuilderLite.WeakBuild() - { - return Build(); - } - - IMessageLite IBuilderLite.WeakBuildPartial() - { - return Build(); - } - - IBuilderLite IBuilderLite.WeakClone() - { - return Build().WeakToBuilder(); - } - - IMessageLite IBuilderLite.WeakDefaultInstanceForType - { - get { return DefaultInstance; } - } - - #endregion - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffers/WireFormat.cs b/src/ProtocolBuffers/WireFormat.cs deleted file mode 100644 index a03f165..0000000 --- a/src/ProtocolBuffers/WireFormat.cs +++ /dev/null @@ -1,192 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using Google.ProtocolBuffers.Descriptors; - -namespace Google.ProtocolBuffers -{ - /// - /// This class is used internally by the Protocol Buffer Library and generated - /// message implementations. It is public only for the sake of those generated - /// messages. Others should not use this class directly. - /// - /// This class contains constants and helper functions useful for dealing with - /// the Protocol Buffer wire format. - /// - /// - public static class WireFormat - { - #region Fixed sizes. - - // TODO(jonskeet): Move these somewhere else. They're messy. Consider making FieldType a smarter kind of enum - public const int Fixed32Size = 4; - public const int Fixed64Size = 8; - public const int SFixed32Size = 4; - public const int SFixed64Size = 8; - public const int FloatSize = 4; - public const int DoubleSize = 8; - public const int BoolSize = 1; - - #endregion - - [CLSCompliant(false)] - public enum WireType : uint - { - Varint = 0, - Fixed64 = 1, - LengthDelimited = 2, - StartGroup = 3, - EndGroup = 4, - Fixed32 = 5 - } - - internal static class MessageSetField - { - internal const int Item = 1; - internal const int TypeID = 2; - internal const int Message = 3; - } - - internal static class MessageSetTag - { - internal static readonly uint ItemStart = MakeTag(MessageSetField.Item, WireType.StartGroup); - internal static readonly uint ItemEnd = MakeTag(MessageSetField.Item, WireType.EndGroup); - internal static readonly uint TypeID = MakeTag(MessageSetField.TypeID, WireType.Varint); - internal static readonly uint Message = MakeTag(MessageSetField.Message, WireType.LengthDelimited); - } - - private const int TagTypeBits = 3; - private const uint TagTypeMask = (1 << TagTypeBits) - 1; - - /// - /// Given a tag value, determines the wire type (lower 3 bits). - /// - [CLSCompliant(false)] - public static WireType GetTagWireType(uint tag) - { - return (WireType) (tag & TagTypeMask); - } - - [CLSCompliant(false)] - public static bool IsEndGroupTag(uint tag) - { - return (WireType) (tag & TagTypeMask) == WireType.EndGroup; - } - - /// - /// Given a tag value, determines the field number (the upper 29 bits). - /// - [CLSCompliant(false)] - public static int GetTagFieldNumber(uint tag) - { - return (int) tag >> TagTypeBits; - } - - /// - /// Makes a tag value given a field number and wire type. - /// TODO(jonskeet): Should we just have a Tag structure? - /// - [CLSCompliant(false)] - public static uint MakeTag(int fieldNumber, WireType wireType) - { - return (uint) (fieldNumber << TagTypeBits) | (uint) wireType; - } - -#if !LITE - [CLSCompliant(false)] - public static uint MakeTag(FieldDescriptor field) - { - return MakeTag(field.FieldNumber, GetWireType(field)); - } - - /// - /// Returns the wire type for the given field descriptor. This differs - /// from GetWireType(FieldType) for packed repeated fields. - /// - internal static WireType GetWireType(FieldDescriptor descriptor) - { - return descriptor.IsPacked ? WireType.LengthDelimited : GetWireType(descriptor.FieldType); - } - -#endif - - /// - /// Converts a field type to its wire type. Done with a switch for the sake - /// of speed - this is significantly faster than a dictionary lookup. - /// - [CLSCompliant(false)] - public static WireType GetWireType(FieldType fieldType) - { - switch (fieldType) - { - case FieldType.Double: - return WireType.Fixed64; - case FieldType.Float: - return WireType.Fixed32; - case FieldType.Int64: - case FieldType.UInt64: - case FieldType.Int32: - return WireType.Varint; - case FieldType.Fixed64: - return WireType.Fixed64; - case FieldType.Fixed32: - return WireType.Fixed32; - case FieldType.Bool: - return WireType.Varint; - case FieldType.String: - return WireType.LengthDelimited; - case FieldType.Group: - return WireType.StartGroup; - case FieldType.Message: - case FieldType.Bytes: - return WireType.LengthDelimited; - case FieldType.UInt32: - return WireType.Varint; - case FieldType.SFixed32: - return WireType.Fixed32; - case FieldType.SFixed64: - return WireType.Fixed64; - case FieldType.SInt32: - case FieldType.SInt64: - case FieldType.Enum: - return WireType.Varint; - default: - throw new ArgumentOutOfRangeException("No such field type"); - } - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffersLibrary.CF20.sln b/src/ProtocolBuffersLibrary.CF20.sln deleted file mode 100644 index 7f1836f..0000000 --- a/src/ProtocolBuffersLibrary.CF20.sln +++ /dev/null @@ -1,55 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers", "ProtocolBuffers\ProtocolBuffers.CF20.csproj", "{6908BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite", "ProtocolBuffers\ProtocolBuffersLite.CF20.csproj", "{6969BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffers.Serialization.CF20.csproj", "{231391AF-449C-4A39-986C-AD7F270F4750}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffersLite.Serialization.CF20.csproj", "{E067A59D-9D0A-4A1F-92B1-38E4457241D1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Test", "ProtocolBuffers.Test\ProtocolBuffers.Test.CF20.csproj", "{DD01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLite.Test.CF20.csproj", "{EE01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLiteMixed.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLiteMixed.Test.CF20.csproj", "{EEFFED24-3750-4567-9A23-1DB676A15610}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.Build.0 = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.ActiveCfg = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.Build.0 = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.Build.0 = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/ProtocolBuffersLibrary.CF35.sln b/src/ProtocolBuffersLibrary.CF35.sln deleted file mode 100644 index d83e22c..0000000 --- a/src/ProtocolBuffersLibrary.CF35.sln +++ /dev/null @@ -1,55 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers", "ProtocolBuffers\ProtocolBuffers.CF35.csproj", "{6908BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite", "ProtocolBuffers\ProtocolBuffersLite.CF35.csproj", "{6969BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffers.Serialization.CF35.csproj", "{231391AF-449C-4A39-986C-AD7F270F4750}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffersLite.Serialization.CF35.csproj", "{E067A59D-9D0A-4A1F-92B1-38E4457241D1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Test", "ProtocolBuffers.Test\ProtocolBuffers.Test.CF35.csproj", "{DD01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLite.Test.CF35.csproj", "{EE01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLiteMixed.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLiteMixed.Test.CF35.csproj", "{EEFFED24-3750-4567-9A23-1DB676A15610}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.Build.0 = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.ActiveCfg = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.Build.0 = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.Build.0 = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/ProtocolBuffersLibrary.NET20.sln b/src/ProtocolBuffersLibrary.NET20.sln deleted file mode 100644 index 2de8ed2..0000000 --- a/src/ProtocolBuffersLibrary.NET20.sln +++ /dev/null @@ -1,55 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers", "ProtocolBuffers\ProtocolBuffers.NET20.csproj", "{6908BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite", "ProtocolBuffers\ProtocolBuffersLite.NET20.csproj", "{6969BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffers.Serialization.NET20.csproj", "{231391AF-449C-4A39-986C-AD7F270F4750}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffersLite.Serialization.NET20.csproj", "{E067A59D-9D0A-4A1F-92B1-38E4457241D1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Test", "ProtocolBuffers.Test\ProtocolBuffers.Test.NET20.csproj", "{DD01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLite.Test.NET20.csproj", "{EE01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLiteMixed.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLiteMixed.Test.NET20.csproj", "{EEFFED24-3750-4567-9A23-1DB676A15610}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.Build.0 = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.ActiveCfg = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.Build.0 = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.Build.0 = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/ProtocolBuffersLibrary.NET35.sln b/src/ProtocolBuffersLibrary.NET35.sln deleted file mode 100644 index 639ab17..0000000 --- a/src/ProtocolBuffersLibrary.NET35.sln +++ /dev/null @@ -1,55 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers", "ProtocolBuffers\ProtocolBuffers.NET35.csproj", "{6908BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite", "ProtocolBuffers\ProtocolBuffersLite.NET35.csproj", "{6969BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffers.Serialization.NET35.csproj", "{231391AF-449C-4A39-986C-AD7F270F4750}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffersLite.Serialization.NET35.csproj", "{E067A59D-9D0A-4A1F-92B1-38E4457241D1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Test", "ProtocolBuffers.Test\ProtocolBuffers.Test.NET35.csproj", "{DD01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLite.Test.NET35.csproj", "{EE01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLiteMixed.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLiteMixed.Test.NET35.csproj", "{EEFFED24-3750-4567-9A23-1DB676A15610}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.Build.0 = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.ActiveCfg = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.Build.0 = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.Build.0 = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/ProtocolBuffersLibrary.NET40.sln b/src/ProtocolBuffersLibrary.NET40.sln deleted file mode 100644 index 8492645..0000000 --- a/src/ProtocolBuffersLibrary.NET40.sln +++ /dev/null @@ -1,55 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers", "ProtocolBuffers\ProtocolBuffers.NET40.csproj", "{6908BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite", "ProtocolBuffers\ProtocolBuffersLite.NET40.csproj", "{6969BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffers.Serialization.NET40.csproj", "{231391AF-449C-4A39-986C-AD7F270F4750}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffersLite.Serialization.NET40.csproj", "{E067A59D-9D0A-4A1F-92B1-38E4457241D1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Test", "ProtocolBuffers.Test\ProtocolBuffers.Test.NET40.csproj", "{DD01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLite.Test.NET40.csproj", "{EE01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLiteMixed.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLiteMixed.Test.NET40.csproj", "{EEFFED24-3750-4567-9A23-1DB676A15610}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.Build.0 = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.ActiveCfg = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.Build.0 = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.Build.0 = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/ProtocolBuffersLibrary.PL40.sln b/src/ProtocolBuffersLibrary.PL40.sln deleted file mode 100644 index aca83c2..0000000 --- a/src/ProtocolBuffersLibrary.PL40.sln +++ /dev/null @@ -1,55 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers", "ProtocolBuffers\ProtocolBuffers.PL40.csproj", "{6908BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite", "ProtocolBuffers\ProtocolBuffersLite.PL40.csproj", "{6969BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffers.Serialization.PL40.csproj", "{231391AF-449C-4A39-986C-AD7F270F4750}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffersLite.Serialization.PL40.csproj", "{E067A59D-9D0A-4A1F-92B1-38E4457241D1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Test", "ProtocolBuffers.Test\ProtocolBuffers.Test.PL40.csproj", "{DD01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLite.Test.PL40.csproj", "{EE01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLiteMixed.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLiteMixed.Test.PL40.csproj", "{EEFFED24-3750-4567-9A23-1DB676A15610}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.Build.0 = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.ActiveCfg = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.Build.0 = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.Build.0 = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/ProtocolBuffersLibrary.SL20.sln b/src/ProtocolBuffersLibrary.SL20.sln deleted file mode 100644 index bba4ada..0000000 --- a/src/ProtocolBuffersLibrary.SL20.sln +++ /dev/null @@ -1,55 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers", "ProtocolBuffers\ProtocolBuffers.SL20.csproj", "{6908BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite", "ProtocolBuffers\ProtocolBuffersLite.SL20.csproj", "{6969BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffers.Serialization.SL20.csproj", "{231391AF-449C-4A39-986C-AD7F270F4750}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffersLite.Serialization.SL20.csproj", "{E067A59D-9D0A-4A1F-92B1-38E4457241D1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Test", "ProtocolBuffers.Test\ProtocolBuffers.Test.SL20.csproj", "{DD01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLite.Test.SL20.csproj", "{EE01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLiteMixed.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLiteMixed.Test.SL20.csproj", "{EEFFED24-3750-4567-9A23-1DB676A15610}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.Build.0 = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.ActiveCfg = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.Build.0 = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.Build.0 = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/ProtocolBuffersLibrary.SL30.sln b/src/ProtocolBuffersLibrary.SL30.sln deleted file mode 100644 index 080c22e..0000000 --- a/src/ProtocolBuffersLibrary.SL30.sln +++ /dev/null @@ -1,55 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers", "ProtocolBuffers\ProtocolBuffers.SL30.csproj", "{6908BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite", "ProtocolBuffers\ProtocolBuffersLite.SL30.csproj", "{6969BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffers.Serialization.SL30.csproj", "{231391AF-449C-4A39-986C-AD7F270F4750}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffersLite.Serialization.SL30.csproj", "{E067A59D-9D0A-4A1F-92B1-38E4457241D1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Test", "ProtocolBuffers.Test\ProtocolBuffers.Test.SL30.csproj", "{DD01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLite.Test.SL30.csproj", "{EE01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLiteMixed.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLiteMixed.Test.SL30.csproj", "{EEFFED24-3750-4567-9A23-1DB676A15610}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.Build.0 = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.ActiveCfg = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.Build.0 = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.Build.0 = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/ProtocolBuffersLibrary.SL40.sln b/src/ProtocolBuffersLibrary.SL40.sln deleted file mode 100644 index 01ea574..0000000 --- a/src/ProtocolBuffersLibrary.SL40.sln +++ /dev/null @@ -1,55 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers", "ProtocolBuffers\ProtocolBuffers.SL40.csproj", "{6908BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite", "ProtocolBuffers\ProtocolBuffersLite.SL40.csproj", "{6969BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffers.Serialization.SL40.csproj", "{231391AF-449C-4A39-986C-AD7F270F4750}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffersLite.Serialization.SL40.csproj", "{E067A59D-9D0A-4A1F-92B1-38E4457241D1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Test", "ProtocolBuffers.Test\ProtocolBuffers.Test.SL40.csproj", "{DD01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLite.Test.SL40.csproj", "{EE01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLiteMixed.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLiteMixed.Test.SL40.csproj", "{EEFFED24-3750-4567-9A23-1DB676A15610}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.Build.0 = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.ActiveCfg = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.Build.0 = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.Build.0 = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/ProtocolBuffersLibrary.sln b/src/ProtocolBuffersLibrary.sln deleted file mode 100644 index c91314a..0000000 --- a/src/ProtocolBuffersLibrary.sln +++ /dev/null @@ -1,55 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers", "ProtocolBuffers\ProtocolBuffers.csproj", "{6908BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite", "ProtocolBuffers\ProtocolBuffersLite.csproj", "{6969BDCE-D925-43F3-94AC-A531E6DF2591}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffers.Serialization.csproj", "{231391AF-449C-4A39-986C-AD7F270F4750}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffersLite.Serialization.csproj", "{E067A59D-9D0A-4A1F-92B1-38E4457241D1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Test", "ProtocolBuffers.Test\ProtocolBuffers.Test.csproj", "{DD01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLite.Test.csproj", "{EE01ED24-3750-4567-9A23-1DB676A15610}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLiteMixed.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLiteMixed.Test.csproj", "{EEFFED24-3750-4567-9A23-1DB676A15610}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.Build.0 = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.ActiveCfg = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.Build.0 = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.Build.0 = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/ProtocolBuffersLite.Test/AbstractBuilderLiteTest.cs b/src/ProtocolBuffersLite.Test/AbstractBuilderLiteTest.cs deleted file mode 100644 index 66791af..0000000 --- a/src/ProtocolBuffersLite.Test/AbstractBuilderLiteTest.cs +++ /dev/null @@ -1,340 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using System.IO; -using Google.ProtocolBuffers; -using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers -{ - [TestClass] - public class AbstractBuilderLiteTest - { - [TestMethod] - public void TestMergeFromCodedInputStream() - { - TestAllTypesLite copy, - msg = TestAllTypesLite.CreateBuilder() - .SetOptionalUint32(uint.MaxValue).Build(); - - copy = TestAllTypesLite.DefaultInstance; - Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray()); - - using (MemoryStream ms = new MemoryStream(msg.ToByteArray())) - { - CodedInputStream ci = CodedInputStream.CreateInstance(ms); - copy = copy.ToBuilder().MergeFrom(ci).Build(); - } - - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); - } - - [TestMethod] - public void TestIBuilderLiteWeakClear() - { - TestAllTypesLite copy, msg = TestAllTypesLite.DefaultInstance; - - copy = msg.ToBuilder().SetOptionalString("Should be removed.").Build(); - Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray()); - - copy = (TestAllTypesLite) ((IBuilderLite) copy.ToBuilder()).WeakClear().WeakBuild(); - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); - } - - [TestMethod] - public void TestBuilderLiteMergeFromCodedInputStream() - { - TestAllTypesLite copy, - msg = TestAllTypesLite.CreateBuilder() - .SetOptionalString("Should be merged.").Build(); - - copy = TestAllTypesLite.DefaultInstance; - Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray()); - - copy = - copy.ToBuilder().MergeFrom(CodedInputStream.CreateInstance(new MemoryStream(msg.ToByteArray()))).Build(); - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); - } - - [TestMethod] - public void TestBuilderLiteMergeDelimitedFrom() - { - TestAllTypesLite copy, - msg = TestAllTypesLite.CreateBuilder() - .SetOptionalString("Should be merged.").Build(); - - copy = TestAllTypesLite.DefaultInstance; - Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray()); - Stream s = new MemoryStream(); - msg.WriteDelimitedTo(s); - s.Position = 0; - copy = copy.ToBuilder().MergeDelimitedFrom(s).Build(); - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); - } - - [TestMethod] - public void TestBuilderLiteMergeDelimitedFromExtensions() - { - TestAllExtensionsLite copy, - msg = TestAllExtensionsLite.CreateBuilder() - .SetExtension(UnitTestLiteProtoFile.OptionalStringExtensionLite, - "Should be merged.").Build(); - - copy = TestAllExtensionsLite.DefaultInstance; - Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray()); - - Stream s = new MemoryStream(); - msg.WriteDelimitedTo(s); - s.Position = 0; - - ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); - UnitTestLiteProtoFile.RegisterAllExtensions(registry); - - copy = copy.ToBuilder().MergeDelimitedFrom(s, registry).Build(); - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); - Assert.AreEqual("Should be merged.", copy.GetExtension(UnitTestLiteProtoFile.OptionalStringExtensionLite)); - } - - [TestMethod] - public void TestBuilderLiteMergeFromStream() - { - TestAllTypesLite copy, - msg = TestAllTypesLite.CreateBuilder() - .SetOptionalString("Should be merged.").Build(); - - copy = TestAllTypesLite.DefaultInstance; - Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray()); - Stream s = new MemoryStream(); - msg.WriteTo(s); - s.Position = 0; - copy = copy.ToBuilder().MergeFrom(s).Build(); - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); - } - - [TestMethod] - public void TestBuilderLiteMergeFromStreamExtensions() - { - TestAllExtensionsLite copy, - msg = TestAllExtensionsLite.CreateBuilder() - .SetExtension(UnitTestLiteProtoFile.OptionalStringExtensionLite, - "Should be merged.").Build(); - - copy = TestAllExtensionsLite.DefaultInstance; - Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray()); - - Stream s = new MemoryStream(); - msg.WriteTo(s); - s.Position = 0; - - ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); - UnitTestLiteProtoFile.RegisterAllExtensions(registry); - - copy = copy.ToBuilder().MergeFrom(s, registry).Build(); - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); - Assert.AreEqual("Should be merged.", copy.GetExtension(UnitTestLiteProtoFile.OptionalStringExtensionLite)); - } - - [TestMethod] - public void TestIBuilderLiteWeakMergeFromIMessageLite() - { - TestAllTypesLite copy, - msg = TestAllTypesLite.CreateBuilder() - .SetOptionalString("Should be merged.").Build(); - - copy = TestAllTypesLite.DefaultInstance; - Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray()); - - copy = (TestAllTypesLite) ((IBuilderLite) copy.ToBuilder()).WeakMergeFrom((IMessageLite) msg).WeakBuild(); - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); - } - - [TestMethod] - public void TestIBuilderLiteWeakMergeFromByteString() - { - TestAllTypesLite copy, - msg = TestAllTypesLite.CreateBuilder() - .SetOptionalString("Should be merged.").Build(); - - copy = TestAllTypesLite.DefaultInstance; - Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray()); - - copy = (TestAllTypesLite) ((IBuilderLite) copy.ToBuilder()).WeakMergeFrom(msg.ToByteString()).WeakBuild(); - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); - } - - [TestMethod] - public void TestIBuilderLiteWeakMergeFromByteStringExtensions() - { - TestAllExtensionsLite copy, - msg = TestAllExtensionsLite.CreateBuilder() - .SetExtension(UnitTestLiteProtoFile.OptionalStringExtensionLite, - "Should be merged.").Build(); - - copy = TestAllExtensionsLite.DefaultInstance; - Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray()); - - copy = - (TestAllExtensionsLite) - ((IBuilderLite) copy.ToBuilder()).WeakMergeFrom(msg.ToByteString(), ExtensionRegistry.Empty).WeakBuild(); - Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray()); - - ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); - UnitTestLiteProtoFile.RegisterAllExtensions(registry); - - copy = - (TestAllExtensionsLite) - ((IBuilderLite) copy.ToBuilder()).WeakMergeFrom(msg.ToByteString(), registry).WeakBuild(); - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); - Assert.AreEqual("Should be merged.", copy.GetExtension(UnitTestLiteProtoFile.OptionalStringExtensionLite)); - } - - [TestMethod] - public void TestIBuilderLiteWeakMergeFromCodedInputStream() - { - TestAllTypesLite copy, - msg = TestAllTypesLite.CreateBuilder() - .SetOptionalUint32(uint.MaxValue).Build(); - - copy = TestAllTypesLite.DefaultInstance; - Assert.AreNotEqual(msg.ToByteArray(), copy.ToByteArray()); - - using (MemoryStream ms = new MemoryStream(msg.ToByteArray())) - { - CodedInputStream ci = CodedInputStream.CreateInstance(ms); - copy = (TestAllTypesLite) ((IBuilderLite) copy.ToBuilder()).WeakMergeFrom(ci).WeakBuild(); - } - - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); - } - - [TestMethod] - public void TestIBuilderLiteWeakBuildPartial() - { - IBuilderLite builder = TestRequiredLite.CreateBuilder(); - Assert.IsFalse(builder.IsInitialized); - - IMessageLite msg = builder.WeakBuildPartial(); - Assert.IsFalse(msg.IsInitialized); - - TestUtil.AssertBytesEqual(msg.ToByteArray(), TestRequiredLite.DefaultInstance.ToByteArray()); - } - - [TestMethod, ExpectedException(typeof(UninitializedMessageException))] - public void TestIBuilderLiteWeakBuildUninitialized() - { - IBuilderLite builder = TestRequiredLite.CreateBuilder(); - Assert.IsFalse(builder.IsInitialized); - builder.WeakBuild(); - } - - [TestMethod] - public void TestIBuilderLiteWeakBuild() - { - IBuilderLite builder = TestRequiredLite.CreateBuilder() - .SetD(0) - .SetEn(ExtraEnum.EXLITE_BAZ); - Assert.IsTrue(builder.IsInitialized); - builder.WeakBuild(); - } - - [TestMethod] - public void TestIBuilderLiteWeakClone() - { - TestRequiredLite msg = TestRequiredLite.CreateBuilder() - .SetD(1).SetEn(ExtraEnum.EXLITE_BAR).Build(); - Assert.IsTrue(msg.IsInitialized); - - IMessageLite copy = ((IBuilderLite) msg.ToBuilder()).WeakClone().WeakBuild(); - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); - } - - [TestMethod] - public void TestIBuilderLiteWeakDefaultInstance() - { - Assert.IsTrue(ReferenceEquals(TestRequiredLite.DefaultInstance, - ((IBuilderLite) TestRequiredLite.CreateBuilder()).WeakDefaultInstanceForType)); - } - - [TestMethod] - public void TestGeneratedBuilderLiteAddRange() - { - TestAllTypesLite copy, - msg = TestAllTypesLite.CreateBuilder() - .SetOptionalUint32(123) - .AddRepeatedInt32(1) - .AddRepeatedInt32(2) - .AddRepeatedInt32(3) - .Build(); - - copy = msg.DefaultInstanceForType.ToBuilder().MergeFrom(msg).Build(); - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); - } - - // ROK 5/7/2013 Issue #54: should retire all bytes in buffer (bufferSize) - [TestMethod] - public void TestBufferRefillIssue() - { - var ms = new MemoryStream(); - BucketOfBytes.CreateBuilder() - .SetValue(ByteString.CopyFrom(new byte[3000])) - .Build().WriteDelimitedTo(ms); - BucketOfBytesEx.CreateBuilder() - .SetValue(ByteString.CopyFrom(new byte[1000])) - .SetValue2(ByteString.CopyFrom(new byte[1100])) - .Build().WriteDelimitedTo(ms); - BucketOfBytes.CreateBuilder() - .SetValue(ByteString.CopyFrom(new byte[100])) - .Build().WriteDelimitedTo(ms); - - ms.Position = 0; - var input = CodedInputStream.CreateInstance(ms); - var builder = BucketOfBytes.CreateBuilder(); - input.ReadMessage(builder, ExtensionRegistry.Empty); - Assert.AreEqual(3005L, input.Position); - Assert.AreEqual(3000, builder.Value.Length); - input.ReadMessage(builder, ExtensionRegistry.Empty); - Assert.AreEqual(5114, input.Position); - Assert.AreEqual(1000, builder.Value.Length); - input.ReadMessage(builder, ExtensionRegistry.Empty); - Assert.AreEqual(5217L, input.Position); - Assert.AreEqual(input.Position, ms.Length); - Assert.AreEqual(100, builder.Value.Length); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffersLite.Test/AbstractMessageLiteTest.cs b/src/ProtocolBuffersLite.Test/AbstractMessageLiteTest.cs deleted file mode 100644 index bead60f..0000000 --- a/src/ProtocolBuffersLite.Test/AbstractMessageLiteTest.cs +++ /dev/null @@ -1,136 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using System.IO; -using Google.ProtocolBuffers; -using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers -{ - [TestClass] - public class AbstractMessageLiteTest - { - [TestMethod] - public void TestMessageLiteToByteString() - { - TestRequiredLite msg = TestRequiredLite.CreateBuilder() - .SetD(42) - .SetEn(ExtraEnum.EXLITE_BAZ) - .Build(); - - ByteString b = msg.ToByteString(); - Assert.AreEqual(4, b.Length); - Assert.AreEqual(TestRequiredLite.DFieldNumber << 3, b[0]); - Assert.AreEqual(42, b[1]); - Assert.AreEqual(TestRequiredLite.EnFieldNumber << 3, b[2]); - Assert.AreEqual((int) ExtraEnum.EXLITE_BAZ, b[3]); - } - - [TestMethod] - public void TestMessageLiteToByteArray() - { - TestRequiredLite msg = TestRequiredLite.CreateBuilder() - .SetD(42) - .SetEn(ExtraEnum.EXLITE_BAZ) - .Build(); - - ByteString b = msg.ToByteString(); - ByteString copy = ByteString.CopyFrom(msg.ToByteArray()); - Assert.AreEqual(b, copy); - } - - [TestMethod] - public void TestMessageLiteWriteTo() - { - TestRequiredLite msg = TestRequiredLite.CreateBuilder() - .SetD(42) - .SetEn(ExtraEnum.EXLITE_BAZ) - .Build(); - - MemoryStream ms = new MemoryStream(); - msg.WriteTo(ms); - TestUtil.AssertBytesEqual(msg.ToByteArray(), ms.ToArray()); - } - - [TestMethod] - public void TestMessageLiteWriteDelimitedTo() - { - TestRequiredLite msg = TestRequiredLite.CreateBuilder() - .SetD(42) - .SetEn(ExtraEnum.EXLITE_BAZ) - .Build(); - - MemoryStream ms = new MemoryStream(); - msg.WriteDelimitedTo(ms); - byte[] buffer = ms.ToArray(); - - Assert.AreEqual(5, buffer.Length); - Assert.AreEqual(4, buffer[0]); - byte[] msgBytes = new byte[4]; - Array.Copy(buffer, 1, msgBytes, 0, 4); - TestUtil.AssertBytesEqual(msg.ToByteArray(), msgBytes); - } - - [TestMethod] - public void TestIMessageLiteWeakCreateBuilderForType() - { - IMessageLite msg = TestRequiredLite.DefaultInstance; - Assert.AreEqual(typeof(TestRequiredLite.Builder), msg.WeakCreateBuilderForType().GetType()); - } - - [TestMethod] - public void TestMessageLiteWeakToBuilder() - { - IMessageLite msg = TestRequiredLite.CreateBuilder() - .SetD(42) - .SetEn(ExtraEnum.EXLITE_BAZ) - .Build(); - - IMessageLite copy = msg.WeakToBuilder().WeakBuild(); - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); - } - - [TestMethod] - public void TestMessageLiteWeakDefaultInstanceForType() - { - IMessageLite msg = TestRequiredLite.DefaultInstance; - Assert.IsTrue(Object.ReferenceEquals(TestRequiredLite.DefaultInstance, msg.WeakDefaultInstanceForType)); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffersLite.Test/App.xaml b/src/ProtocolBuffersLite.Test/App.xaml deleted file mode 100644 index d4f1f2e..0000000 --- a/src/ProtocolBuffersLite.Test/App.xaml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - diff --git a/src/ProtocolBuffersLite.Test/App.xaml.cs b/src/ProtocolBuffersLite.Test/App.xaml.cs deleted file mode 100644 index 0c9fd9e..0000000 --- a/src/ProtocolBuffersLite.Test/App.xaml.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using System.Windows; -using Microsoft.Silverlight.Testing; - -namespace Google.ProtocolBuffers -{ - public partial class App : Application - { - - public App() - { - this.Startup += this.Application_Startup; - this.Exit += this.Application_Exit; - this.UnhandledException += this.Application_UnhandledException; - - //InitializeComponent(); - } - - private void Application_Startup(object sender, StartupEventArgs e) - { - this.RootVisual = UnitTestSystem.CreateTestPage(); - } - - private void Application_Exit(object sender, EventArgs e) - { - - } - private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) - { - // If the app is running outside of the debugger then report the exception using - // the browser's exception mechanism. On IE this will display it a yellow alert - // icon in the status bar and Firefox will display a script error. - if (!System.Diagnostics.Debugger.IsAttached) - { - - // NOTE: This will allow the application to continue running after an exception has been thrown - // but not handled. - // For production applications this error handling should be replaced with something that will - // report the error to the website and stop the application. - e.Handled = true; - Deployment.Current.Dispatcher.BeginInvoke( - new EventHandler(ReportErrorToDOM), - new object[] { sender, e } ); - } - } - private void ReportErrorToDOM(object sender, ApplicationUnhandledExceptionEventArgs e) - { - try - { - string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace; - errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n"); - - System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight 2 Application " + errorMsg + "\");"); - } - catch (Exception) - { - } - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffersLite.Test/ExtendableBuilderLiteTest.cs b/src/ProtocolBuffersLite.Test/ExtendableBuilderLiteTest.cs deleted file mode 100644 index 910ebaf..0000000 --- a/src/ProtocolBuffersLite.Test/ExtendableBuilderLiteTest.cs +++ /dev/null @@ -1,289 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections; -using System.Collections.Generic; -using Google.ProtocolBuffers; -using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers -{ - [TestClass] - public class ExtendableBuilderLiteTest - { - [TestMethod] - public void TestHasExtensionT() - { - TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder() - .SetExtension(UnitTestLiteProtoFile.OptionalInt32ExtensionLite, 123); - - Assert.IsTrue(builder.HasExtension(UnitTestLiteProtoFile.OptionalInt32ExtensionLite)); - } - - [TestMethod] - public void TestHasExtensionTMissing() - { - TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder(); - Assert.IsFalse(builder.HasExtension(UnitTestLiteProtoFile.OptionalInt32ExtensionLite)); - } - - [TestMethod] - public void TestGetExtensionCountT() - { - TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder() - .AddExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite, 1) - .AddExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite, 2) - .AddExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite, 3); - - Assert.AreEqual(3, builder.GetExtensionCount(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite)); - } - - [TestMethod] - public void TestGetExtensionCountTEmpty() - { - TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder(); - Assert.AreEqual(0, builder.GetExtensionCount(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite)); - } - - [TestMethod] - public void TestGetExtensionTNull() - { - TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder(); - string value = builder.GetExtension(UnitTestLiteProtoFile.OptionalStringExtensionLite); - Assert.IsNull(value); - } - - [TestMethod] - public void TestGetExtensionTValue() - { - TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder() - .SetExtension(UnitTestLiteProtoFile.OptionalInt32ExtensionLite, 3); - - Assert.AreEqual(3, builder.GetExtension(UnitTestLiteProtoFile.OptionalInt32ExtensionLite)); - } - - [TestMethod] - public void TestGetExtensionTEmpty() - { - TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder(); - Assert.AreEqual(0, builder.GetExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite).Count); - } - - [TestMethod] - public void TestGetExtensionTList() - { - TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder() - .AddExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite, 1) - .AddExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite, 2) - .AddExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite, 3); - - IList values = builder.GetExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite); - Assert.AreEqual(3, values.Count); - } - - [TestMethod] - public void TestGetExtensionTIndex() - { - TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder() - .AddExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite, 0) - .AddExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite, 1) - .AddExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite, 2); - - for (int i = 0; i < 3; i++) - Assert.AreEqual(i, builder.GetExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite, i)); - } - - [TestMethod, ExpectedException(typeof(ArgumentOutOfRangeException))] - public void TestGetExtensionTIndexOutOfRange() - { - TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder(); - builder.GetExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite, 0); - } - - [TestMethod] - public void TestSetExtensionTIndex() - { - TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder() - .AddExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite, 0) - .AddExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite, 1) - .AddExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite, 2); - - for (int i = 0; i < 3; i++) - Assert.AreEqual(i, builder.GetExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite, i)); - - builder.SetExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite, 0, 5); - builder.SetExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite, 1, 6); - builder.SetExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite, 2, 7); - - for (int i = 0; i < 3; i++) - Assert.AreEqual(5 + i, builder.GetExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite, i)); - } - - [TestMethod, ExpectedException(typeof(ArgumentOutOfRangeException))] - public void TestSetExtensionTIndexOutOfRange() - { - TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder(); - builder.SetExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite, 0, -1); - } - - [TestMethod] - public void TestClearExtensionTList() - { - TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder() - .AddExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite, 0); - Assert.AreEqual(1, builder.GetExtensionCount(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite)); - - builder.ClearExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite); - Assert.AreEqual(0, builder.GetExtensionCount(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite)); - } - - [TestMethod] - public void TestClearExtensionTValue() - { - TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder() - .SetExtension(UnitTestLiteProtoFile.OptionalInt32ExtensionLite, 0); - Assert.IsTrue(builder.HasExtension(UnitTestLiteProtoFile.OptionalInt32ExtensionLite)); - - builder.ClearExtension(UnitTestLiteProtoFile.OptionalInt32ExtensionLite); - Assert.IsFalse(builder.HasExtension(UnitTestLiteProtoFile.OptionalInt32ExtensionLite)); - } - - [TestMethod] - public void TestIndexedByDescriptor() - { - TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder(); - Assert.IsFalse(builder.HasExtension(UnitTestLiteProtoFile.OptionalInt32ExtensionLite)); - - builder[UnitTestLiteProtoFile.OptionalInt32ExtensionLite.Descriptor] = 123; - - Assert.IsTrue(builder.HasExtension(UnitTestLiteProtoFile.OptionalInt32ExtensionLite)); - Assert.AreEqual(123, builder.GetExtension(UnitTestLiteProtoFile.OptionalInt32ExtensionLite)); - } - - [TestMethod] - public void TestIndexedByDescriptorAndOrdinal() - { - TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder() - .AddExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite, 0); - Assert.AreEqual(1, builder.GetExtensionCount(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite)); - - IFieldDescriptorLite f = UnitTestLiteProtoFile.RepeatedInt32ExtensionLite.Descriptor; - builder[f, 0] = 123; - - Assert.AreEqual(1, builder.GetExtensionCount(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite)); - Assert.AreEqual(123, builder.GetExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite, 0)); - } - - [TestMethod, ExpectedException(typeof(ArgumentOutOfRangeException))] - public void TestIndexedByDescriptorAndOrdinalOutOfRange() - { - TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder(); - Assert.AreEqual(0, builder.GetExtensionCount(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite)); - - IFieldDescriptorLite f = UnitTestLiteProtoFile.RepeatedInt32ExtensionLite.Descriptor; - builder[f, 0] = 123; - } - - [TestMethod] - public void TestClearFieldByDescriptor() - { - TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder() - .AddExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite, 0); - Assert.AreEqual(1, builder.GetExtensionCount(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite)); - - IFieldDescriptorLite f = UnitTestLiteProtoFile.RepeatedInt32ExtensionLite.Descriptor; - builder.ClearField(f); - Assert.AreEqual(0, builder.GetExtensionCount(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite)); - } - - [TestMethod] - public void TestAddRepeatedFieldByDescriptor() - { - TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder() - .AddExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite, 0); - Assert.AreEqual(1, builder.GetExtensionCount(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite)); - - IFieldDescriptorLite f = UnitTestLiteProtoFile.RepeatedInt32ExtensionLite.Descriptor; - builder.AddRepeatedField(f, 123); - Assert.AreEqual(2, builder.GetExtensionCount(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite)); - Assert.AreEqual(123, builder.GetExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite, 1)); - } - - [TestMethod] - public void TestMissingExtensionsLite() - { - const int optionalInt32 = 12345678; - TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder(); - builder.SetExtension(UnitTestLiteProtoFile.OptionalInt32ExtensionLite, optionalInt32); - builder.AddExtension(UnitTestLiteProtoFile.RepeatedDoubleExtensionLite, 1.1); - builder.AddExtension(UnitTestLiteProtoFile.RepeatedDoubleExtensionLite, 1.2); - builder.AddExtension(UnitTestLiteProtoFile.RepeatedDoubleExtensionLite, 1.3); - TestAllExtensionsLite msg = builder.Build(); - - Assert.IsTrue(msg.HasExtension(UnitTestLiteProtoFile.OptionalInt32ExtensionLite)); - Assert.AreEqual(3, msg.GetExtensionCount(UnitTestLiteProtoFile.RepeatedDoubleExtensionLite)); - - byte[] bits = msg.ToByteArray(); - TestAllExtensionsLite copy = TestAllExtensionsLite.ParseFrom(bits); - Assert.IsFalse(copy.HasExtension(UnitTestLiteProtoFile.OptionalInt32ExtensionLite)); - Assert.AreEqual(0, copy.GetExtensionCount(UnitTestLiteProtoFile.RepeatedDoubleExtensionLite)); - Assert.AreNotEqual(msg, copy); - - //The lite runtime removes all unknown fields and extensions - byte[] copybits = copy.ToByteArray(); - Assert.AreEqual(0, copybits.Length); - } - - [TestMethod] - public void TestMissingFieldsLite() - { - TestAllTypesLite msg = TestAllTypesLite.CreateBuilder() - .SetOptionalInt32(123) - .SetOptionalString("123") - .Build(); - - byte[] bits = msg.ToByteArray(); - TestAllExtensionsLite copy = TestAllExtensionsLite.ParseFrom(bits); - Assert.AreNotEqual(msg, copy); - - //The lite runtime removes all unknown fields and extensions - byte[] copybits = copy.ToByteArray(); - Assert.AreEqual(0, copybits.Length); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffersLite.Test/ExtendableMessageLiteTest.cs b/src/ProtocolBuffersLite.Test/ExtendableMessageLiteTest.cs deleted file mode 100644 index 5c236aa..0000000 --- a/src/ProtocolBuffersLite.Test/ExtendableMessageLiteTest.cs +++ /dev/null @@ -1,379 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using System.Text; -using Google.ProtocolBuffers; -using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers -{ - [TestClass] - public class ExtendableMessageLiteTest - { - //The lite framework does not make this assertion - //[TestMethod, Ignore, ExpectedException(typeof(ArgumentException))] - //public void ExtensionWriterInvalidExtension() - //{ - // TestPackedExtensionsLite.CreateBuilder()[ - // UnitTestLiteProtoFile.OptionalForeignMessageExtensionLite.Descriptor] = - // ForeignMessageLite.DefaultInstance; - //} - - [TestMethod] - public void ExtensionWriterTestMessages() - { - TestAllExtensionsLite.Builder b = TestAllExtensionsLite.CreateBuilder().SetExtension( - UnitTestLiteProtoFile.OptionalForeignMessageExtensionLite, - ForeignMessageLite.CreateBuilder().SetC(123).Build()); - TestAllExtensionsLite copy, msg = b.Build(); - - ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); - UnitTestLiteProtoFile.RegisterAllExtensions(registry); - - copy = TestAllExtensionsLite.ParseFrom(msg.ToByteArray(), registry); - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); - } - - [TestMethod] - public void ExtensionWriterIsInitialized() - { - Assert.IsTrue(ForeignMessageLite.DefaultInstance.IsInitialized); - Assert.IsTrue(TestPackedExtensionsLite.CreateBuilder().IsInitialized); - Assert.IsTrue(TestAllExtensionsLite.CreateBuilder().SetExtension( - UnitTestLiteProtoFile.OptionalForeignMessageExtensionLite, ForeignMessageLite.DefaultInstance) - .IsInitialized); - } - - [TestMethod] - public void ExtensionWriterTestSetExtensionLists() - { - TestAllExtensionsLite msg, copy; - TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder() - .SetExtension(UnitTestLiteProtoFile.RepeatedBoolExtensionLite, new[] {true, false}) - .SetExtension(UnitTestLiteProtoFile.RepeatedCordExtensionLite, new[] {"123", "456"}) - .SetExtension(UnitTestLiteProtoFile.RepeatedForeignEnumExtensionLite, - new[] {ForeignEnumLite.FOREIGN_LITE_BAZ, ForeignEnumLite.FOREIGN_LITE_FOO}) - ; - - msg = builder.Build(); - ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); - UnitTestLiteProtoFile.RegisterAllExtensions(registry); - - copy = TestAllExtensionsLite.ParseFrom(msg.ToByteArray(), registry); - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); - - Assert.AreEqual(ForeignEnumLite.FOREIGN_LITE_FOO, - copy.GetExtension(UnitTestLiteProtoFile.RepeatedForeignEnumExtensionLite, 1)); - } - - [TestMethod] - public void ExtensionWriterTest() - { - TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder() - .SetExtension(UnitTestLiteProtoFile.DefaultBoolExtensionLite, true) - .SetExtension(UnitTestLiteProtoFile.DefaultBytesExtensionLite, ByteString.CopyFromUtf8("123")) - .SetExtension(UnitTestLiteProtoFile.DefaultCordExtensionLite, "123") - .SetExtension(UnitTestLiteProtoFile.DefaultDoubleExtensionLite, 123) - .SetExtension(UnitTestLiteProtoFile.DefaultFixed32ExtensionLite, 123u) - .SetExtension(UnitTestLiteProtoFile.DefaultFixed64ExtensionLite, 123u) - .SetExtension(UnitTestLiteProtoFile.DefaultFloatExtensionLite, 123) - .SetExtension(UnitTestLiteProtoFile.DefaultForeignEnumExtensionLite, ForeignEnumLite.FOREIGN_LITE_BAZ) - .SetExtension(UnitTestLiteProtoFile.DefaultImportEnumExtensionLite, ImportEnumLite.IMPORT_LITE_BAZ) - .SetExtension(UnitTestLiteProtoFile.DefaultInt32ExtensionLite, 123) - .SetExtension(UnitTestLiteProtoFile.DefaultInt64ExtensionLite, 123) - .SetExtension(UnitTestLiteProtoFile.DefaultNestedEnumExtensionLite, - TestAllTypesLite.Types.NestedEnum.FOO) - .SetExtension(UnitTestLiteProtoFile.DefaultSfixed32ExtensionLite, 123) - .SetExtension(UnitTestLiteProtoFile.DefaultSfixed64ExtensionLite, 123) - .SetExtension(UnitTestLiteProtoFile.DefaultSint32ExtensionLite, 123) - .SetExtension(UnitTestLiteProtoFile.DefaultSint64ExtensionLite, 123) - .SetExtension(UnitTestLiteProtoFile.DefaultStringExtensionLite, "123") - .SetExtension(UnitTestLiteProtoFile.DefaultStringPieceExtensionLite, "123") - .SetExtension(UnitTestLiteProtoFile.DefaultUint32ExtensionLite, 123u) - .SetExtension(UnitTestLiteProtoFile.DefaultUint64ExtensionLite, 123u) - //Optional - .SetExtension(UnitTestLiteProtoFile.OptionalBoolExtensionLite, true) - .SetExtension(UnitTestLiteProtoFile.OptionalBytesExtensionLite, ByteString.CopyFromUtf8("123")) - .SetExtension(UnitTestLiteProtoFile.OptionalCordExtensionLite, "123") - .SetExtension(UnitTestLiteProtoFile.OptionalDoubleExtensionLite, 123) - .SetExtension(UnitTestLiteProtoFile.OptionalFixed32ExtensionLite, 123u) - .SetExtension(UnitTestLiteProtoFile.OptionalFixed64ExtensionLite, 123u) - .SetExtension(UnitTestLiteProtoFile.OptionalFloatExtensionLite, 123) - .SetExtension(UnitTestLiteProtoFile.OptionalForeignEnumExtensionLite, ForeignEnumLite.FOREIGN_LITE_BAZ) - .SetExtension(UnitTestLiteProtoFile.OptionalImportEnumExtensionLite, ImportEnumLite.IMPORT_LITE_BAZ) - .SetExtension(UnitTestLiteProtoFile.OptionalInt32ExtensionLite, 123) - .SetExtension(UnitTestLiteProtoFile.OptionalInt64ExtensionLite, 123) - .SetExtension(UnitTestLiteProtoFile.OptionalNestedEnumExtensionLite, - TestAllTypesLite.Types.NestedEnum.FOO) - .SetExtension(UnitTestLiteProtoFile.OptionalSfixed32ExtensionLite, 123) - .SetExtension(UnitTestLiteProtoFile.OptionalSfixed64ExtensionLite, 123) - .SetExtension(UnitTestLiteProtoFile.OptionalSint32ExtensionLite, 123) - .SetExtension(UnitTestLiteProtoFile.OptionalSint64ExtensionLite, 123) - .SetExtension(UnitTestLiteProtoFile.OptionalStringExtensionLite, "123") - .SetExtension(UnitTestLiteProtoFile.OptionalStringPieceExtensionLite, "123") - .SetExtension(UnitTestLiteProtoFile.OptionalUint32ExtensionLite, 123u) - .SetExtension(UnitTestLiteProtoFile.OptionalUint64ExtensionLite, 123u) - //Repeated - .AddExtension(UnitTestLiteProtoFile.RepeatedBoolExtensionLite, true) - .AddExtension(UnitTestLiteProtoFile.RepeatedBytesExtensionLite, ByteString.CopyFromUtf8("123")) - .AddExtension(UnitTestLiteProtoFile.RepeatedCordExtensionLite, "123") - .AddExtension(UnitTestLiteProtoFile.RepeatedDoubleExtensionLite, 123) - .AddExtension(UnitTestLiteProtoFile.RepeatedFixed32ExtensionLite, 123u) - .AddExtension(UnitTestLiteProtoFile.RepeatedFixed64ExtensionLite, 123u) - .AddExtension(UnitTestLiteProtoFile.RepeatedFloatExtensionLite, 123) - .AddExtension(UnitTestLiteProtoFile.RepeatedForeignEnumExtensionLite, ForeignEnumLite.FOREIGN_LITE_BAZ) - .AddExtension(UnitTestLiteProtoFile.RepeatedImportEnumExtensionLite, ImportEnumLite.IMPORT_LITE_BAZ) - .AddExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite, 123) - .AddExtension(UnitTestLiteProtoFile.RepeatedInt64ExtensionLite, 123) - .AddExtension(UnitTestLiteProtoFile.RepeatedNestedEnumExtensionLite, - TestAllTypesLite.Types.NestedEnum.FOO) - .AddExtension(UnitTestLiteProtoFile.RepeatedSfixed32ExtensionLite, 123) - .AddExtension(UnitTestLiteProtoFile.RepeatedSfixed64ExtensionLite, 123) - .AddExtension(UnitTestLiteProtoFile.RepeatedSint32ExtensionLite, 123) - .AddExtension(UnitTestLiteProtoFile.RepeatedSint64ExtensionLite, 123) - .AddExtension(UnitTestLiteProtoFile.RepeatedStringExtensionLite, "123") - .AddExtension(UnitTestLiteProtoFile.RepeatedStringPieceExtensionLite, "123") - .AddExtension(UnitTestLiteProtoFile.RepeatedUint32ExtensionLite, 123u) - .AddExtension(UnitTestLiteProtoFile.RepeatedUint64ExtensionLite, 123u) - ; - TestAllExtensionsLite msg = builder.Build(); - - ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); - UnitTestLiteProtoFile.RegisterAllExtensions(registry); - - TestAllExtensionsLite.Builder copyBuilder = - TestAllExtensionsLite.CreateBuilder().MergeFrom(msg.ToByteArray(), registry); - TestAllExtensionsLite copy = copyBuilder.Build(); - - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); - - Assert.AreEqual(true, copy.GetExtension(UnitTestLiteProtoFile.DefaultBoolExtensionLite)); - Assert.AreEqual(ByteString.CopyFromUtf8("123"), - copy.GetExtension(UnitTestLiteProtoFile.DefaultBytesExtensionLite)); - Assert.AreEqual("123", copy.GetExtension(UnitTestLiteProtoFile.DefaultCordExtensionLite)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.DefaultDoubleExtensionLite)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestLiteProtoFile.DefaultFixed32ExtensionLite)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestLiteProtoFile.DefaultFixed64ExtensionLite)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.DefaultFloatExtensionLite)); - Assert.AreEqual(ForeignEnumLite.FOREIGN_LITE_BAZ, - copy.GetExtension(UnitTestLiteProtoFile.DefaultForeignEnumExtensionLite)); - Assert.AreEqual(ImportEnumLite.IMPORT_LITE_BAZ, - copy.GetExtension(UnitTestLiteProtoFile.DefaultImportEnumExtensionLite)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.DefaultInt32ExtensionLite)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.DefaultInt64ExtensionLite)); - Assert.AreEqual(TestAllTypesLite.Types.NestedEnum.FOO, - copy.GetExtension(UnitTestLiteProtoFile.DefaultNestedEnumExtensionLite)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.DefaultSfixed32ExtensionLite)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.DefaultSfixed64ExtensionLite)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.DefaultSint32ExtensionLite)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.DefaultSint64ExtensionLite)); - Assert.AreEqual("123", copy.GetExtension(UnitTestLiteProtoFile.DefaultStringExtensionLite)); - Assert.AreEqual("123", copy.GetExtension(UnitTestLiteProtoFile.DefaultStringPieceExtensionLite)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestLiteProtoFile.DefaultUint32ExtensionLite)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestLiteProtoFile.DefaultUint64ExtensionLite)); - - Assert.AreEqual(true, copy.GetExtension(UnitTestLiteProtoFile.OptionalBoolExtensionLite)); - Assert.AreEqual(ByteString.CopyFromUtf8("123"), - copy.GetExtension(UnitTestLiteProtoFile.OptionalBytesExtensionLite)); - Assert.AreEqual("123", copy.GetExtension(UnitTestLiteProtoFile.OptionalCordExtensionLite)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.OptionalDoubleExtensionLite)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestLiteProtoFile.OptionalFixed32ExtensionLite)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestLiteProtoFile.OptionalFixed64ExtensionLite)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.OptionalFloatExtensionLite)); - Assert.AreEqual(ForeignEnumLite.FOREIGN_LITE_BAZ, - copy.GetExtension(UnitTestLiteProtoFile.OptionalForeignEnumExtensionLite)); - Assert.AreEqual(ImportEnumLite.IMPORT_LITE_BAZ, - copy.GetExtension(UnitTestLiteProtoFile.OptionalImportEnumExtensionLite)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.OptionalInt32ExtensionLite)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.OptionalInt64ExtensionLite)); - Assert.AreEqual(TestAllTypesLite.Types.NestedEnum.FOO, - copy.GetExtension(UnitTestLiteProtoFile.OptionalNestedEnumExtensionLite)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.OptionalSfixed32ExtensionLite)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.OptionalSfixed64ExtensionLite)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.OptionalSint32ExtensionLite)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.OptionalSint64ExtensionLite)); - Assert.AreEqual("123", copy.GetExtension(UnitTestLiteProtoFile.OptionalStringExtensionLite)); - Assert.AreEqual("123", copy.GetExtension(UnitTestLiteProtoFile.OptionalStringPieceExtensionLite)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestLiteProtoFile.OptionalUint32ExtensionLite)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestLiteProtoFile.OptionalUint64ExtensionLite)); - - Assert.AreEqual(true, copy.GetExtension(UnitTestLiteProtoFile.RepeatedBoolExtensionLite, 0)); - Assert.AreEqual(ByteString.CopyFromUtf8("123"), - copy.GetExtension(UnitTestLiteProtoFile.RepeatedBytesExtensionLite, 0)); - Assert.AreEqual("123", copy.GetExtension(UnitTestLiteProtoFile.RepeatedCordExtensionLite, 0)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.RepeatedDoubleExtensionLite, 0)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestLiteProtoFile.RepeatedFixed32ExtensionLite, 0)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestLiteProtoFile.RepeatedFixed64ExtensionLite, 0)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.RepeatedFloatExtensionLite, 0)); - Assert.AreEqual(ForeignEnumLite.FOREIGN_LITE_BAZ, - copy.GetExtension(UnitTestLiteProtoFile.RepeatedForeignEnumExtensionLite, 0)); - Assert.AreEqual(ImportEnumLite.IMPORT_LITE_BAZ, - copy.GetExtension(UnitTestLiteProtoFile.RepeatedImportEnumExtensionLite, 0)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite, 0)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.RepeatedInt64ExtensionLite, 0)); - Assert.AreEqual(TestAllTypesLite.Types.NestedEnum.FOO, - copy.GetExtension(UnitTestLiteProtoFile.RepeatedNestedEnumExtensionLite, 0)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.RepeatedSfixed32ExtensionLite, 0)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.RepeatedSfixed64ExtensionLite, 0)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.RepeatedSint32ExtensionLite, 0)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.RepeatedSint64ExtensionLite, 0)); - Assert.AreEqual("123", copy.GetExtension(UnitTestLiteProtoFile.RepeatedStringExtensionLite, 0)); - Assert.AreEqual("123", copy.GetExtension(UnitTestLiteProtoFile.RepeatedStringPieceExtensionLite, 0)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestLiteProtoFile.RepeatedUint32ExtensionLite, 0)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestLiteProtoFile.RepeatedUint64ExtensionLite, 0)); - } - - private TestPackedExtensionsLite BuildPackedExtensions() - { - TestPackedExtensionsLite.Builder builder = TestPackedExtensionsLite.CreateBuilder() - .AddExtension(UnitTestLiteProtoFile.PackedBoolExtensionLite, true) - .AddExtension(UnitTestLiteProtoFile.PackedDoubleExtensionLite, 123) - .AddExtension(UnitTestLiteProtoFile.PackedFixed32ExtensionLite, 123u) - .AddExtension(UnitTestLiteProtoFile.PackedFixed64ExtensionLite, 123u) - .AddExtension(UnitTestLiteProtoFile.PackedFloatExtensionLite, 123) - .AddExtension(UnitTestLiteProtoFile.PackedInt32ExtensionLite, 123) - .AddExtension(UnitTestLiteProtoFile.PackedInt64ExtensionLite, 123) - .AddExtension(UnitTestLiteProtoFile.PackedSfixed32ExtensionLite, 123) - .AddExtension(UnitTestLiteProtoFile.PackedSfixed64ExtensionLite, 123) - .AddExtension(UnitTestLiteProtoFile.PackedSint32ExtensionLite, 123) - .AddExtension(UnitTestLiteProtoFile.PackedSint64ExtensionLite, 123) - .AddExtension(UnitTestLiteProtoFile.PackedUint32ExtensionLite, 123u) - .AddExtension(UnitTestLiteProtoFile.PackedUint64ExtensionLite, 123u) - .AddExtension(UnitTestLiteProtoFile.PackedBoolExtensionLite, true) - .AddExtension(UnitTestLiteProtoFile.PackedDoubleExtensionLite, 123) - .AddExtension(UnitTestLiteProtoFile.PackedFixed32ExtensionLite, 123u) - .AddExtension(UnitTestLiteProtoFile.PackedFixed64ExtensionLite, 123u) - .AddExtension(UnitTestLiteProtoFile.PackedFloatExtensionLite, 123) - .AddExtension(UnitTestLiteProtoFile.PackedInt32ExtensionLite, 123) - .AddExtension(UnitTestLiteProtoFile.PackedInt64ExtensionLite, 123) - .AddExtension(UnitTestLiteProtoFile.PackedSfixed32ExtensionLite, 123) - .AddExtension(UnitTestLiteProtoFile.PackedSfixed64ExtensionLite, 123) - .AddExtension(UnitTestLiteProtoFile.PackedSint32ExtensionLite, 123) - .AddExtension(UnitTestLiteProtoFile.PackedSint64ExtensionLite, 123) - .AddExtension(UnitTestLiteProtoFile.PackedUint32ExtensionLite, 123u) - .AddExtension(UnitTestLiteProtoFile.PackedUint64ExtensionLite, 123u); - - TestPackedExtensionsLite msg = builder.Build(); - return msg; - } - - private void AssertPackedExtensions(TestPackedExtensionsLite copy) - { - Assert.AreEqual(true, copy.GetExtension(UnitTestLiteProtoFile.PackedBoolExtensionLite, 0)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.PackedDoubleExtensionLite, 0)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestLiteProtoFile.PackedFixed32ExtensionLite, 0)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestLiteProtoFile.PackedFixed64ExtensionLite, 0)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.PackedFloatExtensionLite, 0)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.PackedInt32ExtensionLite, 0)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.PackedInt64ExtensionLite, 0)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.PackedSfixed32ExtensionLite, 0)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.PackedSfixed64ExtensionLite, 0)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.PackedSint32ExtensionLite, 0)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.PackedSint64ExtensionLite, 0)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestLiteProtoFile.PackedUint32ExtensionLite, 0)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestLiteProtoFile.PackedUint64ExtensionLite, 0)); - - Assert.AreEqual(true, copy.GetExtension(UnitTestLiteProtoFile.PackedBoolExtensionLite, 1)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.PackedDoubleExtensionLite, 1)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestLiteProtoFile.PackedFixed32ExtensionLite, 1)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestLiteProtoFile.PackedFixed64ExtensionLite, 1)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.PackedFloatExtensionLite, 1)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.PackedInt32ExtensionLite, 1)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.PackedInt64ExtensionLite, 1)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.PackedSfixed32ExtensionLite, 1)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.PackedSfixed64ExtensionLite, 1)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.PackedSint32ExtensionLite, 1)); - Assert.AreEqual(123, copy.GetExtension(UnitTestLiteProtoFile.PackedSint64ExtensionLite, 1)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestLiteProtoFile.PackedUint32ExtensionLite, 1)); - Assert.AreEqual(123u, copy.GetExtension(UnitTestLiteProtoFile.PackedUint64ExtensionLite, 1)); - } - - [TestMethod] - public void ExtensionWriterTestPacked() - { - TestPackedExtensionsLite msg = BuildPackedExtensions(); - - ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); - UnitTestLiteProtoFile.RegisterAllExtensions(registry); - - TestPackedExtensionsLite.Builder copyBuilder = - TestPackedExtensionsLite.CreateBuilder().MergeFrom(msg.ToByteArray(), registry); - TestPackedExtensionsLite copy = copyBuilder.Build(); - - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); - - AssertPackedExtensions(copy); - } - - [TestMethod] - public void TestUnpackedAndPackedExtensions() - { - TestPackedExtensionsLite original = BuildPackedExtensions(); - AssertPackedExtensions(original); - - ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); - UnitTestLiteProtoFile.RegisterAllExtensions(registry); - UnitTestExtrasLiteProtoFile.RegisterAllExtensions(registry); - - TestUnpackedExtensionsLite unpacked = TestUnpackedExtensionsLite.ParseFrom(original.ToByteArray(), registry); - - TestPackedExtensionsLite packed = TestPackedExtensionsLite.ParseFrom(unpacked.ToByteArray(), registry); - - Assert.AreEqual(original, packed); - TestUtil.AssertBytesEqual(original.ToByteArray(), packed.ToByteArray()); - AssertPackedExtensions(packed); - } - - [TestMethod] - public void TestUnpackedFromPackedInput() - { - byte[] packedData = BuildPackedExtensions().ToByteArray(); - - TestUnpackedTypesLite unpacked = TestUnpackedTypesLite.ParseFrom(packedData); - TestPackedTypesLite packed = TestPackedTypesLite.ParseFrom(unpacked.ToByteArray()); - TestUtil.AssertBytesEqual(packedData, packed.ToByteArray()); - - unpacked = TestUnpackedTypesLite.ParseFrom(packed.ToByteArray()); - - ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); - UnitTestLiteProtoFile.RegisterAllExtensions(registry); - AssertPackedExtensions(TestPackedExtensionsLite.ParseFrom(unpacked.ToByteArray(), registry)); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffersLite.Test/InteropLiteTest.cs b/src/ProtocolBuffersLite.Test/InteropLiteTest.cs deleted file mode 100644 index 37739d2..0000000 --- a/src/ProtocolBuffersLite.Test/InteropLiteTest.cs +++ /dev/null @@ -1,186 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using Google.ProtocolBuffers; -using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers -{ - [TestClass] - public class InteropLiteTest - { - [TestMethod] - public void TestConvertFromFullMinimal() - { - TestInteropPerson person = TestInteropPerson.CreateBuilder() - .SetId(123) - .SetName("abc") - .Build(); - Assert.IsTrue(person.IsInitialized); - - TestInteropPersonLite copy = TestInteropPersonLite.ParseFrom(person.ToByteArray()); - - TestUtil.AssertBytesEqual(person.ToByteArray(), copy.ToByteArray()); - } - - [TestMethod] - public void TestConvertFromFullComplete() - { - TestInteropPerson person = TestInteropPerson.CreateBuilder() - .SetId(123) - .SetName("abc") - .SetEmail("abc@123.com") - .AddRangeCodes(new[] {1, 2, 3}) - .AddPhone(TestInteropPerson.Types.PhoneNumber.CreateBuilder().SetNumber("555-1234").Build()) - .AddPhone(TestInteropPerson.Types.PhoneNumber.CreateBuilder().SetNumber("555-5678").Build()) - .AddAddresses( - TestInteropPerson.Types.Addresses.CreateBuilder().SetAddress("123 Seseme").SetCity("Wonderland"). - SetState("NA").SetZip(12345).Build()) - .SetExtension(UnitTestExtrasFullProtoFile.EmployeeId, - TestInteropEmployeeId.CreateBuilder().SetNumber("123").Build()) - .Build(); - Assert.IsTrue(person.IsInitialized); - - ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); - UnitTestExtrasLiteProtoFile.RegisterAllExtensions(registry); - - TestInteropPersonLite copy = TestInteropPersonLite.ParseFrom(person.ToByteArray(), registry); - - TestUtil.AssertBytesEqual(person.ToByteArray(), copy.ToByteArray()); - } - - [TestMethod] - public void TestConvertFromLiteMinimal() - { - TestInteropPersonLite person = TestInteropPersonLite.CreateBuilder() - .SetId(123) - .SetName("abc") - .Build(); - Assert.IsTrue(person.IsInitialized); - - TestInteropPerson copy = TestInteropPerson.ParseFrom(person.ToByteArray()); - - TestUtil.AssertBytesEqual(person.ToByteArray(), copy.ToByteArray()); - } - - [TestMethod] - public void TestConvertFromLiteComplete() - { - TestInteropPersonLite person = TestInteropPersonLite.CreateBuilder() - .SetId(123) - .SetName("abc") - .SetEmail("abc@123.com") - .AddRangeCodes(new[] {1, 2, 3}) - .AddPhone(TestInteropPersonLite.Types.PhoneNumber.CreateBuilder().SetNumber("555-1234").Build()) - .AddPhone(TestInteropPersonLite.Types.PhoneNumber.CreateBuilder().SetNumber("555-5678").Build()) - .AddAddresses( - TestInteropPersonLite.Types.Addresses.CreateBuilder().SetAddress("123 Seseme").SetCity("Wonderland") - .SetState("NA").SetZip(12345).Build()) - .SetExtension(UnitTestExtrasLiteProtoFile.EmployeeIdLite, - TestInteropEmployeeIdLite.CreateBuilder().SetNumber("123").Build()) - .Build(); - Assert.IsTrue(person.IsInitialized); - - ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); - UnitTestExtrasFullProtoFile.RegisterAllExtensions(registry); - - TestInteropPerson copy = TestInteropPerson.ParseFrom(person.ToByteArray(), registry); - - TestUtil.AssertBytesEqual(person.ToByteArray(), copy.ToByteArray()); - } - - public ByteString AllBytes - { - get - { - byte[] bytes = new byte[256]; - for (int i = 0; i < bytes.Length; i++) - bytes[i] = (byte) i; - return ByteString.CopyFrom(bytes); - } - } - - [TestMethod] - public void TestCompareStringValues() - { - TestInteropPersonLite person = TestInteropPersonLite.CreateBuilder() - .SetId(123) - .SetName("abc") - .SetEmail("abc@123.com") - .AddRangeCodes(new[] {1, 2, 3}) - .AddPhone(TestInteropPersonLite.Types.PhoneNumber.CreateBuilder().SetNumber("555-1234").Build()) - .AddPhone( - TestInteropPersonLite.Types.PhoneNumber.CreateBuilder().SetNumber( - System.Text.Encoding.UTF8.GetString(AllBytes.ToByteArray(), 0, AllBytes.Length)).Build()) - .AddAddresses( - TestInteropPersonLite.Types.Addresses.CreateBuilder().SetAddress("123 Seseme").SetCity("Wonderland") - .SetState("NA").SetZip(12345).Build()) - .SetExtension(UnitTestExtrasLiteProtoFile.EmployeeIdLite, - TestInteropEmployeeIdLite.CreateBuilder().SetNumber("123").Build()) - .Build(); - Assert.IsTrue(person.IsInitialized); - - ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); - UnitTestExtrasFullProtoFile.RegisterAllExtensions(registry); - - TestInteropPerson copy = TestInteropPerson.ParseFrom(person.ToByteArray(), registry); - - TestUtil.AssertBytesEqual(person.ToByteArray(), copy.ToByteArray()); - - TestInteropPerson.Builder copyBuilder = TestInteropPerson.CreateBuilder(); - TextFormat.Merge( - person.ToString().Replace("[protobuf_unittest_extra.employee_id_lite]", - "[protobuf_unittest_extra.employee_id]"), registry, copyBuilder); - - copy = copyBuilder.Build(); - TestUtil.AssertBytesEqual(person.ToByteArray(), copy.ToByteArray()); - - string liteText = person.ToString().TrimEnd().Replace("\r", ""); - string fullText = copy.ToString().TrimEnd().Replace("\r", ""); - //map the extension type - liteText = liteText.Replace("[protobuf_unittest_extra.employee_id_lite]", - "[protobuf_unittest_extra.employee_id]"); - //lite version does not indent - while (fullText.IndexOf("\n ") >= 0) - fullText = fullText.Replace("\n ", "\n"); - - Assert.AreEqual(fullText, liteText); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffersLite.Test/LiteTest.cs b/src/ProtocolBuffersLite.Test/LiteTest.cs deleted file mode 100644 index 3561876..0000000 --- a/src/ProtocolBuffersLite.Test/LiteTest.cs +++ /dev/null @@ -1,118 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System; -using System.Collections.Generic; -using System.IO; -using Google.ProtocolBuffers.Descriptors; -using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers -{ - /// - /// Miscellaneous tests for message operations that apply to both - /// generated and dynamic messages. - /// - [TestClass] - public class LiteTest - { - [TestMethod] - public void TestLite() - { - // Since lite messages are a subset of regular messages, we can mostly - // assume that the functionality of lite messages is already thoroughly - // tested by the regular tests. All this test really verifies is that - // a proto with optimize_for = LITE_RUNTIME compiles correctly when - // linked only against the lite library. That is all tested at compile - // time, leaving not much to do in this method. Let's just do some random - // stuff to make sure the lite message is actually here and usable. - - TestAllTypesLite message = - TestAllTypesLite.CreateBuilder() - .SetOptionalInt32(123) - .AddRepeatedString("hello") - .SetOptionalNestedMessage( - TestAllTypesLite.Types.NestedMessage.CreateBuilder().SetBb(7)) - .Build(); - - ByteString data = message.ToByteString(); - - TestAllTypesLite message2 = TestAllTypesLite.ParseFrom(data); - - Assert.AreEqual(123, message2.OptionalInt32); - Assert.AreEqual(1, message2.RepeatedStringCount); - Assert.AreEqual("hello", message2.RepeatedStringList[0]); - Assert.AreEqual(7, message2.OptionalNestedMessage.Bb); - } - - [TestMethod] - public void TestLiteExtensions() - { - // TODO(kenton): Unlike other features of the lite library, extensions are - // implemented completely differently from the regular library. We - // should probably test them more thoroughly. - - TestAllExtensionsLite message = - TestAllExtensionsLite.CreateBuilder() - .SetExtension(UnitTestLiteProtoFile.OptionalInt32ExtensionLite, 123) - .AddExtension(UnitTestLiteProtoFile.RepeatedStringExtensionLite, "hello") - .SetExtension(UnitTestLiteProtoFile.OptionalNestedEnumExtensionLite, - TestAllTypesLite.Types.NestedEnum.BAZ) - .SetExtension(UnitTestLiteProtoFile.OptionalNestedMessageExtensionLite, - TestAllTypesLite.Types.NestedMessage.CreateBuilder().SetBb(7).Build()) - .Build(); - - // Test copying a message, since coping extensions actually does use a - // different code path between lite and regular libraries, and as of this - // writing, parsing hasn't been implemented yet. - TestAllExtensionsLite message2 = message.ToBuilder().Build(); - - Assert.AreEqual(123, (int) message2.GetExtension( - UnitTestLiteProtoFile.OptionalInt32ExtensionLite)); - Assert.AreEqual(1, message2.GetExtensionCount( - UnitTestLiteProtoFile.RepeatedStringExtensionLite)); - Assert.AreEqual(1, message2.GetExtension( - UnitTestLiteProtoFile.RepeatedStringExtensionLite).Count); - Assert.AreEqual("hello", message2.GetExtension( - UnitTestLiteProtoFile.RepeatedStringExtensionLite, 0)); - Assert.AreEqual(TestAllTypesLite.Types.NestedEnum.BAZ, message2.GetExtension( - UnitTestLiteProtoFile.OptionalNestedEnumExtensionLite)); - Assert.AreEqual(7, message2.GetExtension( - UnitTestLiteProtoFile.OptionalNestedMessageExtensionLite).Bb); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffersLite.Test/MissingFieldAndExtensionTest.cs b/src/ProtocolBuffersLite.Test/MissingFieldAndExtensionTest.cs deleted file mode 100644 index c65cb7f..0000000 --- a/src/ProtocolBuffersLite.Test/MissingFieldAndExtensionTest.cs +++ /dev/null @@ -1,240 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using System.IO; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.Collections.Generic; -using Google.ProtocolBuffers.TestProtos; - -namespace Google.ProtocolBuffers -{ - [TestClass] - public class MissingFieldAndExtensionTest - { - [TestMethod] - public void TestRecoverMissingExtensions() - { - const int optionalInt32 = 12345678; - TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder(); - builder.SetExtension(UnitTestProtoFile.OptionalInt32Extension, optionalInt32); - builder.AddExtension(UnitTestProtoFile.RepeatedDoubleExtension, 1.1); - builder.AddExtension(UnitTestProtoFile.RepeatedDoubleExtension, 1.2); - builder.AddExtension(UnitTestProtoFile.RepeatedDoubleExtension, 1.3); - TestAllExtensions msg = builder.Build(); - - Assert.IsTrue(msg.HasExtension(UnitTestProtoFile.OptionalInt32Extension)); - Assert.AreEqual(3, msg.GetExtensionCount(UnitTestProtoFile.RepeatedDoubleExtension)); - - byte[] bits = msg.ToByteArray(); - TestAllExtensions copy = TestAllExtensions.ParseFrom(bits); - Assert.IsFalse(copy.HasExtension(UnitTestProtoFile.OptionalInt32Extension)); - Assert.AreEqual(0, copy.GetExtensionCount(UnitTestProtoFile.RepeatedDoubleExtension)); - Assert.AreNotEqual(msg, copy); - - //Even though copy does not understand the typees they serialize correctly - byte[] copybits = copy.ToByteArray(); - TestUtil.AssertBytesEqual(bits, copybits); - - ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); - UnitTestProtoFile.RegisterAllExtensions(registry); - - //Now we can take those copy bits and restore the full message with extensions - copy = TestAllExtensions.ParseFrom(copybits, registry); - Assert.IsTrue(copy.HasExtension(UnitTestProtoFile.OptionalInt32Extension)); - Assert.AreEqual(3, copy.GetExtensionCount(UnitTestProtoFile.RepeatedDoubleExtension)); - - Assert.AreEqual(msg, copy); - TestUtil.AssertBytesEqual(bits, copy.ToByteArray()); - - //If we modify the object this should all continue to work as before - copybits = copy.ToBuilder().Build().ToByteArray(); - TestUtil.AssertBytesEqual(bits, copybits); - - //If we replace extension the object this should all continue to work as before - copybits = copy.ToBuilder() - .SetExtension(UnitTestProtoFile.OptionalInt32Extension, optionalInt32) - .Build().ToByteArray(); - TestUtil.AssertBytesEqual(bits, copybits); - } - - [TestMethod] - public void TestRecoverMissingFields() - { - TestMissingFieldsA msga = TestMissingFieldsA.CreateBuilder() - .SetId(1001) - .SetName("Name") - .SetEmail("missing@field.value") - .Build(); - - //serialize to type B and verify all fields exist - TestMissingFieldsB msgb = TestMissingFieldsB.ParseFrom(msga.ToByteArray()); - Assert.AreEqual(1001, msgb.Id); - Assert.AreEqual("Name", msgb.Name); - Assert.IsFalse(msgb.HasWebsite); - Assert.AreEqual(1, msgb.UnknownFields.FieldDictionary.Count); - Assert.AreEqual("missing@field.value", - msgb.UnknownFields[TestMissingFieldsA.EmailFieldNumber].LengthDelimitedList[0].ToStringUtf8()); - - //serializes exactly the same (at least for this simple example) - TestUtil.AssertBytesEqual(msga.ToByteArray(), msgb.ToByteArray()); - Assert.AreEqual(msga, TestMissingFieldsA.ParseFrom(msgb.ToByteArray())); - - //now re-create an exact copy of A from serialized B - TestMissingFieldsA copya = TestMissingFieldsA.ParseFrom(msgb.ToByteArray()); - Assert.AreEqual(msga, copya); - Assert.AreEqual(1001, copya.Id); - Assert.AreEqual("Name", copya.Name); - Assert.AreEqual("missing@field.value", copya.Email); - - //Now we modify B... and try again - msgb = msgb.ToBuilder().SetWebsite("http://new.missing.field").Build(); - //Does B still have the missing field? - Assert.AreEqual(1, msgb.UnknownFields.FieldDictionary.Count); - - //Convert back to A and see if all fields are there? - copya = TestMissingFieldsA.ParseFrom(msgb.ToByteArray()); - Assert.AreNotEqual(msga, copya); - Assert.AreEqual(1001, copya.Id); - Assert.AreEqual("Name", copya.Name); - Assert.AreEqual("missing@field.value", copya.Email); - Assert.AreEqual(1, copya.UnknownFields.FieldDictionary.Count); - Assert.AreEqual("http://new.missing.field", - copya.UnknownFields[TestMissingFieldsB.WebsiteFieldNumber].LengthDelimitedList[0]. - ToStringUtf8()); - - //Lastly we can even still trip back to type B and see all fields: - TestMissingFieldsB copyb = TestMissingFieldsB.ParseFrom(copya.ToByteArray()); - Assert.AreEqual(copya.ToByteArray().Length, copyb.ToByteArray().Length); //not exact order. - Assert.AreEqual(1001, copyb.Id); - Assert.AreEqual("Name", copyb.Name); - Assert.AreEqual("http://new.missing.field", copyb.Website); - Assert.AreEqual(1, copyb.UnknownFields.FieldDictionary.Count); - Assert.AreEqual("missing@field.value", - copyb.UnknownFields[TestMissingFieldsA.EmailFieldNumber].LengthDelimitedList[0].ToStringUtf8 - ()); - } - - [TestMethod] - public void TestRecoverMissingMessage() - { - TestMissingFieldsA.Types.SubA suba = - TestMissingFieldsA.Types.SubA.CreateBuilder().SetCount(3).AddValues("a").AddValues("b").AddValues("c"). - Build(); - TestMissingFieldsA msga = TestMissingFieldsA.CreateBuilder() - .SetId(1001) - .SetName("Name") - .SetTestA(suba) - .Build(); - - //serialize to type B and verify all fields exist - TestMissingFieldsB msgb = TestMissingFieldsB.ParseFrom(msga.ToByteArray()); - Assert.AreEqual(1001, msgb.Id); - Assert.AreEqual("Name", msgb.Name); - Assert.AreEqual(1, msgb.UnknownFields.FieldDictionary.Count); - Assert.AreEqual(suba.ToString(), - TestMissingFieldsA.Types.SubA.ParseFrom( - msgb.UnknownFields[TestMissingFieldsA.TestAFieldNumber].LengthDelimitedList[0]).ToString - ()); - - //serializes exactly the same (at least for this simple example) - TestUtil.AssertBytesEqual(msga.ToByteArray(), msgb.ToByteArray()); - Assert.AreEqual(msga, TestMissingFieldsA.ParseFrom(msgb.ToByteArray())); - - //now re-create an exact copy of A from serialized B - TestMissingFieldsA copya = TestMissingFieldsA.ParseFrom(msgb.ToByteArray()); - Assert.AreEqual(msga, copya); - Assert.AreEqual(1001, copya.Id); - Assert.AreEqual("Name", copya.Name); - Assert.AreEqual(suba, copya.TestA); - - //Now we modify B... and try again - TestMissingFieldsB.Types.SubB subb = - TestMissingFieldsB.Types.SubB.CreateBuilder().AddValues("test-b").Build(); - msgb = msgb.ToBuilder().SetTestB(subb).Build(); - //Does B still have the missing field? - Assert.AreEqual(1, msgb.UnknownFields.FieldDictionary.Count); - - //Convert back to A and see if all fields are there? - copya = TestMissingFieldsA.ParseFrom(msgb.ToByteArray()); - Assert.AreNotEqual(msga, copya); - Assert.AreEqual(1001, copya.Id); - Assert.AreEqual("Name", copya.Name); - Assert.AreEqual(suba, copya.TestA); - Assert.AreEqual(1, copya.UnknownFields.FieldDictionary.Count); - TestUtil.AssertBytesEqual(subb.ToByteArray(), - copya.UnknownFields[TestMissingFieldsB.TestBFieldNumber].LengthDelimitedList[0].ToByteArray()); - - //Lastly we can even still trip back to type B and see all fields: - TestMissingFieldsB copyb = TestMissingFieldsB.ParseFrom(copya.ToByteArray()); - Assert.AreEqual(copya.ToByteArray().Length, copyb.ToByteArray().Length); //not exact order. - Assert.AreEqual(1001, copyb.Id); - Assert.AreEqual("Name", copyb.Name); - Assert.AreEqual(subb, copyb.TestB); - Assert.AreEqual(1, copyb.UnknownFields.FieldDictionary.Count); - } - - [TestMethod] - public void TestRestoreFromOtherType() - { - TestInteropPerson person = TestInteropPerson.CreateBuilder() - .SetId(123) - .SetName("abc") - .SetEmail("abc@123.com") - .AddRangeCodes(new[] {1, 2, 3}) - .AddPhone(TestInteropPerson.Types.PhoneNumber.CreateBuilder().SetNumber("555-1234").Build()) - .AddPhone(TestInteropPerson.Types.PhoneNumber.CreateBuilder().SetNumber("555-5678").Build()) - .AddAddresses( - TestInteropPerson.Types.Addresses.CreateBuilder().SetAddress("123 Seseme").SetCity("Wonderland"). - SetState("NA").SetZip(12345).Build()) - .SetExtension(UnitTestExtrasFullProtoFile.EmployeeId, - TestInteropEmployeeId.CreateBuilder().SetNumber("123").Build()) - .Build(); - Assert.IsTrue(person.IsInitialized); - - TestEmptyMessage temp = TestEmptyMessage.ParseFrom(person.ToByteArray()); - Assert.AreEqual(7, temp.UnknownFields.FieldDictionary.Count); - temp = temp.ToBuilder().Build(); - Assert.AreEqual(7, temp.UnknownFields.FieldDictionary.Count); - - ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); - UnitTestExtrasFullProtoFile.RegisterAllExtensions(registry); - - TestInteropPerson copy = TestInteropPerson.ParseFrom(temp.ToByteArray(), registry); - Assert.AreEqual(person, copy); - TestUtil.AssertBytesEqual(person.ToByteArray(), copy.ToByteArray()); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffersLite.Test/Properties/AppManifest.xml b/src/ProtocolBuffersLite.Test/Properties/AppManifest.xml deleted file mode 100644 index a955232..0000000 --- a/src/ProtocolBuffersLite.Test/Properties/AppManifest.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - diff --git a/src/ProtocolBuffersLite.Test/Properties/OutOfBrowserSettings.xml b/src/ProtocolBuffersLite.Test/Properties/OutOfBrowserSettings.xml deleted file mode 100644 index 634f44b..0000000 --- a/src/ProtocolBuffersLite.Test/Properties/OutOfBrowserSettings.xml +++ /dev/null @@ -1,7 +0,0 @@ - - ProtocolBuffers.Test - - - - - \ No newline at end of file diff --git a/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.CF20.csproj b/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.CF20.csproj deleted file mode 100644 index abb9f61..0000000 --- a/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.CF20.csproj +++ /dev/null @@ -1,133 +0,0 @@ - - - COMPACT_FRAMEWORK - CF20 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {EE01ED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersLite.Test - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Smartphone - f27da329-3269-4191-98e0-c87d3d7f1db9 - - - true - full - false - bin\CF20\Debug - obj\CF20\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION;NOEXTENSIONS - prompt - 4 - true - true - Off - true - - - pdbonly - true - bin\CF20\Release - obj\CF20\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION;NOEXTENSIONS - prompt - 4 - true - true - Off - true - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - Properties\AssemblyInfo.cs - - - SerializableAttribute.cs - - - TestRpcForMimeTypes.cs - - - TestRpcGenerator.cs - - - - - - - - - - - - - - - - - {E067A59D-9D0A-4A1F-92B1-38E4457241D1} - ProtocolBuffersLite.Serialization - - - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffersLite - True - - - - - - - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.CF35.csproj b/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.CF35.csproj deleted file mode 100644 index 74edad1..0000000 --- a/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.CF35.csproj +++ /dev/null @@ -1,134 +0,0 @@ - - - COMPACT_FRAMEWORK - CF35 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {EE01ED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersLite.Test - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Smartphone - f27da329-3269-4191-98e0-c87d3d7f1db9 - - - true - full - false - bin\CF35\Debug - obj\CF35\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION - prompt - 4 - true - true - Off - true - - - pdbonly - true - bin\CF35\Release - obj\CF35\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION - prompt - 4 - true - true - Off - true - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - Properties\AssemblyInfo.cs - - - SerializableAttribute.cs - - - TestRpcForMimeTypes.cs - - - TestRpcGenerator.cs - - - - - - - - - - - - - - - - - {E067A59D-9D0A-4A1F-92B1-38E4457241D1} - ProtocolBuffersLite.Serialization - - - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffersLite - True - - - - - - - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.NET20.csproj b/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.NET20.csproj deleted file mode 100644 index 59f9375..0000000 --- a/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.NET20.csproj +++ /dev/null @@ -1,121 +0,0 @@ - - - CLIENTPROFILE - NET20 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {EE01ED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersLite.Test - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET20\Debug - obj\NET20\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOEXTENSIONS - prompt - 4 - true - true - Off - - - pdbonly - true - bin\NET20\Release - obj\NET20\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOEXTENSIONS - prompt - 4 - true - true - Off - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - Properties\AssemblyInfo.cs - - - SerializableAttribute.cs - - - TestRpcForMimeTypes.cs - - - TestRpcGenerator.cs - - - - - - - - - - - - - - - - - {E067A59D-9D0A-4A1F-92B1-38E4457241D1} - ProtocolBuffersLite.Serialization - - - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffersLite - True - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.NET35.csproj b/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.NET35.csproj deleted file mode 100644 index e4ebfe1..0000000 --- a/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.NET35.csproj +++ /dev/null @@ -1,122 +0,0 @@ - - - CLIENTPROFILE - NET35 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {EE01ED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersLite.Test - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET35\Debug - obj\NET35\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - true - Off - - - pdbonly - true - bin\NET35\Release - obj\NET35\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - true - Off - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - Properties\AssemblyInfo.cs - - - SerializableAttribute.cs - - - TestRpcForMimeTypes.cs - - - TestRpcGenerator.cs - - - - - - - - - - - - - - - - - {E067A59D-9D0A-4A1F-92B1-38E4457241D1} - ProtocolBuffersLite.Serialization - - - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffersLite - True - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.NET40.csproj b/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.NET40.csproj deleted file mode 100644 index d02ac77..0000000 --- a/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.NET40.csproj +++ /dev/null @@ -1,122 +0,0 @@ - - - CLIENTPROFILE - NET40 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {EE01ED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersLite.Test - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET40\Debug - obj\NET40\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - true - Off - - - pdbonly - true - bin\NET40\Release - obj\NET40\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - true - Off - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - Properties\AssemblyInfo.cs - - - SerializableAttribute.cs - - - TestRpcForMimeTypes.cs - - - TestRpcGenerator.cs - - - - - - - - - - - - - - - - - {E067A59D-9D0A-4A1F-92B1-38E4457241D1} - ProtocolBuffersLite.Serialization - - - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffersLite - True - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.PL40.csproj b/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.PL40.csproj deleted file mode 100644 index b645a01..0000000 --- a/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.PL40.csproj +++ /dev/null @@ -1,156 +0,0 @@ - - - PORTABLE_LIBRARY - PL40 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {EE01ED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersLite.Test - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - 10.0 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - - false - false - true - true - true - Google.ProtocolBuffersLite.Test.xap - Properties\AppManifest.xml - Google.ProtocolBuffers.App - TestPage.html - true - v4.0 - Properties\OutOfBrowserSettings.xml - true - - - true - full - false - bin\PL40\Debug - obj\PL40\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - true - Off - - - pdbonly - true - bin\PL40\Release - obj\PL40\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - true - Off - - - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - Properties\AssemblyInfo.cs - - - SerializableAttribute.cs - - - TestRpcForMimeTypes.cs - - - TestRpcGenerator.cs - - - - - - - - - - - - - - - App.xaml - - - - - MSBuild:Compile - Designer - - - - - {E067A59D-9D0A-4A1F-92B1-38E4457241D1} - ProtocolBuffersLite.Serialization - - - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffersLite - True - - - - - - - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.SL20.csproj b/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.SL20.csproj deleted file mode 100644 index b4ad946..0000000 --- a/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.SL20.csproj +++ /dev/null @@ -1,157 +0,0 @@ - - - SILVERLIGHT - SL20 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {EE01ED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersLite.Test - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - true - false - false - true - true - Google.ProtocolBuffersLite.Test.xap - Properties\AppManifest.xml - Google.ProtocolBuffers.App - TestPage.html - true - v2.0 - Properties\OutOfBrowserSettings.xml - true - - - true - full - false - bin\SL20\Debug - obj\SL20\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST;NOEXTENSIONS - prompt - 4 - true - true - Off - true - - - pdbonly - true - bin\SL20\Release - obj\SL20\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST;NOEXTENSIONS - prompt - 4 - true - true - Off - true - - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - Properties\AssemblyInfo.cs - - - SerializableAttribute.cs - - - TestRpcForMimeTypes.cs - - - TestRpcGenerator.cs - - - - - - - - - - - - - - - App.xaml - - - - - MSBuild:Compile - Designer - - - - - {E067A59D-9D0A-4A1F-92B1-38E4457241D1} - ProtocolBuffersLite.Serialization - - - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffersLite - True - - - - - - - - OfflineApplication - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.SL30.csproj b/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.SL30.csproj deleted file mode 100644 index b5870ed..0000000 --- a/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.SL30.csproj +++ /dev/null @@ -1,158 +0,0 @@ - - - SILVERLIGHT - SL30 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {EE01ED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersLite.Test - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - true - false - false - true - true - Google.ProtocolBuffersLite.Test.xap - Properties\AppManifest.xml - Google.ProtocolBuffers.App - TestPage.html - true - v3.5 - Properties\OutOfBrowserSettings.xml - true - - - true - full - false - bin\SL30\Debug - obj\SL30\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - true - Off - true - - - pdbonly - true - bin\SL30\Release - obj\SL30\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - true - Off - true - - - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - Properties\AssemblyInfo.cs - - - SerializableAttribute.cs - - - TestRpcForMimeTypes.cs - - - TestRpcGenerator.cs - - - - - - - - - - - - - - - App.xaml - - - - - MSBuild:Compile - Designer - - - - - {E067A59D-9D0A-4A1F-92B1-38E4457241D1} - ProtocolBuffersLite.Serialization - - - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffersLite - True - - - - - - - - OfflineApplication - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.SL40.csproj b/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.SL40.csproj deleted file mode 100644 index ef1543e..0000000 --- a/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.SL40.csproj +++ /dev/null @@ -1,158 +0,0 @@ - - - SILVERLIGHT - SL40 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {EE01ED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersLite.Test - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - true - false - false - v4.0 - true - true - Google.ProtocolBuffersLite.Test.xap - Properties\AppManifest.xml - Google.ProtocolBuffers.App - TestPage.html - true - Properties\OutOfBrowserSettings.xml - true - - - true - full - false - bin\SL40\Debug - obj\SL40\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - true - Off - true - - - pdbonly - true - bin\SL40\Release - obj\SL40\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - true - Off - true - - - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - Properties\AssemblyInfo.cs - - - SerializableAttribute.cs - - - TestRpcForMimeTypes.cs - - - TestRpcGenerator.cs - - - - - - - - - - - - - - - App.xaml - - - - - MSBuild:Compile - Designer - - - - - {E067A59D-9D0A-4A1F-92B1-38E4457241D1} - ProtocolBuffersLite.Serialization - - - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffersLite - True - - - - - - - - OfflineApplication - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.csproj b/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.csproj deleted file mode 100644 index 451aaf8..0000000 --- a/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.csproj +++ /dev/null @@ -1,122 +0,0 @@ - - - - CLIENTPROFILE - NET35 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {EE01ED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersLite.Test - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET35\Debug - obj\NET35\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - true - Off - - - pdbonly - true - bin\NET35\Release - obj\NET35\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - true - Off - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - Properties\AssemblyInfo.cs - - - SerializableAttribute.cs - - - TestRpcForMimeTypes.cs - - - TestRpcGenerator.cs - - - - - - - - - - - - - - - - - {E067A59D-9D0A-4A1F-92B1-38E4457241D1} - ProtocolBuffersLite.Serialization - - - {6969BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffersLite - True - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.CF20.csproj b/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.CF20.csproj deleted file mode 100644 index 0ed3b36..0000000 --- a/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.CF20.csproj +++ /dev/null @@ -1,126 +0,0 @@ - - - COMPACT_FRAMEWORK - CF20 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {EEFFED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersMixedLite.Test - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Smartphone - f27da329-3269-4191-98e0-c87d3d7f1db9 - - - true - full - false - bin\CF20\Debug - obj\CF20\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION;NOEXTENSIONS - prompt - 4 - true - true - Off - true - - - pdbonly - true - bin\CF20\Release - obj\CF20\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION;NOEXTENSIONS - prompt - 4 - true - true - Off - true - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - Properties\AssemblyInfo.cs - - - SerializableAttribute.cs - - - - - - - - - - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - - - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.CF35.csproj b/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.CF35.csproj deleted file mode 100644 index 50d4e64..0000000 --- a/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.CF35.csproj +++ /dev/null @@ -1,127 +0,0 @@ - - - COMPACT_FRAMEWORK - CF35 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {EEFFED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersMixedLite.Test - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Smartphone - f27da329-3269-4191-98e0-c87d3d7f1db9 - - - true - full - false - bin\CF35\Debug - obj\CF35\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION - prompt - 4 - true - true - Off - true - - - pdbonly - true - bin\CF35\Release - obj\CF35\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOFILEVERSION - prompt - 4 - true - true - Off - true - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - Properties\AssemblyInfo.cs - - - SerializableAttribute.cs - - - - - - - - - - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - - - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.NET20.csproj b/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.NET20.csproj deleted file mode 100644 index 80593a4..0000000 --- a/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.NET20.csproj +++ /dev/null @@ -1,114 +0,0 @@ - - - CLIENTPROFILE - NET20 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {EEFFED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersMixedLite.Test - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET20\Debug - obj\NET20\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOEXTENSIONS - prompt - 4 - true - true - Off - - - pdbonly - true - bin\NET20\Release - obj\NET20\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOEXTENSIONS - prompt - 4 - true - true - Off - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - Properties\AssemblyInfo.cs - - - SerializableAttribute.cs - - - - - - - - - - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.NET35.csproj b/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.NET35.csproj deleted file mode 100644 index e8b6d09..0000000 --- a/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.NET35.csproj +++ /dev/null @@ -1,115 +0,0 @@ - - - CLIENTPROFILE - NET35 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {EEFFED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersMixedLite.Test - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET35\Debug - obj\NET35\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - true - Off - - - pdbonly - true - bin\NET35\Release - obj\NET35\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - true - Off - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - Properties\AssemblyInfo.cs - - - SerializableAttribute.cs - - - - - - - - - - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.NET40.csproj b/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.NET40.csproj deleted file mode 100644 index 16ffefd..0000000 --- a/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.NET40.csproj +++ /dev/null @@ -1,115 +0,0 @@ - - - CLIENTPROFILE - NET40 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {EEFFED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersMixedLite.Test - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET40\Debug - obj\NET40\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - true - Off - - - pdbonly - true - bin\NET40\Release - obj\NET40\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - true - Off - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - Properties\AssemblyInfo.cs - - - SerializableAttribute.cs - - - - - - - - - - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.PL40.csproj b/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.PL40.csproj deleted file mode 100644 index 3d1a77b..0000000 --- a/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.PL40.csproj +++ /dev/null @@ -1,149 +0,0 @@ - - - PORTABLE_LIBRARY - PL40 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {EEFFED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersMixedLite.Test - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - 10.0 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - - false - false - true - true - true - Google.ProtocolBuffersMixedLite.Test.xap - Properties\AppManifest.xml - Google.ProtocolBuffers.App - TestPage.html - true - v4.0 - Properties\OutOfBrowserSettings.xml - true - - - true - full - false - bin\PL40\Debug - obj\PL40\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - true - Off - - - pdbonly - true - bin\PL40\Release - obj\PL40\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - true - Off - - - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - Properties\AssemblyInfo.cs - - - SerializableAttribute.cs - - - - - - - - - - - - - - - - - - - App.xaml - - - - - MSBuild:Compile - Designer - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - - - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.SL20.csproj b/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.SL20.csproj deleted file mode 100644 index 22b2c27..0000000 --- a/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.SL20.csproj +++ /dev/null @@ -1,150 +0,0 @@ - - - SILVERLIGHT - SL20 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {EEFFED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersMixedLite.Test - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - true - false - false - true - true - Google.ProtocolBuffersMixedLite.Test.xap - Properties\AppManifest.xml - Google.ProtocolBuffers.App - TestPage.html - true - v2.0 - Properties\OutOfBrowserSettings.xml - true - - - true - full - false - bin\SL20\Debug - obj\SL20\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST;NOEXTENSIONS - prompt - 4 - true - true - Off - true - - - pdbonly - true - bin\SL20\Release - obj\SL20\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST;NOEXTENSIONS - prompt - 4 - true - true - Off - true - - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - Properties\AssemblyInfo.cs - - - SerializableAttribute.cs - - - - - - - - - - - - - - - - - - - App.xaml - - - - - MSBuild:Compile - Designer - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - - - - OfflineApplication - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.SL30.csproj b/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.SL30.csproj deleted file mode 100644 index 3627b76..0000000 --- a/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.SL30.csproj +++ /dev/null @@ -1,151 +0,0 @@ - - - SILVERLIGHT - SL30 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {EEFFED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersMixedLite.Test - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - true - false - false - true - true - Google.ProtocolBuffersMixedLite.Test.xap - Properties\AppManifest.xml - Google.ProtocolBuffers.App - TestPage.html - true - v3.5 - Properties\OutOfBrowserSettings.xml - true - - - true - full - false - bin\SL30\Debug - obj\SL30\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - true - Off - true - - - pdbonly - true - bin\SL30\Release - obj\SL30\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - true - Off - true - - - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - Properties\AssemblyInfo.cs - - - SerializableAttribute.cs - - - - - - - - - - - - - - - - - - - App.xaml - - - - - MSBuild:Compile - Designer - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - - - - OfflineApplication - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.SL40.csproj b/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.SL40.csproj deleted file mode 100644 index a98c4d3..0000000 --- a/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.SL40.csproj +++ /dev/null @@ -1,151 +0,0 @@ - - - SILVERLIGHT - SL40 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {EEFFED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersMixedLite.Test - v4.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - true - false - false - v4.0 - true - true - Google.ProtocolBuffersMixedLite.Test.xap - Properties\AppManifest.xml - Google.ProtocolBuffers.App - TestPage.html - true - Properties\OutOfBrowserSettings.xml - true - - - true - full - false - bin\SL40\Debug - obj\SL40\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - true - Off - true - - - pdbonly - true - bin\SL40\Release - obj\SL40\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate);NOSERIALIZABLE;NOSORTEDLIST - prompt - 4 - true - true - Off - true - - - - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - Properties\AssemblyInfo.cs - - - SerializableAttribute.cs - - - - - - - - - - - - - - - - - - - App.xaml - - - - - MSBuild:Compile - Designer - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - - - - OfflineApplication - - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.csproj b/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.csproj deleted file mode 100644 index 7abd0ab..0000000 --- a/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.csproj +++ /dev/null @@ -1,115 +0,0 @@ - - - - CLIENTPROFILE - NET35 - TEST - Debug - AnyCPU - 9.0.30729 - 2.0 - {EEFFED24-3750-4567-9A23-1DB676A15610} - Library - Properties - Google.ProtocolBuffers - Google.ProtocolBuffersMixedLite.Test - v3.5 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - 3.5 - - - true - full - false - bin\NET35\Debug - obj\NET35\Debug\ - DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - true - Off - - - pdbonly - true - bin\NET35\Release - obj\NET35\Release\ - TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate) - prompt - 4 - true - true - Off - - - - - - - - - False - ..\..\lib\NUnit\lib\nunit.framework.dll - - - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll - - - False - ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll - - - - - Microsoft.VisualStudio.TestTools.cs - - - Properties\AssemblyInfo.cs - - - SerializableAttribute.cs - - - - - - - - - - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - - Program - $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe - /nologo /noshadow /labels /wait $(AssemblyName).dll - $(ProjectDir)$(OutputPath) - - \ No newline at end of file diff --git a/src/ProtocolBuffersLite.Test/SerializableLiteTest.cs b/src/ProtocolBuffersLite.Test/SerializableLiteTest.cs deleted file mode 100644 index 3efb917..0000000 --- a/src/ProtocolBuffersLite.Test/SerializableLiteTest.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; -#if !NOSERIALIZABLE -using System.Collections.Generic; -using System.IO; -using System.Runtime.Serialization; -using System.Runtime.Serialization.Formatters.Binary; -using System.Text; -using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers -{ - [TestClass] - public class SerializableLiteTest - { - /// - /// Just keep it from even compiling if we these objects don't implement the expected interface. - /// - public static readonly ISerializable CompileTimeCheckSerializableMessage = TestRequiredLite.DefaultInstance; - public static readonly ISerializable CompileTimeCheckSerializableBuilder = new TestRequiredLite.Builder(); - - [TestMethod] - public void TestPlainMessage() - { - TestRequiredLite message = TestRequiredLite.CreateBuilder() - .SetD(42) - .BuildPartial(); - - MemoryStream ms = new MemoryStream(); - new BinaryFormatter().Serialize(ms, message); - - ms.Position = 0; - TestRequiredLite copy = (TestRequiredLite)new BinaryFormatter().Deserialize(ms); - - Assert.AreEqual(message, copy); - } - - [TestMethod] - public void TestPlainBuilder() - { - TestRequiredLite.Builder builder = TestRequiredLite.CreateBuilder() - .SetD(42) - ; - - MemoryStream ms = new MemoryStream(); - new BinaryFormatter().Serialize(ms, builder); - - ms.Position = 0; - TestRequiredLite.Builder copy = (TestRequiredLite.Builder)new BinaryFormatter().Deserialize(ms); - - Assert.AreEqual(builder.BuildPartial(), copy.BuildPartial()); - } - } -} -#endif \ No newline at end of file diff --git a/src/ProtocolBuffersLite.Test/TestLiteByApi.cs b/src/ProtocolBuffersLite.Test/TestLiteByApi.cs deleted file mode 100644 index ce37302..0000000 --- a/src/ProtocolBuffersLite.Test/TestLiteByApi.cs +++ /dev/null @@ -1,121 +0,0 @@ -#region Copyright notice and license - -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// http://github.com/jskeet/dotnet-protobufs/ -// Original C++/Java/Python code: -// http://code.google.com/p/protobuf/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#endregion - -using Google.ProtocolBuffers.TestProtos; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers -{ - [TestClass] - public class TestLiteByApi - { - [TestMethod] - public void TestAllTypesEquality() - { - TestAllTypesLite msg = TestAllTypesLite.DefaultInstance; - TestAllTypesLite copy = msg.ToBuilder().Build(); - Assert.AreEqual(msg.GetHashCode(), copy.GetHashCode()); - Assert.IsTrue(msg.Equals(copy)); - msg = msg.ToBuilder().SetOptionalString("Hi").Build(); - Assert.AreNotEqual(msg.GetHashCode(), copy.GetHashCode()); - Assert.IsFalse(msg.Equals(copy)); - copy = copy.ToBuilder().SetOptionalString("Hi").Build(); - Assert.AreEqual(msg.GetHashCode(), copy.GetHashCode()); - Assert.IsTrue(msg.Equals(copy)); - } - - [TestMethod] - public void TestEqualityOnExtensions() - { - TestAllExtensionsLite msg = TestAllExtensionsLite.DefaultInstance; - TestAllExtensionsLite copy = msg.ToBuilder().Build(); - Assert.AreEqual(msg.GetHashCode(), copy.GetHashCode()); - Assert.IsTrue(msg.Equals(copy)); - msg = msg.ToBuilder().SetExtension(UnitTestLiteProtoFile.OptionalStringExtensionLite, "Hi").Build(); - Assert.AreNotEqual(msg.GetHashCode(), copy.GetHashCode()); - Assert.IsFalse(msg.Equals(copy)); - copy = copy.ToBuilder().SetExtension(UnitTestLiteProtoFile.OptionalStringExtensionLite, "Hi").Build(); - Assert.AreEqual(msg.GetHashCode(), copy.GetHashCode()); - Assert.IsTrue(msg.Equals(copy)); - } - - [TestMethod] - public void TestAllTypesToString() - { - TestAllTypesLite msg = TestAllTypesLite.DefaultInstance; - TestAllTypesLite copy = msg.ToBuilder().Build(); - Assert.AreEqual(msg.ToString(), copy.ToString()); - Assert.AreEqual(0, msg.ToString().Length); - msg = msg.ToBuilder().SetOptionalInt32(-1).Build(); - Assert.AreEqual("optional_int32: -1", msg.ToString().TrimEnd()); - msg = msg.ToBuilder().SetOptionalString("abc123").Build(); - Assert.AreEqual("optional_int32: -1\noptional_string: \"abc123\"", - msg.ToString().Replace("\r", "").TrimEnd()); - } - - [TestMethod] - public void TestAllTypesDefaultedRoundTrip() - { - TestAllTypesLite msg = TestAllTypesLite.DefaultInstance; - Assert.IsTrue(msg.IsInitialized); - TestAllTypesLite copy = TestAllTypesLite.CreateBuilder().MergeFrom(msg.ToByteArray()).Build(); - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); - } - - [TestMethod] - public void TestAllTypesModifiedRoundTrip() - { - TestAllTypesLite msg = TestAllTypesLite.DefaultInstance; - msg.ToBuilder() - .SetOptionalBool(true) - .SetOptionalCord("Hi") - .SetOptionalDouble(1.123) - .SetOptionalForeignEnum(ForeignEnumLite.FOREIGN_LITE_FOO) - .SetOptionalForeignMessage(ForeignMessageLite.CreateBuilder().SetC('c').Build()) - .SetOptionalGroup(TestAllTypesLite.Types.OptionalGroup.CreateBuilder().SetA('a').Build()) - .SetOptionalImportEnum(ImportEnumLite.IMPORT_LITE_BAR) - .SetOptionalInt32(32) - .SetOptionalInt64(64) - .SetOptionalNestedEnum(TestAllTypesLite.Types.NestedEnum.FOO) - .SetOptionalString("SetOptionalString") - .AddRepeatedGroup(TestAllTypesLite.Types.RepeatedGroup.CreateBuilder().SetA('a').Build()) - .AddRepeatedGroup(TestAllTypesLite.Types.RepeatedGroup.CreateBuilder().SetA('A').Build()) - ; - TestAllTypesLite copy = TestAllTypesLite.CreateBuilder().MergeFrom(msg.ToByteArray()).Build(); - TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); - } - } -} \ No newline at end of file diff --git a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestExtrasFullProtoFile.cs b/src/ProtocolBuffersLite.Test/TestProtos/UnitTestExtrasFullProtoFile.cs deleted file mode 100644 index 42ef030..0000000 --- a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestExtrasFullProtoFile.cs +++ /dev/null @@ -1,2144 +0,0 @@ -// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.TestProtos { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class UnitTestExtrasFullProtoFile { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasFullProtoFile.EmployeeId); - } - #endregion - #region Extensions - public const int EmployeeIdFieldNumber = 126; - public static pb::GeneratedExtensionBase EmployeeId; - #endregion - - #region Static variables - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_extra_TestInteropPerson__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_extra_TestInteropPerson__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_extra_TestInteropPerson_PhoneNumber__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_extra_TestInteropPerson_PhoneNumber__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_extra_TestInteropPerson_Addresses__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_extra_TestInteropPerson_Addresses__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_extra_TestInteropEmployeeId__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_extra_TestInteropEmployeeId__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_extra_TestMissingFieldsA__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_extra_TestMissingFieldsA__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_extra_TestMissingFieldsA_SubA__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_extra_TestMissingFieldsA_SubA__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_extra_TestMissingFieldsB__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_extra_TestMissingFieldsB__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_extra_TestMissingFieldsB_SubB__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_extra_TestMissingFieldsB_SubB__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static UnitTestExtrasFullProtoFile() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CiFleHRlc3QvdW5pdHRlc3RfZXh0cmFzX2Z1bGwucHJvdG8SF3Byb3RvYnVm", - "X3VuaXR0ZXN0X2V4dHJhGiRnb29nbGUvcHJvdG9idWYvY3NoYXJwX29wdGlv", - "bnMucHJvdG8i1gMKEVRlc3RJbnRlcm9wUGVyc29uEgwKBG5hbWUYASACKAkS", - "CgoCaWQYAiACKAUSDQoFZW1haWwYAyABKAkSEQoFY29kZXMYCiADKAVCAhAB", - "EkUKBXBob25lGAQgAygLMjYucHJvdG9idWZfdW5pdHRlc3RfZXh0cmEuVGVz", - "dEludGVyb3BQZXJzb24uUGhvbmVOdW1iZXISRwoJYWRkcmVzc2VzGAUgAygK", - "MjQucHJvdG9idWZfdW5pdHRlc3RfZXh0cmEuVGVzdEludGVyb3BQZXJzb24u", - "QWRkcmVzc2VzGmcKC1Bob25lTnVtYmVyEg4KBm51bWJlchgBIAIoCRJICgR0", - "eXBlGAIgASgOMjQucHJvdG9idWZfdW5pdHRlc3RfZXh0cmEuVGVzdEludGVy", - "b3BQZXJzb24uUGhvbmVUeXBlOgRIT01FGlgKCUFkZHJlc3NlcxIPCgdhZGRy", - "ZXNzGAEgAigJEhAKCGFkZHJlc3MyGAIgASgJEgwKBGNpdHkYAyACKAkSDQoF", - "c3RhdGUYBCACKAkSCwoDemlwGAUgAigHIisKCVBob25lVHlwZRIKCgZNT0JJ", - "TEUQABIICgRIT01FEAESCAoEV09SSxACKgUIZBDIASInChVUZXN0SW50ZXJv", - "cEVtcGxveWVlSWQSDgoGbnVtYmVyGAEgAigJIqUBChJUZXN0TWlzc2luZ0Zp", - "ZWxkc0ESDAoEbmFtZRgBIAIoCRIKCgJpZBgCIAIoBRINCgVlbWFpbBgDIAEo", - "CRI/CgV0ZXN0QRgLIAEoCzIwLnByb3RvYnVmX3VuaXR0ZXN0X2V4dHJhLlRl", - "c3RNaXNzaW5nRmllbGRzQS5TdWJBGiUKBFN1YkESDQoFY291bnQYBSACKAUS", - "DgoGdmFsdWVzGAYgAygJIpgBChJUZXN0TWlzc2luZ0ZpZWxkc0ISDAoEbmFt", - "ZRgBIAIoCRIKCgJpZBgCIAIoBRIPCgd3ZWJzaXRlGAQgASgJEj8KBXRlc3RC", - "GAwgASgLMjAucHJvdG9idWZfdW5pdHRlc3RfZXh0cmEuVGVzdE1pc3NpbmdG", - "aWVsZHNCLlN1YkIaFgoEU3ViQhIOCgZ2YWx1ZXMYByADKAk6bwoLZW1wbG95", - "ZWVfaWQSKi5wcm90b2J1Zl91bml0dGVzdF9leHRyYS5UZXN0SW50ZXJvcFBl", - "cnNvbhh+IAIoCzIuLnByb3RvYnVmX3VuaXR0ZXN0X2V4dHJhLlRlc3RJbnRl", - "cm9wRW1wbG95ZWVJZEJaChNjb20uZ29vZ2xlLnByb3RvYnVmSALCPkAKIUdv", - "b2dsZS5Qcm90b2NvbEJ1ZmZlcnMuVGVzdFByb3RvcxIbVW5pdFRlc3RFeHRy", - "YXNGdWxsUHJvdG9GaWxl")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_protobuf_unittest_extra_TestInteropPerson__Descriptor = Descriptor.MessageTypes[0]; - internal__static_protobuf_unittest_extra_TestInteropPerson__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_extra_TestInteropPerson__Descriptor, - new string[] { "Name", "Id", "Email", "Codes", "Phone", "Addresses", }); - internal__static_protobuf_unittest_extra_TestInteropPerson_PhoneNumber__Descriptor = internal__static_protobuf_unittest_extra_TestInteropPerson__Descriptor.NestedTypes[0]; - internal__static_protobuf_unittest_extra_TestInteropPerson_PhoneNumber__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_extra_TestInteropPerson_PhoneNumber__Descriptor, - new string[] { "Number", "Type", }); - internal__static_protobuf_unittest_extra_TestInteropPerson_Addresses__Descriptor = internal__static_protobuf_unittest_extra_TestInteropPerson__Descriptor.NestedTypes[1]; - internal__static_protobuf_unittest_extra_TestInteropPerson_Addresses__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_extra_TestInteropPerson_Addresses__Descriptor, - new string[] { "Address", "Address2", "City", "State", "Zip", }); - internal__static_protobuf_unittest_extra_TestInteropEmployeeId__Descriptor = Descriptor.MessageTypes[1]; - internal__static_protobuf_unittest_extra_TestInteropEmployeeId__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_extra_TestInteropEmployeeId__Descriptor, - new string[] { "Number", }); - internal__static_protobuf_unittest_extra_TestMissingFieldsA__Descriptor = Descriptor.MessageTypes[2]; - internal__static_protobuf_unittest_extra_TestMissingFieldsA__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_extra_TestMissingFieldsA__Descriptor, - new string[] { "Name", "Id", "Email", "TestA", }); - internal__static_protobuf_unittest_extra_TestMissingFieldsA_SubA__Descriptor = internal__static_protobuf_unittest_extra_TestMissingFieldsA__Descriptor.NestedTypes[0]; - internal__static_protobuf_unittest_extra_TestMissingFieldsA_SubA__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_extra_TestMissingFieldsA_SubA__Descriptor, - new string[] { "Count", "Values", }); - internal__static_protobuf_unittest_extra_TestMissingFieldsB__Descriptor = Descriptor.MessageTypes[3]; - internal__static_protobuf_unittest_extra_TestMissingFieldsB__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_extra_TestMissingFieldsB__Descriptor, - new string[] { "Name", "Id", "Website", "TestB", }); - internal__static_protobuf_unittest_extra_TestMissingFieldsB_SubB__Descriptor = internal__static_protobuf_unittest_extra_TestMissingFieldsB__Descriptor.NestedTypes[0]; - internal__static_protobuf_unittest_extra_TestMissingFieldsB_SubB__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_extra_TestMissingFieldsB_SubB__Descriptor, - new string[] { "Values", }); - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasFullProtoFile.EmployeeId = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasFullProtoFile.Descriptor.Extensions[0]); - pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); - RegisterAllExtensions(registry); - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.RegisterAllExtensions(registry); - return registry; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, - }, assigner); - } - #endregion - - } - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestInteropPerson : pb::ExtendableMessage { - private TestInteropPerson() { } - private static readonly TestInteropPerson defaultInstance = new TestInteropPerson().MakeReadOnly(); - public static TestInteropPerson DefaultInstance { - get { return defaultInstance; } - } - - public override TestInteropPerson DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestInteropPerson ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasFullProtoFile.internal__static_protobuf_unittest_extra_TestInteropPerson__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasFullProtoFile.internal__static_protobuf_unittest_extra_TestInteropPerson__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - public enum PhoneType { - MOBILE = 0, - HOME = 1, - WORK = 2, - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class PhoneNumber : pb::GeneratedMessage { - private PhoneNumber() { } - private static readonly PhoneNumber defaultInstance = new PhoneNumber().MakeReadOnly(); - public static PhoneNumber DefaultInstance { - get { return defaultInstance; } - } - - public override PhoneNumber DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override PhoneNumber ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasFullProtoFile.internal__static_protobuf_unittest_extra_TestInteropPerson_PhoneNumber__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasFullProtoFile.internal__static_protobuf_unittest_extra_TestInteropPerson_PhoneNumber__FieldAccessorTable; } - } - - public const int NumberFieldNumber = 1; - private bool hasNumber; - private string number_ = ""; - public bool HasNumber { - get { return hasNumber; } - } - public string Number { - get { return number_; } - } - - public const int TypeFieldNumber = 2; - private bool hasType; - private global::Google.ProtocolBuffers.TestProtos.TestInteropPerson.Types.PhoneType type_ = global::Google.ProtocolBuffers.TestProtos.TestInteropPerson.Types.PhoneType.HOME; - public bool HasType { - get { return hasType; } - } - public global::Google.ProtocolBuffers.TestProtos.TestInteropPerson.Types.PhoneType Type { - get { return type_; } - } - - public static PhoneNumber ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static PhoneNumber ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static PhoneNumber ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static PhoneNumber ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static PhoneNumber ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static PhoneNumber ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static PhoneNumber ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static PhoneNumber ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static PhoneNumber ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static PhoneNumber ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private PhoneNumber MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(PhoneNumber prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(PhoneNumber cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private PhoneNumber result; - - private PhoneNumber PrepareBuilder() { - if (resultIsReadOnly) { - PhoneNumber original = result; - result = new PhoneNumber(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override PhoneNumber MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestInteropPerson.Types.PhoneNumber.Descriptor; } - } - - public override PhoneNumber DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestInteropPerson.Types.PhoneNumber.DefaultInstance; } - } - - public override PhoneNumber BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - - public bool HasNumber { - get { return result.hasNumber; } - } - public string Number { - get { return result.Number; } - set { SetNumber(value); } - } - public Builder SetNumber(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasNumber = true; - result.number_ = value; - return this; - } - public Builder ClearNumber() { - PrepareBuilder(); - result.hasNumber = false; - result.number_ = ""; - return this; - } - - public bool HasType { - get { return result.hasType; } - } - public global::Google.ProtocolBuffers.TestProtos.TestInteropPerson.Types.PhoneType Type { - get { return result.Type; } - set { SetType(value); } - } - public Builder SetType(global::Google.ProtocolBuffers.TestProtos.TestInteropPerson.Types.PhoneType value) { - PrepareBuilder(); - result.hasType = true; - result.type_ = value; - return this; - } - public Builder ClearType() { - PrepareBuilder(); - result.hasType = false; - result.type_ = global::Google.ProtocolBuffers.TestProtos.TestInteropPerson.Types.PhoneType.HOME; - return this; - } - } - static PhoneNumber() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasFullProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Addresses : pb::GeneratedMessage { - private Addresses() { } - private static readonly Addresses defaultInstance = new Addresses().MakeReadOnly(); - public static Addresses DefaultInstance { - get { return defaultInstance; } - } - - public override Addresses DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override Addresses ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasFullProtoFile.internal__static_protobuf_unittest_extra_TestInteropPerson_Addresses__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasFullProtoFile.internal__static_protobuf_unittest_extra_TestInteropPerson_Addresses__FieldAccessorTable; } - } - - public const int AddressFieldNumber = 1; - private bool hasAddress; - private string address_ = ""; - public bool HasAddress { - get { return hasAddress; } - } - public string Address { - get { return address_; } - } - - public const int Address2FieldNumber = 2; - private bool hasAddress2; - private string address2_ = ""; - public bool HasAddress2 { - get { return hasAddress2; } - } - public string Address2 { - get { return address2_; } - } - - public const int CityFieldNumber = 3; - private bool hasCity; - private string city_ = ""; - public bool HasCity { - get { return hasCity; } - } - public string City { - get { return city_; } - } - - public const int StateFieldNumber = 4; - private bool hasState; - private string state_ = ""; - public bool HasState { - get { return hasState; } - } - public string State { - get { return state_; } - } - - public const int ZipFieldNumber = 5; - private bool hasZip; - private uint zip_; - public bool HasZip { - get { return hasZip; } - } - [global::System.CLSCompliant(false)] - public uint Zip { - get { return zip_; } - } - - public static Addresses ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Addresses ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Addresses ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Addresses ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Addresses ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Addresses ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Addresses ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Addresses ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Addresses ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Addresses ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private Addresses MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Addresses prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(Addresses cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private Addresses result; - - private Addresses PrepareBuilder() { - if (resultIsReadOnly) { - Addresses original = result; - result = new Addresses(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override Addresses MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestInteropPerson.Types.Addresses.Descriptor; } - } - - public override Addresses DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestInteropPerson.Types.Addresses.DefaultInstance; } - } - - public override Addresses BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - - public bool HasAddress { - get { return result.hasAddress; } - } - public string Address { - get { return result.Address; } - set { SetAddress(value); } - } - public Builder SetAddress(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasAddress = true; - result.address_ = value; - return this; - } - public Builder ClearAddress() { - PrepareBuilder(); - result.hasAddress = false; - result.address_ = ""; - return this; - } - - public bool HasAddress2 { - get { return result.hasAddress2; } - } - public string Address2 { - get { return result.Address2; } - set { SetAddress2(value); } - } - public Builder SetAddress2(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasAddress2 = true; - result.address2_ = value; - return this; - } - public Builder ClearAddress2() { - PrepareBuilder(); - result.hasAddress2 = false; - result.address2_ = ""; - return this; - } - - public bool HasCity { - get { return result.hasCity; } - } - public string City { - get { return result.City; } - set { SetCity(value); } - } - public Builder SetCity(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasCity = true; - result.city_ = value; - return this; - } - public Builder ClearCity() { - PrepareBuilder(); - result.hasCity = false; - result.city_ = ""; - return this; - } - - public bool HasState { - get { return result.hasState; } - } - public string State { - get { return result.State; } - set { SetState(value); } - } - public Builder SetState(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasState = true; - result.state_ = value; - return this; - } - public Builder ClearState() { - PrepareBuilder(); - result.hasState = false; - result.state_ = ""; - return this; - } - - public bool HasZip { - get { return result.hasZip; } - } - [global::System.CLSCompliant(false)] - public uint Zip { - get { return result.Zip; } - set { SetZip(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetZip(uint value) { - PrepareBuilder(); - result.hasZip = true; - result.zip_ = value; - return this; - } - public Builder ClearZip() { - PrepareBuilder(); - result.hasZip = false; - result.zip_ = 0; - return this; - } - } - static Addresses() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasFullProtoFile.Descriptor, null); - } - } - - } - #endregion - - public const int NameFieldNumber = 1; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public const int IdFieldNumber = 2; - private bool hasId; - private int id_; - public bool HasId { - get { return hasId; } - } - public int Id { - get { return id_; } - } - - public const int EmailFieldNumber = 3; - private bool hasEmail; - private string email_ = ""; - public bool HasEmail { - get { return hasEmail; } - } - public string Email { - get { return email_; } - } - - public const int CodesFieldNumber = 10; - private pbc::PopsicleList codes_ = new pbc::PopsicleList(); - public scg::IList CodesList { - get { return pbc::Lists.AsReadOnly(codes_); } - } - public int CodesCount { - get { return codes_.Count; } - } - public int GetCodes(int index) { - return codes_[index]; - } - - public const int PhoneFieldNumber = 4; - private pbc::PopsicleList phone_ = new pbc::PopsicleList(); - public scg::IList PhoneList { - get { return phone_; } - } - public int PhoneCount { - get { return phone_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.TestInteropPerson.Types.PhoneNumber GetPhone(int index) { - return phone_[index]; - } - - public const int AddressesFieldNumber = 5; - private pbc::PopsicleList addresses_ = new pbc::PopsicleList(); - public scg::IList AddressesList { - get { return addresses_; } - } - public int AddressesCount { - get { return addresses_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.TestInteropPerson.Types.Addresses GetAddresses(int index) { - return addresses_[index]; - } - - public static TestInteropPerson ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestInteropPerson ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestInteropPerson ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestInteropPerson ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestInteropPerson ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestInteropPerson ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestInteropPerson ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestInteropPerson ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestInteropPerson ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestInteropPerson ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestInteropPerson MakeReadOnly() { - codes_.MakeReadOnly(); - phone_.MakeReadOnly(); - addresses_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestInteropPerson prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestInteropPerson cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestInteropPerson result; - - private TestInteropPerson PrepareBuilder() { - if (resultIsReadOnly) { - TestInteropPerson original = result; - result = new TestInteropPerson(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestInteropPerson MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestInteropPerson.Descriptor; } - } - - public override TestInteropPerson DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestInteropPerson.DefaultInstance; } - } - - public override TestInteropPerson BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - - public bool HasName { - get { return result.hasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - PrepareBuilder(); - result.hasName = false; - result.name_ = ""; - return this; - } - - public bool HasId { - get { return result.hasId; } - } - public int Id { - get { return result.Id; } - set { SetId(value); } - } - public Builder SetId(int value) { - PrepareBuilder(); - result.hasId = true; - result.id_ = value; - return this; - } - public Builder ClearId() { - PrepareBuilder(); - result.hasId = false; - result.id_ = 0; - return this; - } - - public bool HasEmail { - get { return result.hasEmail; } - } - public string Email { - get { return result.Email; } - set { SetEmail(value); } - } - public Builder SetEmail(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasEmail = true; - result.email_ = value; - return this; - } - public Builder ClearEmail() { - PrepareBuilder(); - result.hasEmail = false; - result.email_ = ""; - return this; - } - - public pbc::IPopsicleList CodesList { - get { return PrepareBuilder().codes_; } - } - public int CodesCount { - get { return result.CodesCount; } - } - public int GetCodes(int index) { - return result.GetCodes(index); - } - public Builder SetCodes(int index, int value) { - PrepareBuilder(); - result.codes_[index] = value; - return this; - } - public Builder AddCodes(int value) { - PrepareBuilder(); - result.codes_.Add(value); - return this; - } - public Builder AddRangeCodes(scg::IEnumerable values) { - PrepareBuilder(); - result.codes_.Add(values); - return this; - } - public Builder ClearCodes() { - PrepareBuilder(); - result.codes_.Clear(); - return this; - } - - public pbc::IPopsicleList PhoneList { - get { return PrepareBuilder().phone_; } - } - public int PhoneCount { - get { return result.PhoneCount; } - } - public global::Google.ProtocolBuffers.TestProtos.TestInteropPerson.Types.PhoneNumber GetPhone(int index) { - return result.GetPhone(index); - } - public Builder SetPhone(int index, global::Google.ProtocolBuffers.TestProtos.TestInteropPerson.Types.PhoneNumber value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.phone_[index] = value; - return this; - } - public Builder SetPhone(int index, global::Google.ProtocolBuffers.TestProtos.TestInteropPerson.Types.PhoneNumber.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.phone_[index] = builderForValue.Build(); - return this; - } - public Builder AddPhone(global::Google.ProtocolBuffers.TestProtos.TestInteropPerson.Types.PhoneNumber value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.phone_.Add(value); - return this; - } - public Builder AddPhone(global::Google.ProtocolBuffers.TestProtos.TestInteropPerson.Types.PhoneNumber.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.phone_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangePhone(scg::IEnumerable values) { - PrepareBuilder(); - result.phone_.Add(values); - return this; - } - public Builder ClearPhone() { - PrepareBuilder(); - result.phone_.Clear(); - return this; - } - - public pbc::IPopsicleList AddressesList { - get { return PrepareBuilder().addresses_; } - } - public int AddressesCount { - get { return result.AddressesCount; } - } - public global::Google.ProtocolBuffers.TestProtos.TestInteropPerson.Types.Addresses GetAddresses(int index) { - return result.GetAddresses(index); - } - public Builder SetAddresses(int index, global::Google.ProtocolBuffers.TestProtos.TestInteropPerson.Types.Addresses value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.addresses_[index] = value; - return this; - } - public Builder SetAddresses(int index, global::Google.ProtocolBuffers.TestProtos.TestInteropPerson.Types.Addresses.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.addresses_[index] = builderForValue.Build(); - return this; - } - public Builder AddAddresses(global::Google.ProtocolBuffers.TestProtos.TestInteropPerson.Types.Addresses value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.addresses_.Add(value); - return this; - } - public Builder AddAddresses(global::Google.ProtocolBuffers.TestProtos.TestInteropPerson.Types.Addresses.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.addresses_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeAddresses(scg::IEnumerable values) { - PrepareBuilder(); - result.addresses_.Add(values); - return this; - } - public Builder ClearAddresses() { - PrepareBuilder(); - result.addresses_.Clear(); - return this; - } - } - static TestInteropPerson() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasFullProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestInteropEmployeeId : pb::GeneratedMessage { - private TestInteropEmployeeId() { } - private static readonly TestInteropEmployeeId defaultInstance = new TestInteropEmployeeId().MakeReadOnly(); - public static TestInteropEmployeeId DefaultInstance { - get { return defaultInstance; } - } - - public override TestInteropEmployeeId DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestInteropEmployeeId ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasFullProtoFile.internal__static_protobuf_unittest_extra_TestInteropEmployeeId__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasFullProtoFile.internal__static_protobuf_unittest_extra_TestInteropEmployeeId__FieldAccessorTable; } - } - - public const int NumberFieldNumber = 1; - private bool hasNumber; - private string number_ = ""; - public bool HasNumber { - get { return hasNumber; } - } - public string Number { - get { return number_; } - } - - public static TestInteropEmployeeId ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestInteropEmployeeId ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestInteropEmployeeId ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestInteropEmployeeId ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestInteropEmployeeId ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestInteropEmployeeId ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestInteropEmployeeId ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestInteropEmployeeId ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestInteropEmployeeId ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestInteropEmployeeId ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestInteropEmployeeId MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestInteropEmployeeId prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestInteropEmployeeId cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestInteropEmployeeId result; - - private TestInteropEmployeeId PrepareBuilder() { - if (resultIsReadOnly) { - TestInteropEmployeeId original = result; - result = new TestInteropEmployeeId(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestInteropEmployeeId MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestInteropEmployeeId.Descriptor; } - } - - public override TestInteropEmployeeId DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestInteropEmployeeId.DefaultInstance; } - } - - public override TestInteropEmployeeId BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - - public bool HasNumber { - get { return result.hasNumber; } - } - public string Number { - get { return result.Number; } - set { SetNumber(value); } - } - public Builder SetNumber(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasNumber = true; - result.number_ = value; - return this; - } - public Builder ClearNumber() { - PrepareBuilder(); - result.hasNumber = false; - result.number_ = ""; - return this; - } - } - static TestInteropEmployeeId() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasFullProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestMissingFieldsA : pb::GeneratedMessage { - private TestMissingFieldsA() { } - private static readonly TestMissingFieldsA defaultInstance = new TestMissingFieldsA().MakeReadOnly(); - public static TestMissingFieldsA DefaultInstance { - get { return defaultInstance; } - } - - public override TestMissingFieldsA DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestMissingFieldsA ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasFullProtoFile.internal__static_protobuf_unittest_extra_TestMissingFieldsA__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasFullProtoFile.internal__static_protobuf_unittest_extra_TestMissingFieldsA__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class SubA : pb::GeneratedMessage { - private SubA() { } - private static readonly SubA defaultInstance = new SubA().MakeReadOnly(); - public static SubA DefaultInstance { - get { return defaultInstance; } - } - - public override SubA DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override SubA ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasFullProtoFile.internal__static_protobuf_unittest_extra_TestMissingFieldsA_SubA__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasFullProtoFile.internal__static_protobuf_unittest_extra_TestMissingFieldsA_SubA__FieldAccessorTable; } - } - - public const int CountFieldNumber = 5; - private bool hasCount; - private int count_; - public bool HasCount { - get { return hasCount; } - } - public int Count { - get { return count_; } - } - - public const int ValuesFieldNumber = 6; - private pbc::PopsicleList values_ = new pbc::PopsicleList(); - public scg::IList ValuesList { - get { return pbc::Lists.AsReadOnly(values_); } - } - public int ValuesCount { - get { return values_.Count; } - } - public string GetValues(int index) { - return values_[index]; - } - - public static SubA ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SubA ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SubA ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SubA ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SubA ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SubA ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SubA ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SubA ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SubA ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SubA ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private SubA MakeReadOnly() { - values_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SubA prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(SubA cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private SubA result; - - private SubA PrepareBuilder() { - if (resultIsReadOnly) { - SubA original = result; - result = new SubA(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override SubA MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestMissingFieldsA.Types.SubA.Descriptor; } - } - - public override SubA DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestMissingFieldsA.Types.SubA.DefaultInstance; } - } - - public override SubA BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - - public bool HasCount { - get { return result.hasCount; } - } - public int Count { - get { return result.Count; } - set { SetCount(value); } - } - public Builder SetCount(int value) { - PrepareBuilder(); - result.hasCount = true; - result.count_ = value; - return this; - } - public Builder ClearCount() { - PrepareBuilder(); - result.hasCount = false; - result.count_ = 0; - return this; - } - - public pbc::IPopsicleList ValuesList { - get { return PrepareBuilder().values_; } - } - public int ValuesCount { - get { return result.ValuesCount; } - } - public string GetValues(int index) { - return result.GetValues(index); - } - public Builder SetValues(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.values_[index] = value; - return this; - } - public Builder AddValues(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.values_.Add(value); - return this; - } - public Builder AddRangeValues(scg::IEnumerable values) { - PrepareBuilder(); - result.values_.Add(values); - return this; - } - public Builder ClearValues() { - PrepareBuilder(); - result.values_.Clear(); - return this; - } - } - static SubA() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasFullProtoFile.Descriptor, null); - } - } - - } - #endregion - - public const int NameFieldNumber = 1; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public const int IdFieldNumber = 2; - private bool hasId; - private int id_; - public bool HasId { - get { return hasId; } - } - public int Id { - get { return id_; } - } - - public const int EmailFieldNumber = 3; - private bool hasEmail; - private string email_ = ""; - public bool HasEmail { - get { return hasEmail; } - } - public string Email { - get { return email_; } - } - - public const int TestAFieldNumber = 11; - private bool hasTestA; - private global::Google.ProtocolBuffers.TestProtos.TestMissingFieldsA.Types.SubA testA_; - public bool HasTestA { - get { return hasTestA; } - } - public global::Google.ProtocolBuffers.TestProtos.TestMissingFieldsA.Types.SubA TestA { - get { return testA_ ?? global::Google.ProtocolBuffers.TestProtos.TestMissingFieldsA.Types.SubA.DefaultInstance; } - } - - public static TestMissingFieldsA ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestMissingFieldsA ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestMissingFieldsA ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestMissingFieldsA ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestMissingFieldsA ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestMissingFieldsA ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestMissingFieldsA ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestMissingFieldsA ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestMissingFieldsA ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestMissingFieldsA ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestMissingFieldsA MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestMissingFieldsA prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestMissingFieldsA cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestMissingFieldsA result; - - private TestMissingFieldsA PrepareBuilder() { - if (resultIsReadOnly) { - TestMissingFieldsA original = result; - result = new TestMissingFieldsA(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestMissingFieldsA MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestMissingFieldsA.Descriptor; } - } - - public override TestMissingFieldsA DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestMissingFieldsA.DefaultInstance; } - } - - public override TestMissingFieldsA BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - - public bool HasName { - get { return result.hasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - PrepareBuilder(); - result.hasName = false; - result.name_ = ""; - return this; - } - - public bool HasId { - get { return result.hasId; } - } - public int Id { - get { return result.Id; } - set { SetId(value); } - } - public Builder SetId(int value) { - PrepareBuilder(); - result.hasId = true; - result.id_ = value; - return this; - } - public Builder ClearId() { - PrepareBuilder(); - result.hasId = false; - result.id_ = 0; - return this; - } - - public bool HasEmail { - get { return result.hasEmail; } - } - public string Email { - get { return result.Email; } - set { SetEmail(value); } - } - public Builder SetEmail(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasEmail = true; - result.email_ = value; - return this; - } - public Builder ClearEmail() { - PrepareBuilder(); - result.hasEmail = false; - result.email_ = ""; - return this; - } - - public bool HasTestA { - get { return result.hasTestA; } - } - public global::Google.ProtocolBuffers.TestProtos.TestMissingFieldsA.Types.SubA TestA { - get { return result.TestA; } - set { SetTestA(value); } - } - public Builder SetTestA(global::Google.ProtocolBuffers.TestProtos.TestMissingFieldsA.Types.SubA value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasTestA = true; - result.testA_ = value; - return this; - } - public Builder SetTestA(global::Google.ProtocolBuffers.TestProtos.TestMissingFieldsA.Types.SubA.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasTestA = true; - result.testA_ = builderForValue.Build(); - return this; - } - public Builder MergeTestA(global::Google.ProtocolBuffers.TestProtos.TestMissingFieldsA.Types.SubA value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasTestA && - result.testA_ != global::Google.ProtocolBuffers.TestProtos.TestMissingFieldsA.Types.SubA.DefaultInstance) { - result.testA_ = global::Google.ProtocolBuffers.TestProtos.TestMissingFieldsA.Types.SubA.CreateBuilder(result.testA_).MergeFrom(value).BuildPartial(); - } else { - result.testA_ = value; - } - result.hasTestA = true; - return this; - } - public Builder ClearTestA() { - PrepareBuilder(); - result.hasTestA = false; - result.testA_ = null; - return this; - } - } - static TestMissingFieldsA() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasFullProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestMissingFieldsB : pb::GeneratedMessage { - private TestMissingFieldsB() { } - private static readonly TestMissingFieldsB defaultInstance = new TestMissingFieldsB().MakeReadOnly(); - public static TestMissingFieldsB DefaultInstance { - get { return defaultInstance; } - } - - public override TestMissingFieldsB DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestMissingFieldsB ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasFullProtoFile.internal__static_protobuf_unittest_extra_TestMissingFieldsB__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasFullProtoFile.internal__static_protobuf_unittest_extra_TestMissingFieldsB__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class SubB : pb::GeneratedMessage { - private SubB() { } - private static readonly SubB defaultInstance = new SubB().MakeReadOnly(); - public static SubB DefaultInstance { - get { return defaultInstance; } - } - - public override SubB DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override SubB ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasFullProtoFile.internal__static_protobuf_unittest_extra_TestMissingFieldsB_SubB__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasFullProtoFile.internal__static_protobuf_unittest_extra_TestMissingFieldsB_SubB__FieldAccessorTable; } - } - - public const int ValuesFieldNumber = 7; - private pbc::PopsicleList values_ = new pbc::PopsicleList(); - public scg::IList ValuesList { - get { return pbc::Lists.AsReadOnly(values_); } - } - public int ValuesCount { - get { return values_.Count; } - } - public string GetValues(int index) { - return values_[index]; - } - - public static SubB ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SubB ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SubB ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SubB ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SubB ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SubB ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SubB ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SubB ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SubB ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SubB ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private SubB MakeReadOnly() { - values_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SubB prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(SubB cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private SubB result; - - private SubB PrepareBuilder() { - if (resultIsReadOnly) { - SubB original = result; - result = new SubB(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override SubB MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestMissingFieldsB.Types.SubB.Descriptor; } - } - - public override SubB DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestMissingFieldsB.Types.SubB.DefaultInstance; } - } - - public override SubB BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - - public pbc::IPopsicleList ValuesList { - get { return PrepareBuilder().values_; } - } - public int ValuesCount { - get { return result.ValuesCount; } - } - public string GetValues(int index) { - return result.GetValues(index); - } - public Builder SetValues(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.values_[index] = value; - return this; - } - public Builder AddValues(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.values_.Add(value); - return this; - } - public Builder AddRangeValues(scg::IEnumerable values) { - PrepareBuilder(); - result.values_.Add(values); - return this; - } - public Builder ClearValues() { - PrepareBuilder(); - result.values_.Clear(); - return this; - } - } - static SubB() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasFullProtoFile.Descriptor, null); - } - } - - } - #endregion - - public const int NameFieldNumber = 1; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public const int IdFieldNumber = 2; - private bool hasId; - private int id_; - public bool HasId { - get { return hasId; } - } - public int Id { - get { return id_; } - } - - public const int WebsiteFieldNumber = 4; - private bool hasWebsite; - private string website_ = ""; - public bool HasWebsite { - get { return hasWebsite; } - } - public string Website { - get { return website_; } - } - - public const int TestBFieldNumber = 12; - private bool hasTestB; - private global::Google.ProtocolBuffers.TestProtos.TestMissingFieldsB.Types.SubB testB_; - public bool HasTestB { - get { return hasTestB; } - } - public global::Google.ProtocolBuffers.TestProtos.TestMissingFieldsB.Types.SubB TestB { - get { return testB_ ?? global::Google.ProtocolBuffers.TestProtos.TestMissingFieldsB.Types.SubB.DefaultInstance; } - } - - public static TestMissingFieldsB ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestMissingFieldsB ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestMissingFieldsB ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestMissingFieldsB ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestMissingFieldsB ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestMissingFieldsB ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestMissingFieldsB ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestMissingFieldsB ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestMissingFieldsB ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestMissingFieldsB ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestMissingFieldsB MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestMissingFieldsB prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestMissingFieldsB cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestMissingFieldsB result; - - private TestMissingFieldsB PrepareBuilder() { - if (resultIsReadOnly) { - TestMissingFieldsB original = result; - result = new TestMissingFieldsB(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestMissingFieldsB MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestMissingFieldsB.Descriptor; } - } - - public override TestMissingFieldsB DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestMissingFieldsB.DefaultInstance; } - } - - public override TestMissingFieldsB BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - - public bool HasName { - get { return result.hasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - PrepareBuilder(); - result.hasName = false; - result.name_ = ""; - return this; - } - - public bool HasId { - get { return result.hasId; } - } - public int Id { - get { return result.Id; } - set { SetId(value); } - } - public Builder SetId(int value) { - PrepareBuilder(); - result.hasId = true; - result.id_ = value; - return this; - } - public Builder ClearId() { - PrepareBuilder(); - result.hasId = false; - result.id_ = 0; - return this; - } - - public bool HasWebsite { - get { return result.hasWebsite; } - } - public string Website { - get { return result.Website; } - set { SetWebsite(value); } - } - public Builder SetWebsite(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasWebsite = true; - result.website_ = value; - return this; - } - public Builder ClearWebsite() { - PrepareBuilder(); - result.hasWebsite = false; - result.website_ = ""; - return this; - } - - public bool HasTestB { - get { return result.hasTestB; } - } - public global::Google.ProtocolBuffers.TestProtos.TestMissingFieldsB.Types.SubB TestB { - get { return result.TestB; } - set { SetTestB(value); } - } - public Builder SetTestB(global::Google.ProtocolBuffers.TestProtos.TestMissingFieldsB.Types.SubB value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasTestB = true; - result.testB_ = value; - return this; - } - public Builder SetTestB(global::Google.ProtocolBuffers.TestProtos.TestMissingFieldsB.Types.SubB.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasTestB = true; - result.testB_ = builderForValue.Build(); - return this; - } - public Builder MergeTestB(global::Google.ProtocolBuffers.TestProtos.TestMissingFieldsB.Types.SubB value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasTestB && - result.testB_ != global::Google.ProtocolBuffers.TestProtos.TestMissingFieldsB.Types.SubB.DefaultInstance) { - result.testB_ = global::Google.ProtocolBuffers.TestProtos.TestMissingFieldsB.Types.SubB.CreateBuilder(result.testB_).MergeFrom(value).BuildPartial(); - } else { - result.testB_ = value; - } - result.hasTestB = true; - return this; - } - public Builder ClearTestB() { - PrepareBuilder(); - result.hasTestB = false; - result.testB_ = null; - return this; - } - } - static TestMissingFieldsB() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasFullProtoFile.Descriptor, null); - } - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestExtrasLiteProtoFile.cs b/src/ProtocolBuffersLite.Test/TestProtos/UnitTestExtrasLiteProtoFile.cs deleted file mode 100644 index caeb5ba..0000000 --- a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestExtrasLiteProtoFile.cs +++ /dev/null @@ -1,4226 +0,0 @@ -// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.TestProtos { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class UnitTestExtrasLiteProtoFile { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.EmployeeIdLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedInt32ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedInt64ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedUint32ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedUint64ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedSint32ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedSint64ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedFixed32ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedFixed64ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedSfixed32ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedSfixed64ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedFloatExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedDoubleExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedBoolExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedEnumExtensionLite); - } - #endregion - #region Extensions - public const int EmployeeIdLiteFieldNumber = 126; - public static pb::GeneratedExtensionLite EmployeeIdLite; - public const int UnpackedInt32ExtensionLiteFieldNumber = 90; - public static pb::GeneratedRepeatExtensionLite UnpackedInt32ExtensionLite; - public const int UnpackedInt64ExtensionLiteFieldNumber = 91; - public static pb::GeneratedRepeatExtensionLite UnpackedInt64ExtensionLite; - public const int UnpackedUint32ExtensionLiteFieldNumber = 92; - [global::System.CLSCompliant(false)] - public static pb::GeneratedRepeatExtensionLite UnpackedUint32ExtensionLite; - public const int UnpackedUint64ExtensionLiteFieldNumber = 93; - [global::System.CLSCompliant(false)] - public static pb::GeneratedRepeatExtensionLite UnpackedUint64ExtensionLite; - public const int UnpackedSint32ExtensionLiteFieldNumber = 94; - public static pb::GeneratedRepeatExtensionLite UnpackedSint32ExtensionLite; - public const int UnpackedSint64ExtensionLiteFieldNumber = 95; - public static pb::GeneratedRepeatExtensionLite UnpackedSint64ExtensionLite; - public const int UnpackedFixed32ExtensionLiteFieldNumber = 96; - [global::System.CLSCompliant(false)] - public static pb::GeneratedRepeatExtensionLite UnpackedFixed32ExtensionLite; - public const int UnpackedFixed64ExtensionLiteFieldNumber = 97; - [global::System.CLSCompliant(false)] - public static pb::GeneratedRepeatExtensionLite UnpackedFixed64ExtensionLite; - public const int UnpackedSfixed32ExtensionLiteFieldNumber = 98; - public static pb::GeneratedRepeatExtensionLite UnpackedSfixed32ExtensionLite; - public const int UnpackedSfixed64ExtensionLiteFieldNumber = 99; - public static pb::GeneratedRepeatExtensionLite UnpackedSfixed64ExtensionLite; - public const int UnpackedFloatExtensionLiteFieldNumber = 100; - public static pb::GeneratedRepeatExtensionLite UnpackedFloatExtensionLite; - public const int UnpackedDoubleExtensionLiteFieldNumber = 101; - public static pb::GeneratedRepeatExtensionLite UnpackedDoubleExtensionLite; - public const int UnpackedBoolExtensionLiteFieldNumber = 102; - public static pb::GeneratedRepeatExtensionLite UnpackedBoolExtensionLite; - public const int UnpackedEnumExtensionLiteFieldNumber = 103; - public static pb::GeneratedRepeatExtensionLite UnpackedEnumExtensionLite; - #endregion - - #region Static variables - #endregion - #region Extensions - internal static readonly object Descriptor; - static UnitTestExtrasLiteProtoFile() { - Descriptor = null; - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.EmployeeIdLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest_extra.employee_id_lite", - global::Google.ProtocolBuffers.TestProtos.TestInteropPersonLite.DefaultInstance, - null, - global::Google.ProtocolBuffers.TestProtos.TestInteropEmployeeIdLite.DefaultInstance, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.EmployeeIdLiteFieldNumber, - pbd::FieldType.Message); - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedInt32ExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest_extra.unpacked_int32_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestUnpackedExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedInt32ExtensionLiteFieldNumber, - pbd::FieldType.Int32, - false); - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedInt64ExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest_extra.unpacked_int64_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestUnpackedExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedInt64ExtensionLiteFieldNumber, - pbd::FieldType.Int64, - false); - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedUint32ExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest_extra.unpacked_uint32_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestUnpackedExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedUint32ExtensionLiteFieldNumber, - pbd::FieldType.UInt32, - false); - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedUint64ExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest_extra.unpacked_uint64_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestUnpackedExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedUint64ExtensionLiteFieldNumber, - pbd::FieldType.UInt64, - false); - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedSint32ExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest_extra.unpacked_sint32_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestUnpackedExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedSint32ExtensionLiteFieldNumber, - pbd::FieldType.SInt32, - false); - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedSint64ExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest_extra.unpacked_sint64_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestUnpackedExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedSint64ExtensionLiteFieldNumber, - pbd::FieldType.SInt64, - false); - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedFixed32ExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest_extra.unpacked_fixed32_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestUnpackedExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedFixed32ExtensionLiteFieldNumber, - pbd::FieldType.Fixed32, - false); - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedFixed64ExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest_extra.unpacked_fixed64_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestUnpackedExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedFixed64ExtensionLiteFieldNumber, - pbd::FieldType.Fixed64, - false); - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedSfixed32ExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest_extra.unpacked_sfixed32_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestUnpackedExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedSfixed32ExtensionLiteFieldNumber, - pbd::FieldType.SFixed32, - false); - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedSfixed64ExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest_extra.unpacked_sfixed64_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestUnpackedExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedSfixed64ExtensionLiteFieldNumber, - pbd::FieldType.SFixed64, - false); - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedFloatExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest_extra.unpacked_float_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestUnpackedExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedFloatExtensionLiteFieldNumber, - pbd::FieldType.Float, - false); - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedDoubleExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest_extra.unpacked_double_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestUnpackedExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedDoubleExtensionLiteFieldNumber, - pbd::FieldType.Double, - false); - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedBoolExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest_extra.unpacked_bool_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestUnpackedExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedBoolExtensionLiteFieldNumber, - pbd::FieldType.Bool, - false); - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedEnumExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest_extra.unpacked_enum_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestUnpackedExtensionsLite.DefaultInstance, - null, - new EnumLiteMap(), - global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.UnpackedEnumExtensionLiteFieldNumber, - pbd::FieldType.Enum, - false); - } - #endregion - - } - #region Enums - public enum ExtraEnum { - DEFAULT = 10, - EXLITE_FOO = 7, - EXLITE_BAR = 8, - EXLITE_BAZ = 9, - } - - public enum UnpackedTypesForeignEnumLite { - FOREIGN_LITE_FOO = 4, - FOREIGN_LITE_BAR = 5, - FOREIGN_LITE_BAZ = 6, - } - - #endregion - - #region Messages - [global::System.SerializableAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestRequiredLite : pb::GeneratedMessageLite { - private TestRequiredLite() { } - private static readonly TestRequiredLite defaultInstance = new TestRequiredLite().MakeReadOnly(); - private static readonly string[] _testRequiredLiteFieldNames = new string[] { "d", "en" }; - private static readonly uint[] _testRequiredLiteFieldTags = new uint[] { 8, 16 }; - public static TestRequiredLite DefaultInstance { - get { return defaultInstance; } - } - - public override TestRequiredLite DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestRequiredLite ThisMessage { - get { return this; } - } - - public const int DFieldNumber = 1; - private bool hasD; - private int d_; - public bool HasD { - get { return hasD; } - } - public int D { - get { return d_; } - } - - public const int EnFieldNumber = 2; - private bool hasEn; - private global::Google.ProtocolBuffers.TestProtos.ExtraEnum en_ = global::Google.ProtocolBuffers.TestProtos.ExtraEnum.DEFAULT; - public bool HasEn { - get { return hasEn; } - } - public global::Google.ProtocolBuffers.TestProtos.ExtraEnum En { - get { return en_; } - } - - public override bool IsInitialized { - get { - if (!hasD) return false; - if (!hasEn) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testRequiredLiteFieldNames; - if (hasD) { - output.WriteInt32(1, field_names[0], D); - } - if (hasEn) { - output.WriteEnum(2, field_names[1], (int) En, En); - } - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasD) { - size += pb::CodedOutputStream.ComputeInt32Size(1, D); - } - if (hasEn) { - size += pb::CodedOutputStream.ComputeEnumSize(2, (int) En); - } - memoizedSerializedSize = size; - return size; - } - #region Lite runtime methods - public override int GetHashCode() { - int hash = GetType().GetHashCode(); - if (hasD) hash ^= d_.GetHashCode(); - if (hasEn) hash ^= en_.GetHashCode(); - return hash; - } - - public override bool Equals(object obj) { - TestRequiredLite other = obj as TestRequiredLite; - if (other == null) return false; - if (hasD != other.hasD || (hasD && !d_.Equals(other.d_))) return false; - if (hasEn != other.hasEn || (hasEn && !en_.Equals(other.en_))) return false; - return true; - } - - public override void PrintTo(global::System.IO.TextWriter writer) { - PrintField("d", hasD, d_, writer); - PrintField("en", hasEn, en_, writer); - } - #endregion - - public static TestRequiredLite ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestRequiredLite ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestRequiredLite ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestRequiredLite ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestRequiredLite ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestRequiredLite ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestRequiredLite ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestRequiredLite ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestRequiredLite ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestRequiredLite ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestRequiredLite MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestRequiredLite prototype) { - return new Builder(prototype); - } - - [global::System.SerializableAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilderLite { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestRequiredLite cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestRequiredLite result; - - private TestRequiredLite PrepareBuilder() { - if (resultIsReadOnly) { - TestRequiredLite original = result; - result = new TestRequiredLite(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestRequiredLite MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override TestRequiredLite DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestRequiredLite.DefaultInstance; } - } - - public override TestRequiredLite BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessageLite other) { - if (other is TestRequiredLite) { - return MergeFrom((TestRequiredLite) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestRequiredLite other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestRequiredLite.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasD) { - D = other.D; - } - if (other.HasEn) { - En = other.En; - } - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testRequiredLiteFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testRequiredLiteFieldTags[field_ordinal]; - else { - ParseUnknownField(input, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - return this; - } - ParseUnknownField(input, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasD = input.ReadInt32(ref result.d_); - break; - } - case 16: { - object unknown; - if(input.ReadEnum(ref result.en_, out unknown)) { - result.hasEn = true; - } else if(unknown is int) { - } - break; - } - } - } - - return this; - } - - - public bool HasD { - get { return result.hasD; } - } - public int D { - get { return result.D; } - set { SetD(value); } - } - public Builder SetD(int value) { - PrepareBuilder(); - result.hasD = true; - result.d_ = value; - return this; - } - public Builder ClearD() { - PrepareBuilder(); - result.hasD = false; - result.d_ = 0; - return this; - } - - public bool HasEn { - get { return result.hasEn; } - } - public global::Google.ProtocolBuffers.TestProtos.ExtraEnum En { - get { return result.En; } - set { SetEn(value); } - } - public Builder SetEn(global::Google.ProtocolBuffers.TestProtos.ExtraEnum value) { - PrepareBuilder(); - result.hasEn = true; - result.en_ = value; - return this; - } - public Builder ClearEn() { - PrepareBuilder(); - result.hasEn = false; - result.en_ = global::Google.ProtocolBuffers.TestProtos.ExtraEnum.DEFAULT; - return this; - } - } - static TestRequiredLite() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.Descriptor, null); - } - } - - [global::System.SerializableAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestInteropPersonLite : pb::ExtendableMessageLite { - private TestInteropPersonLite() { } - private static readonly TestInteropPersonLite defaultInstance = new TestInteropPersonLite().MakeReadOnly(); - private static readonly string[] _testInteropPersonLiteFieldNames = new string[] { "addresses", "codes", "email", "id", "name", "phone" }; - private static readonly uint[] _testInteropPersonLiteFieldTags = new uint[] { 43, 82, 26, 16, 10, 34 }; - public static TestInteropPersonLite DefaultInstance { - get { return defaultInstance; } - } - - public override TestInteropPersonLite DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestInteropPersonLite ThisMessage { - get { return this; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - public enum PhoneType { - MOBILE = 0, - HOME = 1, - WORK = 2, - } - - [global::System.SerializableAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class PhoneNumber : pb::GeneratedMessageLite { - private PhoneNumber() { } - private static readonly PhoneNumber defaultInstance = new PhoneNumber().MakeReadOnly(); - private static readonly string[] _phoneNumberFieldNames = new string[] { "number", "type" }; - private static readonly uint[] _phoneNumberFieldTags = new uint[] { 10, 16 }; - public static PhoneNumber DefaultInstance { - get { return defaultInstance; } - } - - public override PhoneNumber DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override PhoneNumber ThisMessage { - get { return this; } - } - - public const int NumberFieldNumber = 1; - private bool hasNumber; - private string number_ = ""; - public bool HasNumber { - get { return hasNumber; } - } - public string Number { - get { return number_; } - } - - public const int TypeFieldNumber = 2; - private bool hasType; - private global::Google.ProtocolBuffers.TestProtos.TestInteropPersonLite.Types.PhoneType type_ = global::Google.ProtocolBuffers.TestProtos.TestInteropPersonLite.Types.PhoneType.HOME; - public bool HasType { - get { return hasType; } - } - public global::Google.ProtocolBuffers.TestProtos.TestInteropPersonLite.Types.PhoneType Type { - get { return type_; } - } - - public override bool IsInitialized { - get { - if (!hasNumber) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _phoneNumberFieldNames; - if (hasNumber) { - output.WriteString(1, field_names[0], Number); - } - if (hasType) { - output.WriteEnum(2, field_names[1], (int) Type, Type); - } - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasNumber) { - size += pb::CodedOutputStream.ComputeStringSize(1, Number); - } - if (hasType) { - size += pb::CodedOutputStream.ComputeEnumSize(2, (int) Type); - } - memoizedSerializedSize = size; - return size; - } - #region Lite runtime methods - public override int GetHashCode() { - int hash = GetType().GetHashCode(); - if (hasNumber) hash ^= number_.GetHashCode(); - if (hasType) hash ^= type_.GetHashCode(); - return hash; - } - - public override bool Equals(object obj) { - PhoneNumber other = obj as PhoneNumber; - if (other == null) return false; - if (hasNumber != other.hasNumber || (hasNumber && !number_.Equals(other.number_))) return false; - if (hasType != other.hasType || (hasType && !type_.Equals(other.type_))) return false; - return true; - } - - public override void PrintTo(global::System.IO.TextWriter writer) { - PrintField("number", hasNumber, number_, writer); - PrintField("type", hasType, type_, writer); - } - #endregion - - public static PhoneNumber ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static PhoneNumber ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static PhoneNumber ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static PhoneNumber ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static PhoneNumber ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static PhoneNumber ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static PhoneNumber ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static PhoneNumber ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static PhoneNumber ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static PhoneNumber ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private PhoneNumber MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(PhoneNumber prototype) { - return new Builder(prototype); - } - - [global::System.SerializableAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilderLite { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(PhoneNumber cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private PhoneNumber result; - - private PhoneNumber PrepareBuilder() { - if (resultIsReadOnly) { - PhoneNumber original = result; - result = new PhoneNumber(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override PhoneNumber MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override PhoneNumber DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestInteropPersonLite.Types.PhoneNumber.DefaultInstance; } - } - - public override PhoneNumber BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessageLite other) { - if (other is PhoneNumber) { - return MergeFrom((PhoneNumber) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(PhoneNumber other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestInteropPersonLite.Types.PhoneNumber.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasNumber) { - Number = other.Number; - } - if (other.HasType) { - Type = other.Type; - } - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_phoneNumberFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _phoneNumberFieldTags[field_ordinal]; - else { - ParseUnknownField(input, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - return this; - } - ParseUnknownField(input, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasNumber = input.ReadString(ref result.number_); - break; - } - case 16: { - object unknown; - if(input.ReadEnum(ref result.type_, out unknown)) { - result.hasType = true; - } else if(unknown is int) { - } - break; - } - } - } - - return this; - } - - - public bool HasNumber { - get { return result.hasNumber; } - } - public string Number { - get { return result.Number; } - set { SetNumber(value); } - } - public Builder SetNumber(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasNumber = true; - result.number_ = value; - return this; - } - public Builder ClearNumber() { - PrepareBuilder(); - result.hasNumber = false; - result.number_ = ""; - return this; - } - - public bool HasType { - get { return result.hasType; } - } - public global::Google.ProtocolBuffers.TestProtos.TestInteropPersonLite.Types.PhoneType Type { - get { return result.Type; } - set { SetType(value); } - } - public Builder SetType(global::Google.ProtocolBuffers.TestProtos.TestInteropPersonLite.Types.PhoneType value) { - PrepareBuilder(); - result.hasType = true; - result.type_ = value; - return this; - } - public Builder ClearType() { - PrepareBuilder(); - result.hasType = false; - result.type_ = global::Google.ProtocolBuffers.TestProtos.TestInteropPersonLite.Types.PhoneType.HOME; - return this; - } - } - static PhoneNumber() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.Descriptor, null); - } - } - - [global::System.SerializableAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Addresses : pb::GeneratedMessageLite { - private Addresses() { } - private static readonly Addresses defaultInstance = new Addresses().MakeReadOnly(); - private static readonly string[] _addressesFieldNames = new string[] { "address", "address2", "city", "state", "zip" }; - private static readonly uint[] _addressesFieldTags = new uint[] { 10, 18, 26, 34, 45 }; - public static Addresses DefaultInstance { - get { return defaultInstance; } - } - - public override Addresses DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override Addresses ThisMessage { - get { return this; } - } - - public const int AddressFieldNumber = 1; - private bool hasAddress; - private string address_ = ""; - public bool HasAddress { - get { return hasAddress; } - } - public string Address { - get { return address_; } - } - - public const int Address2FieldNumber = 2; - private bool hasAddress2; - private string address2_ = ""; - public bool HasAddress2 { - get { return hasAddress2; } - } - public string Address2 { - get { return address2_; } - } - - public const int CityFieldNumber = 3; - private bool hasCity; - private string city_ = ""; - public bool HasCity { - get { return hasCity; } - } - public string City { - get { return city_; } - } - - public const int StateFieldNumber = 4; - private bool hasState; - private string state_ = ""; - public bool HasState { - get { return hasState; } - } - public string State { - get { return state_; } - } - - public const int ZipFieldNumber = 5; - private bool hasZip; - private uint zip_; - public bool HasZip { - get { return hasZip; } - } - [global::System.CLSCompliant(false)] - public uint Zip { - get { return zip_; } - } - - public override bool IsInitialized { - get { - if (!hasAddress) return false; - if (!hasCity) return false; - if (!hasState) return false; - if (!hasZip) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _addressesFieldNames; - if (hasAddress) { - output.WriteString(1, field_names[0], Address); - } - if (hasAddress2) { - output.WriteString(2, field_names[1], Address2); - } - if (hasCity) { - output.WriteString(3, field_names[2], City); - } - if (hasState) { - output.WriteString(4, field_names[3], State); - } - if (hasZip) { - output.WriteFixed32(5, field_names[4], Zip); - } - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasAddress) { - size += pb::CodedOutputStream.ComputeStringSize(1, Address); - } - if (hasAddress2) { - size += pb::CodedOutputStream.ComputeStringSize(2, Address2); - } - if (hasCity) { - size += pb::CodedOutputStream.ComputeStringSize(3, City); - } - if (hasState) { - size += pb::CodedOutputStream.ComputeStringSize(4, State); - } - if (hasZip) { - size += pb::CodedOutputStream.ComputeFixed32Size(5, Zip); - } - memoizedSerializedSize = size; - return size; - } - #region Lite runtime methods - public override int GetHashCode() { - int hash = GetType().GetHashCode(); - if (hasAddress) hash ^= address_.GetHashCode(); - if (hasAddress2) hash ^= address2_.GetHashCode(); - if (hasCity) hash ^= city_.GetHashCode(); - if (hasState) hash ^= state_.GetHashCode(); - if (hasZip) hash ^= zip_.GetHashCode(); - return hash; - } - - public override bool Equals(object obj) { - Addresses other = obj as Addresses; - if (other == null) return false; - if (hasAddress != other.hasAddress || (hasAddress && !address_.Equals(other.address_))) return false; - if (hasAddress2 != other.hasAddress2 || (hasAddress2 && !address2_.Equals(other.address2_))) return false; - if (hasCity != other.hasCity || (hasCity && !city_.Equals(other.city_))) return false; - if (hasState != other.hasState || (hasState && !state_.Equals(other.state_))) return false; - if (hasZip != other.hasZip || (hasZip && !zip_.Equals(other.zip_))) return false; - return true; - } - - public override void PrintTo(global::System.IO.TextWriter writer) { - PrintField("address", hasAddress, address_, writer); - PrintField("address2", hasAddress2, address2_, writer); - PrintField("city", hasCity, city_, writer); - PrintField("state", hasState, state_, writer); - PrintField("zip", hasZip, zip_, writer); - } - #endregion - - public static Addresses ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Addresses ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Addresses ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Addresses ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Addresses ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Addresses ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Addresses ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Addresses ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Addresses ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Addresses ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private Addresses MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Addresses prototype) { - return new Builder(prototype); - } - - [global::System.SerializableAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilderLite { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(Addresses cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private Addresses result; - - private Addresses PrepareBuilder() { - if (resultIsReadOnly) { - Addresses original = result; - result = new Addresses(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override Addresses MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override Addresses DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestInteropPersonLite.Types.Addresses.DefaultInstance; } - } - - public override Addresses BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessageLite other) { - if (other is Addresses) { - return MergeFrom((Addresses) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Addresses other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestInteropPersonLite.Types.Addresses.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasAddress) { - Address = other.Address; - } - if (other.HasAddress2) { - Address2 = other.Address2; - } - if (other.HasCity) { - City = other.City; - } - if (other.HasState) { - State = other.State; - } - if (other.HasZip) { - Zip = other.Zip; - } - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_addressesFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _addressesFieldTags[field_ordinal]; - else { - ParseUnknownField(input, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - return this; - } - ParseUnknownField(input, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasAddress = input.ReadString(ref result.address_); - break; - } - case 18: { - result.hasAddress2 = input.ReadString(ref result.address2_); - break; - } - case 26: { - result.hasCity = input.ReadString(ref result.city_); - break; - } - case 34: { - result.hasState = input.ReadString(ref result.state_); - break; - } - case 45: { - result.hasZip = input.ReadFixed32(ref result.zip_); - break; - } - } - } - - return this; - } - - - public bool HasAddress { - get { return result.hasAddress; } - } - public string Address { - get { return result.Address; } - set { SetAddress(value); } - } - public Builder SetAddress(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasAddress = true; - result.address_ = value; - return this; - } - public Builder ClearAddress() { - PrepareBuilder(); - result.hasAddress = false; - result.address_ = ""; - return this; - } - - public bool HasAddress2 { - get { return result.hasAddress2; } - } - public string Address2 { - get { return result.Address2; } - set { SetAddress2(value); } - } - public Builder SetAddress2(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasAddress2 = true; - result.address2_ = value; - return this; - } - public Builder ClearAddress2() { - PrepareBuilder(); - result.hasAddress2 = false; - result.address2_ = ""; - return this; - } - - public bool HasCity { - get { return result.hasCity; } - } - public string City { - get { return result.City; } - set { SetCity(value); } - } - public Builder SetCity(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasCity = true; - result.city_ = value; - return this; - } - public Builder ClearCity() { - PrepareBuilder(); - result.hasCity = false; - result.city_ = ""; - return this; - } - - public bool HasState { - get { return result.hasState; } - } - public string State { - get { return result.State; } - set { SetState(value); } - } - public Builder SetState(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasState = true; - result.state_ = value; - return this; - } - public Builder ClearState() { - PrepareBuilder(); - result.hasState = false; - result.state_ = ""; - return this; - } - - public bool HasZip { - get { return result.hasZip; } - } - [global::System.CLSCompliant(false)] - public uint Zip { - get { return result.Zip; } - set { SetZip(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetZip(uint value) { - PrepareBuilder(); - result.hasZip = true; - result.zip_ = value; - return this; - } - public Builder ClearZip() { - PrepareBuilder(); - result.hasZip = false; - result.zip_ = 0; - return this; - } - } - static Addresses() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.Descriptor, null); - } - } - - } - #endregion - - public const int NameFieldNumber = 1; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public const int IdFieldNumber = 2; - private bool hasId; - private int id_; - public bool HasId { - get { return hasId; } - } - public int Id { - get { return id_; } - } - - public const int EmailFieldNumber = 3; - private bool hasEmail; - private string email_ = ""; - public bool HasEmail { - get { return hasEmail; } - } - public string Email { - get { return email_; } - } - - public const int CodesFieldNumber = 10; - private int codesMemoizedSerializedSize; - private pbc::PopsicleList codes_ = new pbc::PopsicleList(); - public scg::IList CodesList { - get { return pbc::Lists.AsReadOnly(codes_); } - } - public int CodesCount { - get { return codes_.Count; } - } - public int GetCodes(int index) { - return codes_[index]; - } - - public const int PhoneFieldNumber = 4; - private pbc::PopsicleList phone_ = new pbc::PopsicleList(); - public scg::IList PhoneList { - get { return phone_; } - } - public int PhoneCount { - get { return phone_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.TestInteropPersonLite.Types.PhoneNumber GetPhone(int index) { - return phone_[index]; - } - - public const int AddressesFieldNumber = 5; - private pbc::PopsicleList addresses_ = new pbc::PopsicleList(); - public scg::IList AddressesList { - get { return addresses_; } - } - public int AddressesCount { - get { return addresses_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.TestInteropPersonLite.Types.Addresses GetAddresses(int index) { - return addresses_[index]; - } - - public override bool IsInitialized { - get { - if (!hasName) return false; - if (!hasId) return false; - foreach (global::Google.ProtocolBuffers.TestProtos.TestInteropPersonLite.Types.PhoneNumber element in PhoneList) { - if (!element.IsInitialized) return false; - } - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testInteropPersonLiteFieldNames; - pb::ExtendableMessageLite.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - if (hasName) { - output.WriteString(1, field_names[4], Name); - } - if (hasId) { - output.WriteInt32(2, field_names[3], Id); - } - if (hasEmail) { - output.WriteString(3, field_names[2], Email); - } - if (phone_.Count > 0) { - output.WriteMessageArray(4, field_names[5], phone_); - } - if (addresses_.Count > 0) { - output.WriteGroupArray(5, field_names[0], addresses_); - } - if (codes_.Count > 0) { - output.WritePackedInt32Array(10, field_names[1], codesMemoizedSerializedSize, codes_); - } - extensionWriter.WriteUntil(200, output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasName) { - size += pb::CodedOutputStream.ComputeStringSize(1, Name); - } - if (hasId) { - size += pb::CodedOutputStream.ComputeInt32Size(2, Id); - } - if (hasEmail) { - size += pb::CodedOutputStream.ComputeStringSize(3, Email); - } - { - int dataSize = 0; - foreach (int element in CodesList) { - dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); - } - size += dataSize; - if (codes_.Count != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - codesMemoizedSerializedSize = dataSize; - } - foreach (global::Google.ProtocolBuffers.TestProtos.TestInteropPersonLite.Types.PhoneNumber element in PhoneList) { - size += pb::CodedOutputStream.ComputeMessageSize(4, element); - } - foreach (global::Google.ProtocolBuffers.TestProtos.TestInteropPersonLite.Types.Addresses element in AddressesList) { - size += pb::CodedOutputStream.ComputeGroupSize(5, element); - } - size += ExtensionsSerializedSize; - memoizedSerializedSize = size; - return size; - } - #region Lite runtime methods - public override int GetHashCode() { - int hash = GetType().GetHashCode(); - if (hasName) hash ^= name_.GetHashCode(); - if (hasId) hash ^= id_.GetHashCode(); - if (hasEmail) hash ^= email_.GetHashCode(); - foreach(int i in codes_) - hash ^= i.GetHashCode(); - foreach(global::Google.ProtocolBuffers.TestProtos.TestInteropPersonLite.Types.PhoneNumber i in phone_) - hash ^= i.GetHashCode(); - foreach(global::Google.ProtocolBuffers.TestProtos.TestInteropPersonLite.Types.Addresses i in addresses_) - hash ^= i.GetHashCode(); - hash ^= base.GetHashCode(); - return hash; - } - - public override bool Equals(object obj) { - TestInteropPersonLite other = obj as TestInteropPersonLite; - if (other == null) return false; - if (hasName != other.hasName || (hasName && !name_.Equals(other.name_))) return false; - if (hasId != other.hasId || (hasId && !id_.Equals(other.id_))) return false; - if (hasEmail != other.hasEmail || (hasEmail && !email_.Equals(other.email_))) return false; - if(codes_.Count != other.codes_.Count) return false; - for(int ix=0; ix < codes_.Count; ix++) - if(!codes_[ix].Equals(other.codes_[ix])) return false; - if(phone_.Count != other.phone_.Count) return false; - for(int ix=0; ix < phone_.Count; ix++) - if(!phone_[ix].Equals(other.phone_[ix])) return false; - if(addresses_.Count != other.addresses_.Count) return false; - for(int ix=0; ix < addresses_.Count; ix++) - if(!addresses_[ix].Equals(other.addresses_[ix])) return false; - if (!base.Equals(other)) return false; - return true; - } - - public override void PrintTo(global::System.IO.TextWriter writer) { - PrintField("name", hasName, name_, writer); - PrintField("id", hasId, id_, writer); - PrintField("email", hasEmail, email_, writer); - PrintField("phone", phone_, writer); - PrintField("Addresses", addresses_, writer); - PrintField("codes", codes_, writer); - base.PrintTo(writer); - } - #endregion - - public static TestInteropPersonLite ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestInteropPersonLite ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestInteropPersonLite ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestInteropPersonLite ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestInteropPersonLite ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestInteropPersonLite ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestInteropPersonLite ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestInteropPersonLite ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestInteropPersonLite ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestInteropPersonLite ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestInteropPersonLite MakeReadOnly() { - codes_.MakeReadOnly(); - phone_.MakeReadOnly(); - addresses_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestInteropPersonLite prototype) { - return new Builder(prototype); - } - - [global::System.SerializableAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilderLite { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestInteropPersonLite cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestInteropPersonLite result; - - private TestInteropPersonLite PrepareBuilder() { - if (resultIsReadOnly) { - TestInteropPersonLite original = result; - result = new TestInteropPersonLite(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestInteropPersonLite MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override TestInteropPersonLite DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestInteropPersonLite.DefaultInstance; } - } - - public override TestInteropPersonLite BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessageLite other) { - if (other is TestInteropPersonLite) { - return MergeFrom((TestInteropPersonLite) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestInteropPersonLite other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestInteropPersonLite.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasName) { - Name = other.Name; - } - if (other.HasId) { - Id = other.Id; - } - if (other.HasEmail) { - Email = other.Email; - } - if (other.codes_.Count != 0) { - result.codes_.Add(other.codes_); - } - if (other.phone_.Count != 0) { - result.phone_.Add(other.phone_); - } - if (other.addresses_.Count != 0) { - result.addresses_.Add(other.addresses_); - } - this.MergeExtensionFields(other); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testInteropPersonLiteFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testInteropPersonLiteFieldTags[field_ordinal]; - else { - ParseUnknownField(input, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - return this; - } - ParseUnknownField(input, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasName = input.ReadString(ref result.name_); - break; - } - case 16: { - result.hasId = input.ReadInt32(ref result.id_); - break; - } - case 26: { - result.hasEmail = input.ReadString(ref result.email_); - break; - } - case 34: { - input.ReadMessageArray(tag, field_name, result.phone_, global::Google.ProtocolBuffers.TestProtos.TestInteropPersonLite.Types.PhoneNumber.DefaultInstance, extensionRegistry); - break; - } - case 43: { - input.ReadGroupArray(tag, field_name, result.addresses_, global::Google.ProtocolBuffers.TestProtos.TestInteropPersonLite.Types.Addresses.DefaultInstance, extensionRegistry); - break; - } - case 82: - case 80: { - input.ReadInt32Array(tag, field_name, result.codes_); - break; - } - } - } - - return this; - } - - - public bool HasName { - get { return result.hasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - PrepareBuilder(); - result.hasName = false; - result.name_ = ""; - return this; - } - - public bool HasId { - get { return result.hasId; } - } - public int Id { - get { return result.Id; } - set { SetId(value); } - } - public Builder SetId(int value) { - PrepareBuilder(); - result.hasId = true; - result.id_ = value; - return this; - } - public Builder ClearId() { - PrepareBuilder(); - result.hasId = false; - result.id_ = 0; - return this; - } - - public bool HasEmail { - get { return result.hasEmail; } - } - public string Email { - get { return result.Email; } - set { SetEmail(value); } - } - public Builder SetEmail(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasEmail = true; - result.email_ = value; - return this; - } - public Builder ClearEmail() { - PrepareBuilder(); - result.hasEmail = false; - result.email_ = ""; - return this; - } - - public pbc::IPopsicleList CodesList { - get { return PrepareBuilder().codes_; } - } - public int CodesCount { - get { return result.CodesCount; } - } - public int GetCodes(int index) { - return result.GetCodes(index); - } - public Builder SetCodes(int index, int value) { - PrepareBuilder(); - result.codes_[index] = value; - return this; - } - public Builder AddCodes(int value) { - PrepareBuilder(); - result.codes_.Add(value); - return this; - } - public Builder AddRangeCodes(scg::IEnumerable values) { - PrepareBuilder(); - result.codes_.Add(values); - return this; - } - public Builder ClearCodes() { - PrepareBuilder(); - result.codes_.Clear(); - return this; - } - - public pbc::IPopsicleList PhoneList { - get { return PrepareBuilder().phone_; } - } - public int PhoneCount { - get { return result.PhoneCount; } - } - public global::Google.ProtocolBuffers.TestProtos.TestInteropPersonLite.Types.PhoneNumber GetPhone(int index) { - return result.GetPhone(index); - } - public Builder SetPhone(int index, global::Google.ProtocolBuffers.TestProtos.TestInteropPersonLite.Types.PhoneNumber value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.phone_[index] = value; - return this; - } - public Builder SetPhone(int index, global::Google.ProtocolBuffers.TestProtos.TestInteropPersonLite.Types.PhoneNumber.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.phone_[index] = builderForValue.Build(); - return this; - } - public Builder AddPhone(global::Google.ProtocolBuffers.TestProtos.TestInteropPersonLite.Types.PhoneNumber value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.phone_.Add(value); - return this; - } - public Builder AddPhone(global::Google.ProtocolBuffers.TestProtos.TestInteropPersonLite.Types.PhoneNumber.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.phone_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangePhone(scg::IEnumerable values) { - PrepareBuilder(); - result.phone_.Add(values); - return this; - } - public Builder ClearPhone() { - PrepareBuilder(); - result.phone_.Clear(); - return this; - } - - public pbc::IPopsicleList AddressesList { - get { return PrepareBuilder().addresses_; } - } - public int AddressesCount { - get { return result.AddressesCount; } - } - public global::Google.ProtocolBuffers.TestProtos.TestInteropPersonLite.Types.Addresses GetAddresses(int index) { - return result.GetAddresses(index); - } - public Builder SetAddresses(int index, global::Google.ProtocolBuffers.TestProtos.TestInteropPersonLite.Types.Addresses value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.addresses_[index] = value; - return this; - } - public Builder SetAddresses(int index, global::Google.ProtocolBuffers.TestProtos.TestInteropPersonLite.Types.Addresses.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.addresses_[index] = builderForValue.Build(); - return this; - } - public Builder AddAddresses(global::Google.ProtocolBuffers.TestProtos.TestInteropPersonLite.Types.Addresses value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.addresses_.Add(value); - return this; - } - public Builder AddAddresses(global::Google.ProtocolBuffers.TestProtos.TestInteropPersonLite.Types.Addresses.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.addresses_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeAddresses(scg::IEnumerable values) { - PrepareBuilder(); - result.addresses_.Add(values); - return this; - } - public Builder ClearAddresses() { - PrepareBuilder(); - result.addresses_.Clear(); - return this; - } - } - static TestInteropPersonLite() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.Descriptor, null); - } - } - - [global::System.SerializableAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestInteropEmployeeIdLite : pb::GeneratedMessageLite { - private TestInteropEmployeeIdLite() { } - private static readonly TestInteropEmployeeIdLite defaultInstance = new TestInteropEmployeeIdLite().MakeReadOnly(); - private static readonly string[] _testInteropEmployeeIdLiteFieldNames = new string[] { "number" }; - private static readonly uint[] _testInteropEmployeeIdLiteFieldTags = new uint[] { 10 }; - public static TestInteropEmployeeIdLite DefaultInstance { - get { return defaultInstance; } - } - - public override TestInteropEmployeeIdLite DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestInteropEmployeeIdLite ThisMessage { - get { return this; } - } - - public const int NumberFieldNumber = 1; - private bool hasNumber; - private string number_ = ""; - public bool HasNumber { - get { return hasNumber; } - } - public string Number { - get { return number_; } - } - - public override bool IsInitialized { - get { - if (!hasNumber) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testInteropEmployeeIdLiteFieldNames; - if (hasNumber) { - output.WriteString(1, field_names[0], Number); - } - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasNumber) { - size += pb::CodedOutputStream.ComputeStringSize(1, Number); - } - memoizedSerializedSize = size; - return size; - } - #region Lite runtime methods - public override int GetHashCode() { - int hash = GetType().GetHashCode(); - if (hasNumber) hash ^= number_.GetHashCode(); - return hash; - } - - public override bool Equals(object obj) { - TestInteropEmployeeIdLite other = obj as TestInteropEmployeeIdLite; - if (other == null) return false; - if (hasNumber != other.hasNumber || (hasNumber && !number_.Equals(other.number_))) return false; - return true; - } - - public override void PrintTo(global::System.IO.TextWriter writer) { - PrintField("number", hasNumber, number_, writer); - } - #endregion - - public static TestInteropEmployeeIdLite ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestInteropEmployeeIdLite ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestInteropEmployeeIdLite ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestInteropEmployeeIdLite ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestInteropEmployeeIdLite ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestInteropEmployeeIdLite ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestInteropEmployeeIdLite ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestInteropEmployeeIdLite ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestInteropEmployeeIdLite ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestInteropEmployeeIdLite ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestInteropEmployeeIdLite MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestInteropEmployeeIdLite prototype) { - return new Builder(prototype); - } - - [global::System.SerializableAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilderLite { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestInteropEmployeeIdLite cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestInteropEmployeeIdLite result; - - private TestInteropEmployeeIdLite PrepareBuilder() { - if (resultIsReadOnly) { - TestInteropEmployeeIdLite original = result; - result = new TestInteropEmployeeIdLite(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestInteropEmployeeIdLite MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override TestInteropEmployeeIdLite DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestInteropEmployeeIdLite.DefaultInstance; } - } - - public override TestInteropEmployeeIdLite BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessageLite other) { - if (other is TestInteropEmployeeIdLite) { - return MergeFrom((TestInteropEmployeeIdLite) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestInteropEmployeeIdLite other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestInteropEmployeeIdLite.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasNumber) { - Number = other.Number; - } - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testInteropEmployeeIdLiteFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testInteropEmployeeIdLiteFieldTags[field_ordinal]; - else { - ParseUnknownField(input, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - return this; - } - ParseUnknownField(input, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasNumber = input.ReadString(ref result.number_); - break; - } - } - } - - return this; - } - - - public bool HasNumber { - get { return result.hasNumber; } - } - public string Number { - get { return result.Number; } - set { SetNumber(value); } - } - public Builder SetNumber(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasNumber = true; - result.number_ = value; - return this; - } - public Builder ClearNumber() { - PrepareBuilder(); - result.hasNumber = false; - result.number_ = ""; - return this; - } - } - static TestInteropEmployeeIdLite() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.Descriptor, null); - } - } - - [global::System.SerializableAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestUnpackedExtensionsLite : pb::ExtendableMessageLite { - private TestUnpackedExtensionsLite() { } - private static readonly TestUnpackedExtensionsLite defaultInstance = new TestUnpackedExtensionsLite().MakeReadOnly(); - private static readonly string[] _testUnpackedExtensionsLiteFieldNames = new string[] { }; - private static readonly uint[] _testUnpackedExtensionsLiteFieldTags = new uint[] { }; - public static TestUnpackedExtensionsLite DefaultInstance { - get { return defaultInstance; } - } - - public override TestUnpackedExtensionsLite DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestUnpackedExtensionsLite ThisMessage { - get { return this; } - } - - public override bool IsInitialized { - get { - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testUnpackedExtensionsLiteFieldNames; - pb::ExtendableMessageLite.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - extensionWriter.WriteUntil(536870912, output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += ExtensionsSerializedSize; - memoizedSerializedSize = size; - return size; - } - #region Lite runtime methods - public override int GetHashCode() { - int hash = GetType().GetHashCode(); - hash ^= base.GetHashCode(); - return hash; - } - - public override bool Equals(object obj) { - TestUnpackedExtensionsLite other = obj as TestUnpackedExtensionsLite; - if (other == null) return false; - if (!base.Equals(other)) return false; - return true; - } - - public override void PrintTo(global::System.IO.TextWriter writer) { - base.PrintTo(writer); - } - #endregion - - public static TestUnpackedExtensionsLite ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestUnpackedExtensionsLite ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestUnpackedExtensionsLite ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestUnpackedExtensionsLite ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestUnpackedExtensionsLite ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestUnpackedExtensionsLite ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestUnpackedExtensionsLite ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestUnpackedExtensionsLite ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestUnpackedExtensionsLite ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestUnpackedExtensionsLite ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestUnpackedExtensionsLite MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestUnpackedExtensionsLite prototype) { - return new Builder(prototype); - } - - [global::System.SerializableAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilderLite { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestUnpackedExtensionsLite cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestUnpackedExtensionsLite result; - - private TestUnpackedExtensionsLite PrepareBuilder() { - if (resultIsReadOnly) { - TestUnpackedExtensionsLite original = result; - result = new TestUnpackedExtensionsLite(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestUnpackedExtensionsLite MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override TestUnpackedExtensionsLite DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestUnpackedExtensionsLite.DefaultInstance; } - } - - public override TestUnpackedExtensionsLite BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessageLite other) { - if (other is TestUnpackedExtensionsLite) { - return MergeFrom((TestUnpackedExtensionsLite) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestUnpackedExtensionsLite other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestUnpackedExtensionsLite.DefaultInstance) return this; - PrepareBuilder(); - this.MergeExtensionFields(other); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testUnpackedExtensionsLiteFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testUnpackedExtensionsLiteFieldTags[field_ordinal]; - else { - ParseUnknownField(input, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - return this; - } - ParseUnknownField(input, extensionRegistry, tag, field_name); - break; - } - } - } - - return this; - } - - } - static TestUnpackedExtensionsLite() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.Descriptor, null); - } - } - - [global::System.SerializableAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestUnpackedTypesLite : pb::GeneratedMessageLite { - private TestUnpackedTypesLite() { } - private static readonly TestUnpackedTypesLite defaultInstance = new TestUnpackedTypesLite().MakeReadOnly(); - private static readonly string[] _testUnpackedTypesLiteFieldNames = new string[] { "unpacked_bool", "unpacked_double", "unpacked_enum", "unpacked_fixed32", "unpacked_fixed64", "unpacked_float", "unpacked_int32", "unpacked_int64", "unpacked_sfixed32", "unpacked_sfixed64", "unpacked_sint32", "unpacked_sint64", "unpacked_uint32", "unpacked_uint64" }; - private static readonly uint[] _testUnpackedTypesLiteFieldTags = new uint[] { 816, 809, 824, 773, 777, 805, 720, 728, 789, 793, 752, 760, 736, 744 }; - public static TestUnpackedTypesLite DefaultInstance { - get { return defaultInstance; } - } - - public override TestUnpackedTypesLite DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestUnpackedTypesLite ThisMessage { - get { return this; } - } - - public const int UnpackedInt32FieldNumber = 90; - private pbc::PopsicleList unpackedInt32_ = new pbc::PopsicleList(); - public scg::IList UnpackedInt32List { - get { return pbc::Lists.AsReadOnly(unpackedInt32_); } - } - public int UnpackedInt32Count { - get { return unpackedInt32_.Count; } - } - public int GetUnpackedInt32(int index) { - return unpackedInt32_[index]; - } - - public const int UnpackedInt64FieldNumber = 91; - private pbc::PopsicleList unpackedInt64_ = new pbc::PopsicleList(); - public scg::IList UnpackedInt64List { - get { return pbc::Lists.AsReadOnly(unpackedInt64_); } - } - public int UnpackedInt64Count { - get { return unpackedInt64_.Count; } - } - public long GetUnpackedInt64(int index) { - return unpackedInt64_[index]; - } - - public const int UnpackedUint32FieldNumber = 92; - private pbc::PopsicleList unpackedUint32_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList UnpackedUint32List { - get { return pbc::Lists.AsReadOnly(unpackedUint32_); } - } - public int UnpackedUint32Count { - get { return unpackedUint32_.Count; } - } - [global::System.CLSCompliant(false)] - public uint GetUnpackedUint32(int index) { - return unpackedUint32_[index]; - } - - public const int UnpackedUint64FieldNumber = 93; - private pbc::PopsicleList unpackedUint64_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList UnpackedUint64List { - get { return pbc::Lists.AsReadOnly(unpackedUint64_); } - } - public int UnpackedUint64Count { - get { return unpackedUint64_.Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetUnpackedUint64(int index) { - return unpackedUint64_[index]; - } - - public const int UnpackedSint32FieldNumber = 94; - private pbc::PopsicleList unpackedSint32_ = new pbc::PopsicleList(); - public scg::IList UnpackedSint32List { - get { return pbc::Lists.AsReadOnly(unpackedSint32_); } - } - public int UnpackedSint32Count { - get { return unpackedSint32_.Count; } - } - public int GetUnpackedSint32(int index) { - return unpackedSint32_[index]; - } - - public const int UnpackedSint64FieldNumber = 95; - private pbc::PopsicleList unpackedSint64_ = new pbc::PopsicleList(); - public scg::IList UnpackedSint64List { - get { return pbc::Lists.AsReadOnly(unpackedSint64_); } - } - public int UnpackedSint64Count { - get { return unpackedSint64_.Count; } - } - public long GetUnpackedSint64(int index) { - return unpackedSint64_[index]; - } - - public const int UnpackedFixed32FieldNumber = 96; - private pbc::PopsicleList unpackedFixed32_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList UnpackedFixed32List { - get { return pbc::Lists.AsReadOnly(unpackedFixed32_); } - } - public int UnpackedFixed32Count { - get { return unpackedFixed32_.Count; } - } - [global::System.CLSCompliant(false)] - public uint GetUnpackedFixed32(int index) { - return unpackedFixed32_[index]; - } - - public const int UnpackedFixed64FieldNumber = 97; - private pbc::PopsicleList unpackedFixed64_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList UnpackedFixed64List { - get { return pbc::Lists.AsReadOnly(unpackedFixed64_); } - } - public int UnpackedFixed64Count { - get { return unpackedFixed64_.Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetUnpackedFixed64(int index) { - return unpackedFixed64_[index]; - } - - public const int UnpackedSfixed32FieldNumber = 98; - private pbc::PopsicleList unpackedSfixed32_ = new pbc::PopsicleList(); - public scg::IList UnpackedSfixed32List { - get { return pbc::Lists.AsReadOnly(unpackedSfixed32_); } - } - public int UnpackedSfixed32Count { - get { return unpackedSfixed32_.Count; } - } - public int GetUnpackedSfixed32(int index) { - return unpackedSfixed32_[index]; - } - - public const int UnpackedSfixed64FieldNumber = 99; - private pbc::PopsicleList unpackedSfixed64_ = new pbc::PopsicleList(); - public scg::IList UnpackedSfixed64List { - get { return pbc::Lists.AsReadOnly(unpackedSfixed64_); } - } - public int UnpackedSfixed64Count { - get { return unpackedSfixed64_.Count; } - } - public long GetUnpackedSfixed64(int index) { - return unpackedSfixed64_[index]; - } - - public const int UnpackedFloatFieldNumber = 100; - private pbc::PopsicleList unpackedFloat_ = new pbc::PopsicleList(); - public scg::IList UnpackedFloatList { - get { return pbc::Lists.AsReadOnly(unpackedFloat_); } - } - public int UnpackedFloatCount { - get { return unpackedFloat_.Count; } - } - public float GetUnpackedFloat(int index) { - return unpackedFloat_[index]; - } - - public const int UnpackedDoubleFieldNumber = 101; - private pbc::PopsicleList unpackedDouble_ = new pbc::PopsicleList(); - public scg::IList UnpackedDoubleList { - get { return pbc::Lists.AsReadOnly(unpackedDouble_); } - } - public int UnpackedDoubleCount { - get { return unpackedDouble_.Count; } - } - public double GetUnpackedDouble(int index) { - return unpackedDouble_[index]; - } - - public const int UnpackedBoolFieldNumber = 102; - private pbc::PopsicleList unpackedBool_ = new pbc::PopsicleList(); - public scg::IList UnpackedBoolList { - get { return pbc::Lists.AsReadOnly(unpackedBool_); } - } - public int UnpackedBoolCount { - get { return unpackedBool_.Count; } - } - public bool GetUnpackedBool(int index) { - return unpackedBool_[index]; - } - - public const int UnpackedEnumFieldNumber = 103; - private pbc::PopsicleList unpackedEnum_ = new pbc::PopsicleList(); - public scg::IList UnpackedEnumList { - get { return pbc::Lists.AsReadOnly(unpackedEnum_); } - } - public int UnpackedEnumCount { - get { return unpackedEnum_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.UnpackedTypesForeignEnumLite GetUnpackedEnum(int index) { - return unpackedEnum_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testUnpackedTypesLiteFieldNames; - if (unpackedInt32_.Count > 0) { - output.WriteInt32Array(90, field_names[6], unpackedInt32_); - } - if (unpackedInt64_.Count > 0) { - output.WriteInt64Array(91, field_names[7], unpackedInt64_); - } - if (unpackedUint32_.Count > 0) { - output.WriteUInt32Array(92, field_names[12], unpackedUint32_); - } - if (unpackedUint64_.Count > 0) { - output.WriteUInt64Array(93, field_names[13], unpackedUint64_); - } - if (unpackedSint32_.Count > 0) { - output.WriteSInt32Array(94, field_names[10], unpackedSint32_); - } - if (unpackedSint64_.Count > 0) { - output.WriteSInt64Array(95, field_names[11], unpackedSint64_); - } - if (unpackedFixed32_.Count > 0) { - output.WriteFixed32Array(96, field_names[3], unpackedFixed32_); - } - if (unpackedFixed64_.Count > 0) { - output.WriteFixed64Array(97, field_names[4], unpackedFixed64_); - } - if (unpackedSfixed32_.Count > 0) { - output.WriteSFixed32Array(98, field_names[8], unpackedSfixed32_); - } - if (unpackedSfixed64_.Count > 0) { - output.WriteSFixed64Array(99, field_names[9], unpackedSfixed64_); - } - if (unpackedFloat_.Count > 0) { - output.WriteFloatArray(100, field_names[5], unpackedFloat_); - } - if (unpackedDouble_.Count > 0) { - output.WriteDoubleArray(101, field_names[1], unpackedDouble_); - } - if (unpackedBool_.Count > 0) { - output.WriteBoolArray(102, field_names[0], unpackedBool_); - } - if (unpackedEnum_.Count > 0) { - output.WriteEnumArray(103, field_names[2], unpackedEnum_); - } - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - foreach (int element in UnpackedInt32List) { - dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); - } - size += dataSize; - size += 2 * unpackedInt32_.Count; - } - { - int dataSize = 0; - foreach (long element in UnpackedInt64List) { - dataSize += pb::CodedOutputStream.ComputeInt64SizeNoTag(element); - } - size += dataSize; - size += 2 * unpackedInt64_.Count; - } - { - int dataSize = 0; - foreach (uint element in UnpackedUint32List) { - dataSize += pb::CodedOutputStream.ComputeUInt32SizeNoTag(element); - } - size += dataSize; - size += 2 * unpackedUint32_.Count; - } - { - int dataSize = 0; - foreach (ulong element in UnpackedUint64List) { - dataSize += pb::CodedOutputStream.ComputeUInt64SizeNoTag(element); - } - size += dataSize; - size += 2 * unpackedUint64_.Count; - } - { - int dataSize = 0; - foreach (int element in UnpackedSint32List) { - dataSize += pb::CodedOutputStream.ComputeSInt32SizeNoTag(element); - } - size += dataSize; - size += 2 * unpackedSint32_.Count; - } - { - int dataSize = 0; - foreach (long element in UnpackedSint64List) { - dataSize += pb::CodedOutputStream.ComputeSInt64SizeNoTag(element); - } - size += dataSize; - size += 2 * unpackedSint64_.Count; - } - { - int dataSize = 0; - dataSize = 4 * unpackedFixed32_.Count; - size += dataSize; - size += 2 * unpackedFixed32_.Count; - } - { - int dataSize = 0; - dataSize = 8 * unpackedFixed64_.Count; - size += dataSize; - size += 2 * unpackedFixed64_.Count; - } - { - int dataSize = 0; - dataSize = 4 * unpackedSfixed32_.Count; - size += dataSize; - size += 2 * unpackedSfixed32_.Count; - } - { - int dataSize = 0; - dataSize = 8 * unpackedSfixed64_.Count; - size += dataSize; - size += 2 * unpackedSfixed64_.Count; - } - { - int dataSize = 0; - dataSize = 4 * unpackedFloat_.Count; - size += dataSize; - size += 2 * unpackedFloat_.Count; - } - { - int dataSize = 0; - dataSize = 8 * unpackedDouble_.Count; - size += dataSize; - size += 2 * unpackedDouble_.Count; - } - { - int dataSize = 0; - dataSize = 1 * unpackedBool_.Count; - size += dataSize; - size += 2 * unpackedBool_.Count; - } - { - int dataSize = 0; - if (unpackedEnum_.Count > 0) { - foreach (global::Google.ProtocolBuffers.TestProtos.UnpackedTypesForeignEnumLite element in unpackedEnum_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 2 * unpackedEnum_.Count; - } - } - memoizedSerializedSize = size; - return size; - } - #region Lite runtime methods - public override int GetHashCode() { - int hash = GetType().GetHashCode(); - foreach(int i in unpackedInt32_) - hash ^= i.GetHashCode(); - foreach(long i in unpackedInt64_) - hash ^= i.GetHashCode(); - foreach(uint i in unpackedUint32_) - hash ^= i.GetHashCode(); - foreach(ulong i in unpackedUint64_) - hash ^= i.GetHashCode(); - foreach(int i in unpackedSint32_) - hash ^= i.GetHashCode(); - foreach(long i in unpackedSint64_) - hash ^= i.GetHashCode(); - foreach(uint i in unpackedFixed32_) - hash ^= i.GetHashCode(); - foreach(ulong i in unpackedFixed64_) - hash ^= i.GetHashCode(); - foreach(int i in unpackedSfixed32_) - hash ^= i.GetHashCode(); - foreach(long i in unpackedSfixed64_) - hash ^= i.GetHashCode(); - foreach(float i in unpackedFloat_) - hash ^= i.GetHashCode(); - foreach(double i in unpackedDouble_) - hash ^= i.GetHashCode(); - foreach(bool i in unpackedBool_) - hash ^= i.GetHashCode(); - foreach(global::Google.ProtocolBuffers.TestProtos.UnpackedTypesForeignEnumLite i in unpackedEnum_) - hash ^= i.GetHashCode(); - return hash; - } - - public override bool Equals(object obj) { - TestUnpackedTypesLite other = obj as TestUnpackedTypesLite; - if (other == null) return false; - if(unpackedInt32_.Count != other.unpackedInt32_.Count) return false; - for(int ix=0; ix < unpackedInt32_.Count; ix++) - if(!unpackedInt32_[ix].Equals(other.unpackedInt32_[ix])) return false; - if(unpackedInt64_.Count != other.unpackedInt64_.Count) return false; - for(int ix=0; ix < unpackedInt64_.Count; ix++) - if(!unpackedInt64_[ix].Equals(other.unpackedInt64_[ix])) return false; - if(unpackedUint32_.Count != other.unpackedUint32_.Count) return false; - for(int ix=0; ix < unpackedUint32_.Count; ix++) - if(!unpackedUint32_[ix].Equals(other.unpackedUint32_[ix])) return false; - if(unpackedUint64_.Count != other.unpackedUint64_.Count) return false; - for(int ix=0; ix < unpackedUint64_.Count; ix++) - if(!unpackedUint64_[ix].Equals(other.unpackedUint64_[ix])) return false; - if(unpackedSint32_.Count != other.unpackedSint32_.Count) return false; - for(int ix=0; ix < unpackedSint32_.Count; ix++) - if(!unpackedSint32_[ix].Equals(other.unpackedSint32_[ix])) return false; - if(unpackedSint64_.Count != other.unpackedSint64_.Count) return false; - for(int ix=0; ix < unpackedSint64_.Count; ix++) - if(!unpackedSint64_[ix].Equals(other.unpackedSint64_[ix])) return false; - if(unpackedFixed32_.Count != other.unpackedFixed32_.Count) return false; - for(int ix=0; ix < unpackedFixed32_.Count; ix++) - if(!unpackedFixed32_[ix].Equals(other.unpackedFixed32_[ix])) return false; - if(unpackedFixed64_.Count != other.unpackedFixed64_.Count) return false; - for(int ix=0; ix < unpackedFixed64_.Count; ix++) - if(!unpackedFixed64_[ix].Equals(other.unpackedFixed64_[ix])) return false; - if(unpackedSfixed32_.Count != other.unpackedSfixed32_.Count) return false; - for(int ix=0; ix < unpackedSfixed32_.Count; ix++) - if(!unpackedSfixed32_[ix].Equals(other.unpackedSfixed32_[ix])) return false; - if(unpackedSfixed64_.Count != other.unpackedSfixed64_.Count) return false; - for(int ix=0; ix < unpackedSfixed64_.Count; ix++) - if(!unpackedSfixed64_[ix].Equals(other.unpackedSfixed64_[ix])) return false; - if(unpackedFloat_.Count != other.unpackedFloat_.Count) return false; - for(int ix=0; ix < unpackedFloat_.Count; ix++) - if(!unpackedFloat_[ix].Equals(other.unpackedFloat_[ix])) return false; - if(unpackedDouble_.Count != other.unpackedDouble_.Count) return false; - for(int ix=0; ix < unpackedDouble_.Count; ix++) - if(!unpackedDouble_[ix].Equals(other.unpackedDouble_[ix])) return false; - if(unpackedBool_.Count != other.unpackedBool_.Count) return false; - for(int ix=0; ix < unpackedBool_.Count; ix++) - if(!unpackedBool_[ix].Equals(other.unpackedBool_[ix])) return false; - if(unpackedEnum_.Count != other.unpackedEnum_.Count) return false; - for(int ix=0; ix < unpackedEnum_.Count; ix++) - if(!unpackedEnum_[ix].Equals(other.unpackedEnum_[ix])) return false; - return true; - } - - public override void PrintTo(global::System.IO.TextWriter writer) { - PrintField("unpacked_int32", unpackedInt32_, writer); - PrintField("unpacked_int64", unpackedInt64_, writer); - PrintField("unpacked_uint32", unpackedUint32_, writer); - PrintField("unpacked_uint64", unpackedUint64_, writer); - PrintField("unpacked_sint32", unpackedSint32_, writer); - PrintField("unpacked_sint64", unpackedSint64_, writer); - PrintField("unpacked_fixed32", unpackedFixed32_, writer); - PrintField("unpacked_fixed64", unpackedFixed64_, writer); - PrintField("unpacked_sfixed32", unpackedSfixed32_, writer); - PrintField("unpacked_sfixed64", unpackedSfixed64_, writer); - PrintField("unpacked_float", unpackedFloat_, writer); - PrintField("unpacked_double", unpackedDouble_, writer); - PrintField("unpacked_bool", unpackedBool_, writer); - PrintField("unpacked_enum", unpackedEnum_, writer); - } - #endregion - - public static TestUnpackedTypesLite ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestUnpackedTypesLite ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestUnpackedTypesLite ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestUnpackedTypesLite ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestUnpackedTypesLite ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestUnpackedTypesLite ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestUnpackedTypesLite ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestUnpackedTypesLite ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestUnpackedTypesLite ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestUnpackedTypesLite ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestUnpackedTypesLite MakeReadOnly() { - unpackedInt32_.MakeReadOnly(); - unpackedInt64_.MakeReadOnly(); - unpackedUint32_.MakeReadOnly(); - unpackedUint64_.MakeReadOnly(); - unpackedSint32_.MakeReadOnly(); - unpackedSint64_.MakeReadOnly(); - unpackedFixed32_.MakeReadOnly(); - unpackedFixed64_.MakeReadOnly(); - unpackedSfixed32_.MakeReadOnly(); - unpackedSfixed64_.MakeReadOnly(); - unpackedFloat_.MakeReadOnly(); - unpackedDouble_.MakeReadOnly(); - unpackedBool_.MakeReadOnly(); - unpackedEnum_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestUnpackedTypesLite prototype) { - return new Builder(prototype); - } - - [global::System.SerializableAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilderLite { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestUnpackedTypesLite cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestUnpackedTypesLite result; - - private TestUnpackedTypesLite PrepareBuilder() { - if (resultIsReadOnly) { - TestUnpackedTypesLite original = result; - result = new TestUnpackedTypesLite(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestUnpackedTypesLite MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override TestUnpackedTypesLite DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestUnpackedTypesLite.DefaultInstance; } - } - - public override TestUnpackedTypesLite BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessageLite other) { - if (other is TestUnpackedTypesLite) { - return MergeFrom((TestUnpackedTypesLite) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestUnpackedTypesLite other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestUnpackedTypesLite.DefaultInstance) return this; - PrepareBuilder(); - if (other.unpackedInt32_.Count != 0) { - result.unpackedInt32_.Add(other.unpackedInt32_); - } - if (other.unpackedInt64_.Count != 0) { - result.unpackedInt64_.Add(other.unpackedInt64_); - } - if (other.unpackedUint32_.Count != 0) { - result.unpackedUint32_.Add(other.unpackedUint32_); - } - if (other.unpackedUint64_.Count != 0) { - result.unpackedUint64_.Add(other.unpackedUint64_); - } - if (other.unpackedSint32_.Count != 0) { - result.unpackedSint32_.Add(other.unpackedSint32_); - } - if (other.unpackedSint64_.Count != 0) { - result.unpackedSint64_.Add(other.unpackedSint64_); - } - if (other.unpackedFixed32_.Count != 0) { - result.unpackedFixed32_.Add(other.unpackedFixed32_); - } - if (other.unpackedFixed64_.Count != 0) { - result.unpackedFixed64_.Add(other.unpackedFixed64_); - } - if (other.unpackedSfixed32_.Count != 0) { - result.unpackedSfixed32_.Add(other.unpackedSfixed32_); - } - if (other.unpackedSfixed64_.Count != 0) { - result.unpackedSfixed64_.Add(other.unpackedSfixed64_); - } - if (other.unpackedFloat_.Count != 0) { - result.unpackedFloat_.Add(other.unpackedFloat_); - } - if (other.unpackedDouble_.Count != 0) { - result.unpackedDouble_.Add(other.unpackedDouble_); - } - if (other.unpackedBool_.Count != 0) { - result.unpackedBool_.Add(other.unpackedBool_); - } - if (other.unpackedEnum_.Count != 0) { - result.unpackedEnum_.Add(other.unpackedEnum_); - } - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testUnpackedTypesLiteFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testUnpackedTypesLiteFieldTags[field_ordinal]; - else { - ParseUnknownField(input, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - return this; - } - ParseUnknownField(input, extensionRegistry, tag, field_name); - break; - } - case 722: - case 720: { - input.ReadInt32Array(tag, field_name, result.unpackedInt32_); - break; - } - case 730: - case 728: { - input.ReadInt64Array(tag, field_name, result.unpackedInt64_); - break; - } - case 738: - case 736: { - input.ReadUInt32Array(tag, field_name, result.unpackedUint32_); - break; - } - case 746: - case 744: { - input.ReadUInt64Array(tag, field_name, result.unpackedUint64_); - break; - } - case 754: - case 752: { - input.ReadSInt32Array(tag, field_name, result.unpackedSint32_); - break; - } - case 762: - case 760: { - input.ReadSInt64Array(tag, field_name, result.unpackedSint64_); - break; - } - case 770: - case 773: { - input.ReadFixed32Array(tag, field_name, result.unpackedFixed32_); - break; - } - case 778: - case 777: { - input.ReadFixed64Array(tag, field_name, result.unpackedFixed64_); - break; - } - case 786: - case 789: { - input.ReadSFixed32Array(tag, field_name, result.unpackedSfixed32_); - break; - } - case 794: - case 793: { - input.ReadSFixed64Array(tag, field_name, result.unpackedSfixed64_); - break; - } - case 802: - case 805: { - input.ReadFloatArray(tag, field_name, result.unpackedFloat_); - break; - } - case 810: - case 809: { - input.ReadDoubleArray(tag, field_name, result.unpackedDouble_); - break; - } - case 818: - case 816: { - input.ReadBoolArray(tag, field_name, result.unpackedBool_); - break; - } - case 826: - case 824: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.unpackedEnum_, out unknownItems); - break; - } - } - } - - return this; - } - - - public pbc::IPopsicleList UnpackedInt32List { - get { return PrepareBuilder().unpackedInt32_; } - } - public int UnpackedInt32Count { - get { return result.UnpackedInt32Count; } - } - public int GetUnpackedInt32(int index) { - return result.GetUnpackedInt32(index); - } - public Builder SetUnpackedInt32(int index, int value) { - PrepareBuilder(); - result.unpackedInt32_[index] = value; - return this; - } - public Builder AddUnpackedInt32(int value) { - PrepareBuilder(); - result.unpackedInt32_.Add(value); - return this; - } - public Builder AddRangeUnpackedInt32(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedInt32_.Add(values); - return this; - } - public Builder ClearUnpackedInt32() { - PrepareBuilder(); - result.unpackedInt32_.Clear(); - return this; - } - - public pbc::IPopsicleList UnpackedInt64List { - get { return PrepareBuilder().unpackedInt64_; } - } - public int UnpackedInt64Count { - get { return result.UnpackedInt64Count; } - } - public long GetUnpackedInt64(int index) { - return result.GetUnpackedInt64(index); - } - public Builder SetUnpackedInt64(int index, long value) { - PrepareBuilder(); - result.unpackedInt64_[index] = value; - return this; - } - public Builder AddUnpackedInt64(long value) { - PrepareBuilder(); - result.unpackedInt64_.Add(value); - return this; - } - public Builder AddRangeUnpackedInt64(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedInt64_.Add(values); - return this; - } - public Builder ClearUnpackedInt64() { - PrepareBuilder(); - result.unpackedInt64_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList UnpackedUint32List { - get { return PrepareBuilder().unpackedUint32_; } - } - public int UnpackedUint32Count { - get { return result.UnpackedUint32Count; } - } - [global::System.CLSCompliant(false)] - public uint GetUnpackedUint32(int index) { - return result.GetUnpackedUint32(index); - } - [global::System.CLSCompliant(false)] - public Builder SetUnpackedUint32(int index, uint value) { - PrepareBuilder(); - result.unpackedUint32_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddUnpackedUint32(uint value) { - PrepareBuilder(); - result.unpackedUint32_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeUnpackedUint32(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedUint32_.Add(values); - return this; - } - public Builder ClearUnpackedUint32() { - PrepareBuilder(); - result.unpackedUint32_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList UnpackedUint64List { - get { return PrepareBuilder().unpackedUint64_; } - } - public int UnpackedUint64Count { - get { return result.UnpackedUint64Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetUnpackedUint64(int index) { - return result.GetUnpackedUint64(index); - } - [global::System.CLSCompliant(false)] - public Builder SetUnpackedUint64(int index, ulong value) { - PrepareBuilder(); - result.unpackedUint64_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddUnpackedUint64(ulong value) { - PrepareBuilder(); - result.unpackedUint64_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeUnpackedUint64(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedUint64_.Add(values); - return this; - } - public Builder ClearUnpackedUint64() { - PrepareBuilder(); - result.unpackedUint64_.Clear(); - return this; - } - - public pbc::IPopsicleList UnpackedSint32List { - get { return PrepareBuilder().unpackedSint32_; } - } - public int UnpackedSint32Count { - get { return result.UnpackedSint32Count; } - } - public int GetUnpackedSint32(int index) { - return result.GetUnpackedSint32(index); - } - public Builder SetUnpackedSint32(int index, int value) { - PrepareBuilder(); - result.unpackedSint32_[index] = value; - return this; - } - public Builder AddUnpackedSint32(int value) { - PrepareBuilder(); - result.unpackedSint32_.Add(value); - return this; - } - public Builder AddRangeUnpackedSint32(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedSint32_.Add(values); - return this; - } - public Builder ClearUnpackedSint32() { - PrepareBuilder(); - result.unpackedSint32_.Clear(); - return this; - } - - public pbc::IPopsicleList UnpackedSint64List { - get { return PrepareBuilder().unpackedSint64_; } - } - public int UnpackedSint64Count { - get { return result.UnpackedSint64Count; } - } - public long GetUnpackedSint64(int index) { - return result.GetUnpackedSint64(index); - } - public Builder SetUnpackedSint64(int index, long value) { - PrepareBuilder(); - result.unpackedSint64_[index] = value; - return this; - } - public Builder AddUnpackedSint64(long value) { - PrepareBuilder(); - result.unpackedSint64_.Add(value); - return this; - } - public Builder AddRangeUnpackedSint64(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedSint64_.Add(values); - return this; - } - public Builder ClearUnpackedSint64() { - PrepareBuilder(); - result.unpackedSint64_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList UnpackedFixed32List { - get { return PrepareBuilder().unpackedFixed32_; } - } - public int UnpackedFixed32Count { - get { return result.UnpackedFixed32Count; } - } - [global::System.CLSCompliant(false)] - public uint GetUnpackedFixed32(int index) { - return result.GetUnpackedFixed32(index); - } - [global::System.CLSCompliant(false)] - public Builder SetUnpackedFixed32(int index, uint value) { - PrepareBuilder(); - result.unpackedFixed32_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddUnpackedFixed32(uint value) { - PrepareBuilder(); - result.unpackedFixed32_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeUnpackedFixed32(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedFixed32_.Add(values); - return this; - } - public Builder ClearUnpackedFixed32() { - PrepareBuilder(); - result.unpackedFixed32_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList UnpackedFixed64List { - get { return PrepareBuilder().unpackedFixed64_; } - } - public int UnpackedFixed64Count { - get { return result.UnpackedFixed64Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetUnpackedFixed64(int index) { - return result.GetUnpackedFixed64(index); - } - [global::System.CLSCompliant(false)] - public Builder SetUnpackedFixed64(int index, ulong value) { - PrepareBuilder(); - result.unpackedFixed64_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddUnpackedFixed64(ulong value) { - PrepareBuilder(); - result.unpackedFixed64_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeUnpackedFixed64(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedFixed64_.Add(values); - return this; - } - public Builder ClearUnpackedFixed64() { - PrepareBuilder(); - result.unpackedFixed64_.Clear(); - return this; - } - - public pbc::IPopsicleList UnpackedSfixed32List { - get { return PrepareBuilder().unpackedSfixed32_; } - } - public int UnpackedSfixed32Count { - get { return result.UnpackedSfixed32Count; } - } - public int GetUnpackedSfixed32(int index) { - return result.GetUnpackedSfixed32(index); - } - public Builder SetUnpackedSfixed32(int index, int value) { - PrepareBuilder(); - result.unpackedSfixed32_[index] = value; - return this; - } - public Builder AddUnpackedSfixed32(int value) { - PrepareBuilder(); - result.unpackedSfixed32_.Add(value); - return this; - } - public Builder AddRangeUnpackedSfixed32(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedSfixed32_.Add(values); - return this; - } - public Builder ClearUnpackedSfixed32() { - PrepareBuilder(); - result.unpackedSfixed32_.Clear(); - return this; - } - - public pbc::IPopsicleList UnpackedSfixed64List { - get { return PrepareBuilder().unpackedSfixed64_; } - } - public int UnpackedSfixed64Count { - get { return result.UnpackedSfixed64Count; } - } - public long GetUnpackedSfixed64(int index) { - return result.GetUnpackedSfixed64(index); - } - public Builder SetUnpackedSfixed64(int index, long value) { - PrepareBuilder(); - result.unpackedSfixed64_[index] = value; - return this; - } - public Builder AddUnpackedSfixed64(long value) { - PrepareBuilder(); - result.unpackedSfixed64_.Add(value); - return this; - } - public Builder AddRangeUnpackedSfixed64(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedSfixed64_.Add(values); - return this; - } - public Builder ClearUnpackedSfixed64() { - PrepareBuilder(); - result.unpackedSfixed64_.Clear(); - return this; - } - - public pbc::IPopsicleList UnpackedFloatList { - get { return PrepareBuilder().unpackedFloat_; } - } - public int UnpackedFloatCount { - get { return result.UnpackedFloatCount; } - } - public float GetUnpackedFloat(int index) { - return result.GetUnpackedFloat(index); - } - public Builder SetUnpackedFloat(int index, float value) { - PrepareBuilder(); - result.unpackedFloat_[index] = value; - return this; - } - public Builder AddUnpackedFloat(float value) { - PrepareBuilder(); - result.unpackedFloat_.Add(value); - return this; - } - public Builder AddRangeUnpackedFloat(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedFloat_.Add(values); - return this; - } - public Builder ClearUnpackedFloat() { - PrepareBuilder(); - result.unpackedFloat_.Clear(); - return this; - } - - public pbc::IPopsicleList UnpackedDoubleList { - get { return PrepareBuilder().unpackedDouble_; } - } - public int UnpackedDoubleCount { - get { return result.UnpackedDoubleCount; } - } - public double GetUnpackedDouble(int index) { - return result.GetUnpackedDouble(index); - } - public Builder SetUnpackedDouble(int index, double value) { - PrepareBuilder(); - result.unpackedDouble_[index] = value; - return this; - } - public Builder AddUnpackedDouble(double value) { - PrepareBuilder(); - result.unpackedDouble_.Add(value); - return this; - } - public Builder AddRangeUnpackedDouble(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedDouble_.Add(values); - return this; - } - public Builder ClearUnpackedDouble() { - PrepareBuilder(); - result.unpackedDouble_.Clear(); - return this; - } - - public pbc::IPopsicleList UnpackedBoolList { - get { return PrepareBuilder().unpackedBool_; } - } - public int UnpackedBoolCount { - get { return result.UnpackedBoolCount; } - } - public bool GetUnpackedBool(int index) { - return result.GetUnpackedBool(index); - } - public Builder SetUnpackedBool(int index, bool value) { - PrepareBuilder(); - result.unpackedBool_[index] = value; - return this; - } - public Builder AddUnpackedBool(bool value) { - PrepareBuilder(); - result.unpackedBool_.Add(value); - return this; - } - public Builder AddRangeUnpackedBool(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedBool_.Add(values); - return this; - } - public Builder ClearUnpackedBool() { - PrepareBuilder(); - result.unpackedBool_.Clear(); - return this; - } - - public pbc::IPopsicleList UnpackedEnumList { - get { return PrepareBuilder().unpackedEnum_; } - } - public int UnpackedEnumCount { - get { return result.UnpackedEnumCount; } - } - public global::Google.ProtocolBuffers.TestProtos.UnpackedTypesForeignEnumLite GetUnpackedEnum(int index) { - return result.GetUnpackedEnum(index); - } - public Builder SetUnpackedEnum(int index, global::Google.ProtocolBuffers.TestProtos.UnpackedTypesForeignEnumLite value) { - PrepareBuilder(); - result.unpackedEnum_[index] = value; - return this; - } - public Builder AddUnpackedEnum(global::Google.ProtocolBuffers.TestProtos.UnpackedTypesForeignEnumLite value) { - PrepareBuilder(); - result.unpackedEnum_.Add(value); - return this; - } - public Builder AddRangeUnpackedEnum(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedEnum_.Add(values); - return this; - } - public Builder ClearUnpackedEnum() { - PrepareBuilder(); - result.unpackedEnum_.Clear(); - return this; - } - } - static TestUnpackedTypesLite() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.Descriptor, null); - } - } - - [global::System.SerializableAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class BucketOfBytes : pb::GeneratedMessageLite { - private BucketOfBytes() { } - private static readonly BucketOfBytes defaultInstance = new BucketOfBytes().MakeReadOnly(); - private static readonly string[] _bucketOfBytesFieldNames = new string[] { "value" }; - private static readonly uint[] _bucketOfBytesFieldTags = new uint[] { 10 }; - public static BucketOfBytes DefaultInstance { - get { return defaultInstance; } - } - - public override BucketOfBytes DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override BucketOfBytes ThisMessage { - get { return this; } - } - - public const int ValueFieldNumber = 1; - private bool hasValue; - private pb::ByteString value_ = pb::ByteString.Empty; - public bool HasValue { - get { return hasValue; } - } - public pb::ByteString Value { - get { return value_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _bucketOfBytesFieldNames; - if (hasValue) { - output.WriteBytes(1, field_names[0], Value); - } - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasValue) { - size += pb::CodedOutputStream.ComputeBytesSize(1, Value); - } - memoizedSerializedSize = size; - return size; - } - #region Lite runtime methods - public override int GetHashCode() { - int hash = GetType().GetHashCode(); - if (hasValue) hash ^= value_.GetHashCode(); - return hash; - } - - public override bool Equals(object obj) { - BucketOfBytes other = obj as BucketOfBytes; - if (other == null) return false; - if (hasValue != other.hasValue || (hasValue && !value_.Equals(other.value_))) return false; - return true; - } - - public override void PrintTo(global::System.IO.TextWriter writer) { - PrintField("value", hasValue, value_, writer); - } - #endregion - - public static BucketOfBytes ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static BucketOfBytes ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static BucketOfBytes ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static BucketOfBytes ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static BucketOfBytes ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static BucketOfBytes ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static BucketOfBytes ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static BucketOfBytes ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static BucketOfBytes ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static BucketOfBytes ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private BucketOfBytes MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(BucketOfBytes prototype) { - return new Builder(prototype); - } - - [global::System.SerializableAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilderLite { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(BucketOfBytes cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private BucketOfBytes result; - - private BucketOfBytes PrepareBuilder() { - if (resultIsReadOnly) { - BucketOfBytes original = result; - result = new BucketOfBytes(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override BucketOfBytes MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override BucketOfBytes DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.BucketOfBytes.DefaultInstance; } - } - - public override BucketOfBytes BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessageLite other) { - if (other is BucketOfBytes) { - return MergeFrom((BucketOfBytes) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(BucketOfBytes other) { - if (other == global::Google.ProtocolBuffers.TestProtos.BucketOfBytes.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasValue) { - Value = other.Value; - } - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_bucketOfBytesFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _bucketOfBytesFieldTags[field_ordinal]; - else { - ParseUnknownField(input, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - return this; - } - ParseUnknownField(input, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasValue = input.ReadBytes(ref result.value_); - break; - } - } - } - - return this; - } - - - public bool HasValue { - get { return result.hasValue; } - } - public pb::ByteString Value { - get { return result.Value; } - set { SetValue(value); } - } - public Builder SetValue(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasValue = true; - result.value_ = value; - return this; - } - public Builder ClearValue() { - PrepareBuilder(); - result.hasValue = false; - result.value_ = pb::ByteString.Empty; - return this; - } - } - static BucketOfBytes() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.Descriptor, null); - } - } - - [global::System.SerializableAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class BucketOfBytesEx : pb::GeneratedMessageLite { - private BucketOfBytesEx() { } - private static readonly BucketOfBytesEx defaultInstance = new BucketOfBytesEx().MakeReadOnly(); - private static readonly string[] _bucketOfBytesExFieldNames = new string[] { "value", "value2" }; - private static readonly uint[] _bucketOfBytesExFieldTags = new uint[] { 10, 2042 }; - public static BucketOfBytesEx DefaultInstance { - get { return defaultInstance; } - } - - public override BucketOfBytesEx DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override BucketOfBytesEx ThisMessage { - get { return this; } - } - - public const int ValueFieldNumber = 1; - private bool hasValue; - private pb::ByteString value_ = pb::ByteString.Empty; - public bool HasValue { - get { return hasValue; } - } - public pb::ByteString Value { - get { return value_; } - } - - public const int Value2FieldNumber = 255; - private bool hasValue2; - private pb::ByteString value2_ = pb::ByteString.Empty; - public bool HasValue2 { - get { return hasValue2; } - } - public pb::ByteString Value2 { - get { return value2_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _bucketOfBytesExFieldNames; - if (hasValue) { - output.WriteBytes(1, field_names[0], Value); - } - if (hasValue2) { - output.WriteBytes(255, field_names[1], Value2); - } - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasValue) { - size += pb::CodedOutputStream.ComputeBytesSize(1, Value); - } - if (hasValue2) { - size += pb::CodedOutputStream.ComputeBytesSize(255, Value2); - } - memoizedSerializedSize = size; - return size; - } - #region Lite runtime methods - public override int GetHashCode() { - int hash = GetType().GetHashCode(); - if (hasValue) hash ^= value_.GetHashCode(); - if (hasValue2) hash ^= value2_.GetHashCode(); - return hash; - } - - public override bool Equals(object obj) { - BucketOfBytesEx other = obj as BucketOfBytesEx; - if (other == null) return false; - if (hasValue != other.hasValue || (hasValue && !value_.Equals(other.value_))) return false; - if (hasValue2 != other.hasValue2 || (hasValue2 && !value2_.Equals(other.value2_))) return false; - return true; - } - - public override void PrintTo(global::System.IO.TextWriter writer) { - PrintField("value", hasValue, value_, writer); - PrintField("value2", hasValue2, value2_, writer); - } - #endregion - - public static BucketOfBytesEx ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static BucketOfBytesEx ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static BucketOfBytesEx ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static BucketOfBytesEx ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static BucketOfBytesEx ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static BucketOfBytesEx ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static BucketOfBytesEx ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static BucketOfBytesEx ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static BucketOfBytesEx ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static BucketOfBytesEx ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private BucketOfBytesEx MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(BucketOfBytesEx prototype) { - return new Builder(prototype); - } - - [global::System.SerializableAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilderLite { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(BucketOfBytesEx cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private BucketOfBytesEx result; - - private BucketOfBytesEx PrepareBuilder() { - if (resultIsReadOnly) { - BucketOfBytesEx original = result; - result = new BucketOfBytesEx(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override BucketOfBytesEx MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override BucketOfBytesEx DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.BucketOfBytesEx.DefaultInstance; } - } - - public override BucketOfBytesEx BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessageLite other) { - if (other is BucketOfBytesEx) { - return MergeFrom((BucketOfBytesEx) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(BucketOfBytesEx other) { - if (other == global::Google.ProtocolBuffers.TestProtos.BucketOfBytesEx.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasValue) { - Value = other.Value; - } - if (other.HasValue2) { - Value2 = other.Value2; - } - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_bucketOfBytesExFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _bucketOfBytesExFieldTags[field_ordinal]; - else { - ParseUnknownField(input, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - return this; - } - ParseUnknownField(input, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasValue = input.ReadBytes(ref result.value_); - break; - } - case 2042: { - result.hasValue2 = input.ReadBytes(ref result.value2_); - break; - } - } - } - - return this; - } - - - public bool HasValue { - get { return result.hasValue; } - } - public pb::ByteString Value { - get { return result.Value; } - set { SetValue(value); } - } - public Builder SetValue(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasValue = true; - result.value_ = value; - return this; - } - public Builder ClearValue() { - PrepareBuilder(); - result.hasValue = false; - result.value_ = pb::ByteString.Empty; - return this; - } - - public bool HasValue2 { - get { return result.hasValue2; } - } - public pb::ByteString Value2 { - get { return result.Value2; } - set { SetValue2(value); } - } - public Builder SetValue2(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasValue2 = true; - result.value2_ = value; - return this; - } - public Builder ClearValue2() { - PrepareBuilder(); - result.hasValue2 = false; - result.value2_ = pb::ByteString.Empty; - return this; - } - } - static BucketOfBytesEx() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasLiteProtoFile.Descriptor, null); - } - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestImportLiteProtoFile.cs b/src/ProtocolBuffersLite.Test/TestProtos/UnitTestImportLiteProtoFile.cs deleted file mode 100644 index fe1f408..0000000 --- a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestImportLiteProtoFile.cs +++ /dev/null @@ -1,308 +0,0 @@ -// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.TestProtos { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class UnitTestImportLiteProtoFile { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - #endregion - #region Extensions - internal static readonly object Descriptor; - static UnitTestImportLiteProtoFile() { - Descriptor = null; - } - #endregion - - } - #region Enums - public enum ImportEnumLite { - IMPORT_LITE_FOO = 7, - IMPORT_LITE_BAR = 8, - IMPORT_LITE_BAZ = 9, - } - - #endregion - - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class ImportMessageLite : pb::GeneratedMessageLite { - private ImportMessageLite() { } - private static readonly ImportMessageLite defaultInstance = new ImportMessageLite().MakeReadOnly(); - private static readonly string[] _importMessageLiteFieldNames = new string[] { "d" }; - private static readonly uint[] _importMessageLiteFieldTags = new uint[] { 8 }; - public static ImportMessageLite DefaultInstance { - get { return defaultInstance; } - } - - public override ImportMessageLite DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override ImportMessageLite ThisMessage { - get { return this; } - } - - public const int DFieldNumber = 1; - private bool hasD; - private int d_; - public bool HasD { - get { return hasD; } - } - public int D { - get { return d_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _importMessageLiteFieldNames; - if (hasD) { - output.WriteInt32(1, field_names[0], D); - } - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasD) { - size += pb::CodedOutputStream.ComputeInt32Size(1, D); - } - memoizedSerializedSize = size; - return size; - } - #region Lite runtime methods - public override int GetHashCode() { - int hash = GetType().GetHashCode(); - if (hasD) hash ^= d_.GetHashCode(); - return hash; - } - - public override bool Equals(object obj) { - ImportMessageLite other = obj as ImportMessageLite; - if (other == null) return false; - if (hasD != other.hasD || (hasD && !d_.Equals(other.d_))) return false; - return true; - } - - public override void PrintTo(global::System.IO.TextWriter writer) { - PrintField("d", hasD, d_, writer); - } - #endregion - - public static ImportMessageLite ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ImportMessageLite ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ImportMessageLite ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ImportMessageLite ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ImportMessageLite ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ImportMessageLite ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ImportMessageLite ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ImportMessageLite ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ImportMessageLite ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ImportMessageLite ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private ImportMessageLite MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ImportMessageLite prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilderLite { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(ImportMessageLite cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private ImportMessageLite result; - - private ImportMessageLite PrepareBuilder() { - if (resultIsReadOnly) { - ImportMessageLite original = result; - result = new ImportMessageLite(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override ImportMessageLite MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override ImportMessageLite DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.ImportMessageLite.DefaultInstance; } - } - - public override ImportMessageLite BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessageLite other) { - if (other is ImportMessageLite) { - return MergeFrom((ImportMessageLite) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ImportMessageLite other) { - if (other == global::Google.ProtocolBuffers.TestProtos.ImportMessageLite.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasD) { - D = other.D; - } - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_importMessageLiteFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _importMessageLiteFieldTags[field_ordinal]; - else { - ParseUnknownField(input, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - return this; - } - ParseUnknownField(input, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasD = input.ReadInt32(ref result.d_); - break; - } - } - } - - return this; - } - - - public bool HasD { - get { return result.hasD; } - } - public int D { - get { return result.D; } - set { SetD(value); } - } - public Builder SetD(int value) { - PrepareBuilder(); - result.hasD = true; - result.d_ = value; - return this; - } - public Builder ClearD() { - PrepareBuilder(); - result.hasD = false; - result.d_ = 0; - return this; - } - } - static ImportMessageLite() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestImportLiteProtoFile.Descriptor, null); - } - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestImportProtoFile.cs b/src/ProtocolBuffersLite.Test/TestProtos/UnitTestImportProtoFile.cs deleted file mode 100644 index 4cae2b8..0000000 --- a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestImportProtoFile.cs +++ /dev/null @@ -1,346 +0,0 @@ -// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.TestProtos { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class UnitTestImportProtoFile { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_import_ImportMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static UnitTestImportProtoFile() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CiVnb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfaW1wb3J0LnByb3RvEhhwcm90", - "b2J1Zl91bml0dGVzdF9pbXBvcnQaJGdvb2dsZS9wcm90b2J1Zi9jc2hhcnBf", - "b3B0aW9ucy5wcm90byIaCg1JbXBvcnRNZXNzYWdlEgkKAWQYASABKAUqPAoK", - "SW1wb3J0RW51bRIOCgpJTVBPUlRfRk9PEAcSDgoKSU1QT1JUX0JBUhAIEg4K", - "CklNUE9SVF9CQVoQCUJbChhjb20uZ29vZ2xlLnByb3RvYnVmLnRlc3RIAcI+", - "PAohR29vZ2xlLlByb3RvY29sQnVmZmVycy5UZXN0UHJvdG9zEhdVbml0VGVz", - "dEltcG9ydFByb3RvRmlsZQ==")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_protobuf_unittest_import_ImportMessage__Descriptor = Descriptor.MessageTypes[0]; - internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_import_ImportMessage__Descriptor, - new string[] { "D", }); - pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); - RegisterAllExtensions(registry); - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.RegisterAllExtensions(registry); - return registry; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, - }, assigner); - } - #endregion - - } - #region Enums - public enum ImportEnum { - IMPORT_FOO = 7, - IMPORT_BAR = 8, - IMPORT_BAZ = 9, - } - - #endregion - - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class ImportMessage : pb::GeneratedMessage { - private ImportMessage() { } - private static readonly ImportMessage defaultInstance = new ImportMessage().MakeReadOnly(); - private static readonly string[] _importMessageFieldNames = new string[] { "d" }; - private static readonly uint[] _importMessageFieldTags = new uint[] { 8 }; - public static ImportMessage DefaultInstance { - get { return defaultInstance; } - } - - public override ImportMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override ImportMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestImportProtoFile.internal__static_protobuf_unittest_import_ImportMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestImportProtoFile.internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable; } - } - - public const int DFieldNumber = 1; - private bool hasD; - private int d_; - public bool HasD { - get { return hasD; } - } - public int D { - get { return d_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _importMessageFieldNames; - if (hasD) { - output.WriteInt32(1, field_names[0], D); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasD) { - size += pb::CodedOutputStream.ComputeInt32Size(1, D); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static ImportMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ImportMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ImportMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ImportMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ImportMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ImportMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ImportMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ImportMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ImportMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ImportMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private ImportMessage MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ImportMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(ImportMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private ImportMessage result; - - private ImportMessage PrepareBuilder() { - if (resultIsReadOnly) { - ImportMessage original = result; - result = new ImportMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override ImportMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.ImportMessage.Descriptor; } - } - - public override ImportMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.ImportMessage.DefaultInstance; } - } - - public override ImportMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ImportMessage) { - return MergeFrom((ImportMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ImportMessage other) { - if (other == global::Google.ProtocolBuffers.TestProtos.ImportMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasD) { - D = other.D; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_importMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _importMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasD = input.ReadInt32(ref result.d_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasD { - get { return result.hasD; } - } - public int D { - get { return result.D; } - set { SetD(value); } - } - public Builder SetD(int value) { - PrepareBuilder(); - result.hasD = true; - result.d_ = value; - return this; - } - public Builder ClearD() { - PrepareBuilder(); - result.hasD = false; - result.d_ = 0; - return this; - } - } - static ImportMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestImportProtoFile.Descriptor, null); - } - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestLiteImportNonLiteProtoFile.cs b/src/ProtocolBuffersLite.Test/TestProtos/UnitTestLiteImportNonLiteProtoFile.cs deleted file mode 100644 index 1ed2969..0000000 --- a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestLiteImportNonLiteProtoFile.cs +++ /dev/null @@ -1,324 +0,0 @@ -// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.TestProtos { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class UnitTestLiteImportNonLiteProtoFile { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - #endregion - #region Extensions - internal static readonly object Descriptor; - static UnitTestLiteImportNonLiteProtoFile() { - Descriptor = null; - } - #endregion - - } - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestLiteImportsNonlite : pb::GeneratedMessageLite { - private TestLiteImportsNonlite() { } - private static readonly TestLiteImportsNonlite defaultInstance = new TestLiteImportsNonlite().MakeReadOnly(); - private static readonly string[] _testLiteImportsNonliteFieldNames = new string[] { "message" }; - private static readonly uint[] _testLiteImportsNonliteFieldTags = new uint[] { 10 }; - public static TestLiteImportsNonlite DefaultInstance { - get { return defaultInstance; } - } - - public override TestLiteImportsNonlite DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestLiteImportsNonlite ThisMessage { - get { return this; } - } - - public const int MessageFieldNumber = 1; - private bool hasMessage; - private global::Google.ProtocolBuffers.TestProtos.TestAllTypes message_; - public bool HasMessage { - get { return hasMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes Message { - get { return message_ ?? global::Google.ProtocolBuffers.TestProtos.TestAllTypes.DefaultInstance; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testLiteImportsNonliteFieldNames; - if (hasMessage) { - output.WriteMessage(1, field_names[0], Message); - } - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasMessage) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Message); - } - memoizedSerializedSize = size; - return size; - } - #region Lite runtime methods - public override int GetHashCode() { - int hash = GetType().GetHashCode(); - if (hasMessage) hash ^= message_.GetHashCode(); - return hash; - } - - public override bool Equals(object obj) { - TestLiteImportsNonlite other = obj as TestLiteImportsNonlite; - if (other == null) return false; - if (hasMessage != other.hasMessage || (hasMessage && !message_.Equals(other.message_))) return false; - return true; - } - - public override void PrintTo(global::System.IO.TextWriter writer) { - PrintField("message", hasMessage, message_, writer); - } - #endregion - - public static TestLiteImportsNonlite ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestLiteImportsNonlite ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestLiteImportsNonlite ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestLiteImportsNonlite ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestLiteImportsNonlite ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestLiteImportsNonlite ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestLiteImportsNonlite ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestLiteImportsNonlite ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestLiteImportsNonlite ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestLiteImportsNonlite ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestLiteImportsNonlite MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestLiteImportsNonlite prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilderLite { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestLiteImportsNonlite cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestLiteImportsNonlite result; - - private TestLiteImportsNonlite PrepareBuilder() { - if (resultIsReadOnly) { - TestLiteImportsNonlite original = result; - result = new TestLiteImportsNonlite(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestLiteImportsNonlite MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override TestLiteImportsNonlite DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestLiteImportsNonlite.DefaultInstance; } - } - - public override TestLiteImportsNonlite BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessageLite other) { - if (other is TestLiteImportsNonlite) { - return MergeFrom((TestLiteImportsNonlite) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestLiteImportsNonlite other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestLiteImportsNonlite.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasMessage) { - MergeMessage(other.Message); - } - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testLiteImportsNonliteFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testLiteImportsNonliteFieldTags[field_ordinal]; - else { - ParseUnknownField(input, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - return this; - } - ParseUnknownField(input, extensionRegistry, tag, field_name); - break; - } - case 10: { - global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.CreateBuilder(); - if (result.hasMessage) { - subBuilder.MergeFrom(Message); - } - input.ReadMessage(subBuilder, extensionRegistry); - Message = subBuilder.BuildPartial(); - break; - } - } - } - - return this; - } - - - public bool HasMessage { - get { return result.hasMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes Message { - get { return result.Message; } - set { SetMessage(value); } - } - public Builder SetMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasMessage = true; - result.message_ = value; - return this; - } - public Builder SetMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasMessage = true; - result.message_ = builderForValue.Build(); - return this; - } - public Builder MergeMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasMessage && - result.message_ != global::Google.ProtocolBuffers.TestProtos.TestAllTypes.DefaultInstance) { - result.message_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.CreateBuilder(result.message_).MergeFrom(value).BuildPartial(); - } else { - result.message_ = value; - } - result.hasMessage = true; - return this; - } - public Builder ClearMessage() { - PrepareBuilder(); - result.hasMessage = false; - result.message_ = null; - return this; - } - } - static TestLiteImportsNonlite() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteImportNonLiteProtoFile.Descriptor, null); - } - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestLiteProtoFile.cs b/src/ProtocolBuffersLite.Test/TestProtos/UnitTestLiteProtoFile.cs deleted file mode 100644 index 5ddc727..0000000 --- a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestLiteProtoFile.cs +++ /dev/null @@ -1,8948 +0,0 @@ -// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.TestProtos { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class UnitTestLiteProtoFile { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalInt32ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalInt64ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalUint32ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalUint64ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalSint32ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalSint64ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalFixed32ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalFixed64ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalSfixed32ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalSfixed64ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalFloatExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalDoubleExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalBoolExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalStringExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalBytesExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalGroupExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalNestedMessageExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalForeignMessageExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalImportMessageExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalNestedEnumExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalForeignEnumExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalImportEnumExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalStringPieceExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalCordExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedInt32ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedInt64ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedUint32ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedUint64ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedSint32ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedSint64ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedFixed32ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedFixed64ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedSfixed32ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedSfixed64ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedFloatExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedDoubleExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedBoolExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedStringExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedBytesExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedGroupExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedNestedMessageExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedForeignMessageExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedImportMessageExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedNestedEnumExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedForeignEnumExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedImportEnumExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedStringPieceExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedCordExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultInt32ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultInt64ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultUint32ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultUint64ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultSint32ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultSint64ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultFixed32ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultFixed64ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultSfixed32ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultSfixed64ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultFloatExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultDoubleExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultBoolExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultStringExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultBytesExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultNestedEnumExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultForeignEnumExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultImportEnumExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultStringPieceExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultCordExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedInt32ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedInt64ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedUint32ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedUint64ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedSint32ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedSint64ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedFixed32ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedFixed64ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedSfixed32ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedSfixed64ExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedFloatExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedDoubleExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedBoolExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedEnumExtensionLite); - registry.Add(global::Google.ProtocolBuffers.TestProtos.TestNestedExtensionLite.NestedExtension); - } - #endregion - #region Extensions - public const int OptionalInt32ExtensionLiteFieldNumber = 1; - public static pb::GeneratedExtensionLite OptionalInt32ExtensionLite; - public const int OptionalInt64ExtensionLiteFieldNumber = 2; - public static pb::GeneratedExtensionLite OptionalInt64ExtensionLite; - public const int OptionalUint32ExtensionLiteFieldNumber = 3; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionLite OptionalUint32ExtensionLite; - public const int OptionalUint64ExtensionLiteFieldNumber = 4; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionLite OptionalUint64ExtensionLite; - public const int OptionalSint32ExtensionLiteFieldNumber = 5; - public static pb::GeneratedExtensionLite OptionalSint32ExtensionLite; - public const int OptionalSint64ExtensionLiteFieldNumber = 6; - public static pb::GeneratedExtensionLite OptionalSint64ExtensionLite; - public const int OptionalFixed32ExtensionLiteFieldNumber = 7; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionLite OptionalFixed32ExtensionLite; - public const int OptionalFixed64ExtensionLiteFieldNumber = 8; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionLite OptionalFixed64ExtensionLite; - public const int OptionalSfixed32ExtensionLiteFieldNumber = 9; - public static pb::GeneratedExtensionLite OptionalSfixed32ExtensionLite; - public const int OptionalSfixed64ExtensionLiteFieldNumber = 10; - public static pb::GeneratedExtensionLite OptionalSfixed64ExtensionLite; - public const int OptionalFloatExtensionLiteFieldNumber = 11; - public static pb::GeneratedExtensionLite OptionalFloatExtensionLite; - public const int OptionalDoubleExtensionLiteFieldNumber = 12; - public static pb::GeneratedExtensionLite OptionalDoubleExtensionLite; - public const int OptionalBoolExtensionLiteFieldNumber = 13; - public static pb::GeneratedExtensionLite OptionalBoolExtensionLite; - public const int OptionalStringExtensionLiteFieldNumber = 14; - public static pb::GeneratedExtensionLite OptionalStringExtensionLite; - public const int OptionalBytesExtensionLiteFieldNumber = 15; - public static pb::GeneratedExtensionLite OptionalBytesExtensionLite; - public const int OptionalGroupExtensionLiteFieldNumber = 16; - public static pb::GeneratedExtensionLite OptionalGroupExtensionLite; - public const int OptionalNestedMessageExtensionLiteFieldNumber = 18; - public static pb::GeneratedExtensionLite OptionalNestedMessageExtensionLite; - public const int OptionalForeignMessageExtensionLiteFieldNumber = 19; - public static pb::GeneratedExtensionLite OptionalForeignMessageExtensionLite; - public const int OptionalImportMessageExtensionLiteFieldNumber = 20; - public static pb::GeneratedExtensionLite OptionalImportMessageExtensionLite; - public const int OptionalNestedEnumExtensionLiteFieldNumber = 21; - public static pb::GeneratedExtensionLite OptionalNestedEnumExtensionLite; - public const int OptionalForeignEnumExtensionLiteFieldNumber = 22; - public static pb::GeneratedExtensionLite OptionalForeignEnumExtensionLite; - public const int OptionalImportEnumExtensionLiteFieldNumber = 23; - public static pb::GeneratedExtensionLite OptionalImportEnumExtensionLite; - public const int OptionalStringPieceExtensionLiteFieldNumber = 24; - public static pb::GeneratedExtensionLite OptionalStringPieceExtensionLite; - public const int OptionalCordExtensionLiteFieldNumber = 25; - public static pb::GeneratedExtensionLite OptionalCordExtensionLite; - public const int RepeatedInt32ExtensionLiteFieldNumber = 31; - public static pb::GeneratedRepeatExtensionLite RepeatedInt32ExtensionLite; - public const int RepeatedInt64ExtensionLiteFieldNumber = 32; - public static pb::GeneratedRepeatExtensionLite RepeatedInt64ExtensionLite; - public const int RepeatedUint32ExtensionLiteFieldNumber = 33; - [global::System.CLSCompliant(false)] - public static pb::GeneratedRepeatExtensionLite RepeatedUint32ExtensionLite; - public const int RepeatedUint64ExtensionLiteFieldNumber = 34; - [global::System.CLSCompliant(false)] - public static pb::GeneratedRepeatExtensionLite RepeatedUint64ExtensionLite; - public const int RepeatedSint32ExtensionLiteFieldNumber = 35; - public static pb::GeneratedRepeatExtensionLite RepeatedSint32ExtensionLite; - public const int RepeatedSint64ExtensionLiteFieldNumber = 36; - public static pb::GeneratedRepeatExtensionLite RepeatedSint64ExtensionLite; - public const int RepeatedFixed32ExtensionLiteFieldNumber = 37; - [global::System.CLSCompliant(false)] - public static pb::GeneratedRepeatExtensionLite RepeatedFixed32ExtensionLite; - public const int RepeatedFixed64ExtensionLiteFieldNumber = 38; - [global::System.CLSCompliant(false)] - public static pb::GeneratedRepeatExtensionLite RepeatedFixed64ExtensionLite; - public const int RepeatedSfixed32ExtensionLiteFieldNumber = 39; - public static pb::GeneratedRepeatExtensionLite RepeatedSfixed32ExtensionLite; - public const int RepeatedSfixed64ExtensionLiteFieldNumber = 40; - public static pb::GeneratedRepeatExtensionLite RepeatedSfixed64ExtensionLite; - public const int RepeatedFloatExtensionLiteFieldNumber = 41; - public static pb::GeneratedRepeatExtensionLite RepeatedFloatExtensionLite; - public const int RepeatedDoubleExtensionLiteFieldNumber = 42; - public static pb::GeneratedRepeatExtensionLite RepeatedDoubleExtensionLite; - public const int RepeatedBoolExtensionLiteFieldNumber = 43; - public static pb::GeneratedRepeatExtensionLite RepeatedBoolExtensionLite; - public const int RepeatedStringExtensionLiteFieldNumber = 44; - public static pb::GeneratedRepeatExtensionLite RepeatedStringExtensionLite; - public const int RepeatedBytesExtensionLiteFieldNumber = 45; - public static pb::GeneratedRepeatExtensionLite RepeatedBytesExtensionLite; - public const int RepeatedGroupExtensionLiteFieldNumber = 46; - public static pb::GeneratedRepeatExtensionLite RepeatedGroupExtensionLite; - public const int RepeatedNestedMessageExtensionLiteFieldNumber = 48; - public static pb::GeneratedRepeatExtensionLite RepeatedNestedMessageExtensionLite; - public const int RepeatedForeignMessageExtensionLiteFieldNumber = 49; - public static pb::GeneratedRepeatExtensionLite RepeatedForeignMessageExtensionLite; - public const int RepeatedImportMessageExtensionLiteFieldNumber = 50; - public static pb::GeneratedRepeatExtensionLite RepeatedImportMessageExtensionLite; - public const int RepeatedNestedEnumExtensionLiteFieldNumber = 51; - public static pb::GeneratedRepeatExtensionLite RepeatedNestedEnumExtensionLite; - public const int RepeatedForeignEnumExtensionLiteFieldNumber = 52; - public static pb::GeneratedRepeatExtensionLite RepeatedForeignEnumExtensionLite; - public const int RepeatedImportEnumExtensionLiteFieldNumber = 53; - public static pb::GeneratedRepeatExtensionLite RepeatedImportEnumExtensionLite; - public const int RepeatedStringPieceExtensionLiteFieldNumber = 54; - public static pb::GeneratedRepeatExtensionLite RepeatedStringPieceExtensionLite; - public const int RepeatedCordExtensionLiteFieldNumber = 55; - public static pb::GeneratedRepeatExtensionLite RepeatedCordExtensionLite; - public const int DefaultInt32ExtensionLiteFieldNumber = 61; - public static pb::GeneratedExtensionLite DefaultInt32ExtensionLite; - public const int DefaultInt64ExtensionLiteFieldNumber = 62; - public static pb::GeneratedExtensionLite DefaultInt64ExtensionLite; - public const int DefaultUint32ExtensionLiteFieldNumber = 63; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionLite DefaultUint32ExtensionLite; - public const int DefaultUint64ExtensionLiteFieldNumber = 64; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionLite DefaultUint64ExtensionLite; - public const int DefaultSint32ExtensionLiteFieldNumber = 65; - public static pb::GeneratedExtensionLite DefaultSint32ExtensionLite; - public const int DefaultSint64ExtensionLiteFieldNumber = 66; - public static pb::GeneratedExtensionLite DefaultSint64ExtensionLite; - public const int DefaultFixed32ExtensionLiteFieldNumber = 67; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionLite DefaultFixed32ExtensionLite; - public const int DefaultFixed64ExtensionLiteFieldNumber = 68; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionLite DefaultFixed64ExtensionLite; - public const int DefaultSfixed32ExtensionLiteFieldNumber = 69; - public static pb::GeneratedExtensionLite DefaultSfixed32ExtensionLite; - public const int DefaultSfixed64ExtensionLiteFieldNumber = 70; - public static pb::GeneratedExtensionLite DefaultSfixed64ExtensionLite; - public const int DefaultFloatExtensionLiteFieldNumber = 71; - public static pb::GeneratedExtensionLite DefaultFloatExtensionLite; - public const int DefaultDoubleExtensionLiteFieldNumber = 72; - public static pb::GeneratedExtensionLite DefaultDoubleExtensionLite; - public const int DefaultBoolExtensionLiteFieldNumber = 73; - public static pb::GeneratedExtensionLite DefaultBoolExtensionLite; - public const int DefaultStringExtensionLiteFieldNumber = 74; - public static pb::GeneratedExtensionLite DefaultStringExtensionLite; - public const int DefaultBytesExtensionLiteFieldNumber = 75; - public static pb::GeneratedExtensionLite DefaultBytesExtensionLite; - public const int DefaultNestedEnumExtensionLiteFieldNumber = 81; - public static pb::GeneratedExtensionLite DefaultNestedEnumExtensionLite; - public const int DefaultForeignEnumExtensionLiteFieldNumber = 82; - public static pb::GeneratedExtensionLite DefaultForeignEnumExtensionLite; - public const int DefaultImportEnumExtensionLiteFieldNumber = 83; - public static pb::GeneratedExtensionLite DefaultImportEnumExtensionLite; - public const int DefaultStringPieceExtensionLiteFieldNumber = 84; - public static pb::GeneratedExtensionLite DefaultStringPieceExtensionLite; - public const int DefaultCordExtensionLiteFieldNumber = 85; - public static pb::GeneratedExtensionLite DefaultCordExtensionLite; - public const int PackedInt32ExtensionLiteFieldNumber = 90; - public static pb::GeneratedRepeatExtensionLite PackedInt32ExtensionLite; - public const int PackedInt64ExtensionLiteFieldNumber = 91; - public static pb::GeneratedRepeatExtensionLite PackedInt64ExtensionLite; - public const int PackedUint32ExtensionLiteFieldNumber = 92; - [global::System.CLSCompliant(false)] - public static pb::GeneratedRepeatExtensionLite PackedUint32ExtensionLite; - public const int PackedUint64ExtensionLiteFieldNumber = 93; - [global::System.CLSCompliant(false)] - public static pb::GeneratedRepeatExtensionLite PackedUint64ExtensionLite; - public const int PackedSint32ExtensionLiteFieldNumber = 94; - public static pb::GeneratedRepeatExtensionLite PackedSint32ExtensionLite; - public const int PackedSint64ExtensionLiteFieldNumber = 95; - public static pb::GeneratedRepeatExtensionLite PackedSint64ExtensionLite; - public const int PackedFixed32ExtensionLiteFieldNumber = 96; - [global::System.CLSCompliant(false)] - public static pb::GeneratedRepeatExtensionLite PackedFixed32ExtensionLite; - public const int PackedFixed64ExtensionLiteFieldNumber = 97; - [global::System.CLSCompliant(false)] - public static pb::GeneratedRepeatExtensionLite PackedFixed64ExtensionLite; - public const int PackedSfixed32ExtensionLiteFieldNumber = 98; - public static pb::GeneratedRepeatExtensionLite PackedSfixed32ExtensionLite; - public const int PackedSfixed64ExtensionLiteFieldNumber = 99; - public static pb::GeneratedRepeatExtensionLite PackedSfixed64ExtensionLite; - public const int PackedFloatExtensionLiteFieldNumber = 100; - public static pb::GeneratedRepeatExtensionLite PackedFloatExtensionLite; - public const int PackedDoubleExtensionLiteFieldNumber = 101; - public static pb::GeneratedRepeatExtensionLite PackedDoubleExtensionLite; - public const int PackedBoolExtensionLiteFieldNumber = 102; - public static pb::GeneratedRepeatExtensionLite PackedBoolExtensionLite; - public const int PackedEnumExtensionLiteFieldNumber = 103; - public static pb::GeneratedRepeatExtensionLite PackedEnumExtensionLite; - #endregion - - #region Static variables - #endregion - #region Extensions - internal static readonly object Descriptor; - static UnitTestLiteProtoFile() { - Descriptor = null; - global::Google.ProtocolBuffers.TestProtos.TestNestedExtensionLite.NestedExtension = - new pb::GeneratedExtensionLite( - "protobuf_unittest.TestNestedExtensionLite.nested_extension", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - default(int), - null, - null, - global::Google.ProtocolBuffers.TestProtos.TestNestedExtensionLite.NestedExtensionFieldNumber, - pbd::FieldType.Int32); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalInt32ExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.optional_int32_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - default(int), - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalInt32ExtensionLiteFieldNumber, - pbd::FieldType.Int32); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalInt64ExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.optional_int64_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - default(long), - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalInt64ExtensionLiteFieldNumber, - pbd::FieldType.Int64); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalUint32ExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.optional_uint32_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - default(uint), - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalUint32ExtensionLiteFieldNumber, - pbd::FieldType.UInt32); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalUint64ExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.optional_uint64_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - default(ulong), - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalUint64ExtensionLiteFieldNumber, - pbd::FieldType.UInt64); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalSint32ExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.optional_sint32_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - default(int), - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalSint32ExtensionLiteFieldNumber, - pbd::FieldType.SInt32); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalSint64ExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.optional_sint64_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - default(long), - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalSint64ExtensionLiteFieldNumber, - pbd::FieldType.SInt64); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalFixed32ExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.optional_fixed32_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - default(uint), - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalFixed32ExtensionLiteFieldNumber, - pbd::FieldType.Fixed32); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalFixed64ExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.optional_fixed64_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - default(ulong), - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalFixed64ExtensionLiteFieldNumber, - pbd::FieldType.Fixed64); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalSfixed32ExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.optional_sfixed32_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - default(int), - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalSfixed32ExtensionLiteFieldNumber, - pbd::FieldType.SFixed32); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalSfixed64ExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.optional_sfixed64_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - default(long), - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalSfixed64ExtensionLiteFieldNumber, - pbd::FieldType.SFixed64); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalFloatExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.optional_float_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - default(float), - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalFloatExtensionLiteFieldNumber, - pbd::FieldType.Float); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalDoubleExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.optional_double_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - default(double), - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalDoubleExtensionLiteFieldNumber, - pbd::FieldType.Double); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalBoolExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.optional_bool_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - default(bool), - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalBoolExtensionLiteFieldNumber, - pbd::FieldType.Bool); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalStringExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.optional_string_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - null, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalStringExtensionLiteFieldNumber, - pbd::FieldType.String); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalBytesExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.optional_bytes_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - null, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalBytesExtensionLiteFieldNumber, - pbd::FieldType.Bytes); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalGroupExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.optionalgroup_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - null, - global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension_lite.DefaultInstance, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalGroupExtensionLiteFieldNumber, - pbd::FieldType.Group); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalNestedMessageExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.optional_nested_message_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - null, - global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedMessage.DefaultInstance, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalNestedMessageExtensionLiteFieldNumber, - pbd::FieldType.Message); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalForeignMessageExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.optional_foreign_message_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - null, - global::Google.ProtocolBuffers.TestProtos.ForeignMessageLite.DefaultInstance, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalForeignMessageExtensionLiteFieldNumber, - pbd::FieldType.Message); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalImportMessageExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.optional_import_message_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - null, - global::Google.ProtocolBuffers.TestProtos.ImportMessageLite.DefaultInstance, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalImportMessageExtensionLiteFieldNumber, - pbd::FieldType.Message); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalNestedEnumExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.optional_nested_enum_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - default(global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedEnum), - null, - new EnumLiteMap(), - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalNestedEnumExtensionLiteFieldNumber, - pbd::FieldType.Enum); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalForeignEnumExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.optional_foreign_enum_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - default(global::Google.ProtocolBuffers.TestProtos.ForeignEnumLite), - null, - new EnumLiteMap(), - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalForeignEnumExtensionLiteFieldNumber, - pbd::FieldType.Enum); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalImportEnumExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.optional_import_enum_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - default(global::Google.ProtocolBuffers.TestProtos.ImportEnumLite), - null, - new EnumLiteMap(), - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalImportEnumExtensionLiteFieldNumber, - pbd::FieldType.Enum); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalStringPieceExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.optional_string_piece_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - null, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalStringPieceExtensionLiteFieldNumber, - pbd::FieldType.String); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalCordExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.optional_cord_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - null, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.OptionalCordExtensionLiteFieldNumber, - pbd::FieldType.String); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedInt32ExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest.repeated_int32_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedInt32ExtensionLiteFieldNumber, - pbd::FieldType.Int32, - false); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedInt64ExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest.repeated_int64_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedInt64ExtensionLiteFieldNumber, - pbd::FieldType.Int64, - false); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedUint32ExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest.repeated_uint32_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedUint32ExtensionLiteFieldNumber, - pbd::FieldType.UInt32, - false); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedUint64ExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest.repeated_uint64_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedUint64ExtensionLiteFieldNumber, - pbd::FieldType.UInt64, - false); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedSint32ExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest.repeated_sint32_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedSint32ExtensionLiteFieldNumber, - pbd::FieldType.SInt32, - false); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedSint64ExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest.repeated_sint64_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedSint64ExtensionLiteFieldNumber, - pbd::FieldType.SInt64, - false); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedFixed32ExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest.repeated_fixed32_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedFixed32ExtensionLiteFieldNumber, - pbd::FieldType.Fixed32, - false); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedFixed64ExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest.repeated_fixed64_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedFixed64ExtensionLiteFieldNumber, - pbd::FieldType.Fixed64, - false); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedSfixed32ExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest.repeated_sfixed32_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedSfixed32ExtensionLiteFieldNumber, - pbd::FieldType.SFixed32, - false); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedSfixed64ExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest.repeated_sfixed64_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedSfixed64ExtensionLiteFieldNumber, - pbd::FieldType.SFixed64, - false); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedFloatExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest.repeated_float_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedFloatExtensionLiteFieldNumber, - pbd::FieldType.Float, - false); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedDoubleExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest.repeated_double_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedDoubleExtensionLiteFieldNumber, - pbd::FieldType.Double, - false); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedBoolExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest.repeated_bool_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedBoolExtensionLiteFieldNumber, - pbd::FieldType.Bool, - false); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedStringExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest.repeated_string_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedStringExtensionLiteFieldNumber, - pbd::FieldType.String, - false); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedBytesExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest.repeated_bytes_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedBytesExtensionLiteFieldNumber, - pbd::FieldType.Bytes, - false); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedGroupExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest.repeatedgroup_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension_lite.DefaultInstance, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedGroupExtensionLiteFieldNumber, - pbd::FieldType.Group, - false); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedNestedMessageExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest.repeated_nested_message_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedMessage.DefaultInstance, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedNestedMessageExtensionLiteFieldNumber, - pbd::FieldType.Message, - false); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedForeignMessageExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest.repeated_foreign_message_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - global::Google.ProtocolBuffers.TestProtos.ForeignMessageLite.DefaultInstance, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedForeignMessageExtensionLiteFieldNumber, - pbd::FieldType.Message, - false); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedImportMessageExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest.repeated_import_message_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - global::Google.ProtocolBuffers.TestProtos.ImportMessageLite.DefaultInstance, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedImportMessageExtensionLiteFieldNumber, - pbd::FieldType.Message, - false); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedNestedEnumExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest.repeated_nested_enum_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - null, - new EnumLiteMap(), - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedNestedEnumExtensionLiteFieldNumber, - pbd::FieldType.Enum, - false); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedForeignEnumExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest.repeated_foreign_enum_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - null, - new EnumLiteMap(), - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedForeignEnumExtensionLiteFieldNumber, - pbd::FieldType.Enum, - false); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedImportEnumExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest.repeated_import_enum_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - null, - new EnumLiteMap(), - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedImportEnumExtensionLiteFieldNumber, - pbd::FieldType.Enum, - false); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedStringPieceExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest.repeated_string_piece_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedStringPieceExtensionLiteFieldNumber, - pbd::FieldType.String, - false); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedCordExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest.repeated_cord_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.RepeatedCordExtensionLiteFieldNumber, - pbd::FieldType.String, - false); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultInt32ExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.default_int32_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - 41, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultInt32ExtensionLiteFieldNumber, - pbd::FieldType.Int32); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultInt64ExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.default_int64_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - 42L, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultInt64ExtensionLiteFieldNumber, - pbd::FieldType.Int64); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultUint32ExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.default_uint32_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - 43, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultUint32ExtensionLiteFieldNumber, - pbd::FieldType.UInt32); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultUint64ExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.default_uint64_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - 44UL, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultUint64ExtensionLiteFieldNumber, - pbd::FieldType.UInt64); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultSint32ExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.default_sint32_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - -45, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultSint32ExtensionLiteFieldNumber, - pbd::FieldType.SInt32); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultSint64ExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.default_sint64_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - 46, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultSint64ExtensionLiteFieldNumber, - pbd::FieldType.SInt64); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultFixed32ExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.default_fixed32_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - 47, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultFixed32ExtensionLiteFieldNumber, - pbd::FieldType.Fixed32); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultFixed64ExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.default_fixed64_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - 48, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultFixed64ExtensionLiteFieldNumber, - pbd::FieldType.Fixed64); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultSfixed32ExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.default_sfixed32_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - 49, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultSfixed32ExtensionLiteFieldNumber, - pbd::FieldType.SFixed32); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultSfixed64ExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.default_sfixed64_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - -50, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultSfixed64ExtensionLiteFieldNumber, - pbd::FieldType.SFixed64); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultFloatExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.default_float_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - 51.5F, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultFloatExtensionLiteFieldNumber, - pbd::FieldType.Float); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultDoubleExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.default_double_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - 52000D, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultDoubleExtensionLiteFieldNumber, - pbd::FieldType.Double); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultBoolExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.default_bool_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - true, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultBoolExtensionLiteFieldNumber, - pbd::FieldType.Bool); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultStringExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.default_string_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - "hello", - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultStringExtensionLiteFieldNumber, - pbd::FieldType.String); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultBytesExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.default_bytes_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - pb::ByteString.FromBase64("d29ybGQ="), - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultBytesExtensionLiteFieldNumber, - pbd::FieldType.Bytes); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultNestedEnumExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.default_nested_enum_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedEnum.BAR, - null, - new EnumLiteMap(), - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultNestedEnumExtensionLiteFieldNumber, - pbd::FieldType.Enum); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultForeignEnumExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.default_foreign_enum_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - global::Google.ProtocolBuffers.TestProtos.ForeignEnumLite.FOREIGN_LITE_BAR, - null, - new EnumLiteMap(), - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultForeignEnumExtensionLiteFieldNumber, - pbd::FieldType.Enum); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultImportEnumExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.default_import_enum_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - global::Google.ProtocolBuffers.TestProtos.ImportEnumLite.IMPORT_LITE_BAR, - null, - new EnumLiteMap(), - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultImportEnumExtensionLiteFieldNumber, - pbd::FieldType.Enum); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultStringPieceExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.default_string_piece_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - "abc", - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultStringPieceExtensionLiteFieldNumber, - pbd::FieldType.String); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultCordExtensionLite = - new pb::GeneratedExtensionLite( - "protobuf_unittest.default_cord_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance, - "123", - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.DefaultCordExtensionLiteFieldNumber, - pbd::FieldType.String); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedInt32ExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest.packed_int32_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestPackedExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedInt32ExtensionLiteFieldNumber, - pbd::FieldType.Int32, - true); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedInt64ExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest.packed_int64_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestPackedExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedInt64ExtensionLiteFieldNumber, - pbd::FieldType.Int64, - true); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedUint32ExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest.packed_uint32_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestPackedExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedUint32ExtensionLiteFieldNumber, - pbd::FieldType.UInt32, - true); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedUint64ExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest.packed_uint64_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestPackedExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedUint64ExtensionLiteFieldNumber, - pbd::FieldType.UInt64, - true); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedSint32ExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest.packed_sint32_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestPackedExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedSint32ExtensionLiteFieldNumber, - pbd::FieldType.SInt32, - true); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedSint64ExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest.packed_sint64_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestPackedExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedSint64ExtensionLiteFieldNumber, - pbd::FieldType.SInt64, - true); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedFixed32ExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest.packed_fixed32_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestPackedExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedFixed32ExtensionLiteFieldNumber, - pbd::FieldType.Fixed32, - true); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedFixed64ExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest.packed_fixed64_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestPackedExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedFixed64ExtensionLiteFieldNumber, - pbd::FieldType.Fixed64, - true); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedSfixed32ExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest.packed_sfixed32_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestPackedExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedSfixed32ExtensionLiteFieldNumber, - pbd::FieldType.SFixed32, - true); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedSfixed64ExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest.packed_sfixed64_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestPackedExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedSfixed64ExtensionLiteFieldNumber, - pbd::FieldType.SFixed64, - true); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedFloatExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest.packed_float_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestPackedExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedFloatExtensionLiteFieldNumber, - pbd::FieldType.Float, - true); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedDoubleExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest.packed_double_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestPackedExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedDoubleExtensionLiteFieldNumber, - pbd::FieldType.Double, - true); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedBoolExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest.packed_bool_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestPackedExtensionsLite.DefaultInstance, - null, - null, - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedBoolExtensionLiteFieldNumber, - pbd::FieldType.Bool, - true); - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedEnumExtensionLite = - new pb::GeneratedRepeatExtensionLite( - "protobuf_unittest.packed_enum_extension_lite", - global::Google.ProtocolBuffers.TestProtos.TestPackedExtensionsLite.DefaultInstance, - null, - new EnumLiteMap(), - global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.PackedEnumExtensionLiteFieldNumber, - pbd::FieldType.Enum, - true); - } - #endregion - - } - #region Enums - public enum ForeignEnumLite { - FOREIGN_LITE_FOO = 4, - FOREIGN_LITE_BAR = 5, - FOREIGN_LITE_BAZ = 6, - } - - #endregion - - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestAllTypesLite : pb::GeneratedMessageLite { - private TestAllTypesLite() { } - private static readonly TestAllTypesLite defaultInstance = new TestAllTypesLite().MakeReadOnly(); - private static readonly string[] _testAllTypesLiteFieldNames = new string[] { "default_bool", "default_bytes", "default_cord", "default_double", "default_fixed32", "default_fixed64", "default_float", "default_foreign_enum", "default_import_enum", "default_int32", "default_int64", "default_nested_enum", "default_sfixed32", "default_sfixed64", "default_sint32", "default_sint64", "default_string", "default_string_piece", "default_uint32", "default_uint64", "optional_bool", "optional_bytes", "optional_cord", "optional_double", "optional_fixed32", "optional_fixed64", "optional_float", "optional_foreign_enum", "optional_foreign_message", "optional_import_enum", "optional_import_message", "optional_int32", "optional_int64", "optional_nested_enum", "optional_nested_message", "optional_sfixed32", "optional_sfixed64", "optional_sint32", "optional_sint64", "optional_string", "optional_string_piece", "optional_uint32", "optional_uint64", "optionalgroup", "repeated_bool", "repeated_bytes", "repeated_cord", "repeated_double", "repeated_fixed32", "repeated_fixed64", "repeated_float", "repeated_foreign_enum", "repeated_foreign_message", "repeated_import_enum", "repeated_import_message", "repeated_int32", "repeated_int64", "repeated_nested_enum", "repeated_nested_message", "repeated_sfixed32", "repeated_sfixed64", "repeated_sint32", "repeated_sint64", "repeated_string", "repeated_string_piece", "repeated_uint32", "repeated_uint64", "repeatedgroup" }; - private static readonly uint[] _testAllTypesLiteFieldTags = new uint[] { 584, 602, 682, 577, 541, 545, 573, 656, 664, 488, 496, 648, 557, 561, 520, 528, 594, 674, 504, 512, 104, 122, 202, 97, 61, 65, 93, 176, 154, 184, 162, 8, 16, 168, 146, 77, 81, 40, 48, 114, 194, 24, 32, 131, 344, 362, 442, 337, 301, 305, 333, 416, 394, 424, 402, 248, 256, 408, 386, 317, 321, 280, 288, 354, 434, 264, 272, 371 }; - public static TestAllTypesLite DefaultInstance { - get { return defaultInstance; } - } - - public override TestAllTypesLite DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestAllTypesLite ThisMessage { - get { return this; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - public enum NestedEnum { - FOO = 1, - BAR = 2, - BAZ = 3, - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class NestedMessage : pb::GeneratedMessageLite { - private NestedMessage() { } - private static readonly NestedMessage defaultInstance = new NestedMessage().MakeReadOnly(); - private static readonly string[] _nestedMessageFieldNames = new string[] { "bb" }; - private static readonly uint[] _nestedMessageFieldTags = new uint[] { 8 }; - public static NestedMessage DefaultInstance { - get { return defaultInstance; } - } - - public override NestedMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override NestedMessage ThisMessage { - get { return this; } - } - - public const int BbFieldNumber = 1; - private bool hasBb; - private int bb_; - public bool HasBb { - get { return hasBb; } - } - public int Bb { - get { return bb_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _nestedMessageFieldNames; - if (hasBb) { - output.WriteInt32(1, field_names[0], Bb); - } - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasBb) { - size += pb::CodedOutputStream.ComputeInt32Size(1, Bb); - } - memoizedSerializedSize = size; - return size; - } - #region Lite runtime methods - public override int GetHashCode() { - int hash = GetType().GetHashCode(); - if (hasBb) hash ^= bb_.GetHashCode(); - return hash; - } - - public override bool Equals(object obj) { - NestedMessage other = obj as NestedMessage; - if (other == null) return false; - if (hasBb != other.hasBb || (hasBb && !bb_.Equals(other.bb_))) return false; - return true; - } - - public override void PrintTo(global::System.IO.TextWriter writer) { - PrintField("bb", hasBb, bb_, writer); - } - #endregion - - public static NestedMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NestedMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NestedMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NestedMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NestedMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NestedMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static NestedMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NestedMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private NestedMessage MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(NestedMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilderLite { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(NestedMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private NestedMessage result; - - private NestedMessage PrepareBuilder() { - if (resultIsReadOnly) { - NestedMessage original = result; - result = new NestedMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override NestedMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override NestedMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedMessage.DefaultInstance; } - } - - public override NestedMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessageLite other) { - if (other is NestedMessage) { - return MergeFrom((NestedMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(NestedMessage other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasBb) { - Bb = other.Bb; - } - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_nestedMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _nestedMessageFieldTags[field_ordinal]; - else { - ParseUnknownField(input, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - return this; - } - ParseUnknownField(input, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasBb = input.ReadInt32(ref result.bb_); - break; - } - } - } - - return this; - } - - - public bool HasBb { - get { return result.hasBb; } - } - public int Bb { - get { return result.Bb; } - set { SetBb(value); } - } - public Builder SetBb(int value) { - PrepareBuilder(); - result.hasBb = true; - result.bb_ = value; - return this; - } - public Builder ClearBb() { - PrepareBuilder(); - result.hasBb = false; - result.bb_ = 0; - return this; - } - } - static NestedMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class OptionalGroup : pb::GeneratedMessageLite { - private OptionalGroup() { } - private static readonly OptionalGroup defaultInstance = new OptionalGroup().MakeReadOnly(); - private static readonly string[] _optionalGroupFieldNames = new string[] { "a" }; - private static readonly uint[] _optionalGroupFieldTags = new uint[] { 136 }; - public static OptionalGroup DefaultInstance { - get { return defaultInstance; } - } - - public override OptionalGroup DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override OptionalGroup ThisMessage { - get { return this; } - } - - public const int AFieldNumber = 17; - private bool hasA; - private int a_; - public bool HasA { - get { return hasA; } - } - public int A { - get { return a_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _optionalGroupFieldNames; - if (hasA) { - output.WriteInt32(17, field_names[0], A); - } - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA) { - size += pb::CodedOutputStream.ComputeInt32Size(17, A); - } - memoizedSerializedSize = size; - return size; - } - #region Lite runtime methods - public override int GetHashCode() { - int hash = GetType().GetHashCode(); - if (hasA) hash ^= a_.GetHashCode(); - return hash; - } - - public override bool Equals(object obj) { - OptionalGroup other = obj as OptionalGroup; - if (other == null) return false; - if (hasA != other.hasA || (hasA && !a_.Equals(other.a_))) return false; - return true; - } - - public override void PrintTo(global::System.IO.TextWriter writer) { - PrintField("a", hasA, a_, writer); - } - #endregion - - public static OptionalGroup ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OptionalGroup ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OptionalGroup ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OptionalGroup ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OptionalGroup ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OptionalGroup ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static OptionalGroup ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static OptionalGroup ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static OptionalGroup ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OptionalGroup ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private OptionalGroup MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(OptionalGroup prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilderLite { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(OptionalGroup cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private OptionalGroup result; - - private OptionalGroup PrepareBuilder() { - if (resultIsReadOnly) { - OptionalGroup original = result; - result = new OptionalGroup(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override OptionalGroup MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override OptionalGroup DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.OptionalGroup.DefaultInstance; } - } - - public override OptionalGroup BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessageLite other) { - if (other is OptionalGroup) { - return MergeFrom((OptionalGroup) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(OptionalGroup other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.OptionalGroup.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA) { - A = other.A; - } - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_optionalGroupFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _optionalGroupFieldTags[field_ordinal]; - else { - ParseUnknownField(input, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - return this; - } - ParseUnknownField(input, extensionRegistry, tag, field_name); - break; - } - case 136: { - result.hasA = input.ReadInt32(ref result.a_); - break; - } - } - } - - return this; - } - - - public bool HasA { - get { return result.hasA; } - } - public int A { - get { return result.A; } - set { SetA(value); } - } - public Builder SetA(int value) { - PrepareBuilder(); - result.hasA = true; - result.a_ = value; - return this; - } - public Builder ClearA() { - PrepareBuilder(); - result.hasA = false; - result.a_ = 0; - return this; - } - } - static OptionalGroup() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class RepeatedGroup : pb::GeneratedMessageLite { - private RepeatedGroup() { } - private static readonly RepeatedGroup defaultInstance = new RepeatedGroup().MakeReadOnly(); - private static readonly string[] _repeatedGroupFieldNames = new string[] { "a" }; - private static readonly uint[] _repeatedGroupFieldTags = new uint[] { 376 }; - public static RepeatedGroup DefaultInstance { - get { return defaultInstance; } - } - - public override RepeatedGroup DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override RepeatedGroup ThisMessage { - get { return this; } - } - - public const int AFieldNumber = 47; - private bool hasA; - private int a_; - public bool HasA { - get { return hasA; } - } - public int A { - get { return a_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _repeatedGroupFieldNames; - if (hasA) { - output.WriteInt32(47, field_names[0], A); - } - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA) { - size += pb::CodedOutputStream.ComputeInt32Size(47, A); - } - memoizedSerializedSize = size; - return size; - } - #region Lite runtime methods - public override int GetHashCode() { - int hash = GetType().GetHashCode(); - if (hasA) hash ^= a_.GetHashCode(); - return hash; - } - - public override bool Equals(object obj) { - RepeatedGroup other = obj as RepeatedGroup; - if (other == null) return false; - if (hasA != other.hasA || (hasA && !a_.Equals(other.a_))) return false; - return true; - } - - public override void PrintTo(global::System.IO.TextWriter writer) { - PrintField("a", hasA, a_, writer); - } - #endregion - - public static RepeatedGroup ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RepeatedGroup ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RepeatedGroup ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RepeatedGroup ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RepeatedGroup ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RepeatedGroup ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static RepeatedGroup ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static RepeatedGroup ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static RepeatedGroup ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RepeatedGroup ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private RepeatedGroup MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(RepeatedGroup prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilderLite { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(RepeatedGroup cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private RepeatedGroup result; - - private RepeatedGroup PrepareBuilder() { - if (resultIsReadOnly) { - RepeatedGroup original = result; - result = new RepeatedGroup(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override RepeatedGroup MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override RepeatedGroup DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.RepeatedGroup.DefaultInstance; } - } - - public override RepeatedGroup BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessageLite other) { - if (other is RepeatedGroup) { - return MergeFrom((RepeatedGroup) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(RepeatedGroup other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.RepeatedGroup.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA) { - A = other.A; - } - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_repeatedGroupFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _repeatedGroupFieldTags[field_ordinal]; - else { - ParseUnknownField(input, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - return this; - } - ParseUnknownField(input, extensionRegistry, tag, field_name); - break; - } - case 376: { - result.hasA = input.ReadInt32(ref result.a_); - break; - } - } - } - - return this; - } - - - public bool HasA { - get { return result.hasA; } - } - public int A { - get { return result.A; } - set { SetA(value); } - } - public Builder SetA(int value) { - PrepareBuilder(); - result.hasA = true; - result.a_ = value; - return this; - } - public Builder ClearA() { - PrepareBuilder(); - result.hasA = false; - result.a_ = 0; - return this; - } - } - static RepeatedGroup() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.Descriptor, null); - } - } - - } - #endregion - - public const int OptionalInt32FieldNumber = 1; - private bool hasOptionalInt32; - private int optionalInt32_; - public bool HasOptionalInt32 { - get { return hasOptionalInt32; } - } - public int OptionalInt32 { - get { return optionalInt32_; } - } - - public const int OptionalInt64FieldNumber = 2; - private bool hasOptionalInt64; - private long optionalInt64_; - public bool HasOptionalInt64 { - get { return hasOptionalInt64; } - } - public long OptionalInt64 { - get { return optionalInt64_; } - } - - public const int OptionalUint32FieldNumber = 3; - private bool hasOptionalUint32; - private uint optionalUint32_; - public bool HasOptionalUint32 { - get { return hasOptionalUint32; } - } - [global::System.CLSCompliant(false)] - public uint OptionalUint32 { - get { return optionalUint32_; } - } - - public const int OptionalUint64FieldNumber = 4; - private bool hasOptionalUint64; - private ulong optionalUint64_; - public bool HasOptionalUint64 { - get { return hasOptionalUint64; } - } - [global::System.CLSCompliant(false)] - public ulong OptionalUint64 { - get { return optionalUint64_; } - } - - public const int OptionalSint32FieldNumber = 5; - private bool hasOptionalSint32; - private int optionalSint32_; - public bool HasOptionalSint32 { - get { return hasOptionalSint32; } - } - public int OptionalSint32 { - get { return optionalSint32_; } - } - - public const int OptionalSint64FieldNumber = 6; - private bool hasOptionalSint64; - private long optionalSint64_; - public bool HasOptionalSint64 { - get { return hasOptionalSint64; } - } - public long OptionalSint64 { - get { return optionalSint64_; } - } - - public const int OptionalFixed32FieldNumber = 7; - private bool hasOptionalFixed32; - private uint optionalFixed32_; - public bool HasOptionalFixed32 { - get { return hasOptionalFixed32; } - } - [global::System.CLSCompliant(false)] - public uint OptionalFixed32 { - get { return optionalFixed32_; } - } - - public const int OptionalFixed64FieldNumber = 8; - private bool hasOptionalFixed64; - private ulong optionalFixed64_; - public bool HasOptionalFixed64 { - get { return hasOptionalFixed64; } - } - [global::System.CLSCompliant(false)] - public ulong OptionalFixed64 { - get { return optionalFixed64_; } - } - - public const int OptionalSfixed32FieldNumber = 9; - private bool hasOptionalSfixed32; - private int optionalSfixed32_; - public bool HasOptionalSfixed32 { - get { return hasOptionalSfixed32; } - } - public int OptionalSfixed32 { - get { return optionalSfixed32_; } - } - - public const int OptionalSfixed64FieldNumber = 10; - private bool hasOptionalSfixed64; - private long optionalSfixed64_; - public bool HasOptionalSfixed64 { - get { return hasOptionalSfixed64; } - } - public long OptionalSfixed64 { - get { return optionalSfixed64_; } - } - - public const int OptionalFloatFieldNumber = 11; - private bool hasOptionalFloat; - private float optionalFloat_; - public bool HasOptionalFloat { - get { return hasOptionalFloat; } - } - public float OptionalFloat { - get { return optionalFloat_; } - } - - public const int OptionalDoubleFieldNumber = 12; - private bool hasOptionalDouble; - private double optionalDouble_; - public bool HasOptionalDouble { - get { return hasOptionalDouble; } - } - public double OptionalDouble { - get { return optionalDouble_; } - } - - public const int OptionalBoolFieldNumber = 13; - private bool hasOptionalBool; - private bool optionalBool_; - public bool HasOptionalBool { - get { return hasOptionalBool; } - } - public bool OptionalBool { - get { return optionalBool_; } - } - - public const int OptionalStringFieldNumber = 14; - private bool hasOptionalString; - private string optionalString_ = ""; - public bool HasOptionalString { - get { return hasOptionalString; } - } - public string OptionalString { - get { return optionalString_; } - } - - public const int OptionalBytesFieldNumber = 15; - private bool hasOptionalBytes; - private pb::ByteString optionalBytes_ = pb::ByteString.Empty; - public bool HasOptionalBytes { - get { return hasOptionalBytes; } - } - public pb::ByteString OptionalBytes { - get { return optionalBytes_; } - } - - public const int OptionalGroupFieldNumber = 16; - private bool hasOptionalGroup; - private global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.OptionalGroup optionalGroup_; - public bool HasOptionalGroup { - get { return hasOptionalGroup; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.OptionalGroup OptionalGroup { - get { return optionalGroup_ ?? global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.OptionalGroup.DefaultInstance; } - } - - public const int OptionalNestedMessageFieldNumber = 18; - private bool hasOptionalNestedMessage; - private global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedMessage optionalNestedMessage_; - public bool HasOptionalNestedMessage { - get { return hasOptionalNestedMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedMessage OptionalNestedMessage { - get { return optionalNestedMessage_ ?? global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedMessage.DefaultInstance; } - } - - public const int OptionalForeignMessageFieldNumber = 19; - private bool hasOptionalForeignMessage; - private global::Google.ProtocolBuffers.TestProtos.ForeignMessageLite optionalForeignMessage_; - public bool HasOptionalForeignMessage { - get { return hasOptionalForeignMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessageLite OptionalForeignMessage { - get { return optionalForeignMessage_ ?? global::Google.ProtocolBuffers.TestProtos.ForeignMessageLite.DefaultInstance; } - } - - public const int OptionalImportMessageFieldNumber = 20; - private bool hasOptionalImportMessage; - private global::Google.ProtocolBuffers.TestProtos.ImportMessageLite optionalImportMessage_; - public bool HasOptionalImportMessage { - get { return hasOptionalImportMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportMessageLite OptionalImportMessage { - get { return optionalImportMessage_ ?? global::Google.ProtocolBuffers.TestProtos.ImportMessageLite.DefaultInstance; } - } - - public const int OptionalNestedEnumFieldNumber = 21; - private bool hasOptionalNestedEnum; - private global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedEnum optionalNestedEnum_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedEnum.FOO; - public bool HasOptionalNestedEnum { - get { return hasOptionalNestedEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedEnum OptionalNestedEnum { - get { return optionalNestedEnum_; } - } - - public const int OptionalForeignEnumFieldNumber = 22; - private bool hasOptionalForeignEnum; - private global::Google.ProtocolBuffers.TestProtos.ForeignEnumLite optionalForeignEnum_ = global::Google.ProtocolBuffers.TestProtos.ForeignEnumLite.FOREIGN_LITE_FOO; - public bool HasOptionalForeignEnum { - get { return hasOptionalForeignEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnumLite OptionalForeignEnum { - get { return optionalForeignEnum_; } - } - - public const int OptionalImportEnumFieldNumber = 23; - private bool hasOptionalImportEnum; - private global::Google.ProtocolBuffers.TestProtos.ImportEnumLite optionalImportEnum_ = global::Google.ProtocolBuffers.TestProtos.ImportEnumLite.IMPORT_LITE_FOO; - public bool HasOptionalImportEnum { - get { return hasOptionalImportEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportEnumLite OptionalImportEnum { - get { return optionalImportEnum_; } - } - - public const int OptionalStringPieceFieldNumber = 24; - private bool hasOptionalStringPiece; - private string optionalStringPiece_ = ""; - public bool HasOptionalStringPiece { - get { return hasOptionalStringPiece; } - } - public string OptionalStringPiece { - get { return optionalStringPiece_; } - } - - public const int OptionalCordFieldNumber = 25; - private bool hasOptionalCord; - private string optionalCord_ = ""; - public bool HasOptionalCord { - get { return hasOptionalCord; } - } - public string OptionalCord { - get { return optionalCord_; } - } - - public const int RepeatedInt32FieldNumber = 31; - private pbc::PopsicleList repeatedInt32_ = new pbc::PopsicleList(); - public scg::IList RepeatedInt32List { - get { return pbc::Lists.AsReadOnly(repeatedInt32_); } - } - public int RepeatedInt32Count { - get { return repeatedInt32_.Count; } - } - public int GetRepeatedInt32(int index) { - return repeatedInt32_[index]; - } - - public const int RepeatedInt64FieldNumber = 32; - private pbc::PopsicleList repeatedInt64_ = new pbc::PopsicleList(); - public scg::IList RepeatedInt64List { - get { return pbc::Lists.AsReadOnly(repeatedInt64_); } - } - public int RepeatedInt64Count { - get { return repeatedInt64_.Count; } - } - public long GetRepeatedInt64(int index) { - return repeatedInt64_[index]; - } - - public const int RepeatedUint32FieldNumber = 33; - private pbc::PopsicleList repeatedUint32_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList RepeatedUint32List { - get { return pbc::Lists.AsReadOnly(repeatedUint32_); } - } - public int RepeatedUint32Count { - get { return repeatedUint32_.Count; } - } - [global::System.CLSCompliant(false)] - public uint GetRepeatedUint32(int index) { - return repeatedUint32_[index]; - } - - public const int RepeatedUint64FieldNumber = 34; - private pbc::PopsicleList repeatedUint64_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList RepeatedUint64List { - get { return pbc::Lists.AsReadOnly(repeatedUint64_); } - } - public int RepeatedUint64Count { - get { return repeatedUint64_.Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetRepeatedUint64(int index) { - return repeatedUint64_[index]; - } - - public const int RepeatedSint32FieldNumber = 35; - private pbc::PopsicleList repeatedSint32_ = new pbc::PopsicleList(); - public scg::IList RepeatedSint32List { - get { return pbc::Lists.AsReadOnly(repeatedSint32_); } - } - public int RepeatedSint32Count { - get { return repeatedSint32_.Count; } - } - public int GetRepeatedSint32(int index) { - return repeatedSint32_[index]; - } - - public const int RepeatedSint64FieldNumber = 36; - private pbc::PopsicleList repeatedSint64_ = new pbc::PopsicleList(); - public scg::IList RepeatedSint64List { - get { return pbc::Lists.AsReadOnly(repeatedSint64_); } - } - public int RepeatedSint64Count { - get { return repeatedSint64_.Count; } - } - public long GetRepeatedSint64(int index) { - return repeatedSint64_[index]; - } - - public const int RepeatedFixed32FieldNumber = 37; - private pbc::PopsicleList repeatedFixed32_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList RepeatedFixed32List { - get { return pbc::Lists.AsReadOnly(repeatedFixed32_); } - } - public int RepeatedFixed32Count { - get { return repeatedFixed32_.Count; } - } - [global::System.CLSCompliant(false)] - public uint GetRepeatedFixed32(int index) { - return repeatedFixed32_[index]; - } - - public const int RepeatedFixed64FieldNumber = 38; - private pbc::PopsicleList repeatedFixed64_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList RepeatedFixed64List { - get { return pbc::Lists.AsReadOnly(repeatedFixed64_); } - } - public int RepeatedFixed64Count { - get { return repeatedFixed64_.Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetRepeatedFixed64(int index) { - return repeatedFixed64_[index]; - } - - public const int RepeatedSfixed32FieldNumber = 39; - private pbc::PopsicleList repeatedSfixed32_ = new pbc::PopsicleList(); - public scg::IList RepeatedSfixed32List { - get { return pbc::Lists.AsReadOnly(repeatedSfixed32_); } - } - public int RepeatedSfixed32Count { - get { return repeatedSfixed32_.Count; } - } - public int GetRepeatedSfixed32(int index) { - return repeatedSfixed32_[index]; - } - - public const int RepeatedSfixed64FieldNumber = 40; - private pbc::PopsicleList repeatedSfixed64_ = new pbc::PopsicleList(); - public scg::IList RepeatedSfixed64List { - get { return pbc::Lists.AsReadOnly(repeatedSfixed64_); } - } - public int RepeatedSfixed64Count { - get { return repeatedSfixed64_.Count; } - } - public long GetRepeatedSfixed64(int index) { - return repeatedSfixed64_[index]; - } - - public const int RepeatedFloatFieldNumber = 41; - private pbc::PopsicleList repeatedFloat_ = new pbc::PopsicleList(); - public scg::IList RepeatedFloatList { - get { return pbc::Lists.AsReadOnly(repeatedFloat_); } - } - public int RepeatedFloatCount { - get { return repeatedFloat_.Count; } - } - public float GetRepeatedFloat(int index) { - return repeatedFloat_[index]; - } - - public const int RepeatedDoubleFieldNumber = 42; - private pbc::PopsicleList repeatedDouble_ = new pbc::PopsicleList(); - public scg::IList RepeatedDoubleList { - get { return pbc::Lists.AsReadOnly(repeatedDouble_); } - } - public int RepeatedDoubleCount { - get { return repeatedDouble_.Count; } - } - public double GetRepeatedDouble(int index) { - return repeatedDouble_[index]; - } - - public const int RepeatedBoolFieldNumber = 43; - private pbc::PopsicleList repeatedBool_ = new pbc::PopsicleList(); - public scg::IList RepeatedBoolList { - get { return pbc::Lists.AsReadOnly(repeatedBool_); } - } - public int RepeatedBoolCount { - get { return repeatedBool_.Count; } - } - public bool GetRepeatedBool(int index) { - return repeatedBool_[index]; - } - - public const int RepeatedStringFieldNumber = 44; - private pbc::PopsicleList repeatedString_ = new pbc::PopsicleList(); - public scg::IList RepeatedStringList { - get { return pbc::Lists.AsReadOnly(repeatedString_); } - } - public int RepeatedStringCount { - get { return repeatedString_.Count; } - } - public string GetRepeatedString(int index) { - return repeatedString_[index]; - } - - public const int RepeatedBytesFieldNumber = 45; - private pbc::PopsicleList repeatedBytes_ = new pbc::PopsicleList(); - public scg::IList RepeatedBytesList { - get { return pbc::Lists.AsReadOnly(repeatedBytes_); } - } - public int RepeatedBytesCount { - get { return repeatedBytes_.Count; } - } - public pb::ByteString GetRepeatedBytes(int index) { - return repeatedBytes_[index]; - } - - public const int RepeatedGroupFieldNumber = 46; - private pbc::PopsicleList repeatedGroup_ = new pbc::PopsicleList(); - public scg::IList RepeatedGroupList { - get { return repeatedGroup_; } - } - public int RepeatedGroupCount { - get { return repeatedGroup_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.RepeatedGroup GetRepeatedGroup(int index) { - return repeatedGroup_[index]; - } - - public const int RepeatedNestedMessageFieldNumber = 48; - private pbc::PopsicleList repeatedNestedMessage_ = new pbc::PopsicleList(); - public scg::IList RepeatedNestedMessageList { - get { return repeatedNestedMessage_; } - } - public int RepeatedNestedMessageCount { - get { return repeatedNestedMessage_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedMessage GetRepeatedNestedMessage(int index) { - return repeatedNestedMessage_[index]; - } - - public const int RepeatedForeignMessageFieldNumber = 49; - private pbc::PopsicleList repeatedForeignMessage_ = new pbc::PopsicleList(); - public scg::IList RepeatedForeignMessageList { - get { return repeatedForeignMessage_; } - } - public int RepeatedForeignMessageCount { - get { return repeatedForeignMessage_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessageLite GetRepeatedForeignMessage(int index) { - return repeatedForeignMessage_[index]; - } - - public const int RepeatedImportMessageFieldNumber = 50; - private pbc::PopsicleList repeatedImportMessage_ = new pbc::PopsicleList(); - public scg::IList RepeatedImportMessageList { - get { return repeatedImportMessage_; } - } - public int RepeatedImportMessageCount { - get { return repeatedImportMessage_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportMessageLite GetRepeatedImportMessage(int index) { - return repeatedImportMessage_[index]; - } - - public const int RepeatedNestedEnumFieldNumber = 51; - private pbc::PopsicleList repeatedNestedEnum_ = new pbc::PopsicleList(); - public scg::IList RepeatedNestedEnumList { - get { return pbc::Lists.AsReadOnly(repeatedNestedEnum_); } - } - public int RepeatedNestedEnumCount { - get { return repeatedNestedEnum_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedEnum GetRepeatedNestedEnum(int index) { - return repeatedNestedEnum_[index]; - } - - public const int RepeatedForeignEnumFieldNumber = 52; - private pbc::PopsicleList repeatedForeignEnum_ = new pbc::PopsicleList(); - public scg::IList RepeatedForeignEnumList { - get { return pbc::Lists.AsReadOnly(repeatedForeignEnum_); } - } - public int RepeatedForeignEnumCount { - get { return repeatedForeignEnum_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnumLite GetRepeatedForeignEnum(int index) { - return repeatedForeignEnum_[index]; - } - - public const int RepeatedImportEnumFieldNumber = 53; - private pbc::PopsicleList repeatedImportEnum_ = new pbc::PopsicleList(); - public scg::IList RepeatedImportEnumList { - get { return pbc::Lists.AsReadOnly(repeatedImportEnum_); } - } - public int RepeatedImportEnumCount { - get { return repeatedImportEnum_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportEnumLite GetRepeatedImportEnum(int index) { - return repeatedImportEnum_[index]; - } - - public const int RepeatedStringPieceFieldNumber = 54; - private pbc::PopsicleList repeatedStringPiece_ = new pbc::PopsicleList(); - public scg::IList RepeatedStringPieceList { - get { return pbc::Lists.AsReadOnly(repeatedStringPiece_); } - } - public int RepeatedStringPieceCount { - get { return repeatedStringPiece_.Count; } - } - public string GetRepeatedStringPiece(int index) { - return repeatedStringPiece_[index]; - } - - public const int RepeatedCordFieldNumber = 55; - private pbc::PopsicleList repeatedCord_ = new pbc::PopsicleList(); - public scg::IList RepeatedCordList { - get { return pbc::Lists.AsReadOnly(repeatedCord_); } - } - public int RepeatedCordCount { - get { return repeatedCord_.Count; } - } - public string GetRepeatedCord(int index) { - return repeatedCord_[index]; - } - - public const int DefaultInt32FieldNumber = 61; - private bool hasDefaultInt32; - private int defaultInt32_ = 41; - public bool HasDefaultInt32 { - get { return hasDefaultInt32; } - } - public int DefaultInt32 { - get { return defaultInt32_; } - } - - public const int DefaultInt64FieldNumber = 62; - private bool hasDefaultInt64; - private long defaultInt64_ = 42L; - public bool HasDefaultInt64 { - get { return hasDefaultInt64; } - } - public long DefaultInt64 { - get { return defaultInt64_; } - } - - public const int DefaultUint32FieldNumber = 63; - private bool hasDefaultUint32; - private uint defaultUint32_ = 43; - public bool HasDefaultUint32 { - get { return hasDefaultUint32; } - } - [global::System.CLSCompliant(false)] - public uint DefaultUint32 { - get { return defaultUint32_; } - } - - public const int DefaultUint64FieldNumber = 64; - private bool hasDefaultUint64; - private ulong defaultUint64_ = 44UL; - public bool HasDefaultUint64 { - get { return hasDefaultUint64; } - } - [global::System.CLSCompliant(false)] - public ulong DefaultUint64 { - get { return defaultUint64_; } - } - - public const int DefaultSint32FieldNumber = 65; - private bool hasDefaultSint32; - private int defaultSint32_ = -45; - public bool HasDefaultSint32 { - get { return hasDefaultSint32; } - } - public int DefaultSint32 { - get { return defaultSint32_; } - } - - public const int DefaultSint64FieldNumber = 66; - private bool hasDefaultSint64; - private long defaultSint64_ = 46; - public bool HasDefaultSint64 { - get { return hasDefaultSint64; } - } - public long DefaultSint64 { - get { return defaultSint64_; } - } - - public const int DefaultFixed32FieldNumber = 67; - private bool hasDefaultFixed32; - private uint defaultFixed32_ = 47; - public bool HasDefaultFixed32 { - get { return hasDefaultFixed32; } - } - [global::System.CLSCompliant(false)] - public uint DefaultFixed32 { - get { return defaultFixed32_; } - } - - public const int DefaultFixed64FieldNumber = 68; - private bool hasDefaultFixed64; - private ulong defaultFixed64_ = 48; - public bool HasDefaultFixed64 { - get { return hasDefaultFixed64; } - } - [global::System.CLSCompliant(false)] - public ulong DefaultFixed64 { - get { return defaultFixed64_; } - } - - public const int DefaultSfixed32FieldNumber = 69; - private bool hasDefaultSfixed32; - private int defaultSfixed32_ = 49; - public bool HasDefaultSfixed32 { - get { return hasDefaultSfixed32; } - } - public int DefaultSfixed32 { - get { return defaultSfixed32_; } - } - - public const int DefaultSfixed64FieldNumber = 70; - private bool hasDefaultSfixed64; - private long defaultSfixed64_ = -50; - public bool HasDefaultSfixed64 { - get { return hasDefaultSfixed64; } - } - public long DefaultSfixed64 { - get { return defaultSfixed64_; } - } - - public const int DefaultFloatFieldNumber = 71; - private bool hasDefaultFloat; - private float defaultFloat_ = 51.5F; - public bool HasDefaultFloat { - get { return hasDefaultFloat; } - } - public float DefaultFloat { - get { return defaultFloat_; } - } - - public const int DefaultDoubleFieldNumber = 72; - private bool hasDefaultDouble; - private double defaultDouble_ = 52000D; - public bool HasDefaultDouble { - get { return hasDefaultDouble; } - } - public double DefaultDouble { - get { return defaultDouble_; } - } - - public const int DefaultBoolFieldNumber = 73; - private bool hasDefaultBool; - private bool defaultBool_ = true; - public bool HasDefaultBool { - get { return hasDefaultBool; } - } - public bool DefaultBool { - get { return defaultBool_; } - } - - public const int DefaultStringFieldNumber = 74; - private bool hasDefaultString; - private string defaultString_ = "hello"; - public bool HasDefaultString { - get { return hasDefaultString; } - } - public string DefaultString { - get { return defaultString_; } - } - - public const int DefaultBytesFieldNumber = 75; - private bool hasDefaultBytes; - private pb::ByteString defaultBytes_ = pb::ByteString.FromBase64("d29ybGQ="); - public bool HasDefaultBytes { - get { return hasDefaultBytes; } - } - public pb::ByteString DefaultBytes { - get { return defaultBytes_; } - } - - public const int DefaultNestedEnumFieldNumber = 81; - private bool hasDefaultNestedEnum; - private global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedEnum defaultNestedEnum_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedEnum.BAR; - public bool HasDefaultNestedEnum { - get { return hasDefaultNestedEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedEnum DefaultNestedEnum { - get { return defaultNestedEnum_; } - } - - public const int DefaultForeignEnumFieldNumber = 82; - private bool hasDefaultForeignEnum; - private global::Google.ProtocolBuffers.TestProtos.ForeignEnumLite defaultForeignEnum_ = global::Google.ProtocolBuffers.TestProtos.ForeignEnumLite.FOREIGN_LITE_BAR; - public bool HasDefaultForeignEnum { - get { return hasDefaultForeignEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnumLite DefaultForeignEnum { - get { return defaultForeignEnum_; } - } - - public const int DefaultImportEnumFieldNumber = 83; - private bool hasDefaultImportEnum; - private global::Google.ProtocolBuffers.TestProtos.ImportEnumLite defaultImportEnum_ = global::Google.ProtocolBuffers.TestProtos.ImportEnumLite.IMPORT_LITE_BAR; - public bool HasDefaultImportEnum { - get { return hasDefaultImportEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportEnumLite DefaultImportEnum { - get { return defaultImportEnum_; } - } - - public const int DefaultStringPieceFieldNumber = 84; - private bool hasDefaultStringPiece; - private string defaultStringPiece_ = "abc"; - public bool HasDefaultStringPiece { - get { return hasDefaultStringPiece; } - } - public string DefaultStringPiece { - get { return defaultStringPiece_; } - } - - public const int DefaultCordFieldNumber = 85; - private bool hasDefaultCord; - private string defaultCord_ = "123"; - public bool HasDefaultCord { - get { return hasDefaultCord; } - } - public string DefaultCord { - get { return defaultCord_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testAllTypesLiteFieldNames; - if (hasOptionalInt32) { - output.WriteInt32(1, field_names[31], OptionalInt32); - } - if (hasOptionalInt64) { - output.WriteInt64(2, field_names[32], OptionalInt64); - } - if (hasOptionalUint32) { - output.WriteUInt32(3, field_names[41], OptionalUint32); - } - if (hasOptionalUint64) { - output.WriteUInt64(4, field_names[42], OptionalUint64); - } - if (hasOptionalSint32) { - output.WriteSInt32(5, field_names[37], OptionalSint32); - } - if (hasOptionalSint64) { - output.WriteSInt64(6, field_names[38], OptionalSint64); - } - if (hasOptionalFixed32) { - output.WriteFixed32(7, field_names[24], OptionalFixed32); - } - if (hasOptionalFixed64) { - output.WriteFixed64(8, field_names[25], OptionalFixed64); - } - if (hasOptionalSfixed32) { - output.WriteSFixed32(9, field_names[35], OptionalSfixed32); - } - if (hasOptionalSfixed64) { - output.WriteSFixed64(10, field_names[36], OptionalSfixed64); - } - if (hasOptionalFloat) { - output.WriteFloat(11, field_names[26], OptionalFloat); - } - if (hasOptionalDouble) { - output.WriteDouble(12, field_names[23], OptionalDouble); - } - if (hasOptionalBool) { - output.WriteBool(13, field_names[20], OptionalBool); - } - if (hasOptionalString) { - output.WriteString(14, field_names[39], OptionalString); - } - if (hasOptionalBytes) { - output.WriteBytes(15, field_names[21], OptionalBytes); - } - if (hasOptionalGroup) { - output.WriteGroup(16, field_names[43], OptionalGroup); - } - if (hasOptionalNestedMessage) { - output.WriteMessage(18, field_names[34], OptionalNestedMessage); - } - if (hasOptionalForeignMessage) { - output.WriteMessage(19, field_names[28], OptionalForeignMessage); - } - if (hasOptionalImportMessage) { - output.WriteMessage(20, field_names[30], OptionalImportMessage); - } - if (hasOptionalNestedEnum) { - output.WriteEnum(21, field_names[33], (int) OptionalNestedEnum, OptionalNestedEnum); - } - if (hasOptionalForeignEnum) { - output.WriteEnum(22, field_names[27], (int) OptionalForeignEnum, OptionalForeignEnum); - } - if (hasOptionalImportEnum) { - output.WriteEnum(23, field_names[29], (int) OptionalImportEnum, OptionalImportEnum); - } - if (hasOptionalStringPiece) { - output.WriteString(24, field_names[40], OptionalStringPiece); - } - if (hasOptionalCord) { - output.WriteString(25, field_names[22], OptionalCord); - } - if (repeatedInt32_.Count > 0) { - output.WriteInt32Array(31, field_names[55], repeatedInt32_); - } - if (repeatedInt64_.Count > 0) { - output.WriteInt64Array(32, field_names[56], repeatedInt64_); - } - if (repeatedUint32_.Count > 0) { - output.WriteUInt32Array(33, field_names[65], repeatedUint32_); - } - if (repeatedUint64_.Count > 0) { - output.WriteUInt64Array(34, field_names[66], repeatedUint64_); - } - if (repeatedSint32_.Count > 0) { - output.WriteSInt32Array(35, field_names[61], repeatedSint32_); - } - if (repeatedSint64_.Count > 0) { - output.WriteSInt64Array(36, field_names[62], repeatedSint64_); - } - if (repeatedFixed32_.Count > 0) { - output.WriteFixed32Array(37, field_names[48], repeatedFixed32_); - } - if (repeatedFixed64_.Count > 0) { - output.WriteFixed64Array(38, field_names[49], repeatedFixed64_); - } - if (repeatedSfixed32_.Count > 0) { - output.WriteSFixed32Array(39, field_names[59], repeatedSfixed32_); - } - if (repeatedSfixed64_.Count > 0) { - output.WriteSFixed64Array(40, field_names[60], repeatedSfixed64_); - } - if (repeatedFloat_.Count > 0) { - output.WriteFloatArray(41, field_names[50], repeatedFloat_); - } - if (repeatedDouble_.Count > 0) { - output.WriteDoubleArray(42, field_names[47], repeatedDouble_); - } - if (repeatedBool_.Count > 0) { - output.WriteBoolArray(43, field_names[44], repeatedBool_); - } - if (repeatedString_.Count > 0) { - output.WriteStringArray(44, field_names[63], repeatedString_); - } - if (repeatedBytes_.Count > 0) { - output.WriteBytesArray(45, field_names[45], repeatedBytes_); - } - if (repeatedGroup_.Count > 0) { - output.WriteGroupArray(46, field_names[67], repeatedGroup_); - } - if (repeatedNestedMessage_.Count > 0) { - output.WriteMessageArray(48, field_names[58], repeatedNestedMessage_); - } - if (repeatedForeignMessage_.Count > 0) { - output.WriteMessageArray(49, field_names[52], repeatedForeignMessage_); - } - if (repeatedImportMessage_.Count > 0) { - output.WriteMessageArray(50, field_names[54], repeatedImportMessage_); - } - if (repeatedNestedEnum_.Count > 0) { - output.WriteEnumArray(51, field_names[57], repeatedNestedEnum_); - } - if (repeatedForeignEnum_.Count > 0) { - output.WriteEnumArray(52, field_names[51], repeatedForeignEnum_); - } - if (repeatedImportEnum_.Count > 0) { - output.WriteEnumArray(53, field_names[53], repeatedImportEnum_); - } - if (repeatedStringPiece_.Count > 0) { - output.WriteStringArray(54, field_names[64], repeatedStringPiece_); - } - if (repeatedCord_.Count > 0) { - output.WriteStringArray(55, field_names[46], repeatedCord_); - } - if (hasDefaultInt32) { - output.WriteInt32(61, field_names[9], DefaultInt32); - } - if (hasDefaultInt64) { - output.WriteInt64(62, field_names[10], DefaultInt64); - } - if (hasDefaultUint32) { - output.WriteUInt32(63, field_names[18], DefaultUint32); - } - if (hasDefaultUint64) { - output.WriteUInt64(64, field_names[19], DefaultUint64); - } - if (hasDefaultSint32) { - output.WriteSInt32(65, field_names[14], DefaultSint32); - } - if (hasDefaultSint64) { - output.WriteSInt64(66, field_names[15], DefaultSint64); - } - if (hasDefaultFixed32) { - output.WriteFixed32(67, field_names[4], DefaultFixed32); - } - if (hasDefaultFixed64) { - output.WriteFixed64(68, field_names[5], DefaultFixed64); - } - if (hasDefaultSfixed32) { - output.WriteSFixed32(69, field_names[12], DefaultSfixed32); - } - if (hasDefaultSfixed64) { - output.WriteSFixed64(70, field_names[13], DefaultSfixed64); - } - if (hasDefaultFloat) { - output.WriteFloat(71, field_names[6], DefaultFloat); - } - if (hasDefaultDouble) { - output.WriteDouble(72, field_names[3], DefaultDouble); - } - if (hasDefaultBool) { - output.WriteBool(73, field_names[0], DefaultBool); - } - if (hasDefaultString) { - output.WriteString(74, field_names[16], DefaultString); - } - if (hasDefaultBytes) { - output.WriteBytes(75, field_names[1], DefaultBytes); - } - if (hasDefaultNestedEnum) { - output.WriteEnum(81, field_names[11], (int) DefaultNestedEnum, DefaultNestedEnum); - } - if (hasDefaultForeignEnum) { - output.WriteEnum(82, field_names[7], (int) DefaultForeignEnum, DefaultForeignEnum); - } - if (hasDefaultImportEnum) { - output.WriteEnum(83, field_names[8], (int) DefaultImportEnum, DefaultImportEnum); - } - if (hasDefaultStringPiece) { - output.WriteString(84, field_names[17], DefaultStringPiece); - } - if (hasDefaultCord) { - output.WriteString(85, field_names[2], DefaultCord); - } - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasOptionalInt32) { - size += pb::CodedOutputStream.ComputeInt32Size(1, OptionalInt32); - } - if (hasOptionalInt64) { - size += pb::CodedOutputStream.ComputeInt64Size(2, OptionalInt64); - } - if (hasOptionalUint32) { - size += pb::CodedOutputStream.ComputeUInt32Size(3, OptionalUint32); - } - if (hasOptionalUint64) { - size += pb::CodedOutputStream.ComputeUInt64Size(4, OptionalUint64); - } - if (hasOptionalSint32) { - size += pb::CodedOutputStream.ComputeSInt32Size(5, OptionalSint32); - } - if (hasOptionalSint64) { - size += pb::CodedOutputStream.ComputeSInt64Size(6, OptionalSint64); - } - if (hasOptionalFixed32) { - size += pb::CodedOutputStream.ComputeFixed32Size(7, OptionalFixed32); - } - if (hasOptionalFixed64) { - size += pb::CodedOutputStream.ComputeFixed64Size(8, OptionalFixed64); - } - if (hasOptionalSfixed32) { - size += pb::CodedOutputStream.ComputeSFixed32Size(9, OptionalSfixed32); - } - if (hasOptionalSfixed64) { - size += pb::CodedOutputStream.ComputeSFixed64Size(10, OptionalSfixed64); - } - if (hasOptionalFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(11, OptionalFloat); - } - if (hasOptionalDouble) { - size += pb::CodedOutputStream.ComputeDoubleSize(12, OptionalDouble); - } - if (hasOptionalBool) { - size += pb::CodedOutputStream.ComputeBoolSize(13, OptionalBool); - } - if (hasOptionalString) { - size += pb::CodedOutputStream.ComputeStringSize(14, OptionalString); - } - if (hasOptionalBytes) { - size += pb::CodedOutputStream.ComputeBytesSize(15, OptionalBytes); - } - if (hasOptionalGroup) { - size += pb::CodedOutputStream.ComputeGroupSize(16, OptionalGroup); - } - if (hasOptionalNestedMessage) { - size += pb::CodedOutputStream.ComputeMessageSize(18, OptionalNestedMessage); - } - if (hasOptionalForeignMessage) { - size += pb::CodedOutputStream.ComputeMessageSize(19, OptionalForeignMessage); - } - if (hasOptionalImportMessage) { - size += pb::CodedOutputStream.ComputeMessageSize(20, OptionalImportMessage); - } - if (hasOptionalNestedEnum) { - size += pb::CodedOutputStream.ComputeEnumSize(21, (int) OptionalNestedEnum); - } - if (hasOptionalForeignEnum) { - size += pb::CodedOutputStream.ComputeEnumSize(22, (int) OptionalForeignEnum); - } - if (hasOptionalImportEnum) { - size += pb::CodedOutputStream.ComputeEnumSize(23, (int) OptionalImportEnum); - } - if (hasOptionalStringPiece) { - size += pb::CodedOutputStream.ComputeStringSize(24, OptionalStringPiece); - } - if (hasOptionalCord) { - size += pb::CodedOutputStream.ComputeStringSize(25, OptionalCord); - } - { - int dataSize = 0; - foreach (int element in RepeatedInt32List) { - dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedInt32_.Count; - } - { - int dataSize = 0; - foreach (long element in RepeatedInt64List) { - dataSize += pb::CodedOutputStream.ComputeInt64SizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedInt64_.Count; - } - { - int dataSize = 0; - foreach (uint element in RepeatedUint32List) { - dataSize += pb::CodedOutputStream.ComputeUInt32SizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedUint32_.Count; - } - { - int dataSize = 0; - foreach (ulong element in RepeatedUint64List) { - dataSize += pb::CodedOutputStream.ComputeUInt64SizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedUint64_.Count; - } - { - int dataSize = 0; - foreach (int element in RepeatedSint32List) { - dataSize += pb::CodedOutputStream.ComputeSInt32SizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedSint32_.Count; - } - { - int dataSize = 0; - foreach (long element in RepeatedSint64List) { - dataSize += pb::CodedOutputStream.ComputeSInt64SizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedSint64_.Count; - } - { - int dataSize = 0; - dataSize = 4 * repeatedFixed32_.Count; - size += dataSize; - size += 2 * repeatedFixed32_.Count; - } - { - int dataSize = 0; - dataSize = 8 * repeatedFixed64_.Count; - size += dataSize; - size += 2 * repeatedFixed64_.Count; - } - { - int dataSize = 0; - dataSize = 4 * repeatedSfixed32_.Count; - size += dataSize; - size += 2 * repeatedSfixed32_.Count; - } - { - int dataSize = 0; - dataSize = 8 * repeatedSfixed64_.Count; - size += dataSize; - size += 2 * repeatedSfixed64_.Count; - } - { - int dataSize = 0; - dataSize = 4 * repeatedFloat_.Count; - size += dataSize; - size += 2 * repeatedFloat_.Count; - } - { - int dataSize = 0; - dataSize = 8 * repeatedDouble_.Count; - size += dataSize; - size += 2 * repeatedDouble_.Count; - } - { - int dataSize = 0; - dataSize = 1 * repeatedBool_.Count; - size += dataSize; - size += 2 * repeatedBool_.Count; - } - { - int dataSize = 0; - foreach (string element in RepeatedStringList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedString_.Count; - } - { - int dataSize = 0; - foreach (pb::ByteString element in RepeatedBytesList) { - dataSize += pb::CodedOutputStream.ComputeBytesSizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedBytes_.Count; - } - foreach (global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.RepeatedGroup element in RepeatedGroupList) { - size += pb::CodedOutputStream.ComputeGroupSize(46, element); - } - foreach (global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedMessage element in RepeatedNestedMessageList) { - size += pb::CodedOutputStream.ComputeMessageSize(48, element); - } - foreach (global::Google.ProtocolBuffers.TestProtos.ForeignMessageLite element in RepeatedForeignMessageList) { - size += pb::CodedOutputStream.ComputeMessageSize(49, element); - } - foreach (global::Google.ProtocolBuffers.TestProtos.ImportMessageLite element in RepeatedImportMessageList) { - size += pb::CodedOutputStream.ComputeMessageSize(50, element); - } - { - int dataSize = 0; - if (repeatedNestedEnum_.Count > 0) { - foreach (global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedEnum element in repeatedNestedEnum_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 2 * repeatedNestedEnum_.Count; - } - } - { - int dataSize = 0; - if (repeatedForeignEnum_.Count > 0) { - foreach (global::Google.ProtocolBuffers.TestProtos.ForeignEnumLite element in repeatedForeignEnum_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 2 * repeatedForeignEnum_.Count; - } - } - { - int dataSize = 0; - if (repeatedImportEnum_.Count > 0) { - foreach (global::Google.ProtocolBuffers.TestProtos.ImportEnumLite element in repeatedImportEnum_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 2 * repeatedImportEnum_.Count; - } - } - { - int dataSize = 0; - foreach (string element in RepeatedStringPieceList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedStringPiece_.Count; - } - { - int dataSize = 0; - foreach (string element in RepeatedCordList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedCord_.Count; - } - if (hasDefaultInt32) { - size += pb::CodedOutputStream.ComputeInt32Size(61, DefaultInt32); - } - if (hasDefaultInt64) { - size += pb::CodedOutputStream.ComputeInt64Size(62, DefaultInt64); - } - if (hasDefaultUint32) { - size += pb::CodedOutputStream.ComputeUInt32Size(63, DefaultUint32); - } - if (hasDefaultUint64) { - size += pb::CodedOutputStream.ComputeUInt64Size(64, DefaultUint64); - } - if (hasDefaultSint32) { - size += pb::CodedOutputStream.ComputeSInt32Size(65, DefaultSint32); - } - if (hasDefaultSint64) { - size += pb::CodedOutputStream.ComputeSInt64Size(66, DefaultSint64); - } - if (hasDefaultFixed32) { - size += pb::CodedOutputStream.ComputeFixed32Size(67, DefaultFixed32); - } - if (hasDefaultFixed64) { - size += pb::CodedOutputStream.ComputeFixed64Size(68, DefaultFixed64); - } - if (hasDefaultSfixed32) { - size += pb::CodedOutputStream.ComputeSFixed32Size(69, DefaultSfixed32); - } - if (hasDefaultSfixed64) { - size += pb::CodedOutputStream.ComputeSFixed64Size(70, DefaultSfixed64); - } - if (hasDefaultFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(71, DefaultFloat); - } - if (hasDefaultDouble) { - size += pb::CodedOutputStream.ComputeDoubleSize(72, DefaultDouble); - } - if (hasDefaultBool) { - size += pb::CodedOutputStream.ComputeBoolSize(73, DefaultBool); - } - if (hasDefaultString) { - size += pb::CodedOutputStream.ComputeStringSize(74, DefaultString); - } - if (hasDefaultBytes) { - size += pb::CodedOutputStream.ComputeBytesSize(75, DefaultBytes); - } - if (hasDefaultNestedEnum) { - size += pb::CodedOutputStream.ComputeEnumSize(81, (int) DefaultNestedEnum); - } - if (hasDefaultForeignEnum) { - size += pb::CodedOutputStream.ComputeEnumSize(82, (int) DefaultForeignEnum); - } - if (hasDefaultImportEnum) { - size += pb::CodedOutputStream.ComputeEnumSize(83, (int) DefaultImportEnum); - } - if (hasDefaultStringPiece) { - size += pb::CodedOutputStream.ComputeStringSize(84, DefaultStringPiece); - } - if (hasDefaultCord) { - size += pb::CodedOutputStream.ComputeStringSize(85, DefaultCord); - } - memoizedSerializedSize = size; - return size; - } - #region Lite runtime methods - public override int GetHashCode() { - int hash = GetType().GetHashCode(); - if (hasOptionalInt32) hash ^= optionalInt32_.GetHashCode(); - if (hasOptionalInt64) hash ^= optionalInt64_.GetHashCode(); - if (hasOptionalUint32) hash ^= optionalUint32_.GetHashCode(); - if (hasOptionalUint64) hash ^= optionalUint64_.GetHashCode(); - if (hasOptionalSint32) hash ^= optionalSint32_.GetHashCode(); - if (hasOptionalSint64) hash ^= optionalSint64_.GetHashCode(); - if (hasOptionalFixed32) hash ^= optionalFixed32_.GetHashCode(); - if (hasOptionalFixed64) hash ^= optionalFixed64_.GetHashCode(); - if (hasOptionalSfixed32) hash ^= optionalSfixed32_.GetHashCode(); - if (hasOptionalSfixed64) hash ^= optionalSfixed64_.GetHashCode(); - if (hasOptionalFloat) hash ^= optionalFloat_.GetHashCode(); - if (hasOptionalDouble) hash ^= optionalDouble_.GetHashCode(); - if (hasOptionalBool) hash ^= optionalBool_.GetHashCode(); - if (hasOptionalString) hash ^= optionalString_.GetHashCode(); - if (hasOptionalBytes) hash ^= optionalBytes_.GetHashCode(); - if (hasOptionalGroup) hash ^= optionalGroup_.GetHashCode(); - if (hasOptionalNestedMessage) hash ^= optionalNestedMessage_.GetHashCode(); - if (hasOptionalForeignMessage) hash ^= optionalForeignMessage_.GetHashCode(); - if (hasOptionalImportMessage) hash ^= optionalImportMessage_.GetHashCode(); - if (hasOptionalNestedEnum) hash ^= optionalNestedEnum_.GetHashCode(); - if (hasOptionalForeignEnum) hash ^= optionalForeignEnum_.GetHashCode(); - if (hasOptionalImportEnum) hash ^= optionalImportEnum_.GetHashCode(); - if (hasOptionalStringPiece) hash ^= optionalStringPiece_.GetHashCode(); - if (hasOptionalCord) hash ^= optionalCord_.GetHashCode(); - foreach(int i in repeatedInt32_) - hash ^= i.GetHashCode(); - foreach(long i in repeatedInt64_) - hash ^= i.GetHashCode(); - foreach(uint i in repeatedUint32_) - hash ^= i.GetHashCode(); - foreach(ulong i in repeatedUint64_) - hash ^= i.GetHashCode(); - foreach(int i in repeatedSint32_) - hash ^= i.GetHashCode(); - foreach(long i in repeatedSint64_) - hash ^= i.GetHashCode(); - foreach(uint i in repeatedFixed32_) - hash ^= i.GetHashCode(); - foreach(ulong i in repeatedFixed64_) - hash ^= i.GetHashCode(); - foreach(int i in repeatedSfixed32_) - hash ^= i.GetHashCode(); - foreach(long i in repeatedSfixed64_) - hash ^= i.GetHashCode(); - foreach(float i in repeatedFloat_) - hash ^= i.GetHashCode(); - foreach(double i in repeatedDouble_) - hash ^= i.GetHashCode(); - foreach(bool i in repeatedBool_) - hash ^= i.GetHashCode(); - foreach(string i in repeatedString_) - hash ^= i.GetHashCode(); - foreach(pb::ByteString i in repeatedBytes_) - hash ^= i.GetHashCode(); - foreach(global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.RepeatedGroup i in repeatedGroup_) - hash ^= i.GetHashCode(); - foreach(global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedMessage i in repeatedNestedMessage_) - hash ^= i.GetHashCode(); - foreach(global::Google.ProtocolBuffers.TestProtos.ForeignMessageLite i in repeatedForeignMessage_) - hash ^= i.GetHashCode(); - foreach(global::Google.ProtocolBuffers.TestProtos.ImportMessageLite i in repeatedImportMessage_) - hash ^= i.GetHashCode(); - foreach(global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedEnum i in repeatedNestedEnum_) - hash ^= i.GetHashCode(); - foreach(global::Google.ProtocolBuffers.TestProtos.ForeignEnumLite i in repeatedForeignEnum_) - hash ^= i.GetHashCode(); - foreach(global::Google.ProtocolBuffers.TestProtos.ImportEnumLite i in repeatedImportEnum_) - hash ^= i.GetHashCode(); - foreach(string i in repeatedStringPiece_) - hash ^= i.GetHashCode(); - foreach(string i in repeatedCord_) - hash ^= i.GetHashCode(); - if (hasDefaultInt32) hash ^= defaultInt32_.GetHashCode(); - if (hasDefaultInt64) hash ^= defaultInt64_.GetHashCode(); - if (hasDefaultUint32) hash ^= defaultUint32_.GetHashCode(); - if (hasDefaultUint64) hash ^= defaultUint64_.GetHashCode(); - if (hasDefaultSint32) hash ^= defaultSint32_.GetHashCode(); - if (hasDefaultSint64) hash ^= defaultSint64_.GetHashCode(); - if (hasDefaultFixed32) hash ^= defaultFixed32_.GetHashCode(); - if (hasDefaultFixed64) hash ^= defaultFixed64_.GetHashCode(); - if (hasDefaultSfixed32) hash ^= defaultSfixed32_.GetHashCode(); - if (hasDefaultSfixed64) hash ^= defaultSfixed64_.GetHashCode(); - if (hasDefaultFloat) hash ^= defaultFloat_.GetHashCode(); - if (hasDefaultDouble) hash ^= defaultDouble_.GetHashCode(); - if (hasDefaultBool) hash ^= defaultBool_.GetHashCode(); - if (hasDefaultString) hash ^= defaultString_.GetHashCode(); - if (hasDefaultBytes) hash ^= defaultBytes_.GetHashCode(); - if (hasDefaultNestedEnum) hash ^= defaultNestedEnum_.GetHashCode(); - if (hasDefaultForeignEnum) hash ^= defaultForeignEnum_.GetHashCode(); - if (hasDefaultImportEnum) hash ^= defaultImportEnum_.GetHashCode(); - if (hasDefaultStringPiece) hash ^= defaultStringPiece_.GetHashCode(); - if (hasDefaultCord) hash ^= defaultCord_.GetHashCode(); - return hash; - } - - public override bool Equals(object obj) { - TestAllTypesLite other = obj as TestAllTypesLite; - if (other == null) return false; - if (hasOptionalInt32 != other.hasOptionalInt32 || (hasOptionalInt32 && !optionalInt32_.Equals(other.optionalInt32_))) return false; - if (hasOptionalInt64 != other.hasOptionalInt64 || (hasOptionalInt64 && !optionalInt64_.Equals(other.optionalInt64_))) return false; - if (hasOptionalUint32 != other.hasOptionalUint32 || (hasOptionalUint32 && !optionalUint32_.Equals(other.optionalUint32_))) return false; - if (hasOptionalUint64 != other.hasOptionalUint64 || (hasOptionalUint64 && !optionalUint64_.Equals(other.optionalUint64_))) return false; - if (hasOptionalSint32 != other.hasOptionalSint32 || (hasOptionalSint32 && !optionalSint32_.Equals(other.optionalSint32_))) return false; - if (hasOptionalSint64 != other.hasOptionalSint64 || (hasOptionalSint64 && !optionalSint64_.Equals(other.optionalSint64_))) return false; - if (hasOptionalFixed32 != other.hasOptionalFixed32 || (hasOptionalFixed32 && !optionalFixed32_.Equals(other.optionalFixed32_))) return false; - if (hasOptionalFixed64 != other.hasOptionalFixed64 || (hasOptionalFixed64 && !optionalFixed64_.Equals(other.optionalFixed64_))) return false; - if (hasOptionalSfixed32 != other.hasOptionalSfixed32 || (hasOptionalSfixed32 && !optionalSfixed32_.Equals(other.optionalSfixed32_))) return false; - if (hasOptionalSfixed64 != other.hasOptionalSfixed64 || (hasOptionalSfixed64 && !optionalSfixed64_.Equals(other.optionalSfixed64_))) return false; - if (hasOptionalFloat != other.hasOptionalFloat || (hasOptionalFloat && !optionalFloat_.Equals(other.optionalFloat_))) return false; - if (hasOptionalDouble != other.hasOptionalDouble || (hasOptionalDouble && !optionalDouble_.Equals(other.optionalDouble_))) return false; - if (hasOptionalBool != other.hasOptionalBool || (hasOptionalBool && !optionalBool_.Equals(other.optionalBool_))) return false; - if (hasOptionalString != other.hasOptionalString || (hasOptionalString && !optionalString_.Equals(other.optionalString_))) return false; - if (hasOptionalBytes != other.hasOptionalBytes || (hasOptionalBytes && !optionalBytes_.Equals(other.optionalBytes_))) return false; - if (hasOptionalGroup != other.hasOptionalGroup || (hasOptionalGroup && !optionalGroup_.Equals(other.optionalGroup_))) return false; - if (hasOptionalNestedMessage != other.hasOptionalNestedMessage || (hasOptionalNestedMessage && !optionalNestedMessage_.Equals(other.optionalNestedMessage_))) return false; - if (hasOptionalForeignMessage != other.hasOptionalForeignMessage || (hasOptionalForeignMessage && !optionalForeignMessage_.Equals(other.optionalForeignMessage_))) return false; - if (hasOptionalImportMessage != other.hasOptionalImportMessage || (hasOptionalImportMessage && !optionalImportMessage_.Equals(other.optionalImportMessage_))) return false; - if (hasOptionalNestedEnum != other.hasOptionalNestedEnum || (hasOptionalNestedEnum && !optionalNestedEnum_.Equals(other.optionalNestedEnum_))) return false; - if (hasOptionalForeignEnum != other.hasOptionalForeignEnum || (hasOptionalForeignEnum && !optionalForeignEnum_.Equals(other.optionalForeignEnum_))) return false; - if (hasOptionalImportEnum != other.hasOptionalImportEnum || (hasOptionalImportEnum && !optionalImportEnum_.Equals(other.optionalImportEnum_))) return false; - if (hasOptionalStringPiece != other.hasOptionalStringPiece || (hasOptionalStringPiece && !optionalStringPiece_.Equals(other.optionalStringPiece_))) return false; - if (hasOptionalCord != other.hasOptionalCord || (hasOptionalCord && !optionalCord_.Equals(other.optionalCord_))) return false; - if(repeatedInt32_.Count != other.repeatedInt32_.Count) return false; - for(int ix=0; ix < repeatedInt32_.Count; ix++) - if(!repeatedInt32_[ix].Equals(other.repeatedInt32_[ix])) return false; - if(repeatedInt64_.Count != other.repeatedInt64_.Count) return false; - for(int ix=0; ix < repeatedInt64_.Count; ix++) - if(!repeatedInt64_[ix].Equals(other.repeatedInt64_[ix])) return false; - if(repeatedUint32_.Count != other.repeatedUint32_.Count) return false; - for(int ix=0; ix < repeatedUint32_.Count; ix++) - if(!repeatedUint32_[ix].Equals(other.repeatedUint32_[ix])) return false; - if(repeatedUint64_.Count != other.repeatedUint64_.Count) return false; - for(int ix=0; ix < repeatedUint64_.Count; ix++) - if(!repeatedUint64_[ix].Equals(other.repeatedUint64_[ix])) return false; - if(repeatedSint32_.Count != other.repeatedSint32_.Count) return false; - for(int ix=0; ix < repeatedSint32_.Count; ix++) - if(!repeatedSint32_[ix].Equals(other.repeatedSint32_[ix])) return false; - if(repeatedSint64_.Count != other.repeatedSint64_.Count) return false; - for(int ix=0; ix < repeatedSint64_.Count; ix++) - if(!repeatedSint64_[ix].Equals(other.repeatedSint64_[ix])) return false; - if(repeatedFixed32_.Count != other.repeatedFixed32_.Count) return false; - for(int ix=0; ix < repeatedFixed32_.Count; ix++) - if(!repeatedFixed32_[ix].Equals(other.repeatedFixed32_[ix])) return false; - if(repeatedFixed64_.Count != other.repeatedFixed64_.Count) return false; - for(int ix=0; ix < repeatedFixed64_.Count; ix++) - if(!repeatedFixed64_[ix].Equals(other.repeatedFixed64_[ix])) return false; - if(repeatedSfixed32_.Count != other.repeatedSfixed32_.Count) return false; - for(int ix=0; ix < repeatedSfixed32_.Count; ix++) - if(!repeatedSfixed32_[ix].Equals(other.repeatedSfixed32_[ix])) return false; - if(repeatedSfixed64_.Count != other.repeatedSfixed64_.Count) return false; - for(int ix=0; ix < repeatedSfixed64_.Count; ix++) - if(!repeatedSfixed64_[ix].Equals(other.repeatedSfixed64_[ix])) return false; - if(repeatedFloat_.Count != other.repeatedFloat_.Count) return false; - for(int ix=0; ix < repeatedFloat_.Count; ix++) - if(!repeatedFloat_[ix].Equals(other.repeatedFloat_[ix])) return false; - if(repeatedDouble_.Count != other.repeatedDouble_.Count) return false; - for(int ix=0; ix < repeatedDouble_.Count; ix++) - if(!repeatedDouble_[ix].Equals(other.repeatedDouble_[ix])) return false; - if(repeatedBool_.Count != other.repeatedBool_.Count) return false; - for(int ix=0; ix < repeatedBool_.Count; ix++) - if(!repeatedBool_[ix].Equals(other.repeatedBool_[ix])) return false; - if(repeatedString_.Count != other.repeatedString_.Count) return false; - for(int ix=0; ix < repeatedString_.Count; ix++) - if(!repeatedString_[ix].Equals(other.repeatedString_[ix])) return false; - if(repeatedBytes_.Count != other.repeatedBytes_.Count) return false; - for(int ix=0; ix < repeatedBytes_.Count; ix++) - if(!repeatedBytes_[ix].Equals(other.repeatedBytes_[ix])) return false; - if(repeatedGroup_.Count != other.repeatedGroup_.Count) return false; - for(int ix=0; ix < repeatedGroup_.Count; ix++) - if(!repeatedGroup_[ix].Equals(other.repeatedGroup_[ix])) return false; - if(repeatedNestedMessage_.Count != other.repeatedNestedMessage_.Count) return false; - for(int ix=0; ix < repeatedNestedMessage_.Count; ix++) - if(!repeatedNestedMessage_[ix].Equals(other.repeatedNestedMessage_[ix])) return false; - if(repeatedForeignMessage_.Count != other.repeatedForeignMessage_.Count) return false; - for(int ix=0; ix < repeatedForeignMessage_.Count; ix++) - if(!repeatedForeignMessage_[ix].Equals(other.repeatedForeignMessage_[ix])) return false; - if(repeatedImportMessage_.Count != other.repeatedImportMessage_.Count) return false; - for(int ix=0; ix < repeatedImportMessage_.Count; ix++) - if(!repeatedImportMessage_[ix].Equals(other.repeatedImportMessage_[ix])) return false; - if(repeatedNestedEnum_.Count != other.repeatedNestedEnum_.Count) return false; - for(int ix=0; ix < repeatedNestedEnum_.Count; ix++) - if(!repeatedNestedEnum_[ix].Equals(other.repeatedNestedEnum_[ix])) return false; - if(repeatedForeignEnum_.Count != other.repeatedForeignEnum_.Count) return false; - for(int ix=0; ix < repeatedForeignEnum_.Count; ix++) - if(!repeatedForeignEnum_[ix].Equals(other.repeatedForeignEnum_[ix])) return false; - if(repeatedImportEnum_.Count != other.repeatedImportEnum_.Count) return false; - for(int ix=0; ix < repeatedImportEnum_.Count; ix++) - if(!repeatedImportEnum_[ix].Equals(other.repeatedImportEnum_[ix])) return false; - if(repeatedStringPiece_.Count != other.repeatedStringPiece_.Count) return false; - for(int ix=0; ix < repeatedStringPiece_.Count; ix++) - if(!repeatedStringPiece_[ix].Equals(other.repeatedStringPiece_[ix])) return false; - if(repeatedCord_.Count != other.repeatedCord_.Count) return false; - for(int ix=0; ix < repeatedCord_.Count; ix++) - if(!repeatedCord_[ix].Equals(other.repeatedCord_[ix])) return false; - if (hasDefaultInt32 != other.hasDefaultInt32 || (hasDefaultInt32 && !defaultInt32_.Equals(other.defaultInt32_))) return false; - if (hasDefaultInt64 != other.hasDefaultInt64 || (hasDefaultInt64 && !defaultInt64_.Equals(other.defaultInt64_))) return false; - if (hasDefaultUint32 != other.hasDefaultUint32 || (hasDefaultUint32 && !defaultUint32_.Equals(other.defaultUint32_))) return false; - if (hasDefaultUint64 != other.hasDefaultUint64 || (hasDefaultUint64 && !defaultUint64_.Equals(other.defaultUint64_))) return false; - if (hasDefaultSint32 != other.hasDefaultSint32 || (hasDefaultSint32 && !defaultSint32_.Equals(other.defaultSint32_))) return false; - if (hasDefaultSint64 != other.hasDefaultSint64 || (hasDefaultSint64 && !defaultSint64_.Equals(other.defaultSint64_))) return false; - if (hasDefaultFixed32 != other.hasDefaultFixed32 || (hasDefaultFixed32 && !defaultFixed32_.Equals(other.defaultFixed32_))) return false; - if (hasDefaultFixed64 != other.hasDefaultFixed64 || (hasDefaultFixed64 && !defaultFixed64_.Equals(other.defaultFixed64_))) return false; - if (hasDefaultSfixed32 != other.hasDefaultSfixed32 || (hasDefaultSfixed32 && !defaultSfixed32_.Equals(other.defaultSfixed32_))) return false; - if (hasDefaultSfixed64 != other.hasDefaultSfixed64 || (hasDefaultSfixed64 && !defaultSfixed64_.Equals(other.defaultSfixed64_))) return false; - if (hasDefaultFloat != other.hasDefaultFloat || (hasDefaultFloat && !defaultFloat_.Equals(other.defaultFloat_))) return false; - if (hasDefaultDouble != other.hasDefaultDouble || (hasDefaultDouble && !defaultDouble_.Equals(other.defaultDouble_))) return false; - if (hasDefaultBool != other.hasDefaultBool || (hasDefaultBool && !defaultBool_.Equals(other.defaultBool_))) return false; - if (hasDefaultString != other.hasDefaultString || (hasDefaultString && !defaultString_.Equals(other.defaultString_))) return false; - if (hasDefaultBytes != other.hasDefaultBytes || (hasDefaultBytes && !defaultBytes_.Equals(other.defaultBytes_))) return false; - if (hasDefaultNestedEnum != other.hasDefaultNestedEnum || (hasDefaultNestedEnum && !defaultNestedEnum_.Equals(other.defaultNestedEnum_))) return false; - if (hasDefaultForeignEnum != other.hasDefaultForeignEnum || (hasDefaultForeignEnum && !defaultForeignEnum_.Equals(other.defaultForeignEnum_))) return false; - if (hasDefaultImportEnum != other.hasDefaultImportEnum || (hasDefaultImportEnum && !defaultImportEnum_.Equals(other.defaultImportEnum_))) return false; - if (hasDefaultStringPiece != other.hasDefaultStringPiece || (hasDefaultStringPiece && !defaultStringPiece_.Equals(other.defaultStringPiece_))) return false; - if (hasDefaultCord != other.hasDefaultCord || (hasDefaultCord && !defaultCord_.Equals(other.defaultCord_))) return false; - return true; - } - - public override void PrintTo(global::System.IO.TextWriter writer) { - PrintField("optional_int32", hasOptionalInt32, optionalInt32_, writer); - PrintField("optional_int64", hasOptionalInt64, optionalInt64_, writer); - PrintField("optional_uint32", hasOptionalUint32, optionalUint32_, writer); - PrintField("optional_uint64", hasOptionalUint64, optionalUint64_, writer); - PrintField("optional_sint32", hasOptionalSint32, optionalSint32_, writer); - PrintField("optional_sint64", hasOptionalSint64, optionalSint64_, writer); - PrintField("optional_fixed32", hasOptionalFixed32, optionalFixed32_, writer); - PrintField("optional_fixed64", hasOptionalFixed64, optionalFixed64_, writer); - PrintField("optional_sfixed32", hasOptionalSfixed32, optionalSfixed32_, writer); - PrintField("optional_sfixed64", hasOptionalSfixed64, optionalSfixed64_, writer); - PrintField("optional_float", hasOptionalFloat, optionalFloat_, writer); - PrintField("optional_double", hasOptionalDouble, optionalDouble_, writer); - PrintField("optional_bool", hasOptionalBool, optionalBool_, writer); - PrintField("optional_string", hasOptionalString, optionalString_, writer); - PrintField("optional_bytes", hasOptionalBytes, optionalBytes_, writer); - PrintField("OptionalGroup", hasOptionalGroup, optionalGroup_, writer); - PrintField("optional_nested_message", hasOptionalNestedMessage, optionalNestedMessage_, writer); - PrintField("optional_foreign_message", hasOptionalForeignMessage, optionalForeignMessage_, writer); - PrintField("optional_import_message", hasOptionalImportMessage, optionalImportMessage_, writer); - PrintField("optional_nested_enum", hasOptionalNestedEnum, optionalNestedEnum_, writer); - PrintField("optional_foreign_enum", hasOptionalForeignEnum, optionalForeignEnum_, writer); - PrintField("optional_import_enum", hasOptionalImportEnum, optionalImportEnum_, writer); - PrintField("optional_string_piece", hasOptionalStringPiece, optionalStringPiece_, writer); - PrintField("optional_cord", hasOptionalCord, optionalCord_, writer); - PrintField("repeated_int32", repeatedInt32_, writer); - PrintField("repeated_int64", repeatedInt64_, writer); - PrintField("repeated_uint32", repeatedUint32_, writer); - PrintField("repeated_uint64", repeatedUint64_, writer); - PrintField("repeated_sint32", repeatedSint32_, writer); - PrintField("repeated_sint64", repeatedSint64_, writer); - PrintField("repeated_fixed32", repeatedFixed32_, writer); - PrintField("repeated_fixed64", repeatedFixed64_, writer); - PrintField("repeated_sfixed32", repeatedSfixed32_, writer); - PrintField("repeated_sfixed64", repeatedSfixed64_, writer); - PrintField("repeated_float", repeatedFloat_, writer); - PrintField("repeated_double", repeatedDouble_, writer); - PrintField("repeated_bool", repeatedBool_, writer); - PrintField("repeated_string", repeatedString_, writer); - PrintField("repeated_bytes", repeatedBytes_, writer); - PrintField("RepeatedGroup", repeatedGroup_, writer); - PrintField("repeated_nested_message", repeatedNestedMessage_, writer); - PrintField("repeated_foreign_message", repeatedForeignMessage_, writer); - PrintField("repeated_import_message", repeatedImportMessage_, writer); - PrintField("repeated_nested_enum", repeatedNestedEnum_, writer); - PrintField("repeated_foreign_enum", repeatedForeignEnum_, writer); - PrintField("repeated_import_enum", repeatedImportEnum_, writer); - PrintField("repeated_string_piece", repeatedStringPiece_, writer); - PrintField("repeated_cord", repeatedCord_, writer); - PrintField("default_int32", hasDefaultInt32, defaultInt32_, writer); - PrintField("default_int64", hasDefaultInt64, defaultInt64_, writer); - PrintField("default_uint32", hasDefaultUint32, defaultUint32_, writer); - PrintField("default_uint64", hasDefaultUint64, defaultUint64_, writer); - PrintField("default_sint32", hasDefaultSint32, defaultSint32_, writer); - PrintField("default_sint64", hasDefaultSint64, defaultSint64_, writer); - PrintField("default_fixed32", hasDefaultFixed32, defaultFixed32_, writer); - PrintField("default_fixed64", hasDefaultFixed64, defaultFixed64_, writer); - PrintField("default_sfixed32", hasDefaultSfixed32, defaultSfixed32_, writer); - PrintField("default_sfixed64", hasDefaultSfixed64, defaultSfixed64_, writer); - PrintField("default_float", hasDefaultFloat, defaultFloat_, writer); - PrintField("default_double", hasDefaultDouble, defaultDouble_, writer); - PrintField("default_bool", hasDefaultBool, defaultBool_, writer); - PrintField("default_string", hasDefaultString, defaultString_, writer); - PrintField("default_bytes", hasDefaultBytes, defaultBytes_, writer); - PrintField("default_nested_enum", hasDefaultNestedEnum, defaultNestedEnum_, writer); - PrintField("default_foreign_enum", hasDefaultForeignEnum, defaultForeignEnum_, writer); - PrintField("default_import_enum", hasDefaultImportEnum, defaultImportEnum_, writer); - PrintField("default_string_piece", hasDefaultStringPiece, defaultStringPiece_, writer); - PrintField("default_cord", hasDefaultCord, defaultCord_, writer); - } - #endregion - - public static TestAllTypesLite ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestAllTypesLite ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestAllTypesLite ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestAllTypesLite ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestAllTypesLite ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestAllTypesLite ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestAllTypesLite ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestAllTypesLite ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestAllTypesLite ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestAllTypesLite ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestAllTypesLite MakeReadOnly() { - repeatedInt32_.MakeReadOnly(); - repeatedInt64_.MakeReadOnly(); - repeatedUint32_.MakeReadOnly(); - repeatedUint64_.MakeReadOnly(); - repeatedSint32_.MakeReadOnly(); - repeatedSint64_.MakeReadOnly(); - repeatedFixed32_.MakeReadOnly(); - repeatedFixed64_.MakeReadOnly(); - repeatedSfixed32_.MakeReadOnly(); - repeatedSfixed64_.MakeReadOnly(); - repeatedFloat_.MakeReadOnly(); - repeatedDouble_.MakeReadOnly(); - repeatedBool_.MakeReadOnly(); - repeatedString_.MakeReadOnly(); - repeatedBytes_.MakeReadOnly(); - repeatedGroup_.MakeReadOnly(); - repeatedNestedMessage_.MakeReadOnly(); - repeatedForeignMessage_.MakeReadOnly(); - repeatedImportMessage_.MakeReadOnly(); - repeatedNestedEnum_.MakeReadOnly(); - repeatedForeignEnum_.MakeReadOnly(); - repeatedImportEnum_.MakeReadOnly(); - repeatedStringPiece_.MakeReadOnly(); - repeatedCord_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestAllTypesLite prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilderLite { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestAllTypesLite cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestAllTypesLite result; - - private TestAllTypesLite PrepareBuilder() { - if (resultIsReadOnly) { - TestAllTypesLite original = result; - result = new TestAllTypesLite(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestAllTypesLite MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override TestAllTypesLite DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.DefaultInstance; } - } - - public override TestAllTypesLite BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessageLite other) { - if (other is TestAllTypesLite) { - return MergeFrom((TestAllTypesLite) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestAllTypesLite other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasOptionalInt32) { - OptionalInt32 = other.OptionalInt32; - } - if (other.HasOptionalInt64) { - OptionalInt64 = other.OptionalInt64; - } - if (other.HasOptionalUint32) { - OptionalUint32 = other.OptionalUint32; - } - if (other.HasOptionalUint64) { - OptionalUint64 = other.OptionalUint64; - } - if (other.HasOptionalSint32) { - OptionalSint32 = other.OptionalSint32; - } - if (other.HasOptionalSint64) { - OptionalSint64 = other.OptionalSint64; - } - if (other.HasOptionalFixed32) { - OptionalFixed32 = other.OptionalFixed32; - } - if (other.HasOptionalFixed64) { - OptionalFixed64 = other.OptionalFixed64; - } - if (other.HasOptionalSfixed32) { - OptionalSfixed32 = other.OptionalSfixed32; - } - if (other.HasOptionalSfixed64) { - OptionalSfixed64 = other.OptionalSfixed64; - } - if (other.HasOptionalFloat) { - OptionalFloat = other.OptionalFloat; - } - if (other.HasOptionalDouble) { - OptionalDouble = other.OptionalDouble; - } - if (other.HasOptionalBool) { - OptionalBool = other.OptionalBool; - } - if (other.HasOptionalString) { - OptionalString = other.OptionalString; - } - if (other.HasOptionalBytes) { - OptionalBytes = other.OptionalBytes; - } - if (other.HasOptionalGroup) { - MergeOptionalGroup(other.OptionalGroup); - } - if (other.HasOptionalNestedMessage) { - MergeOptionalNestedMessage(other.OptionalNestedMessage); - } - if (other.HasOptionalForeignMessage) { - MergeOptionalForeignMessage(other.OptionalForeignMessage); - } - if (other.HasOptionalImportMessage) { - MergeOptionalImportMessage(other.OptionalImportMessage); - } - if (other.HasOptionalNestedEnum) { - OptionalNestedEnum = other.OptionalNestedEnum; - } - if (other.HasOptionalForeignEnum) { - OptionalForeignEnum = other.OptionalForeignEnum; - } - if (other.HasOptionalImportEnum) { - OptionalImportEnum = other.OptionalImportEnum; - } - if (other.HasOptionalStringPiece) { - OptionalStringPiece = other.OptionalStringPiece; - } - if (other.HasOptionalCord) { - OptionalCord = other.OptionalCord; - } - if (other.repeatedInt32_.Count != 0) { - result.repeatedInt32_.Add(other.repeatedInt32_); - } - if (other.repeatedInt64_.Count != 0) { - result.repeatedInt64_.Add(other.repeatedInt64_); - } - if (other.repeatedUint32_.Count != 0) { - result.repeatedUint32_.Add(other.repeatedUint32_); - } - if (other.repeatedUint64_.Count != 0) { - result.repeatedUint64_.Add(other.repeatedUint64_); - } - if (other.repeatedSint32_.Count != 0) { - result.repeatedSint32_.Add(other.repeatedSint32_); - } - if (other.repeatedSint64_.Count != 0) { - result.repeatedSint64_.Add(other.repeatedSint64_); - } - if (other.repeatedFixed32_.Count != 0) { - result.repeatedFixed32_.Add(other.repeatedFixed32_); - } - if (other.repeatedFixed64_.Count != 0) { - result.repeatedFixed64_.Add(other.repeatedFixed64_); - } - if (other.repeatedSfixed32_.Count != 0) { - result.repeatedSfixed32_.Add(other.repeatedSfixed32_); - } - if (other.repeatedSfixed64_.Count != 0) { - result.repeatedSfixed64_.Add(other.repeatedSfixed64_); - } - if (other.repeatedFloat_.Count != 0) { - result.repeatedFloat_.Add(other.repeatedFloat_); - } - if (other.repeatedDouble_.Count != 0) { - result.repeatedDouble_.Add(other.repeatedDouble_); - } - if (other.repeatedBool_.Count != 0) { - result.repeatedBool_.Add(other.repeatedBool_); - } - if (other.repeatedString_.Count != 0) { - result.repeatedString_.Add(other.repeatedString_); - } - if (other.repeatedBytes_.Count != 0) { - result.repeatedBytes_.Add(other.repeatedBytes_); - } - if (other.repeatedGroup_.Count != 0) { - result.repeatedGroup_.Add(other.repeatedGroup_); - } - if (other.repeatedNestedMessage_.Count != 0) { - result.repeatedNestedMessage_.Add(other.repeatedNestedMessage_); - } - if (other.repeatedForeignMessage_.Count != 0) { - result.repeatedForeignMessage_.Add(other.repeatedForeignMessage_); - } - if (other.repeatedImportMessage_.Count != 0) { - result.repeatedImportMessage_.Add(other.repeatedImportMessage_); - } - if (other.repeatedNestedEnum_.Count != 0) { - result.repeatedNestedEnum_.Add(other.repeatedNestedEnum_); - } - if (other.repeatedForeignEnum_.Count != 0) { - result.repeatedForeignEnum_.Add(other.repeatedForeignEnum_); - } - if (other.repeatedImportEnum_.Count != 0) { - result.repeatedImportEnum_.Add(other.repeatedImportEnum_); - } - if (other.repeatedStringPiece_.Count != 0) { - result.repeatedStringPiece_.Add(other.repeatedStringPiece_); - } - if (other.repeatedCord_.Count != 0) { - result.repeatedCord_.Add(other.repeatedCord_); - } - if (other.HasDefaultInt32) { - DefaultInt32 = other.DefaultInt32; - } - if (other.HasDefaultInt64) { - DefaultInt64 = other.DefaultInt64; - } - if (other.HasDefaultUint32) { - DefaultUint32 = other.DefaultUint32; - } - if (other.HasDefaultUint64) { - DefaultUint64 = other.DefaultUint64; - } - if (other.HasDefaultSint32) { - DefaultSint32 = other.DefaultSint32; - } - if (other.HasDefaultSint64) { - DefaultSint64 = other.DefaultSint64; - } - if (other.HasDefaultFixed32) { - DefaultFixed32 = other.DefaultFixed32; - } - if (other.HasDefaultFixed64) { - DefaultFixed64 = other.DefaultFixed64; - } - if (other.HasDefaultSfixed32) { - DefaultSfixed32 = other.DefaultSfixed32; - } - if (other.HasDefaultSfixed64) { - DefaultSfixed64 = other.DefaultSfixed64; - } - if (other.HasDefaultFloat) { - DefaultFloat = other.DefaultFloat; - } - if (other.HasDefaultDouble) { - DefaultDouble = other.DefaultDouble; - } - if (other.HasDefaultBool) { - DefaultBool = other.DefaultBool; - } - if (other.HasDefaultString) { - DefaultString = other.DefaultString; - } - if (other.HasDefaultBytes) { - DefaultBytes = other.DefaultBytes; - } - if (other.HasDefaultNestedEnum) { - DefaultNestedEnum = other.DefaultNestedEnum; - } - if (other.HasDefaultForeignEnum) { - DefaultForeignEnum = other.DefaultForeignEnum; - } - if (other.HasDefaultImportEnum) { - DefaultImportEnum = other.DefaultImportEnum; - } - if (other.HasDefaultStringPiece) { - DefaultStringPiece = other.DefaultStringPiece; - } - if (other.HasDefaultCord) { - DefaultCord = other.DefaultCord; - } - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testAllTypesLiteFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testAllTypesLiteFieldTags[field_ordinal]; - else { - ParseUnknownField(input, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - return this; - } - ParseUnknownField(input, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasOptionalInt32 = input.ReadInt32(ref result.optionalInt32_); - break; - } - case 16: { - result.hasOptionalInt64 = input.ReadInt64(ref result.optionalInt64_); - break; - } - case 24: { - result.hasOptionalUint32 = input.ReadUInt32(ref result.optionalUint32_); - break; - } - case 32: { - result.hasOptionalUint64 = input.ReadUInt64(ref result.optionalUint64_); - break; - } - case 40: { - result.hasOptionalSint32 = input.ReadSInt32(ref result.optionalSint32_); - break; - } - case 48: { - result.hasOptionalSint64 = input.ReadSInt64(ref result.optionalSint64_); - break; - } - case 61: { - result.hasOptionalFixed32 = input.ReadFixed32(ref result.optionalFixed32_); - break; - } - case 65: { - result.hasOptionalFixed64 = input.ReadFixed64(ref result.optionalFixed64_); - break; - } - case 77: { - result.hasOptionalSfixed32 = input.ReadSFixed32(ref result.optionalSfixed32_); - break; - } - case 81: { - result.hasOptionalSfixed64 = input.ReadSFixed64(ref result.optionalSfixed64_); - break; - } - case 93: { - result.hasOptionalFloat = input.ReadFloat(ref result.optionalFloat_); - break; - } - case 97: { - result.hasOptionalDouble = input.ReadDouble(ref result.optionalDouble_); - break; - } - case 104: { - result.hasOptionalBool = input.ReadBool(ref result.optionalBool_); - break; - } - case 114: { - result.hasOptionalString = input.ReadString(ref result.optionalString_); - break; - } - case 122: { - result.hasOptionalBytes = input.ReadBytes(ref result.optionalBytes_); - break; - } - case 131: { - global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.OptionalGroup.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.OptionalGroup.CreateBuilder(); - if (result.hasOptionalGroup) { - subBuilder.MergeFrom(OptionalGroup); - } - input.ReadGroup(16, subBuilder, extensionRegistry); - OptionalGroup = subBuilder.BuildPartial(); - break; - } - case 146: { - global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedMessage.CreateBuilder(); - if (result.hasOptionalNestedMessage) { - subBuilder.MergeFrom(OptionalNestedMessage); - } - input.ReadMessage(subBuilder, extensionRegistry); - OptionalNestedMessage = subBuilder.BuildPartial(); - break; - } - case 154: { - global::Google.ProtocolBuffers.TestProtos.ForeignMessageLite.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.ForeignMessageLite.CreateBuilder(); - if (result.hasOptionalForeignMessage) { - subBuilder.MergeFrom(OptionalForeignMessage); - } - input.ReadMessage(subBuilder, extensionRegistry); - OptionalForeignMessage = subBuilder.BuildPartial(); - break; - } - case 162: { - global::Google.ProtocolBuffers.TestProtos.ImportMessageLite.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.ImportMessageLite.CreateBuilder(); - if (result.hasOptionalImportMessage) { - subBuilder.MergeFrom(OptionalImportMessage); - } - input.ReadMessage(subBuilder, extensionRegistry); - OptionalImportMessage = subBuilder.BuildPartial(); - break; - } - case 168: { - object unknown; - if(input.ReadEnum(ref result.optionalNestedEnum_, out unknown)) { - result.hasOptionalNestedEnum = true; - } else if(unknown is int) { - } - break; - } - case 176: { - object unknown; - if(input.ReadEnum(ref result.optionalForeignEnum_, out unknown)) { - result.hasOptionalForeignEnum = true; - } else if(unknown is int) { - } - break; - } - case 184: { - object unknown; - if(input.ReadEnum(ref result.optionalImportEnum_, out unknown)) { - result.hasOptionalImportEnum = true; - } else if(unknown is int) { - } - break; - } - case 194: { - result.hasOptionalStringPiece = input.ReadString(ref result.optionalStringPiece_); - break; - } - case 202: { - result.hasOptionalCord = input.ReadString(ref result.optionalCord_); - break; - } - case 250: - case 248: { - input.ReadInt32Array(tag, field_name, result.repeatedInt32_); - break; - } - case 258: - case 256: { - input.ReadInt64Array(tag, field_name, result.repeatedInt64_); - break; - } - case 266: - case 264: { - input.ReadUInt32Array(tag, field_name, result.repeatedUint32_); - break; - } - case 274: - case 272: { - input.ReadUInt64Array(tag, field_name, result.repeatedUint64_); - break; - } - case 282: - case 280: { - input.ReadSInt32Array(tag, field_name, result.repeatedSint32_); - break; - } - case 290: - case 288: { - input.ReadSInt64Array(tag, field_name, result.repeatedSint64_); - break; - } - case 298: - case 301: { - input.ReadFixed32Array(tag, field_name, result.repeatedFixed32_); - break; - } - case 306: - case 305: { - input.ReadFixed64Array(tag, field_name, result.repeatedFixed64_); - break; - } - case 314: - case 317: { - input.ReadSFixed32Array(tag, field_name, result.repeatedSfixed32_); - break; - } - case 322: - case 321: { - input.ReadSFixed64Array(tag, field_name, result.repeatedSfixed64_); - break; - } - case 330: - case 333: { - input.ReadFloatArray(tag, field_name, result.repeatedFloat_); - break; - } - case 338: - case 337: { - input.ReadDoubleArray(tag, field_name, result.repeatedDouble_); - break; - } - case 346: - case 344: { - input.ReadBoolArray(tag, field_name, result.repeatedBool_); - break; - } - case 354: { - input.ReadStringArray(tag, field_name, result.repeatedString_); - break; - } - case 362: { - input.ReadBytesArray(tag, field_name, result.repeatedBytes_); - break; - } - case 371: { - input.ReadGroupArray(tag, field_name, result.repeatedGroup_, global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.RepeatedGroup.DefaultInstance, extensionRegistry); - break; - } - case 386: { - input.ReadMessageArray(tag, field_name, result.repeatedNestedMessage_, global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedMessage.DefaultInstance, extensionRegistry); - break; - } - case 394: { - input.ReadMessageArray(tag, field_name, result.repeatedForeignMessage_, global::Google.ProtocolBuffers.TestProtos.ForeignMessageLite.DefaultInstance, extensionRegistry); - break; - } - case 402: { - input.ReadMessageArray(tag, field_name, result.repeatedImportMessage_, global::Google.ProtocolBuffers.TestProtos.ImportMessageLite.DefaultInstance, extensionRegistry); - break; - } - case 410: - case 408: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.repeatedNestedEnum_, out unknownItems); - break; - } - case 418: - case 416: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.repeatedForeignEnum_, out unknownItems); - break; - } - case 426: - case 424: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.repeatedImportEnum_, out unknownItems); - break; - } - case 434: { - input.ReadStringArray(tag, field_name, result.repeatedStringPiece_); - break; - } - case 442: { - input.ReadStringArray(tag, field_name, result.repeatedCord_); - break; - } - case 488: { - result.hasDefaultInt32 = input.ReadInt32(ref result.defaultInt32_); - break; - } - case 496: { - result.hasDefaultInt64 = input.ReadInt64(ref result.defaultInt64_); - break; - } - case 504: { - result.hasDefaultUint32 = input.ReadUInt32(ref result.defaultUint32_); - break; - } - case 512: { - result.hasDefaultUint64 = input.ReadUInt64(ref result.defaultUint64_); - break; - } - case 520: { - result.hasDefaultSint32 = input.ReadSInt32(ref result.defaultSint32_); - break; - } - case 528: { - result.hasDefaultSint64 = input.ReadSInt64(ref result.defaultSint64_); - break; - } - case 541: { - result.hasDefaultFixed32 = input.ReadFixed32(ref result.defaultFixed32_); - break; - } - case 545: { - result.hasDefaultFixed64 = input.ReadFixed64(ref result.defaultFixed64_); - break; - } - case 557: { - result.hasDefaultSfixed32 = input.ReadSFixed32(ref result.defaultSfixed32_); - break; - } - case 561: { - result.hasDefaultSfixed64 = input.ReadSFixed64(ref result.defaultSfixed64_); - break; - } - case 573: { - result.hasDefaultFloat = input.ReadFloat(ref result.defaultFloat_); - break; - } - case 577: { - result.hasDefaultDouble = input.ReadDouble(ref result.defaultDouble_); - break; - } - case 584: { - result.hasDefaultBool = input.ReadBool(ref result.defaultBool_); - break; - } - case 594: { - result.hasDefaultString = input.ReadString(ref result.defaultString_); - break; - } - case 602: { - result.hasDefaultBytes = input.ReadBytes(ref result.defaultBytes_); - break; - } - case 648: { - object unknown; - if(input.ReadEnum(ref result.defaultNestedEnum_, out unknown)) { - result.hasDefaultNestedEnum = true; - } else if(unknown is int) { - } - break; - } - case 656: { - object unknown; - if(input.ReadEnum(ref result.defaultForeignEnum_, out unknown)) { - result.hasDefaultForeignEnum = true; - } else if(unknown is int) { - } - break; - } - case 664: { - object unknown; - if(input.ReadEnum(ref result.defaultImportEnum_, out unknown)) { - result.hasDefaultImportEnum = true; - } else if(unknown is int) { - } - break; - } - case 674: { - result.hasDefaultStringPiece = input.ReadString(ref result.defaultStringPiece_); - break; - } - case 682: { - result.hasDefaultCord = input.ReadString(ref result.defaultCord_); - break; - } - } - } - - return this; - } - - - public bool HasOptionalInt32 { - get { return result.hasOptionalInt32; } - } - public int OptionalInt32 { - get { return result.OptionalInt32; } - set { SetOptionalInt32(value); } - } - public Builder SetOptionalInt32(int value) { - PrepareBuilder(); - result.hasOptionalInt32 = true; - result.optionalInt32_ = value; - return this; - } - public Builder ClearOptionalInt32() { - PrepareBuilder(); - result.hasOptionalInt32 = false; - result.optionalInt32_ = 0; - return this; - } - - public bool HasOptionalInt64 { - get { return result.hasOptionalInt64; } - } - public long OptionalInt64 { - get { return result.OptionalInt64; } - set { SetOptionalInt64(value); } - } - public Builder SetOptionalInt64(long value) { - PrepareBuilder(); - result.hasOptionalInt64 = true; - result.optionalInt64_ = value; - return this; - } - public Builder ClearOptionalInt64() { - PrepareBuilder(); - result.hasOptionalInt64 = false; - result.optionalInt64_ = 0L; - return this; - } - - public bool HasOptionalUint32 { - get { return result.hasOptionalUint32; } - } - [global::System.CLSCompliant(false)] - public uint OptionalUint32 { - get { return result.OptionalUint32; } - set { SetOptionalUint32(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetOptionalUint32(uint value) { - PrepareBuilder(); - result.hasOptionalUint32 = true; - result.optionalUint32_ = value; - return this; - } - public Builder ClearOptionalUint32() { - PrepareBuilder(); - result.hasOptionalUint32 = false; - result.optionalUint32_ = 0; - return this; - } - - public bool HasOptionalUint64 { - get { return result.hasOptionalUint64; } - } - [global::System.CLSCompliant(false)] - public ulong OptionalUint64 { - get { return result.OptionalUint64; } - set { SetOptionalUint64(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetOptionalUint64(ulong value) { - PrepareBuilder(); - result.hasOptionalUint64 = true; - result.optionalUint64_ = value; - return this; - } - public Builder ClearOptionalUint64() { - PrepareBuilder(); - result.hasOptionalUint64 = false; - result.optionalUint64_ = 0UL; - return this; - } - - public bool HasOptionalSint32 { - get { return result.hasOptionalSint32; } - } - public int OptionalSint32 { - get { return result.OptionalSint32; } - set { SetOptionalSint32(value); } - } - public Builder SetOptionalSint32(int value) { - PrepareBuilder(); - result.hasOptionalSint32 = true; - result.optionalSint32_ = value; - return this; - } - public Builder ClearOptionalSint32() { - PrepareBuilder(); - result.hasOptionalSint32 = false; - result.optionalSint32_ = 0; - return this; - } - - public bool HasOptionalSint64 { - get { return result.hasOptionalSint64; } - } - public long OptionalSint64 { - get { return result.OptionalSint64; } - set { SetOptionalSint64(value); } - } - public Builder SetOptionalSint64(long value) { - PrepareBuilder(); - result.hasOptionalSint64 = true; - result.optionalSint64_ = value; - return this; - } - public Builder ClearOptionalSint64() { - PrepareBuilder(); - result.hasOptionalSint64 = false; - result.optionalSint64_ = 0; - return this; - } - - public bool HasOptionalFixed32 { - get { return result.hasOptionalFixed32; } - } - [global::System.CLSCompliant(false)] - public uint OptionalFixed32 { - get { return result.OptionalFixed32; } - set { SetOptionalFixed32(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetOptionalFixed32(uint value) { - PrepareBuilder(); - result.hasOptionalFixed32 = true; - result.optionalFixed32_ = value; - return this; - } - public Builder ClearOptionalFixed32() { - PrepareBuilder(); - result.hasOptionalFixed32 = false; - result.optionalFixed32_ = 0; - return this; - } - - public bool HasOptionalFixed64 { - get { return result.hasOptionalFixed64; } - } - [global::System.CLSCompliant(false)] - public ulong OptionalFixed64 { - get { return result.OptionalFixed64; } - set { SetOptionalFixed64(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetOptionalFixed64(ulong value) { - PrepareBuilder(); - result.hasOptionalFixed64 = true; - result.optionalFixed64_ = value; - return this; - } - public Builder ClearOptionalFixed64() { - PrepareBuilder(); - result.hasOptionalFixed64 = false; - result.optionalFixed64_ = 0; - return this; - } - - public bool HasOptionalSfixed32 { - get { return result.hasOptionalSfixed32; } - } - public int OptionalSfixed32 { - get { return result.OptionalSfixed32; } - set { SetOptionalSfixed32(value); } - } - public Builder SetOptionalSfixed32(int value) { - PrepareBuilder(); - result.hasOptionalSfixed32 = true; - result.optionalSfixed32_ = value; - return this; - } - public Builder ClearOptionalSfixed32() { - PrepareBuilder(); - result.hasOptionalSfixed32 = false; - result.optionalSfixed32_ = 0; - return this; - } - - public bool HasOptionalSfixed64 { - get { return result.hasOptionalSfixed64; } - } - public long OptionalSfixed64 { - get { return result.OptionalSfixed64; } - set { SetOptionalSfixed64(value); } - } - public Builder SetOptionalSfixed64(long value) { - PrepareBuilder(); - result.hasOptionalSfixed64 = true; - result.optionalSfixed64_ = value; - return this; - } - public Builder ClearOptionalSfixed64() { - PrepareBuilder(); - result.hasOptionalSfixed64 = false; - result.optionalSfixed64_ = 0; - return this; - } - - public bool HasOptionalFloat { - get { return result.hasOptionalFloat; } - } - public float OptionalFloat { - get { return result.OptionalFloat; } - set { SetOptionalFloat(value); } - } - public Builder SetOptionalFloat(float value) { - PrepareBuilder(); - result.hasOptionalFloat = true; - result.optionalFloat_ = value; - return this; - } - public Builder ClearOptionalFloat() { - PrepareBuilder(); - result.hasOptionalFloat = false; - result.optionalFloat_ = 0F; - return this; - } - - public bool HasOptionalDouble { - get { return result.hasOptionalDouble; } - } - public double OptionalDouble { - get { return result.OptionalDouble; } - set { SetOptionalDouble(value); } - } - public Builder SetOptionalDouble(double value) { - PrepareBuilder(); - result.hasOptionalDouble = true; - result.optionalDouble_ = value; - return this; - } - public Builder ClearOptionalDouble() { - PrepareBuilder(); - result.hasOptionalDouble = false; - result.optionalDouble_ = 0D; - return this; - } - - public bool HasOptionalBool { - get { return result.hasOptionalBool; } - } - public bool OptionalBool { - get { return result.OptionalBool; } - set { SetOptionalBool(value); } - } - public Builder SetOptionalBool(bool value) { - PrepareBuilder(); - result.hasOptionalBool = true; - result.optionalBool_ = value; - return this; - } - public Builder ClearOptionalBool() { - PrepareBuilder(); - result.hasOptionalBool = false; - result.optionalBool_ = false; - return this; - } - - public bool HasOptionalString { - get { return result.hasOptionalString; } - } - public string OptionalString { - get { return result.OptionalString; } - set { SetOptionalString(value); } - } - public Builder SetOptionalString(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalString = true; - result.optionalString_ = value; - return this; - } - public Builder ClearOptionalString() { - PrepareBuilder(); - result.hasOptionalString = false; - result.optionalString_ = ""; - return this; - } - - public bool HasOptionalBytes { - get { return result.hasOptionalBytes; } - } - public pb::ByteString OptionalBytes { - get { return result.OptionalBytes; } - set { SetOptionalBytes(value); } - } - public Builder SetOptionalBytes(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalBytes = true; - result.optionalBytes_ = value; - return this; - } - public Builder ClearOptionalBytes() { - PrepareBuilder(); - result.hasOptionalBytes = false; - result.optionalBytes_ = pb::ByteString.Empty; - return this; - } - - public bool HasOptionalGroup { - get { return result.hasOptionalGroup; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.OptionalGroup OptionalGroup { - get { return result.OptionalGroup; } - set { SetOptionalGroup(value); } - } - public Builder SetOptionalGroup(global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.OptionalGroup value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalGroup = true; - result.optionalGroup_ = value; - return this; - } - public Builder SetOptionalGroup(global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.OptionalGroup.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptionalGroup = true; - result.optionalGroup_ = builderForValue.Build(); - return this; - } - public Builder MergeOptionalGroup(global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.OptionalGroup value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptionalGroup && - result.optionalGroup_ != global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.OptionalGroup.DefaultInstance) { - result.optionalGroup_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.OptionalGroup.CreateBuilder(result.optionalGroup_).MergeFrom(value).BuildPartial(); - } else { - result.optionalGroup_ = value; - } - result.hasOptionalGroup = true; - return this; - } - public Builder ClearOptionalGroup() { - PrepareBuilder(); - result.hasOptionalGroup = false; - result.optionalGroup_ = null; - return this; - } - - public bool HasOptionalNestedMessage { - get { return result.hasOptionalNestedMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedMessage OptionalNestedMessage { - get { return result.OptionalNestedMessage; } - set { SetOptionalNestedMessage(value); } - } - public Builder SetOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalNestedMessage = true; - result.optionalNestedMessage_ = value; - return this; - } - public Builder SetOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptionalNestedMessage = true; - result.optionalNestedMessage_ = builderForValue.Build(); - return this; - } - public Builder MergeOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptionalNestedMessage && - result.optionalNestedMessage_ != global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedMessage.DefaultInstance) { - result.optionalNestedMessage_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedMessage.CreateBuilder(result.optionalNestedMessage_).MergeFrom(value).BuildPartial(); - } else { - result.optionalNestedMessage_ = value; - } - result.hasOptionalNestedMessage = true; - return this; - } - public Builder ClearOptionalNestedMessage() { - PrepareBuilder(); - result.hasOptionalNestedMessage = false; - result.optionalNestedMessage_ = null; - return this; - } - - public bool HasOptionalForeignMessage { - get { return result.hasOptionalForeignMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessageLite OptionalForeignMessage { - get { return result.OptionalForeignMessage; } - set { SetOptionalForeignMessage(value); } - } - public Builder SetOptionalForeignMessage(global::Google.ProtocolBuffers.TestProtos.ForeignMessageLite value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalForeignMessage = true; - result.optionalForeignMessage_ = value; - return this; - } - public Builder SetOptionalForeignMessage(global::Google.ProtocolBuffers.TestProtos.ForeignMessageLite.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptionalForeignMessage = true; - result.optionalForeignMessage_ = builderForValue.Build(); - return this; - } - public Builder MergeOptionalForeignMessage(global::Google.ProtocolBuffers.TestProtos.ForeignMessageLite value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptionalForeignMessage && - result.optionalForeignMessage_ != global::Google.ProtocolBuffers.TestProtos.ForeignMessageLite.DefaultInstance) { - result.optionalForeignMessage_ = global::Google.ProtocolBuffers.TestProtos.ForeignMessageLite.CreateBuilder(result.optionalForeignMessage_).MergeFrom(value).BuildPartial(); - } else { - result.optionalForeignMessage_ = value; - } - result.hasOptionalForeignMessage = true; - return this; - } - public Builder ClearOptionalForeignMessage() { - PrepareBuilder(); - result.hasOptionalForeignMessage = false; - result.optionalForeignMessage_ = null; - return this; - } - - public bool HasOptionalImportMessage { - get { return result.hasOptionalImportMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportMessageLite OptionalImportMessage { - get { return result.OptionalImportMessage; } - set { SetOptionalImportMessage(value); } - } - public Builder SetOptionalImportMessage(global::Google.ProtocolBuffers.TestProtos.ImportMessageLite value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalImportMessage = true; - result.optionalImportMessage_ = value; - return this; - } - public Builder SetOptionalImportMessage(global::Google.ProtocolBuffers.TestProtos.ImportMessageLite.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptionalImportMessage = true; - result.optionalImportMessage_ = builderForValue.Build(); - return this; - } - public Builder MergeOptionalImportMessage(global::Google.ProtocolBuffers.TestProtos.ImportMessageLite value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptionalImportMessage && - result.optionalImportMessage_ != global::Google.ProtocolBuffers.TestProtos.ImportMessageLite.DefaultInstance) { - result.optionalImportMessage_ = global::Google.ProtocolBuffers.TestProtos.ImportMessageLite.CreateBuilder(result.optionalImportMessage_).MergeFrom(value).BuildPartial(); - } else { - result.optionalImportMessage_ = value; - } - result.hasOptionalImportMessage = true; - return this; - } - public Builder ClearOptionalImportMessage() { - PrepareBuilder(); - result.hasOptionalImportMessage = false; - result.optionalImportMessage_ = null; - return this; - } - - public bool HasOptionalNestedEnum { - get { return result.hasOptionalNestedEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedEnum OptionalNestedEnum { - get { return result.OptionalNestedEnum; } - set { SetOptionalNestedEnum(value); } - } - public Builder SetOptionalNestedEnum(global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedEnum value) { - PrepareBuilder(); - result.hasOptionalNestedEnum = true; - result.optionalNestedEnum_ = value; - return this; - } - public Builder ClearOptionalNestedEnum() { - PrepareBuilder(); - result.hasOptionalNestedEnum = false; - result.optionalNestedEnum_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedEnum.FOO; - return this; - } - - public bool HasOptionalForeignEnum { - get { return result.hasOptionalForeignEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnumLite OptionalForeignEnum { - get { return result.OptionalForeignEnum; } - set { SetOptionalForeignEnum(value); } - } - public Builder SetOptionalForeignEnum(global::Google.ProtocolBuffers.TestProtos.ForeignEnumLite value) { - PrepareBuilder(); - result.hasOptionalForeignEnum = true; - result.optionalForeignEnum_ = value; - return this; - } - public Builder ClearOptionalForeignEnum() { - PrepareBuilder(); - result.hasOptionalForeignEnum = false; - result.optionalForeignEnum_ = global::Google.ProtocolBuffers.TestProtos.ForeignEnumLite.FOREIGN_LITE_FOO; - return this; - } - - public bool HasOptionalImportEnum { - get { return result.hasOptionalImportEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportEnumLite OptionalImportEnum { - get { return result.OptionalImportEnum; } - set { SetOptionalImportEnum(value); } - } - public Builder SetOptionalImportEnum(global::Google.ProtocolBuffers.TestProtos.ImportEnumLite value) { - PrepareBuilder(); - result.hasOptionalImportEnum = true; - result.optionalImportEnum_ = value; - return this; - } - public Builder ClearOptionalImportEnum() { - PrepareBuilder(); - result.hasOptionalImportEnum = false; - result.optionalImportEnum_ = global::Google.ProtocolBuffers.TestProtos.ImportEnumLite.IMPORT_LITE_FOO; - return this; - } - - public bool HasOptionalStringPiece { - get { return result.hasOptionalStringPiece; } - } - public string OptionalStringPiece { - get { return result.OptionalStringPiece; } - set { SetOptionalStringPiece(value); } - } - public Builder SetOptionalStringPiece(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalStringPiece = true; - result.optionalStringPiece_ = value; - return this; - } - public Builder ClearOptionalStringPiece() { - PrepareBuilder(); - result.hasOptionalStringPiece = false; - result.optionalStringPiece_ = ""; - return this; - } - - public bool HasOptionalCord { - get { return result.hasOptionalCord; } - } - public string OptionalCord { - get { return result.OptionalCord; } - set { SetOptionalCord(value); } - } - public Builder SetOptionalCord(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalCord = true; - result.optionalCord_ = value; - return this; - } - public Builder ClearOptionalCord() { - PrepareBuilder(); - result.hasOptionalCord = false; - result.optionalCord_ = ""; - return this; - } - - public pbc::IPopsicleList RepeatedInt32List { - get { return PrepareBuilder().repeatedInt32_; } - } - public int RepeatedInt32Count { - get { return result.RepeatedInt32Count; } - } - public int GetRepeatedInt32(int index) { - return result.GetRepeatedInt32(index); - } - public Builder SetRepeatedInt32(int index, int value) { - PrepareBuilder(); - result.repeatedInt32_[index] = value; - return this; - } - public Builder AddRepeatedInt32(int value) { - PrepareBuilder(); - result.repeatedInt32_.Add(value); - return this; - } - public Builder AddRangeRepeatedInt32(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedInt32_.Add(values); - return this; - } - public Builder ClearRepeatedInt32() { - PrepareBuilder(); - result.repeatedInt32_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedInt64List { - get { return PrepareBuilder().repeatedInt64_; } - } - public int RepeatedInt64Count { - get { return result.RepeatedInt64Count; } - } - public long GetRepeatedInt64(int index) { - return result.GetRepeatedInt64(index); - } - public Builder SetRepeatedInt64(int index, long value) { - PrepareBuilder(); - result.repeatedInt64_[index] = value; - return this; - } - public Builder AddRepeatedInt64(long value) { - PrepareBuilder(); - result.repeatedInt64_.Add(value); - return this; - } - public Builder AddRangeRepeatedInt64(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedInt64_.Add(values); - return this; - } - public Builder ClearRepeatedInt64() { - PrepareBuilder(); - result.repeatedInt64_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList RepeatedUint32List { - get { return PrepareBuilder().repeatedUint32_; } - } - public int RepeatedUint32Count { - get { return result.RepeatedUint32Count; } - } - [global::System.CLSCompliant(false)] - public uint GetRepeatedUint32(int index) { - return result.GetRepeatedUint32(index); - } - [global::System.CLSCompliant(false)] - public Builder SetRepeatedUint32(int index, uint value) { - PrepareBuilder(); - result.repeatedUint32_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRepeatedUint32(uint value) { - PrepareBuilder(); - result.repeatedUint32_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeRepeatedUint32(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedUint32_.Add(values); - return this; - } - public Builder ClearRepeatedUint32() { - PrepareBuilder(); - result.repeatedUint32_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList RepeatedUint64List { - get { return PrepareBuilder().repeatedUint64_; } - } - public int RepeatedUint64Count { - get { return result.RepeatedUint64Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetRepeatedUint64(int index) { - return result.GetRepeatedUint64(index); - } - [global::System.CLSCompliant(false)] - public Builder SetRepeatedUint64(int index, ulong value) { - PrepareBuilder(); - result.repeatedUint64_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRepeatedUint64(ulong value) { - PrepareBuilder(); - result.repeatedUint64_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeRepeatedUint64(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedUint64_.Add(values); - return this; - } - public Builder ClearRepeatedUint64() { - PrepareBuilder(); - result.repeatedUint64_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedSint32List { - get { return PrepareBuilder().repeatedSint32_; } - } - public int RepeatedSint32Count { - get { return result.RepeatedSint32Count; } - } - public int GetRepeatedSint32(int index) { - return result.GetRepeatedSint32(index); - } - public Builder SetRepeatedSint32(int index, int value) { - PrepareBuilder(); - result.repeatedSint32_[index] = value; - return this; - } - public Builder AddRepeatedSint32(int value) { - PrepareBuilder(); - result.repeatedSint32_.Add(value); - return this; - } - public Builder AddRangeRepeatedSint32(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedSint32_.Add(values); - return this; - } - public Builder ClearRepeatedSint32() { - PrepareBuilder(); - result.repeatedSint32_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedSint64List { - get { return PrepareBuilder().repeatedSint64_; } - } - public int RepeatedSint64Count { - get { return result.RepeatedSint64Count; } - } - public long GetRepeatedSint64(int index) { - return result.GetRepeatedSint64(index); - } - public Builder SetRepeatedSint64(int index, long value) { - PrepareBuilder(); - result.repeatedSint64_[index] = value; - return this; - } - public Builder AddRepeatedSint64(long value) { - PrepareBuilder(); - result.repeatedSint64_.Add(value); - return this; - } - public Builder AddRangeRepeatedSint64(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedSint64_.Add(values); - return this; - } - public Builder ClearRepeatedSint64() { - PrepareBuilder(); - result.repeatedSint64_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList RepeatedFixed32List { - get { return PrepareBuilder().repeatedFixed32_; } - } - public int RepeatedFixed32Count { - get { return result.RepeatedFixed32Count; } - } - [global::System.CLSCompliant(false)] - public uint GetRepeatedFixed32(int index) { - return result.GetRepeatedFixed32(index); - } - [global::System.CLSCompliant(false)] - public Builder SetRepeatedFixed32(int index, uint value) { - PrepareBuilder(); - result.repeatedFixed32_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRepeatedFixed32(uint value) { - PrepareBuilder(); - result.repeatedFixed32_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeRepeatedFixed32(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedFixed32_.Add(values); - return this; - } - public Builder ClearRepeatedFixed32() { - PrepareBuilder(); - result.repeatedFixed32_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList RepeatedFixed64List { - get { return PrepareBuilder().repeatedFixed64_; } - } - public int RepeatedFixed64Count { - get { return result.RepeatedFixed64Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetRepeatedFixed64(int index) { - return result.GetRepeatedFixed64(index); - } - [global::System.CLSCompliant(false)] - public Builder SetRepeatedFixed64(int index, ulong value) { - PrepareBuilder(); - result.repeatedFixed64_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRepeatedFixed64(ulong value) { - PrepareBuilder(); - result.repeatedFixed64_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeRepeatedFixed64(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedFixed64_.Add(values); - return this; - } - public Builder ClearRepeatedFixed64() { - PrepareBuilder(); - result.repeatedFixed64_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedSfixed32List { - get { return PrepareBuilder().repeatedSfixed32_; } - } - public int RepeatedSfixed32Count { - get { return result.RepeatedSfixed32Count; } - } - public int GetRepeatedSfixed32(int index) { - return result.GetRepeatedSfixed32(index); - } - public Builder SetRepeatedSfixed32(int index, int value) { - PrepareBuilder(); - result.repeatedSfixed32_[index] = value; - return this; - } - public Builder AddRepeatedSfixed32(int value) { - PrepareBuilder(); - result.repeatedSfixed32_.Add(value); - return this; - } - public Builder AddRangeRepeatedSfixed32(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedSfixed32_.Add(values); - return this; - } - public Builder ClearRepeatedSfixed32() { - PrepareBuilder(); - result.repeatedSfixed32_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedSfixed64List { - get { return PrepareBuilder().repeatedSfixed64_; } - } - public int RepeatedSfixed64Count { - get { return result.RepeatedSfixed64Count; } - } - public long GetRepeatedSfixed64(int index) { - return result.GetRepeatedSfixed64(index); - } - public Builder SetRepeatedSfixed64(int index, long value) { - PrepareBuilder(); - result.repeatedSfixed64_[index] = value; - return this; - } - public Builder AddRepeatedSfixed64(long value) { - PrepareBuilder(); - result.repeatedSfixed64_.Add(value); - return this; - } - public Builder AddRangeRepeatedSfixed64(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedSfixed64_.Add(values); - return this; - } - public Builder ClearRepeatedSfixed64() { - PrepareBuilder(); - result.repeatedSfixed64_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedFloatList { - get { return PrepareBuilder().repeatedFloat_; } - } - public int RepeatedFloatCount { - get { return result.RepeatedFloatCount; } - } - public float GetRepeatedFloat(int index) { - return result.GetRepeatedFloat(index); - } - public Builder SetRepeatedFloat(int index, float value) { - PrepareBuilder(); - result.repeatedFloat_[index] = value; - return this; - } - public Builder AddRepeatedFloat(float value) { - PrepareBuilder(); - result.repeatedFloat_.Add(value); - return this; - } - public Builder AddRangeRepeatedFloat(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedFloat_.Add(values); - return this; - } - public Builder ClearRepeatedFloat() { - PrepareBuilder(); - result.repeatedFloat_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedDoubleList { - get { return PrepareBuilder().repeatedDouble_; } - } - public int RepeatedDoubleCount { - get { return result.RepeatedDoubleCount; } - } - public double GetRepeatedDouble(int index) { - return result.GetRepeatedDouble(index); - } - public Builder SetRepeatedDouble(int index, double value) { - PrepareBuilder(); - result.repeatedDouble_[index] = value; - return this; - } - public Builder AddRepeatedDouble(double value) { - PrepareBuilder(); - result.repeatedDouble_.Add(value); - return this; - } - public Builder AddRangeRepeatedDouble(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedDouble_.Add(values); - return this; - } - public Builder ClearRepeatedDouble() { - PrepareBuilder(); - result.repeatedDouble_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedBoolList { - get { return PrepareBuilder().repeatedBool_; } - } - public int RepeatedBoolCount { - get { return result.RepeatedBoolCount; } - } - public bool GetRepeatedBool(int index) { - return result.GetRepeatedBool(index); - } - public Builder SetRepeatedBool(int index, bool value) { - PrepareBuilder(); - result.repeatedBool_[index] = value; - return this; - } - public Builder AddRepeatedBool(bool value) { - PrepareBuilder(); - result.repeatedBool_.Add(value); - return this; - } - public Builder AddRangeRepeatedBool(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedBool_.Add(values); - return this; - } - public Builder ClearRepeatedBool() { - PrepareBuilder(); - result.repeatedBool_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedStringList { - get { return PrepareBuilder().repeatedString_; } - } - public int RepeatedStringCount { - get { return result.RepeatedStringCount; } - } - public string GetRepeatedString(int index) { - return result.GetRepeatedString(index); - } - public Builder SetRepeatedString(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedString_[index] = value; - return this; - } - public Builder AddRepeatedString(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedString_.Add(value); - return this; - } - public Builder AddRangeRepeatedString(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedString_.Add(values); - return this; - } - public Builder ClearRepeatedString() { - PrepareBuilder(); - result.repeatedString_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedBytesList { - get { return PrepareBuilder().repeatedBytes_; } - } - public int RepeatedBytesCount { - get { return result.RepeatedBytesCount; } - } - public pb::ByteString GetRepeatedBytes(int index) { - return result.GetRepeatedBytes(index); - } - public Builder SetRepeatedBytes(int index, pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedBytes_[index] = value; - return this; - } - public Builder AddRepeatedBytes(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedBytes_.Add(value); - return this; - } - public Builder AddRangeRepeatedBytes(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedBytes_.Add(values); - return this; - } - public Builder ClearRepeatedBytes() { - PrepareBuilder(); - result.repeatedBytes_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedGroupList { - get { return PrepareBuilder().repeatedGroup_; } - } - public int RepeatedGroupCount { - get { return result.RepeatedGroupCount; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.RepeatedGroup GetRepeatedGroup(int index) { - return result.GetRepeatedGroup(index); - } - public Builder SetRepeatedGroup(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.RepeatedGroup value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedGroup_[index] = value; - return this; - } - public Builder SetRepeatedGroup(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.RepeatedGroup.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedGroup_[index] = builderForValue.Build(); - return this; - } - public Builder AddRepeatedGroup(global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.RepeatedGroup value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedGroup_.Add(value); - return this; - } - public Builder AddRepeatedGroup(global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.RepeatedGroup.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedGroup_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeRepeatedGroup(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedGroup_.Add(values); - return this; - } - public Builder ClearRepeatedGroup() { - PrepareBuilder(); - result.repeatedGroup_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedNestedMessageList { - get { return PrepareBuilder().repeatedNestedMessage_; } - } - public int RepeatedNestedMessageCount { - get { return result.RepeatedNestedMessageCount; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedMessage GetRepeatedNestedMessage(int index) { - return result.GetRepeatedNestedMessage(index); - } - public Builder SetRepeatedNestedMessage(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedNestedMessage_[index] = value; - return this; - } - public Builder SetRepeatedNestedMessage(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedNestedMessage_[index] = builderForValue.Build(); - return this; - } - public Builder AddRepeatedNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedNestedMessage_.Add(value); - return this; - } - public Builder AddRepeatedNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedNestedMessage_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeRepeatedNestedMessage(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedNestedMessage_.Add(values); - return this; - } - public Builder ClearRepeatedNestedMessage() { - PrepareBuilder(); - result.repeatedNestedMessage_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedForeignMessageList { - get { return PrepareBuilder().repeatedForeignMessage_; } - } - public int RepeatedForeignMessageCount { - get { return result.RepeatedForeignMessageCount; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessageLite GetRepeatedForeignMessage(int index) { - return result.GetRepeatedForeignMessage(index); - } - public Builder SetRepeatedForeignMessage(int index, global::Google.ProtocolBuffers.TestProtos.ForeignMessageLite value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedForeignMessage_[index] = value; - return this; - } - public Builder SetRepeatedForeignMessage(int index, global::Google.ProtocolBuffers.TestProtos.ForeignMessageLite.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedForeignMessage_[index] = builderForValue.Build(); - return this; - } - public Builder AddRepeatedForeignMessage(global::Google.ProtocolBuffers.TestProtos.ForeignMessageLite value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedForeignMessage_.Add(value); - return this; - } - public Builder AddRepeatedForeignMessage(global::Google.ProtocolBuffers.TestProtos.ForeignMessageLite.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedForeignMessage_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeRepeatedForeignMessage(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedForeignMessage_.Add(values); - return this; - } - public Builder ClearRepeatedForeignMessage() { - PrepareBuilder(); - result.repeatedForeignMessage_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedImportMessageList { - get { return PrepareBuilder().repeatedImportMessage_; } - } - public int RepeatedImportMessageCount { - get { return result.RepeatedImportMessageCount; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportMessageLite GetRepeatedImportMessage(int index) { - return result.GetRepeatedImportMessage(index); - } - public Builder SetRepeatedImportMessage(int index, global::Google.ProtocolBuffers.TestProtos.ImportMessageLite value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedImportMessage_[index] = value; - return this; - } - public Builder SetRepeatedImportMessage(int index, global::Google.ProtocolBuffers.TestProtos.ImportMessageLite.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedImportMessage_[index] = builderForValue.Build(); - return this; - } - public Builder AddRepeatedImportMessage(global::Google.ProtocolBuffers.TestProtos.ImportMessageLite value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedImportMessage_.Add(value); - return this; - } - public Builder AddRepeatedImportMessage(global::Google.ProtocolBuffers.TestProtos.ImportMessageLite.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedImportMessage_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeRepeatedImportMessage(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedImportMessage_.Add(values); - return this; - } - public Builder ClearRepeatedImportMessage() { - PrepareBuilder(); - result.repeatedImportMessage_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedNestedEnumList { - get { return PrepareBuilder().repeatedNestedEnum_; } - } - public int RepeatedNestedEnumCount { - get { return result.RepeatedNestedEnumCount; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedEnum GetRepeatedNestedEnum(int index) { - return result.GetRepeatedNestedEnum(index); - } - public Builder SetRepeatedNestedEnum(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedEnum value) { - PrepareBuilder(); - result.repeatedNestedEnum_[index] = value; - return this; - } - public Builder AddRepeatedNestedEnum(global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedEnum value) { - PrepareBuilder(); - result.repeatedNestedEnum_.Add(value); - return this; - } - public Builder AddRangeRepeatedNestedEnum(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedNestedEnum_.Add(values); - return this; - } - public Builder ClearRepeatedNestedEnum() { - PrepareBuilder(); - result.repeatedNestedEnum_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedForeignEnumList { - get { return PrepareBuilder().repeatedForeignEnum_; } - } - public int RepeatedForeignEnumCount { - get { return result.RepeatedForeignEnumCount; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnumLite GetRepeatedForeignEnum(int index) { - return result.GetRepeatedForeignEnum(index); - } - public Builder SetRepeatedForeignEnum(int index, global::Google.ProtocolBuffers.TestProtos.ForeignEnumLite value) { - PrepareBuilder(); - result.repeatedForeignEnum_[index] = value; - return this; - } - public Builder AddRepeatedForeignEnum(global::Google.ProtocolBuffers.TestProtos.ForeignEnumLite value) { - PrepareBuilder(); - result.repeatedForeignEnum_.Add(value); - return this; - } - public Builder AddRangeRepeatedForeignEnum(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedForeignEnum_.Add(values); - return this; - } - public Builder ClearRepeatedForeignEnum() { - PrepareBuilder(); - result.repeatedForeignEnum_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedImportEnumList { - get { return PrepareBuilder().repeatedImportEnum_; } - } - public int RepeatedImportEnumCount { - get { return result.RepeatedImportEnumCount; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportEnumLite GetRepeatedImportEnum(int index) { - return result.GetRepeatedImportEnum(index); - } - public Builder SetRepeatedImportEnum(int index, global::Google.ProtocolBuffers.TestProtos.ImportEnumLite value) { - PrepareBuilder(); - result.repeatedImportEnum_[index] = value; - return this; - } - public Builder AddRepeatedImportEnum(global::Google.ProtocolBuffers.TestProtos.ImportEnumLite value) { - PrepareBuilder(); - result.repeatedImportEnum_.Add(value); - return this; - } - public Builder AddRangeRepeatedImportEnum(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedImportEnum_.Add(values); - return this; - } - public Builder ClearRepeatedImportEnum() { - PrepareBuilder(); - result.repeatedImportEnum_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedStringPieceList { - get { return PrepareBuilder().repeatedStringPiece_; } - } - public int RepeatedStringPieceCount { - get { return result.RepeatedStringPieceCount; } - } - public string GetRepeatedStringPiece(int index) { - return result.GetRepeatedStringPiece(index); - } - public Builder SetRepeatedStringPiece(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedStringPiece_[index] = value; - return this; - } - public Builder AddRepeatedStringPiece(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedStringPiece_.Add(value); - return this; - } - public Builder AddRangeRepeatedStringPiece(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedStringPiece_.Add(values); - return this; - } - public Builder ClearRepeatedStringPiece() { - PrepareBuilder(); - result.repeatedStringPiece_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedCordList { - get { return PrepareBuilder().repeatedCord_; } - } - public int RepeatedCordCount { - get { return result.RepeatedCordCount; } - } - public string GetRepeatedCord(int index) { - return result.GetRepeatedCord(index); - } - public Builder SetRepeatedCord(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedCord_[index] = value; - return this; - } - public Builder AddRepeatedCord(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedCord_.Add(value); - return this; - } - public Builder AddRangeRepeatedCord(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedCord_.Add(values); - return this; - } - public Builder ClearRepeatedCord() { - PrepareBuilder(); - result.repeatedCord_.Clear(); - return this; - } - - public bool HasDefaultInt32 { - get { return result.hasDefaultInt32; } - } - public int DefaultInt32 { - get { return result.DefaultInt32; } - set { SetDefaultInt32(value); } - } - public Builder SetDefaultInt32(int value) { - PrepareBuilder(); - result.hasDefaultInt32 = true; - result.defaultInt32_ = value; - return this; - } - public Builder ClearDefaultInt32() { - PrepareBuilder(); - result.hasDefaultInt32 = false; - result.defaultInt32_ = 41; - return this; - } - - public bool HasDefaultInt64 { - get { return result.hasDefaultInt64; } - } - public long DefaultInt64 { - get { return result.DefaultInt64; } - set { SetDefaultInt64(value); } - } - public Builder SetDefaultInt64(long value) { - PrepareBuilder(); - result.hasDefaultInt64 = true; - result.defaultInt64_ = value; - return this; - } - public Builder ClearDefaultInt64() { - PrepareBuilder(); - result.hasDefaultInt64 = false; - result.defaultInt64_ = 42L; - return this; - } - - public bool HasDefaultUint32 { - get { return result.hasDefaultUint32; } - } - [global::System.CLSCompliant(false)] - public uint DefaultUint32 { - get { return result.DefaultUint32; } - set { SetDefaultUint32(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetDefaultUint32(uint value) { - PrepareBuilder(); - result.hasDefaultUint32 = true; - result.defaultUint32_ = value; - return this; - } - public Builder ClearDefaultUint32() { - PrepareBuilder(); - result.hasDefaultUint32 = false; - result.defaultUint32_ = 43; - return this; - } - - public bool HasDefaultUint64 { - get { return result.hasDefaultUint64; } - } - [global::System.CLSCompliant(false)] - public ulong DefaultUint64 { - get { return result.DefaultUint64; } - set { SetDefaultUint64(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetDefaultUint64(ulong value) { - PrepareBuilder(); - result.hasDefaultUint64 = true; - result.defaultUint64_ = value; - return this; - } - public Builder ClearDefaultUint64() { - PrepareBuilder(); - result.hasDefaultUint64 = false; - result.defaultUint64_ = 44UL; - return this; - } - - public bool HasDefaultSint32 { - get { return result.hasDefaultSint32; } - } - public int DefaultSint32 { - get { return result.DefaultSint32; } - set { SetDefaultSint32(value); } - } - public Builder SetDefaultSint32(int value) { - PrepareBuilder(); - result.hasDefaultSint32 = true; - result.defaultSint32_ = value; - return this; - } - public Builder ClearDefaultSint32() { - PrepareBuilder(); - result.hasDefaultSint32 = false; - result.defaultSint32_ = -45; - return this; - } - - public bool HasDefaultSint64 { - get { return result.hasDefaultSint64; } - } - public long DefaultSint64 { - get { return result.DefaultSint64; } - set { SetDefaultSint64(value); } - } - public Builder SetDefaultSint64(long value) { - PrepareBuilder(); - result.hasDefaultSint64 = true; - result.defaultSint64_ = value; - return this; - } - public Builder ClearDefaultSint64() { - PrepareBuilder(); - result.hasDefaultSint64 = false; - result.defaultSint64_ = 46; - return this; - } - - public bool HasDefaultFixed32 { - get { return result.hasDefaultFixed32; } - } - [global::System.CLSCompliant(false)] - public uint DefaultFixed32 { - get { return result.DefaultFixed32; } - set { SetDefaultFixed32(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetDefaultFixed32(uint value) { - PrepareBuilder(); - result.hasDefaultFixed32 = true; - result.defaultFixed32_ = value; - return this; - } - public Builder ClearDefaultFixed32() { - PrepareBuilder(); - result.hasDefaultFixed32 = false; - result.defaultFixed32_ = 47; - return this; - } - - public bool HasDefaultFixed64 { - get { return result.hasDefaultFixed64; } - } - [global::System.CLSCompliant(false)] - public ulong DefaultFixed64 { - get { return result.DefaultFixed64; } - set { SetDefaultFixed64(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetDefaultFixed64(ulong value) { - PrepareBuilder(); - result.hasDefaultFixed64 = true; - result.defaultFixed64_ = value; - return this; - } - public Builder ClearDefaultFixed64() { - PrepareBuilder(); - result.hasDefaultFixed64 = false; - result.defaultFixed64_ = 48; - return this; - } - - public bool HasDefaultSfixed32 { - get { return result.hasDefaultSfixed32; } - } - public int DefaultSfixed32 { - get { return result.DefaultSfixed32; } - set { SetDefaultSfixed32(value); } - } - public Builder SetDefaultSfixed32(int value) { - PrepareBuilder(); - result.hasDefaultSfixed32 = true; - result.defaultSfixed32_ = value; - return this; - } - public Builder ClearDefaultSfixed32() { - PrepareBuilder(); - result.hasDefaultSfixed32 = false; - result.defaultSfixed32_ = 49; - return this; - } - - public bool HasDefaultSfixed64 { - get { return result.hasDefaultSfixed64; } - } - public long DefaultSfixed64 { - get { return result.DefaultSfixed64; } - set { SetDefaultSfixed64(value); } - } - public Builder SetDefaultSfixed64(long value) { - PrepareBuilder(); - result.hasDefaultSfixed64 = true; - result.defaultSfixed64_ = value; - return this; - } - public Builder ClearDefaultSfixed64() { - PrepareBuilder(); - result.hasDefaultSfixed64 = false; - result.defaultSfixed64_ = -50; - return this; - } - - public bool HasDefaultFloat { - get { return result.hasDefaultFloat; } - } - public float DefaultFloat { - get { return result.DefaultFloat; } - set { SetDefaultFloat(value); } - } - public Builder SetDefaultFloat(float value) { - PrepareBuilder(); - result.hasDefaultFloat = true; - result.defaultFloat_ = value; - return this; - } - public Builder ClearDefaultFloat() { - PrepareBuilder(); - result.hasDefaultFloat = false; - result.defaultFloat_ = 51.5F; - return this; - } - - public bool HasDefaultDouble { - get { return result.hasDefaultDouble; } - } - public double DefaultDouble { - get { return result.DefaultDouble; } - set { SetDefaultDouble(value); } - } - public Builder SetDefaultDouble(double value) { - PrepareBuilder(); - result.hasDefaultDouble = true; - result.defaultDouble_ = value; - return this; - } - public Builder ClearDefaultDouble() { - PrepareBuilder(); - result.hasDefaultDouble = false; - result.defaultDouble_ = 52000D; - return this; - } - - public bool HasDefaultBool { - get { return result.hasDefaultBool; } - } - public bool DefaultBool { - get { return result.DefaultBool; } - set { SetDefaultBool(value); } - } - public Builder SetDefaultBool(bool value) { - PrepareBuilder(); - result.hasDefaultBool = true; - result.defaultBool_ = value; - return this; - } - public Builder ClearDefaultBool() { - PrepareBuilder(); - result.hasDefaultBool = false; - result.defaultBool_ = true; - return this; - } - - public bool HasDefaultString { - get { return result.hasDefaultString; } - } - public string DefaultString { - get { return result.DefaultString; } - set { SetDefaultString(value); } - } - public Builder SetDefaultString(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasDefaultString = true; - result.defaultString_ = value; - return this; - } - public Builder ClearDefaultString() { - PrepareBuilder(); - result.hasDefaultString = false; - result.defaultString_ = "hello"; - return this; - } - - public bool HasDefaultBytes { - get { return result.hasDefaultBytes; } - } - public pb::ByteString DefaultBytes { - get { return result.DefaultBytes; } - set { SetDefaultBytes(value); } - } - public Builder SetDefaultBytes(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasDefaultBytes = true; - result.defaultBytes_ = value; - return this; - } - public Builder ClearDefaultBytes() { - PrepareBuilder(); - result.hasDefaultBytes = false; - result.defaultBytes_ = pb::ByteString.FromBase64("d29ybGQ="); - return this; - } - - public bool HasDefaultNestedEnum { - get { return result.hasDefaultNestedEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedEnum DefaultNestedEnum { - get { return result.DefaultNestedEnum; } - set { SetDefaultNestedEnum(value); } - } - public Builder SetDefaultNestedEnum(global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedEnum value) { - PrepareBuilder(); - result.hasDefaultNestedEnum = true; - result.defaultNestedEnum_ = value; - return this; - } - public Builder ClearDefaultNestedEnum() { - PrepareBuilder(); - result.hasDefaultNestedEnum = false; - result.defaultNestedEnum_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypesLite.Types.NestedEnum.BAR; - return this; - } - - public bool HasDefaultForeignEnum { - get { return result.hasDefaultForeignEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnumLite DefaultForeignEnum { - get { return result.DefaultForeignEnum; } - set { SetDefaultForeignEnum(value); } - } - public Builder SetDefaultForeignEnum(global::Google.ProtocolBuffers.TestProtos.ForeignEnumLite value) { - PrepareBuilder(); - result.hasDefaultForeignEnum = true; - result.defaultForeignEnum_ = value; - return this; - } - public Builder ClearDefaultForeignEnum() { - PrepareBuilder(); - result.hasDefaultForeignEnum = false; - result.defaultForeignEnum_ = global::Google.ProtocolBuffers.TestProtos.ForeignEnumLite.FOREIGN_LITE_BAR; - return this; - } - - public bool HasDefaultImportEnum { - get { return result.hasDefaultImportEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportEnumLite DefaultImportEnum { - get { return result.DefaultImportEnum; } - set { SetDefaultImportEnum(value); } - } - public Builder SetDefaultImportEnum(global::Google.ProtocolBuffers.TestProtos.ImportEnumLite value) { - PrepareBuilder(); - result.hasDefaultImportEnum = true; - result.defaultImportEnum_ = value; - return this; - } - public Builder ClearDefaultImportEnum() { - PrepareBuilder(); - result.hasDefaultImportEnum = false; - result.defaultImportEnum_ = global::Google.ProtocolBuffers.TestProtos.ImportEnumLite.IMPORT_LITE_BAR; - return this; - } - - public bool HasDefaultStringPiece { - get { return result.hasDefaultStringPiece; } - } - public string DefaultStringPiece { - get { return result.DefaultStringPiece; } - set { SetDefaultStringPiece(value); } - } - public Builder SetDefaultStringPiece(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasDefaultStringPiece = true; - result.defaultStringPiece_ = value; - return this; - } - public Builder ClearDefaultStringPiece() { - PrepareBuilder(); - result.hasDefaultStringPiece = false; - result.defaultStringPiece_ = "abc"; - return this; - } - - public bool HasDefaultCord { - get { return result.hasDefaultCord; } - } - public string DefaultCord { - get { return result.DefaultCord; } - set { SetDefaultCord(value); } - } - public Builder SetDefaultCord(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasDefaultCord = true; - result.defaultCord_ = value; - return this; - } - public Builder ClearDefaultCord() { - PrepareBuilder(); - result.hasDefaultCord = false; - result.defaultCord_ = "123"; - return this; - } - } - static TestAllTypesLite() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class ForeignMessageLite : pb::GeneratedMessageLite { - private ForeignMessageLite() { } - private static readonly ForeignMessageLite defaultInstance = new ForeignMessageLite().MakeReadOnly(); - private static readonly string[] _foreignMessageLiteFieldNames = new string[] { "c" }; - private static readonly uint[] _foreignMessageLiteFieldTags = new uint[] { 8 }; - public static ForeignMessageLite DefaultInstance { - get { return defaultInstance; } - } - - public override ForeignMessageLite DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override ForeignMessageLite ThisMessage { - get { return this; } - } - - public const int CFieldNumber = 1; - private bool hasC; - private int c_; - public bool HasC { - get { return hasC; } - } - public int C { - get { return c_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _foreignMessageLiteFieldNames; - if (hasC) { - output.WriteInt32(1, field_names[0], C); - } - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasC) { - size += pb::CodedOutputStream.ComputeInt32Size(1, C); - } - memoizedSerializedSize = size; - return size; - } - #region Lite runtime methods - public override int GetHashCode() { - int hash = GetType().GetHashCode(); - if (hasC) hash ^= c_.GetHashCode(); - return hash; - } - - public override bool Equals(object obj) { - ForeignMessageLite other = obj as ForeignMessageLite; - if (other == null) return false; - if (hasC != other.hasC || (hasC && !c_.Equals(other.c_))) return false; - return true; - } - - public override void PrintTo(global::System.IO.TextWriter writer) { - PrintField("c", hasC, c_, writer); - } - #endregion - - public static ForeignMessageLite ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ForeignMessageLite ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ForeignMessageLite ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ForeignMessageLite ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ForeignMessageLite ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ForeignMessageLite ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ForeignMessageLite ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ForeignMessageLite ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ForeignMessageLite ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ForeignMessageLite ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private ForeignMessageLite MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ForeignMessageLite prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilderLite { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(ForeignMessageLite cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private ForeignMessageLite result; - - private ForeignMessageLite PrepareBuilder() { - if (resultIsReadOnly) { - ForeignMessageLite original = result; - result = new ForeignMessageLite(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override ForeignMessageLite MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override ForeignMessageLite DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.ForeignMessageLite.DefaultInstance; } - } - - public override ForeignMessageLite BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessageLite other) { - if (other is ForeignMessageLite) { - return MergeFrom((ForeignMessageLite) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ForeignMessageLite other) { - if (other == global::Google.ProtocolBuffers.TestProtos.ForeignMessageLite.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasC) { - C = other.C; - } - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_foreignMessageLiteFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _foreignMessageLiteFieldTags[field_ordinal]; - else { - ParseUnknownField(input, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - return this; - } - ParseUnknownField(input, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasC = input.ReadInt32(ref result.c_); - break; - } - } - } - - return this; - } - - - public bool HasC { - get { return result.hasC; } - } - public int C { - get { return result.C; } - set { SetC(value); } - } - public Builder SetC(int value) { - PrepareBuilder(); - result.hasC = true; - result.c_ = value; - return this; - } - public Builder ClearC() { - PrepareBuilder(); - result.hasC = false; - result.c_ = 0; - return this; - } - } - static ForeignMessageLite() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestPackedTypesLite : pb::GeneratedMessageLite { - private TestPackedTypesLite() { } - private static readonly TestPackedTypesLite defaultInstance = new TestPackedTypesLite().MakeReadOnly(); - private static readonly string[] _testPackedTypesLiteFieldNames = new string[] { "packed_bool", "packed_double", "packed_enum", "packed_fixed32", "packed_fixed64", "packed_float", "packed_int32", "packed_int64", "packed_sfixed32", "packed_sfixed64", "packed_sint32", "packed_sint64", "packed_uint32", "packed_uint64" }; - private static readonly uint[] _testPackedTypesLiteFieldTags = new uint[] { 818, 810, 826, 770, 778, 802, 722, 730, 786, 794, 754, 762, 738, 746 }; - public static TestPackedTypesLite DefaultInstance { - get { return defaultInstance; } - } - - public override TestPackedTypesLite DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestPackedTypesLite ThisMessage { - get { return this; } - } - - public const int PackedInt32FieldNumber = 90; - private int packedInt32MemoizedSerializedSize; - private pbc::PopsicleList packedInt32_ = new pbc::PopsicleList(); - public scg::IList PackedInt32List { - get { return pbc::Lists.AsReadOnly(packedInt32_); } - } - public int PackedInt32Count { - get { return packedInt32_.Count; } - } - public int GetPackedInt32(int index) { - return packedInt32_[index]; - } - - public const int PackedInt64FieldNumber = 91; - private int packedInt64MemoizedSerializedSize; - private pbc::PopsicleList packedInt64_ = new pbc::PopsicleList(); - public scg::IList PackedInt64List { - get { return pbc::Lists.AsReadOnly(packedInt64_); } - } - public int PackedInt64Count { - get { return packedInt64_.Count; } - } - public long GetPackedInt64(int index) { - return packedInt64_[index]; - } - - public const int PackedUint32FieldNumber = 92; - private int packedUint32MemoizedSerializedSize; - private pbc::PopsicleList packedUint32_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList PackedUint32List { - get { return pbc::Lists.AsReadOnly(packedUint32_); } - } - public int PackedUint32Count { - get { return packedUint32_.Count; } - } - [global::System.CLSCompliant(false)] - public uint GetPackedUint32(int index) { - return packedUint32_[index]; - } - - public const int PackedUint64FieldNumber = 93; - private int packedUint64MemoizedSerializedSize; - private pbc::PopsicleList packedUint64_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList PackedUint64List { - get { return pbc::Lists.AsReadOnly(packedUint64_); } - } - public int PackedUint64Count { - get { return packedUint64_.Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetPackedUint64(int index) { - return packedUint64_[index]; - } - - public const int PackedSint32FieldNumber = 94; - private int packedSint32MemoizedSerializedSize; - private pbc::PopsicleList packedSint32_ = new pbc::PopsicleList(); - public scg::IList PackedSint32List { - get { return pbc::Lists.AsReadOnly(packedSint32_); } - } - public int PackedSint32Count { - get { return packedSint32_.Count; } - } - public int GetPackedSint32(int index) { - return packedSint32_[index]; - } - - public const int PackedSint64FieldNumber = 95; - private int packedSint64MemoizedSerializedSize; - private pbc::PopsicleList packedSint64_ = new pbc::PopsicleList(); - public scg::IList PackedSint64List { - get { return pbc::Lists.AsReadOnly(packedSint64_); } - } - public int PackedSint64Count { - get { return packedSint64_.Count; } - } - public long GetPackedSint64(int index) { - return packedSint64_[index]; - } - - public const int PackedFixed32FieldNumber = 96; - private int packedFixed32MemoizedSerializedSize; - private pbc::PopsicleList packedFixed32_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList PackedFixed32List { - get { return pbc::Lists.AsReadOnly(packedFixed32_); } - } - public int PackedFixed32Count { - get { return packedFixed32_.Count; } - } - [global::System.CLSCompliant(false)] - public uint GetPackedFixed32(int index) { - return packedFixed32_[index]; - } - - public const int PackedFixed64FieldNumber = 97; - private int packedFixed64MemoizedSerializedSize; - private pbc::PopsicleList packedFixed64_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList PackedFixed64List { - get { return pbc::Lists.AsReadOnly(packedFixed64_); } - } - public int PackedFixed64Count { - get { return packedFixed64_.Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetPackedFixed64(int index) { - return packedFixed64_[index]; - } - - public const int PackedSfixed32FieldNumber = 98; - private int packedSfixed32MemoizedSerializedSize; - private pbc::PopsicleList packedSfixed32_ = new pbc::PopsicleList(); - public scg::IList PackedSfixed32List { - get { return pbc::Lists.AsReadOnly(packedSfixed32_); } - } - public int PackedSfixed32Count { - get { return packedSfixed32_.Count; } - } - public int GetPackedSfixed32(int index) { - return packedSfixed32_[index]; - } - - public const int PackedSfixed64FieldNumber = 99; - private int packedSfixed64MemoizedSerializedSize; - private pbc::PopsicleList packedSfixed64_ = new pbc::PopsicleList(); - public scg::IList PackedSfixed64List { - get { return pbc::Lists.AsReadOnly(packedSfixed64_); } - } - public int PackedSfixed64Count { - get { return packedSfixed64_.Count; } - } - public long GetPackedSfixed64(int index) { - return packedSfixed64_[index]; - } - - public const int PackedFloatFieldNumber = 100; - private int packedFloatMemoizedSerializedSize; - private pbc::PopsicleList packedFloat_ = new pbc::PopsicleList(); - public scg::IList PackedFloatList { - get { return pbc::Lists.AsReadOnly(packedFloat_); } - } - public int PackedFloatCount { - get { return packedFloat_.Count; } - } - public float GetPackedFloat(int index) { - return packedFloat_[index]; - } - - public const int PackedDoubleFieldNumber = 101; - private int packedDoubleMemoizedSerializedSize; - private pbc::PopsicleList packedDouble_ = new pbc::PopsicleList(); - public scg::IList PackedDoubleList { - get { return pbc::Lists.AsReadOnly(packedDouble_); } - } - public int PackedDoubleCount { - get { return packedDouble_.Count; } - } - public double GetPackedDouble(int index) { - return packedDouble_[index]; - } - - public const int PackedBoolFieldNumber = 102; - private int packedBoolMemoizedSerializedSize; - private pbc::PopsicleList packedBool_ = new pbc::PopsicleList(); - public scg::IList PackedBoolList { - get { return pbc::Lists.AsReadOnly(packedBool_); } - } - public int PackedBoolCount { - get { return packedBool_.Count; } - } - public bool GetPackedBool(int index) { - return packedBool_[index]; - } - - public const int PackedEnumFieldNumber = 103; - private int packedEnumMemoizedSerializedSize; - private pbc::PopsicleList packedEnum_ = new pbc::PopsicleList(); - public scg::IList PackedEnumList { - get { return pbc::Lists.AsReadOnly(packedEnum_); } - } - public int PackedEnumCount { - get { return packedEnum_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnumLite GetPackedEnum(int index) { - return packedEnum_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testPackedTypesLiteFieldNames; - if (packedInt32_.Count > 0) { - output.WritePackedInt32Array(90, field_names[6], packedInt32MemoizedSerializedSize, packedInt32_); - } - if (packedInt64_.Count > 0) { - output.WritePackedInt64Array(91, field_names[7], packedInt64MemoizedSerializedSize, packedInt64_); - } - if (packedUint32_.Count > 0) { - output.WritePackedUInt32Array(92, field_names[12], packedUint32MemoizedSerializedSize, packedUint32_); - } - if (packedUint64_.Count > 0) { - output.WritePackedUInt64Array(93, field_names[13], packedUint64MemoizedSerializedSize, packedUint64_); - } - if (packedSint32_.Count > 0) { - output.WritePackedSInt32Array(94, field_names[10], packedSint32MemoizedSerializedSize, packedSint32_); - } - if (packedSint64_.Count > 0) { - output.WritePackedSInt64Array(95, field_names[11], packedSint64MemoizedSerializedSize, packedSint64_); - } - if (packedFixed32_.Count > 0) { - output.WritePackedFixed32Array(96, field_names[3], packedFixed32MemoizedSerializedSize, packedFixed32_); - } - if (packedFixed64_.Count > 0) { - output.WritePackedFixed64Array(97, field_names[4], packedFixed64MemoizedSerializedSize, packedFixed64_); - } - if (packedSfixed32_.Count > 0) { - output.WritePackedSFixed32Array(98, field_names[8], packedSfixed32MemoizedSerializedSize, packedSfixed32_); - } - if (packedSfixed64_.Count > 0) { - output.WritePackedSFixed64Array(99, field_names[9], packedSfixed64MemoizedSerializedSize, packedSfixed64_); - } - if (packedFloat_.Count > 0) { - output.WritePackedFloatArray(100, field_names[5], packedFloatMemoizedSerializedSize, packedFloat_); - } - if (packedDouble_.Count > 0) { - output.WritePackedDoubleArray(101, field_names[1], packedDoubleMemoizedSerializedSize, packedDouble_); - } - if (packedBool_.Count > 0) { - output.WritePackedBoolArray(102, field_names[0], packedBoolMemoizedSerializedSize, packedBool_); - } - if (packedEnum_.Count > 0) { - output.WritePackedEnumArray(103, field_names[2], packedEnumMemoizedSerializedSize, packedEnum_); - } - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - foreach (int element in PackedInt32List) { - dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); - } - size += dataSize; - if (packedInt32_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedInt32MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - foreach (long element in PackedInt64List) { - dataSize += pb::CodedOutputStream.ComputeInt64SizeNoTag(element); - } - size += dataSize; - if (packedInt64_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedInt64MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - foreach (uint element in PackedUint32List) { - dataSize += pb::CodedOutputStream.ComputeUInt32SizeNoTag(element); - } - size += dataSize; - if (packedUint32_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedUint32MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - foreach (ulong element in PackedUint64List) { - dataSize += pb::CodedOutputStream.ComputeUInt64SizeNoTag(element); - } - size += dataSize; - if (packedUint64_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedUint64MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - foreach (int element in PackedSint32List) { - dataSize += pb::CodedOutputStream.ComputeSInt32SizeNoTag(element); - } - size += dataSize; - if (packedSint32_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedSint32MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - foreach (long element in PackedSint64List) { - dataSize += pb::CodedOutputStream.ComputeSInt64SizeNoTag(element); - } - size += dataSize; - if (packedSint64_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedSint64MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 4 * packedFixed32_.Count; - size += dataSize; - if (packedFixed32_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedFixed32MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 8 * packedFixed64_.Count; - size += dataSize; - if (packedFixed64_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedFixed64MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 4 * packedSfixed32_.Count; - size += dataSize; - if (packedSfixed32_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedSfixed32MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 8 * packedSfixed64_.Count; - size += dataSize; - if (packedSfixed64_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedSfixed64MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 4 * packedFloat_.Count; - size += dataSize; - if (packedFloat_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedFloatMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 8 * packedDouble_.Count; - size += dataSize; - if (packedDouble_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedDoubleMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 1 * packedBool_.Count; - size += dataSize; - if (packedBool_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedBoolMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - if (packedEnum_.Count > 0) { - foreach (global::Google.ProtocolBuffers.TestProtos.ForeignEnumLite element in packedEnum_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 2; - size += pb::CodedOutputStream.ComputeRawVarint32Size((uint) dataSize); - } - packedEnumMemoizedSerializedSize = dataSize; - } - memoizedSerializedSize = size; - return size; - } - #region Lite runtime methods - public override int GetHashCode() { - int hash = GetType().GetHashCode(); - foreach(int i in packedInt32_) - hash ^= i.GetHashCode(); - foreach(long i in packedInt64_) - hash ^= i.GetHashCode(); - foreach(uint i in packedUint32_) - hash ^= i.GetHashCode(); - foreach(ulong i in packedUint64_) - hash ^= i.GetHashCode(); - foreach(int i in packedSint32_) - hash ^= i.GetHashCode(); - foreach(long i in packedSint64_) - hash ^= i.GetHashCode(); - foreach(uint i in packedFixed32_) - hash ^= i.GetHashCode(); - foreach(ulong i in packedFixed64_) - hash ^= i.GetHashCode(); - foreach(int i in packedSfixed32_) - hash ^= i.GetHashCode(); - foreach(long i in packedSfixed64_) - hash ^= i.GetHashCode(); - foreach(float i in packedFloat_) - hash ^= i.GetHashCode(); - foreach(double i in packedDouble_) - hash ^= i.GetHashCode(); - foreach(bool i in packedBool_) - hash ^= i.GetHashCode(); - foreach(global::Google.ProtocolBuffers.TestProtos.ForeignEnumLite i in packedEnum_) - hash ^= i.GetHashCode(); - return hash; - } - - public override bool Equals(object obj) { - TestPackedTypesLite other = obj as TestPackedTypesLite; - if (other == null) return false; - if(packedInt32_.Count != other.packedInt32_.Count) return false; - for(int ix=0; ix < packedInt32_.Count; ix++) - if(!packedInt32_[ix].Equals(other.packedInt32_[ix])) return false; - if(packedInt64_.Count != other.packedInt64_.Count) return false; - for(int ix=0; ix < packedInt64_.Count; ix++) - if(!packedInt64_[ix].Equals(other.packedInt64_[ix])) return false; - if(packedUint32_.Count != other.packedUint32_.Count) return false; - for(int ix=0; ix < packedUint32_.Count; ix++) - if(!packedUint32_[ix].Equals(other.packedUint32_[ix])) return false; - if(packedUint64_.Count != other.packedUint64_.Count) return false; - for(int ix=0; ix < packedUint64_.Count; ix++) - if(!packedUint64_[ix].Equals(other.packedUint64_[ix])) return false; - if(packedSint32_.Count != other.packedSint32_.Count) return false; - for(int ix=0; ix < packedSint32_.Count; ix++) - if(!packedSint32_[ix].Equals(other.packedSint32_[ix])) return false; - if(packedSint64_.Count != other.packedSint64_.Count) return false; - for(int ix=0; ix < packedSint64_.Count; ix++) - if(!packedSint64_[ix].Equals(other.packedSint64_[ix])) return false; - if(packedFixed32_.Count != other.packedFixed32_.Count) return false; - for(int ix=0; ix < packedFixed32_.Count; ix++) - if(!packedFixed32_[ix].Equals(other.packedFixed32_[ix])) return false; - if(packedFixed64_.Count != other.packedFixed64_.Count) return false; - for(int ix=0; ix < packedFixed64_.Count; ix++) - if(!packedFixed64_[ix].Equals(other.packedFixed64_[ix])) return false; - if(packedSfixed32_.Count != other.packedSfixed32_.Count) return false; - for(int ix=0; ix < packedSfixed32_.Count; ix++) - if(!packedSfixed32_[ix].Equals(other.packedSfixed32_[ix])) return false; - if(packedSfixed64_.Count != other.packedSfixed64_.Count) return false; - for(int ix=0; ix < packedSfixed64_.Count; ix++) - if(!packedSfixed64_[ix].Equals(other.packedSfixed64_[ix])) return false; - if(packedFloat_.Count != other.packedFloat_.Count) return false; - for(int ix=0; ix < packedFloat_.Count; ix++) - if(!packedFloat_[ix].Equals(other.packedFloat_[ix])) return false; - if(packedDouble_.Count != other.packedDouble_.Count) return false; - for(int ix=0; ix < packedDouble_.Count; ix++) - if(!packedDouble_[ix].Equals(other.packedDouble_[ix])) return false; - if(packedBool_.Count != other.packedBool_.Count) return false; - for(int ix=0; ix < packedBool_.Count; ix++) - if(!packedBool_[ix].Equals(other.packedBool_[ix])) return false; - if(packedEnum_.Count != other.packedEnum_.Count) return false; - for(int ix=0; ix < packedEnum_.Count; ix++) - if(!packedEnum_[ix].Equals(other.packedEnum_[ix])) return false; - return true; - } - - public override void PrintTo(global::System.IO.TextWriter writer) { - PrintField("packed_int32", packedInt32_, writer); - PrintField("packed_int64", packedInt64_, writer); - PrintField("packed_uint32", packedUint32_, writer); - PrintField("packed_uint64", packedUint64_, writer); - PrintField("packed_sint32", packedSint32_, writer); - PrintField("packed_sint64", packedSint64_, writer); - PrintField("packed_fixed32", packedFixed32_, writer); - PrintField("packed_fixed64", packedFixed64_, writer); - PrintField("packed_sfixed32", packedSfixed32_, writer); - PrintField("packed_sfixed64", packedSfixed64_, writer); - PrintField("packed_float", packedFloat_, writer); - PrintField("packed_double", packedDouble_, writer); - PrintField("packed_bool", packedBool_, writer); - PrintField("packed_enum", packedEnum_, writer); - } - #endregion - - public static TestPackedTypesLite ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestPackedTypesLite ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestPackedTypesLite ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestPackedTypesLite ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestPackedTypesLite ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestPackedTypesLite ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestPackedTypesLite ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestPackedTypesLite ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestPackedTypesLite ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestPackedTypesLite ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestPackedTypesLite MakeReadOnly() { - packedInt32_.MakeReadOnly(); - packedInt64_.MakeReadOnly(); - packedUint32_.MakeReadOnly(); - packedUint64_.MakeReadOnly(); - packedSint32_.MakeReadOnly(); - packedSint64_.MakeReadOnly(); - packedFixed32_.MakeReadOnly(); - packedFixed64_.MakeReadOnly(); - packedSfixed32_.MakeReadOnly(); - packedSfixed64_.MakeReadOnly(); - packedFloat_.MakeReadOnly(); - packedDouble_.MakeReadOnly(); - packedBool_.MakeReadOnly(); - packedEnum_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestPackedTypesLite prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilderLite { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestPackedTypesLite cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestPackedTypesLite result; - - private TestPackedTypesLite PrepareBuilder() { - if (resultIsReadOnly) { - TestPackedTypesLite original = result; - result = new TestPackedTypesLite(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestPackedTypesLite MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override TestPackedTypesLite DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestPackedTypesLite.DefaultInstance; } - } - - public override TestPackedTypesLite BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessageLite other) { - if (other is TestPackedTypesLite) { - return MergeFrom((TestPackedTypesLite) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestPackedTypesLite other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestPackedTypesLite.DefaultInstance) return this; - PrepareBuilder(); - if (other.packedInt32_.Count != 0) { - result.packedInt32_.Add(other.packedInt32_); - } - if (other.packedInt64_.Count != 0) { - result.packedInt64_.Add(other.packedInt64_); - } - if (other.packedUint32_.Count != 0) { - result.packedUint32_.Add(other.packedUint32_); - } - if (other.packedUint64_.Count != 0) { - result.packedUint64_.Add(other.packedUint64_); - } - if (other.packedSint32_.Count != 0) { - result.packedSint32_.Add(other.packedSint32_); - } - if (other.packedSint64_.Count != 0) { - result.packedSint64_.Add(other.packedSint64_); - } - if (other.packedFixed32_.Count != 0) { - result.packedFixed32_.Add(other.packedFixed32_); - } - if (other.packedFixed64_.Count != 0) { - result.packedFixed64_.Add(other.packedFixed64_); - } - if (other.packedSfixed32_.Count != 0) { - result.packedSfixed32_.Add(other.packedSfixed32_); - } - if (other.packedSfixed64_.Count != 0) { - result.packedSfixed64_.Add(other.packedSfixed64_); - } - if (other.packedFloat_.Count != 0) { - result.packedFloat_.Add(other.packedFloat_); - } - if (other.packedDouble_.Count != 0) { - result.packedDouble_.Add(other.packedDouble_); - } - if (other.packedBool_.Count != 0) { - result.packedBool_.Add(other.packedBool_); - } - if (other.packedEnum_.Count != 0) { - result.packedEnum_.Add(other.packedEnum_); - } - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testPackedTypesLiteFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testPackedTypesLiteFieldTags[field_ordinal]; - else { - ParseUnknownField(input, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - return this; - } - ParseUnknownField(input, extensionRegistry, tag, field_name); - break; - } - case 722: - case 720: { - input.ReadInt32Array(tag, field_name, result.packedInt32_); - break; - } - case 730: - case 728: { - input.ReadInt64Array(tag, field_name, result.packedInt64_); - break; - } - case 738: - case 736: { - input.ReadUInt32Array(tag, field_name, result.packedUint32_); - break; - } - case 746: - case 744: { - input.ReadUInt64Array(tag, field_name, result.packedUint64_); - break; - } - case 754: - case 752: { - input.ReadSInt32Array(tag, field_name, result.packedSint32_); - break; - } - case 762: - case 760: { - input.ReadSInt64Array(tag, field_name, result.packedSint64_); - break; - } - case 770: - case 773: { - input.ReadFixed32Array(tag, field_name, result.packedFixed32_); - break; - } - case 778: - case 777: { - input.ReadFixed64Array(tag, field_name, result.packedFixed64_); - break; - } - case 786: - case 789: { - input.ReadSFixed32Array(tag, field_name, result.packedSfixed32_); - break; - } - case 794: - case 793: { - input.ReadSFixed64Array(tag, field_name, result.packedSfixed64_); - break; - } - case 802: - case 805: { - input.ReadFloatArray(tag, field_name, result.packedFloat_); - break; - } - case 810: - case 809: { - input.ReadDoubleArray(tag, field_name, result.packedDouble_); - break; - } - case 818: - case 816: { - input.ReadBoolArray(tag, field_name, result.packedBool_); - break; - } - case 826: - case 824: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.packedEnum_, out unknownItems); - break; - } - } - } - - return this; - } - - - public pbc::IPopsicleList PackedInt32List { - get { return PrepareBuilder().packedInt32_; } - } - public int PackedInt32Count { - get { return result.PackedInt32Count; } - } - public int GetPackedInt32(int index) { - return result.GetPackedInt32(index); - } - public Builder SetPackedInt32(int index, int value) { - PrepareBuilder(); - result.packedInt32_[index] = value; - return this; - } - public Builder AddPackedInt32(int value) { - PrepareBuilder(); - result.packedInt32_.Add(value); - return this; - } - public Builder AddRangePackedInt32(scg::IEnumerable values) { - PrepareBuilder(); - result.packedInt32_.Add(values); - return this; - } - public Builder ClearPackedInt32() { - PrepareBuilder(); - result.packedInt32_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedInt64List { - get { return PrepareBuilder().packedInt64_; } - } - public int PackedInt64Count { - get { return result.PackedInt64Count; } - } - public long GetPackedInt64(int index) { - return result.GetPackedInt64(index); - } - public Builder SetPackedInt64(int index, long value) { - PrepareBuilder(); - result.packedInt64_[index] = value; - return this; - } - public Builder AddPackedInt64(long value) { - PrepareBuilder(); - result.packedInt64_.Add(value); - return this; - } - public Builder AddRangePackedInt64(scg::IEnumerable values) { - PrepareBuilder(); - result.packedInt64_.Add(values); - return this; - } - public Builder ClearPackedInt64() { - PrepareBuilder(); - result.packedInt64_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList PackedUint32List { - get { return PrepareBuilder().packedUint32_; } - } - public int PackedUint32Count { - get { return result.PackedUint32Count; } - } - [global::System.CLSCompliant(false)] - public uint GetPackedUint32(int index) { - return result.GetPackedUint32(index); - } - [global::System.CLSCompliant(false)] - public Builder SetPackedUint32(int index, uint value) { - PrepareBuilder(); - result.packedUint32_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddPackedUint32(uint value) { - PrepareBuilder(); - result.packedUint32_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangePackedUint32(scg::IEnumerable values) { - PrepareBuilder(); - result.packedUint32_.Add(values); - return this; - } - public Builder ClearPackedUint32() { - PrepareBuilder(); - result.packedUint32_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList PackedUint64List { - get { return PrepareBuilder().packedUint64_; } - } - public int PackedUint64Count { - get { return result.PackedUint64Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetPackedUint64(int index) { - return result.GetPackedUint64(index); - } - [global::System.CLSCompliant(false)] - public Builder SetPackedUint64(int index, ulong value) { - PrepareBuilder(); - result.packedUint64_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddPackedUint64(ulong value) { - PrepareBuilder(); - result.packedUint64_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangePackedUint64(scg::IEnumerable values) { - PrepareBuilder(); - result.packedUint64_.Add(values); - return this; - } - public Builder ClearPackedUint64() { - PrepareBuilder(); - result.packedUint64_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedSint32List { - get { return PrepareBuilder().packedSint32_; } - } - public int PackedSint32Count { - get { return result.PackedSint32Count; } - } - public int GetPackedSint32(int index) { - return result.GetPackedSint32(index); - } - public Builder SetPackedSint32(int index, int value) { - PrepareBuilder(); - result.packedSint32_[index] = value; - return this; - } - public Builder AddPackedSint32(int value) { - PrepareBuilder(); - result.packedSint32_.Add(value); - return this; - } - public Builder AddRangePackedSint32(scg::IEnumerable values) { - PrepareBuilder(); - result.packedSint32_.Add(values); - return this; - } - public Builder ClearPackedSint32() { - PrepareBuilder(); - result.packedSint32_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedSint64List { - get { return PrepareBuilder().packedSint64_; } - } - public int PackedSint64Count { - get { return result.PackedSint64Count; } - } - public long GetPackedSint64(int index) { - return result.GetPackedSint64(index); - } - public Builder SetPackedSint64(int index, long value) { - PrepareBuilder(); - result.packedSint64_[index] = value; - return this; - } - public Builder AddPackedSint64(long value) { - PrepareBuilder(); - result.packedSint64_.Add(value); - return this; - } - public Builder AddRangePackedSint64(scg::IEnumerable values) { - PrepareBuilder(); - result.packedSint64_.Add(values); - return this; - } - public Builder ClearPackedSint64() { - PrepareBuilder(); - result.packedSint64_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList PackedFixed32List { - get { return PrepareBuilder().packedFixed32_; } - } - public int PackedFixed32Count { - get { return result.PackedFixed32Count; } - } - [global::System.CLSCompliant(false)] - public uint GetPackedFixed32(int index) { - return result.GetPackedFixed32(index); - } - [global::System.CLSCompliant(false)] - public Builder SetPackedFixed32(int index, uint value) { - PrepareBuilder(); - result.packedFixed32_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddPackedFixed32(uint value) { - PrepareBuilder(); - result.packedFixed32_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangePackedFixed32(scg::IEnumerable values) { - PrepareBuilder(); - result.packedFixed32_.Add(values); - return this; - } - public Builder ClearPackedFixed32() { - PrepareBuilder(); - result.packedFixed32_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList PackedFixed64List { - get { return PrepareBuilder().packedFixed64_; } - } - public int PackedFixed64Count { - get { return result.PackedFixed64Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetPackedFixed64(int index) { - return result.GetPackedFixed64(index); - } - [global::System.CLSCompliant(false)] - public Builder SetPackedFixed64(int index, ulong value) { - PrepareBuilder(); - result.packedFixed64_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddPackedFixed64(ulong value) { - PrepareBuilder(); - result.packedFixed64_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangePackedFixed64(scg::IEnumerable values) { - PrepareBuilder(); - result.packedFixed64_.Add(values); - return this; - } - public Builder ClearPackedFixed64() { - PrepareBuilder(); - result.packedFixed64_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedSfixed32List { - get { return PrepareBuilder().packedSfixed32_; } - } - public int PackedSfixed32Count { - get { return result.PackedSfixed32Count; } - } - public int GetPackedSfixed32(int index) { - return result.GetPackedSfixed32(index); - } - public Builder SetPackedSfixed32(int index, int value) { - PrepareBuilder(); - result.packedSfixed32_[index] = value; - return this; - } - public Builder AddPackedSfixed32(int value) { - PrepareBuilder(); - result.packedSfixed32_.Add(value); - return this; - } - public Builder AddRangePackedSfixed32(scg::IEnumerable values) { - PrepareBuilder(); - result.packedSfixed32_.Add(values); - return this; - } - public Builder ClearPackedSfixed32() { - PrepareBuilder(); - result.packedSfixed32_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedSfixed64List { - get { return PrepareBuilder().packedSfixed64_; } - } - public int PackedSfixed64Count { - get { return result.PackedSfixed64Count; } - } - public long GetPackedSfixed64(int index) { - return result.GetPackedSfixed64(index); - } - public Builder SetPackedSfixed64(int index, long value) { - PrepareBuilder(); - result.packedSfixed64_[index] = value; - return this; - } - public Builder AddPackedSfixed64(long value) { - PrepareBuilder(); - result.packedSfixed64_.Add(value); - return this; - } - public Builder AddRangePackedSfixed64(scg::IEnumerable values) { - PrepareBuilder(); - result.packedSfixed64_.Add(values); - return this; - } - public Builder ClearPackedSfixed64() { - PrepareBuilder(); - result.packedSfixed64_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedFloatList { - get { return PrepareBuilder().packedFloat_; } - } - public int PackedFloatCount { - get { return result.PackedFloatCount; } - } - public float GetPackedFloat(int index) { - return result.GetPackedFloat(index); - } - public Builder SetPackedFloat(int index, float value) { - PrepareBuilder(); - result.packedFloat_[index] = value; - return this; - } - public Builder AddPackedFloat(float value) { - PrepareBuilder(); - result.packedFloat_.Add(value); - return this; - } - public Builder AddRangePackedFloat(scg::IEnumerable values) { - PrepareBuilder(); - result.packedFloat_.Add(values); - return this; - } - public Builder ClearPackedFloat() { - PrepareBuilder(); - result.packedFloat_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedDoubleList { - get { return PrepareBuilder().packedDouble_; } - } - public int PackedDoubleCount { - get { return result.PackedDoubleCount; } - } - public double GetPackedDouble(int index) { - return result.GetPackedDouble(index); - } - public Builder SetPackedDouble(int index, double value) { - PrepareBuilder(); - result.packedDouble_[index] = value; - return this; - } - public Builder AddPackedDouble(double value) { - PrepareBuilder(); - result.packedDouble_.Add(value); - return this; - } - public Builder AddRangePackedDouble(scg::IEnumerable values) { - PrepareBuilder(); - result.packedDouble_.Add(values); - return this; - } - public Builder ClearPackedDouble() { - PrepareBuilder(); - result.packedDouble_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedBoolList { - get { return PrepareBuilder().packedBool_; } - } - public int PackedBoolCount { - get { return result.PackedBoolCount; } - } - public bool GetPackedBool(int index) { - return result.GetPackedBool(index); - } - public Builder SetPackedBool(int index, bool value) { - PrepareBuilder(); - result.packedBool_[index] = value; - return this; - } - public Builder AddPackedBool(bool value) { - PrepareBuilder(); - result.packedBool_.Add(value); - return this; - } - public Builder AddRangePackedBool(scg::IEnumerable values) { - PrepareBuilder(); - result.packedBool_.Add(values); - return this; - } - public Builder ClearPackedBool() { - PrepareBuilder(); - result.packedBool_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedEnumList { - get { return PrepareBuilder().packedEnum_; } - } - public int PackedEnumCount { - get { return result.PackedEnumCount; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnumLite GetPackedEnum(int index) { - return result.GetPackedEnum(index); - } - public Builder SetPackedEnum(int index, global::Google.ProtocolBuffers.TestProtos.ForeignEnumLite value) { - PrepareBuilder(); - result.packedEnum_[index] = value; - return this; - } - public Builder AddPackedEnum(global::Google.ProtocolBuffers.TestProtos.ForeignEnumLite value) { - PrepareBuilder(); - result.packedEnum_.Add(value); - return this; - } - public Builder AddRangePackedEnum(scg::IEnumerable values) { - PrepareBuilder(); - result.packedEnum_.Add(values); - return this; - } - public Builder ClearPackedEnum() { - PrepareBuilder(); - result.packedEnum_.Clear(); - return this; - } - } - static TestPackedTypesLite() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestAllExtensionsLite : pb::ExtendableMessageLite { - private TestAllExtensionsLite() { } - private static readonly TestAllExtensionsLite defaultInstance = new TestAllExtensionsLite().MakeReadOnly(); - private static readonly string[] _testAllExtensionsLiteFieldNames = new string[] { }; - private static readonly uint[] _testAllExtensionsLiteFieldTags = new uint[] { }; - public static TestAllExtensionsLite DefaultInstance { - get { return defaultInstance; } - } - - public override TestAllExtensionsLite DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestAllExtensionsLite ThisMessage { - get { return this; } - } - - public override bool IsInitialized { - get { - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testAllExtensionsLiteFieldNames; - pb::ExtendableMessageLite.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - extensionWriter.WriteUntil(536870912, output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += ExtensionsSerializedSize; - memoizedSerializedSize = size; - return size; - } - #region Lite runtime methods - public override int GetHashCode() { - int hash = GetType().GetHashCode(); - hash ^= base.GetHashCode(); - return hash; - } - - public override bool Equals(object obj) { - TestAllExtensionsLite other = obj as TestAllExtensionsLite; - if (other == null) return false; - if (!base.Equals(other)) return false; - return true; - } - - public override void PrintTo(global::System.IO.TextWriter writer) { - base.PrintTo(writer); - } - #endregion - - public static TestAllExtensionsLite ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestAllExtensionsLite ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestAllExtensionsLite ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestAllExtensionsLite ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestAllExtensionsLite ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestAllExtensionsLite ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestAllExtensionsLite ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestAllExtensionsLite ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestAllExtensionsLite ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestAllExtensionsLite ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestAllExtensionsLite MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestAllExtensionsLite prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilderLite { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestAllExtensionsLite cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestAllExtensionsLite result; - - private TestAllExtensionsLite PrepareBuilder() { - if (resultIsReadOnly) { - TestAllExtensionsLite original = result; - result = new TestAllExtensionsLite(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestAllExtensionsLite MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override TestAllExtensionsLite DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance; } - } - - public override TestAllExtensionsLite BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessageLite other) { - if (other is TestAllExtensionsLite) { - return MergeFrom((TestAllExtensionsLite) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestAllExtensionsLite other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestAllExtensionsLite.DefaultInstance) return this; - PrepareBuilder(); - this.MergeExtensionFields(other); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testAllExtensionsLiteFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testAllExtensionsLiteFieldTags[field_ordinal]; - else { - ParseUnknownField(input, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - return this; - } - ParseUnknownField(input, extensionRegistry, tag, field_name); - break; - } - } - } - - return this; - } - - } - static TestAllExtensionsLite() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class OptionalGroup_extension_lite : pb::GeneratedMessageLite { - private OptionalGroup_extension_lite() { } - private static readonly OptionalGroup_extension_lite defaultInstance = new OptionalGroup_extension_lite().MakeReadOnly(); - private static readonly string[] _optionalGroupExtensionLiteFieldNames = new string[] { "a" }; - private static readonly uint[] _optionalGroupExtensionLiteFieldTags = new uint[] { 136 }; - public static OptionalGroup_extension_lite DefaultInstance { - get { return defaultInstance; } - } - - public override OptionalGroup_extension_lite DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override OptionalGroup_extension_lite ThisMessage { - get { return this; } - } - - public const int AFieldNumber = 17; - private bool hasA; - private int a_; - public bool HasA { - get { return hasA; } - } - public int A { - get { return a_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _optionalGroupExtensionLiteFieldNames; - if (hasA) { - output.WriteInt32(17, field_names[0], A); - } - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA) { - size += pb::CodedOutputStream.ComputeInt32Size(17, A); - } - memoizedSerializedSize = size; - return size; - } - #region Lite runtime methods - public override int GetHashCode() { - int hash = GetType().GetHashCode(); - if (hasA) hash ^= a_.GetHashCode(); - return hash; - } - - public override bool Equals(object obj) { - OptionalGroup_extension_lite other = obj as OptionalGroup_extension_lite; - if (other == null) return false; - if (hasA != other.hasA || (hasA && !a_.Equals(other.a_))) return false; - return true; - } - - public override void PrintTo(global::System.IO.TextWriter writer) { - PrintField("a", hasA, a_, writer); - } - #endregion - - public static OptionalGroup_extension_lite ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OptionalGroup_extension_lite ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OptionalGroup_extension_lite ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OptionalGroup_extension_lite ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OptionalGroup_extension_lite ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OptionalGroup_extension_lite ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static OptionalGroup_extension_lite ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static OptionalGroup_extension_lite ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static OptionalGroup_extension_lite ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OptionalGroup_extension_lite ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private OptionalGroup_extension_lite MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(OptionalGroup_extension_lite prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilderLite { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(OptionalGroup_extension_lite cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private OptionalGroup_extension_lite result; - - private OptionalGroup_extension_lite PrepareBuilder() { - if (resultIsReadOnly) { - OptionalGroup_extension_lite original = result; - result = new OptionalGroup_extension_lite(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override OptionalGroup_extension_lite MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override OptionalGroup_extension_lite DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension_lite.DefaultInstance; } - } - - public override OptionalGroup_extension_lite BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessageLite other) { - if (other is OptionalGroup_extension_lite) { - return MergeFrom((OptionalGroup_extension_lite) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(OptionalGroup_extension_lite other) { - if (other == global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension_lite.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA) { - A = other.A; - } - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_optionalGroupExtensionLiteFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _optionalGroupExtensionLiteFieldTags[field_ordinal]; - else { - ParseUnknownField(input, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - return this; - } - ParseUnknownField(input, extensionRegistry, tag, field_name); - break; - } - case 136: { - result.hasA = input.ReadInt32(ref result.a_); - break; - } - } - } - - return this; - } - - - public bool HasA { - get { return result.hasA; } - } - public int A { - get { return result.A; } - set { SetA(value); } - } - public Builder SetA(int value) { - PrepareBuilder(); - result.hasA = true; - result.a_ = value; - return this; - } - public Builder ClearA() { - PrepareBuilder(); - result.hasA = false; - result.a_ = 0; - return this; - } - } - static OptionalGroup_extension_lite() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class RepeatedGroup_extension_lite : pb::GeneratedMessageLite { - private RepeatedGroup_extension_lite() { } - private static readonly RepeatedGroup_extension_lite defaultInstance = new RepeatedGroup_extension_lite().MakeReadOnly(); - private static readonly string[] _repeatedGroupExtensionLiteFieldNames = new string[] { "a" }; - private static readonly uint[] _repeatedGroupExtensionLiteFieldTags = new uint[] { 376 }; - public static RepeatedGroup_extension_lite DefaultInstance { - get { return defaultInstance; } - } - - public override RepeatedGroup_extension_lite DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override RepeatedGroup_extension_lite ThisMessage { - get { return this; } - } - - public const int AFieldNumber = 47; - private bool hasA; - private int a_; - public bool HasA { - get { return hasA; } - } - public int A { - get { return a_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _repeatedGroupExtensionLiteFieldNames; - if (hasA) { - output.WriteInt32(47, field_names[0], A); - } - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA) { - size += pb::CodedOutputStream.ComputeInt32Size(47, A); - } - memoizedSerializedSize = size; - return size; - } - #region Lite runtime methods - public override int GetHashCode() { - int hash = GetType().GetHashCode(); - if (hasA) hash ^= a_.GetHashCode(); - return hash; - } - - public override bool Equals(object obj) { - RepeatedGroup_extension_lite other = obj as RepeatedGroup_extension_lite; - if (other == null) return false; - if (hasA != other.hasA || (hasA && !a_.Equals(other.a_))) return false; - return true; - } - - public override void PrintTo(global::System.IO.TextWriter writer) { - PrintField("a", hasA, a_, writer); - } - #endregion - - public static RepeatedGroup_extension_lite ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RepeatedGroup_extension_lite ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RepeatedGroup_extension_lite ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RepeatedGroup_extension_lite ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RepeatedGroup_extension_lite ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RepeatedGroup_extension_lite ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static RepeatedGroup_extension_lite ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static RepeatedGroup_extension_lite ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static RepeatedGroup_extension_lite ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RepeatedGroup_extension_lite ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private RepeatedGroup_extension_lite MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(RepeatedGroup_extension_lite prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilderLite { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(RepeatedGroup_extension_lite cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private RepeatedGroup_extension_lite result; - - private RepeatedGroup_extension_lite PrepareBuilder() { - if (resultIsReadOnly) { - RepeatedGroup_extension_lite original = result; - result = new RepeatedGroup_extension_lite(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override RepeatedGroup_extension_lite MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override RepeatedGroup_extension_lite DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension_lite.DefaultInstance; } - } - - public override RepeatedGroup_extension_lite BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessageLite other) { - if (other is RepeatedGroup_extension_lite) { - return MergeFrom((RepeatedGroup_extension_lite) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(RepeatedGroup_extension_lite other) { - if (other == global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension_lite.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA) { - A = other.A; - } - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_repeatedGroupExtensionLiteFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _repeatedGroupExtensionLiteFieldTags[field_ordinal]; - else { - ParseUnknownField(input, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - return this; - } - ParseUnknownField(input, extensionRegistry, tag, field_name); - break; - } - case 376: { - result.hasA = input.ReadInt32(ref result.a_); - break; - } - } - } - - return this; - } - - - public bool HasA { - get { return result.hasA; } - } - public int A { - get { return result.A; } - set { SetA(value); } - } - public Builder SetA(int value) { - PrepareBuilder(); - result.hasA = true; - result.a_ = value; - return this; - } - public Builder ClearA() { - PrepareBuilder(); - result.hasA = false; - result.a_ = 0; - return this; - } - } - static RepeatedGroup_extension_lite() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestPackedExtensionsLite : pb::ExtendableMessageLite { - private TestPackedExtensionsLite() { } - private static readonly TestPackedExtensionsLite defaultInstance = new TestPackedExtensionsLite().MakeReadOnly(); - private static readonly string[] _testPackedExtensionsLiteFieldNames = new string[] { }; - private static readonly uint[] _testPackedExtensionsLiteFieldTags = new uint[] { }; - public static TestPackedExtensionsLite DefaultInstance { - get { return defaultInstance; } - } - - public override TestPackedExtensionsLite DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestPackedExtensionsLite ThisMessage { - get { return this; } - } - - public override bool IsInitialized { - get { - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testPackedExtensionsLiteFieldNames; - pb::ExtendableMessageLite.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - extensionWriter.WriteUntil(536870912, output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += ExtensionsSerializedSize; - memoizedSerializedSize = size; - return size; - } - #region Lite runtime methods - public override int GetHashCode() { - int hash = GetType().GetHashCode(); - hash ^= base.GetHashCode(); - return hash; - } - - public override bool Equals(object obj) { - TestPackedExtensionsLite other = obj as TestPackedExtensionsLite; - if (other == null) return false; - if (!base.Equals(other)) return false; - return true; - } - - public override void PrintTo(global::System.IO.TextWriter writer) { - base.PrintTo(writer); - } - #endregion - - public static TestPackedExtensionsLite ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestPackedExtensionsLite ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestPackedExtensionsLite ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestPackedExtensionsLite ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestPackedExtensionsLite ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestPackedExtensionsLite ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestPackedExtensionsLite ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestPackedExtensionsLite ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestPackedExtensionsLite ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestPackedExtensionsLite ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestPackedExtensionsLite MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestPackedExtensionsLite prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilderLite { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestPackedExtensionsLite cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestPackedExtensionsLite result; - - private TestPackedExtensionsLite PrepareBuilder() { - if (resultIsReadOnly) { - TestPackedExtensionsLite original = result; - result = new TestPackedExtensionsLite(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestPackedExtensionsLite MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override TestPackedExtensionsLite DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestPackedExtensionsLite.DefaultInstance; } - } - - public override TestPackedExtensionsLite BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessageLite other) { - if (other is TestPackedExtensionsLite) { - return MergeFrom((TestPackedExtensionsLite) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestPackedExtensionsLite other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestPackedExtensionsLite.DefaultInstance) return this; - PrepareBuilder(); - this.MergeExtensionFields(other); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testPackedExtensionsLiteFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testPackedExtensionsLiteFieldTags[field_ordinal]; - else { - ParseUnknownField(input, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - return this; - } - ParseUnknownField(input, extensionRegistry, tag, field_name); - break; - } - } - } - - return this; - } - - } - static TestPackedExtensionsLite() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestNestedExtensionLite : pb::GeneratedMessageLite { - private TestNestedExtensionLite() { } - private static readonly TestNestedExtensionLite defaultInstance = new TestNestedExtensionLite().MakeReadOnly(); - private static readonly string[] _testNestedExtensionLiteFieldNames = new string[] { }; - private static readonly uint[] _testNestedExtensionLiteFieldTags = new uint[] { }; - public static TestNestedExtensionLite DefaultInstance { - get { return defaultInstance; } - } - - public override TestNestedExtensionLite DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestNestedExtensionLite ThisMessage { - get { return this; } - } - - public const int NestedExtensionFieldNumber = 12345; - public static pb::GeneratedExtensionLite NestedExtension; - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testNestedExtensionLiteFieldNames; - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - memoizedSerializedSize = size; - return size; - } - #region Lite runtime methods - public override int GetHashCode() { - int hash = GetType().GetHashCode(); - return hash; - } - - public override bool Equals(object obj) { - TestNestedExtensionLite other = obj as TestNestedExtensionLite; - if (other == null) return false; - return true; - } - - public override void PrintTo(global::System.IO.TextWriter writer) { - } - #endregion - - public static TestNestedExtensionLite ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestNestedExtensionLite ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestNestedExtensionLite ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestNestedExtensionLite ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestNestedExtensionLite ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestNestedExtensionLite ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestNestedExtensionLite ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestNestedExtensionLite ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestNestedExtensionLite ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestNestedExtensionLite ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestNestedExtensionLite MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestNestedExtensionLite prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilderLite { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestNestedExtensionLite cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestNestedExtensionLite result; - - private TestNestedExtensionLite PrepareBuilder() { - if (resultIsReadOnly) { - TestNestedExtensionLite original = result; - result = new TestNestedExtensionLite(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestNestedExtensionLite MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override TestNestedExtensionLite DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestNestedExtensionLite.DefaultInstance; } - } - - public override TestNestedExtensionLite BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessageLite other) { - if (other is TestNestedExtensionLite) { - return MergeFrom((TestNestedExtensionLite) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestNestedExtensionLite other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestNestedExtensionLite.DefaultInstance) return this; - PrepareBuilder(); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testNestedExtensionLiteFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testNestedExtensionLiteFieldTags[field_ordinal]; - else { - ParseUnknownField(input, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - return this; - } - ParseUnknownField(input, extensionRegistry, tag, field_name); - break; - } - } - } - - return this; - } - - } - static TestNestedExtensionLite() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestDeprecatedLite : pb::GeneratedMessageLite { - private TestDeprecatedLite() { } - private static readonly TestDeprecatedLite defaultInstance = new TestDeprecatedLite().MakeReadOnly(); - private static readonly string[] _testDeprecatedLiteFieldNames = new string[] { "deprecated_field" }; - private static readonly uint[] _testDeprecatedLiteFieldTags = new uint[] { 8 }; - public static TestDeprecatedLite DefaultInstance { - get { return defaultInstance; } - } - - public override TestDeprecatedLite DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestDeprecatedLite ThisMessage { - get { return this; } - } - - public const int DeprecatedFieldFieldNumber = 1; - private bool hasDeprecatedField; - private int deprecatedField_; - [global::System.ObsoleteAttribute()] - public bool HasDeprecatedField { - get { return hasDeprecatedField; } - } - [global::System.ObsoleteAttribute()] - public int DeprecatedField { - get { return deprecatedField_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testDeprecatedLiteFieldNames; - if (hasDeprecatedField) { - output.WriteInt32(1, field_names[0], DeprecatedField); - } - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasDeprecatedField) { - size += pb::CodedOutputStream.ComputeInt32Size(1, DeprecatedField); - } - memoizedSerializedSize = size; - return size; - } - #region Lite runtime methods - public override int GetHashCode() { - int hash = GetType().GetHashCode(); - if (hasDeprecatedField) hash ^= deprecatedField_.GetHashCode(); - return hash; - } - - public override bool Equals(object obj) { - TestDeprecatedLite other = obj as TestDeprecatedLite; - if (other == null) return false; - if (hasDeprecatedField != other.hasDeprecatedField || (hasDeprecatedField && !deprecatedField_.Equals(other.deprecatedField_))) return false; - return true; - } - - public override void PrintTo(global::System.IO.TextWriter writer) { - PrintField("deprecated_field", hasDeprecatedField, deprecatedField_, writer); - } - #endregion - - public static TestDeprecatedLite ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestDeprecatedLite ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestDeprecatedLite ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestDeprecatedLite ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestDeprecatedLite ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestDeprecatedLite ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestDeprecatedLite ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestDeprecatedLite ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestDeprecatedLite ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestDeprecatedLite ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestDeprecatedLite MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestDeprecatedLite prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilderLite { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestDeprecatedLite cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestDeprecatedLite result; - - private TestDeprecatedLite PrepareBuilder() { - if (resultIsReadOnly) { - TestDeprecatedLite original = result; - result = new TestDeprecatedLite(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestDeprecatedLite MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override TestDeprecatedLite DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestDeprecatedLite.DefaultInstance; } - } - - public override TestDeprecatedLite BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessageLite other) { - if (other is TestDeprecatedLite) { - return MergeFrom((TestDeprecatedLite) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestDeprecatedLite other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestDeprecatedLite.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasDeprecatedField) { - DeprecatedField = other.DeprecatedField; - } - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testDeprecatedLiteFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testDeprecatedLiteFieldTags[field_ordinal]; - else { - ParseUnknownField(input, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - return this; - } - ParseUnknownField(input, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasDeprecatedField = input.ReadInt32(ref result.deprecatedField_); - break; - } - } - } - - return this; - } - - - [global::System.ObsoleteAttribute()] - public bool HasDeprecatedField { - get { return result.hasDeprecatedField; } - } - [global::System.ObsoleteAttribute()] - public int DeprecatedField { - get { return result.DeprecatedField; } - set { SetDeprecatedField(value); } - } - [global::System.ObsoleteAttribute()] - public Builder SetDeprecatedField(int value) { - PrepareBuilder(); - result.hasDeprecatedField = true; - result.deprecatedField_ = value; - return this; - } - [global::System.ObsoleteAttribute()] - public Builder ClearDeprecatedField() { - PrepareBuilder(); - result.hasDeprecatedField = false; - result.deprecatedField_ = 0; - return this; - } - } - static TestDeprecatedLite() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteProtoFile.Descriptor, null); - } - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestProtoFile.cs b/src/ProtocolBuffersLite.Test/TestProtos/UnitTestProtoFile.cs deleted file mode 100644 index dd31c67..0000000 --- a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestProtoFile.cs +++ /dev/null @@ -1,21602 +0,0 @@ -// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.TestProtos { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class UnitTestProtoFile { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalInt32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalInt64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalUint32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalUint64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalSint32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalSint64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalFixed32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalFixed64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalSfixed32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalSfixed64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalFloatExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalDoubleExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalBoolExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalStringExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalBytesExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalGroupExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalNestedMessageExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalForeignMessageExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalImportMessageExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalNestedEnumExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalForeignEnumExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalImportEnumExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalStringPieceExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalCordExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedInt32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedInt64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedUint32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedUint64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedSint32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedSint64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedFixed32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedFixed64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedSfixed32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedSfixed64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedFloatExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedDoubleExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedBoolExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedStringExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedBytesExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedGroupExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedNestedMessageExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedForeignMessageExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedImportMessageExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedNestedEnumExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedForeignEnumExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedImportEnumExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedStringPieceExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedCordExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultInt32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultInt64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultUint32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultUint64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultSint32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultSint64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultFixed32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultFixed64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultSfixed32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultSfixed64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultFloatExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultDoubleExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultBoolExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultStringExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultBytesExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultNestedEnumExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultForeignEnumExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultImportEnumExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultStringPieceExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultCordExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.MyExtensionString); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.MyExtensionInt); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedInt32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedInt64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedUint32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedUint64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedSint32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedSint64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedFixed32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedFixed64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedSfixed32Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedSfixed64Extension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedFloatExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedDoubleExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedBoolExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedEnumExtension); - registry.Add(global::Google.ProtocolBuffers.TestProtos.TestNestedExtension.Test); - registry.Add(global::Google.ProtocolBuffers.TestProtos.TestRequired.Single); - registry.Add(global::Google.ProtocolBuffers.TestProtos.TestRequired.Multi); - } - #endregion - #region Extensions - public const int OptionalInt32ExtensionFieldNumber = 1; - public static pb::GeneratedExtensionBase OptionalInt32Extension; - public const int OptionalInt64ExtensionFieldNumber = 2; - public static pb::GeneratedExtensionBase OptionalInt64Extension; - public const int OptionalUint32ExtensionFieldNumber = 3; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase OptionalUint32Extension; - public const int OptionalUint64ExtensionFieldNumber = 4; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase OptionalUint64Extension; - public const int OptionalSint32ExtensionFieldNumber = 5; - public static pb::GeneratedExtensionBase OptionalSint32Extension; - public const int OptionalSint64ExtensionFieldNumber = 6; - public static pb::GeneratedExtensionBase OptionalSint64Extension; - public const int OptionalFixed32ExtensionFieldNumber = 7; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase OptionalFixed32Extension; - public const int OptionalFixed64ExtensionFieldNumber = 8; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase OptionalFixed64Extension; - public const int OptionalSfixed32ExtensionFieldNumber = 9; - public static pb::GeneratedExtensionBase OptionalSfixed32Extension; - public const int OptionalSfixed64ExtensionFieldNumber = 10; - public static pb::GeneratedExtensionBase OptionalSfixed64Extension; - public const int OptionalFloatExtensionFieldNumber = 11; - public static pb::GeneratedExtensionBase OptionalFloatExtension; - public const int OptionalDoubleExtensionFieldNumber = 12; - public static pb::GeneratedExtensionBase OptionalDoubleExtension; - public const int OptionalBoolExtensionFieldNumber = 13; - public static pb::GeneratedExtensionBase OptionalBoolExtension; - public const int OptionalStringExtensionFieldNumber = 14; - public static pb::GeneratedExtensionBase OptionalStringExtension; - public const int OptionalBytesExtensionFieldNumber = 15; - public static pb::GeneratedExtensionBase OptionalBytesExtension; - public const int OptionalGroupExtensionFieldNumber = 16; - public static pb::GeneratedExtensionBase OptionalGroupExtension; - public const int OptionalNestedMessageExtensionFieldNumber = 18; - public static pb::GeneratedExtensionBase OptionalNestedMessageExtension; - public const int OptionalForeignMessageExtensionFieldNumber = 19; - public static pb::GeneratedExtensionBase OptionalForeignMessageExtension; - public const int OptionalImportMessageExtensionFieldNumber = 20; - public static pb::GeneratedExtensionBase OptionalImportMessageExtension; - public const int OptionalNestedEnumExtensionFieldNumber = 21; - public static pb::GeneratedExtensionBase OptionalNestedEnumExtension; - public const int OptionalForeignEnumExtensionFieldNumber = 22; - public static pb::GeneratedExtensionBase OptionalForeignEnumExtension; - public const int OptionalImportEnumExtensionFieldNumber = 23; - public static pb::GeneratedExtensionBase OptionalImportEnumExtension; - public const int OptionalStringPieceExtensionFieldNumber = 24; - public static pb::GeneratedExtensionBase OptionalStringPieceExtension; - public const int OptionalCordExtensionFieldNumber = 25; - public static pb::GeneratedExtensionBase OptionalCordExtension; - public const int RepeatedInt32ExtensionFieldNumber = 31; - public static pb::GeneratedExtensionBase> RepeatedInt32Extension; - public const int RepeatedInt64ExtensionFieldNumber = 32; - public static pb::GeneratedExtensionBase> RepeatedInt64Extension; - public const int RepeatedUint32ExtensionFieldNumber = 33; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase> RepeatedUint32Extension; - public const int RepeatedUint64ExtensionFieldNumber = 34; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase> RepeatedUint64Extension; - public const int RepeatedSint32ExtensionFieldNumber = 35; - public static pb::GeneratedExtensionBase> RepeatedSint32Extension; - public const int RepeatedSint64ExtensionFieldNumber = 36; - public static pb::GeneratedExtensionBase> RepeatedSint64Extension; - public const int RepeatedFixed32ExtensionFieldNumber = 37; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase> RepeatedFixed32Extension; - public const int RepeatedFixed64ExtensionFieldNumber = 38; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase> RepeatedFixed64Extension; - public const int RepeatedSfixed32ExtensionFieldNumber = 39; - public static pb::GeneratedExtensionBase> RepeatedSfixed32Extension; - public const int RepeatedSfixed64ExtensionFieldNumber = 40; - public static pb::GeneratedExtensionBase> RepeatedSfixed64Extension; - public const int RepeatedFloatExtensionFieldNumber = 41; - public static pb::GeneratedExtensionBase> RepeatedFloatExtension; - public const int RepeatedDoubleExtensionFieldNumber = 42; - public static pb::GeneratedExtensionBase> RepeatedDoubleExtension; - public const int RepeatedBoolExtensionFieldNumber = 43; - public static pb::GeneratedExtensionBase> RepeatedBoolExtension; - public const int RepeatedStringExtensionFieldNumber = 44; - public static pb::GeneratedExtensionBase> RepeatedStringExtension; - public const int RepeatedBytesExtensionFieldNumber = 45; - public static pb::GeneratedExtensionBase> RepeatedBytesExtension; - public const int RepeatedGroupExtensionFieldNumber = 46; - public static pb::GeneratedExtensionBase> RepeatedGroupExtension; - public const int RepeatedNestedMessageExtensionFieldNumber = 48; - public static pb::GeneratedExtensionBase> RepeatedNestedMessageExtension; - public const int RepeatedForeignMessageExtensionFieldNumber = 49; - public static pb::GeneratedExtensionBase> RepeatedForeignMessageExtension; - public const int RepeatedImportMessageExtensionFieldNumber = 50; - public static pb::GeneratedExtensionBase> RepeatedImportMessageExtension; - public const int RepeatedNestedEnumExtensionFieldNumber = 51; - public static pb::GeneratedExtensionBase> RepeatedNestedEnumExtension; - public const int RepeatedForeignEnumExtensionFieldNumber = 52; - public static pb::GeneratedExtensionBase> RepeatedForeignEnumExtension; - public const int RepeatedImportEnumExtensionFieldNumber = 53; - public static pb::GeneratedExtensionBase> RepeatedImportEnumExtension; - public const int RepeatedStringPieceExtensionFieldNumber = 54; - public static pb::GeneratedExtensionBase> RepeatedStringPieceExtension; - public const int RepeatedCordExtensionFieldNumber = 55; - public static pb::GeneratedExtensionBase> RepeatedCordExtension; - public const int DefaultInt32ExtensionFieldNumber = 61; - public static pb::GeneratedExtensionBase DefaultInt32Extension; - public const int DefaultInt64ExtensionFieldNumber = 62; - public static pb::GeneratedExtensionBase DefaultInt64Extension; - public const int DefaultUint32ExtensionFieldNumber = 63; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase DefaultUint32Extension; - public const int DefaultUint64ExtensionFieldNumber = 64; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase DefaultUint64Extension; - public const int DefaultSint32ExtensionFieldNumber = 65; - public static pb::GeneratedExtensionBase DefaultSint32Extension; - public const int DefaultSint64ExtensionFieldNumber = 66; - public static pb::GeneratedExtensionBase DefaultSint64Extension; - public const int DefaultFixed32ExtensionFieldNumber = 67; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase DefaultFixed32Extension; - public const int DefaultFixed64ExtensionFieldNumber = 68; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase DefaultFixed64Extension; - public const int DefaultSfixed32ExtensionFieldNumber = 69; - public static pb::GeneratedExtensionBase DefaultSfixed32Extension; - public const int DefaultSfixed64ExtensionFieldNumber = 70; - public static pb::GeneratedExtensionBase DefaultSfixed64Extension; - public const int DefaultFloatExtensionFieldNumber = 71; - public static pb::GeneratedExtensionBase DefaultFloatExtension; - public const int DefaultDoubleExtensionFieldNumber = 72; - public static pb::GeneratedExtensionBase DefaultDoubleExtension; - public const int DefaultBoolExtensionFieldNumber = 73; - public static pb::GeneratedExtensionBase DefaultBoolExtension; - public const int DefaultStringExtensionFieldNumber = 74; - public static pb::GeneratedExtensionBase DefaultStringExtension; - public const int DefaultBytesExtensionFieldNumber = 75; - public static pb::GeneratedExtensionBase DefaultBytesExtension; - public const int DefaultNestedEnumExtensionFieldNumber = 81; - public static pb::GeneratedExtensionBase DefaultNestedEnumExtension; - public const int DefaultForeignEnumExtensionFieldNumber = 82; - public static pb::GeneratedExtensionBase DefaultForeignEnumExtension; - public const int DefaultImportEnumExtensionFieldNumber = 83; - public static pb::GeneratedExtensionBase DefaultImportEnumExtension; - public const int DefaultStringPieceExtensionFieldNumber = 84; - public static pb::GeneratedExtensionBase DefaultStringPieceExtension; - public const int DefaultCordExtensionFieldNumber = 85; - public static pb::GeneratedExtensionBase DefaultCordExtension; - public const int MyExtensionStringFieldNumber = 50; - public static pb::GeneratedExtensionBase MyExtensionString; - public const int MyExtensionIntFieldNumber = 5; - public static pb::GeneratedExtensionBase MyExtensionInt; - public const int PackedInt32ExtensionFieldNumber = 90; - public static pb::GeneratedExtensionBase> PackedInt32Extension; - public const int PackedInt64ExtensionFieldNumber = 91; - public static pb::GeneratedExtensionBase> PackedInt64Extension; - public const int PackedUint32ExtensionFieldNumber = 92; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase> PackedUint32Extension; - public const int PackedUint64ExtensionFieldNumber = 93; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase> PackedUint64Extension; - public const int PackedSint32ExtensionFieldNumber = 94; - public static pb::GeneratedExtensionBase> PackedSint32Extension; - public const int PackedSint64ExtensionFieldNumber = 95; - public static pb::GeneratedExtensionBase> PackedSint64Extension; - public const int PackedFixed32ExtensionFieldNumber = 96; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase> PackedFixed32Extension; - public const int PackedFixed64ExtensionFieldNumber = 97; - [global::System.CLSCompliant(false)] - public static pb::GeneratedExtensionBase> PackedFixed64Extension; - public const int PackedSfixed32ExtensionFieldNumber = 98; - public static pb::GeneratedExtensionBase> PackedSfixed32Extension; - public const int PackedSfixed64ExtensionFieldNumber = 99; - public static pb::GeneratedExtensionBase> PackedSfixed64Extension; - public const int PackedFloatExtensionFieldNumber = 100; - public static pb::GeneratedExtensionBase> PackedFloatExtension; - public const int PackedDoubleExtensionFieldNumber = 101; - public static pb::GeneratedExtensionBase> PackedDoubleExtension; - public const int PackedBoolExtensionFieldNumber = 102; - public static pb::GeneratedExtensionBase> PackedBoolExtension; - public const int PackedEnumExtensionFieldNumber = 103; - public static pb::GeneratedExtensionBase> PackedEnumExtension; - #endregion - - #region Static variables - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestAllTypes__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestAllTypes__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestAllTypes_NestedMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestAllTypes_NestedMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestAllTypes_OptionalGroup__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestAllTypes_OptionalGroup__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestAllTypes_RepeatedGroup__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestAllTypes_RepeatedGroup__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestDeprecatedFields__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestDeprecatedFields__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_ForeignMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_ForeignMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestAllExtensions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestAllExtensions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_OptionalGroup_extension__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_OptionalGroup_extension__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_RepeatedGroup_extension__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_RepeatedGroup_extension__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestNestedExtension__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestNestedExtension__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestRequired__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestRequired__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestRequiredForeign__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestRequiredForeign__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestForeignNested__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestForeignNested__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestEmptyMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestEmptyMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestEmptyMessageWithExtensions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestEmptyMessageWithExtensions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestMultipleExtensionRanges__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMultipleExtensionRanges__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestReallyLargeTagNumber__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestReallyLargeTagNumber__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestRecursiveMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestRecursiveMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestMutualRecursionA__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMutualRecursionA__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestMutualRecursionB__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMutualRecursionB__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestDupFieldNumber__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestDupFieldNumber__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestDupFieldNumber_Foo__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestDupFieldNumber_Foo__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestDupFieldNumber_Bar__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestDupFieldNumber_Bar__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestNestedMessageHasBits__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestNestedMessageHasBits__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestNestedMessageHasBits_NestedMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestNestedMessageHasBits_NestedMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestCamelCaseFieldNames__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestCamelCaseFieldNames__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestFieldOrderings__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestFieldOrderings__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestExtremeDefaultValues__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestExtremeDefaultValues__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_SparseEnumMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_SparseEnumMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_OneString__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_OneString__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_OneBytes__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_OneBytes__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestPackedTypes__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestPackedTypes__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestUnpackedTypes__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestUnpackedTypes__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestPackedExtensions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestPackedExtensions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestDynamicExtensions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestDynamicExtensions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestDynamicExtensions_DynamicMessageType__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestDynamicExtensions_DynamicMessageType__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestRepeatedScalarDifferentTagSizes__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestRepeatedScalarDifferentTagSizes__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_FooRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_FooRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_FooResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_FooResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_BarRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_BarRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_BarResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_BarResponse__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static UnitTestProtoFile() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "Ch5nb29nbGUvcHJvdG9idWYvdW5pdHRlc3QucHJvdG8SEXByb3RvYnVmX3Vu", - "aXR0ZXN0GiRnb29nbGUvcHJvdG9idWYvY3NoYXJwX29wdGlvbnMucHJvdG8a", - "JWdvb2dsZS9wcm90b2J1Zi91bml0dGVzdF9pbXBvcnQucHJvdG8iuxUKDFRl", - "c3RBbGxUeXBlcxIWCg5vcHRpb25hbF9pbnQzMhgBIAEoBRIWCg5vcHRpb25h", - "bF9pbnQ2NBgCIAEoAxIXCg9vcHRpb25hbF91aW50MzIYAyABKA0SFwoPb3B0", - "aW9uYWxfdWludDY0GAQgASgEEhcKD29wdGlvbmFsX3NpbnQzMhgFIAEoERIX", - "Cg9vcHRpb25hbF9zaW50NjQYBiABKBISGAoQb3B0aW9uYWxfZml4ZWQzMhgH", - "IAEoBxIYChBvcHRpb25hbF9maXhlZDY0GAggASgGEhkKEW9wdGlvbmFsX3Nm", - "aXhlZDMyGAkgASgPEhkKEW9wdGlvbmFsX3NmaXhlZDY0GAogASgQEhYKDm9w", - "dGlvbmFsX2Zsb2F0GAsgASgCEhcKD29wdGlvbmFsX2RvdWJsZRgMIAEoARIV", - "Cg1vcHRpb25hbF9ib29sGA0gASgIEhcKD29wdGlvbmFsX3N0cmluZxgOIAEo", - "CRIWCg5vcHRpb25hbF9ieXRlcxgPIAEoDBJECg1vcHRpb25hbGdyb3VwGBAg", - "ASgKMi0ucHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbFR5cGVzLk9wdGlvbmFs", - "R3JvdXASTgoXb3B0aW9uYWxfbmVzdGVkX21lc3NhZ2UYEiABKAsyLS5wcm90", - "b2J1Zl91bml0dGVzdC5UZXN0QWxsVHlwZXMuTmVzdGVkTWVzc2FnZRJDChhv", - "cHRpb25hbF9mb3JlaWduX21lc3NhZ2UYEyABKAsyIS5wcm90b2J1Zl91bml0", - "dGVzdC5Gb3JlaWduTWVzc2FnZRJIChdvcHRpb25hbF9pbXBvcnRfbWVzc2Fn", - "ZRgUIAEoCzInLnByb3RvYnVmX3VuaXR0ZXN0X2ltcG9ydC5JbXBvcnRNZXNz", - "YWdlEkgKFG9wdGlvbmFsX25lc3RlZF9lbnVtGBUgASgOMioucHJvdG9idWZf", - "dW5pdHRlc3QuVGVzdEFsbFR5cGVzLk5lc3RlZEVudW0SPQoVb3B0aW9uYWxf", - "Zm9yZWlnbl9lbnVtGBYgASgOMh4ucHJvdG9idWZfdW5pdHRlc3QuRm9yZWln", - "bkVudW0SQgoUb3B0aW9uYWxfaW1wb3J0X2VudW0YFyABKA4yJC5wcm90b2J1", - "Zl91bml0dGVzdF9pbXBvcnQuSW1wb3J0RW51bRIhChVvcHRpb25hbF9zdHJp", - "bmdfcGllY2UYGCABKAlCAggCEhkKDW9wdGlvbmFsX2NvcmQYGSABKAlCAggB", - "EhYKDnJlcGVhdGVkX2ludDMyGB8gAygFEhYKDnJlcGVhdGVkX2ludDY0GCAg", - "AygDEhcKD3JlcGVhdGVkX3VpbnQzMhghIAMoDRIXCg9yZXBlYXRlZF91aW50", - "NjQYIiADKAQSFwoPcmVwZWF0ZWRfc2ludDMyGCMgAygREhcKD3JlcGVhdGVk", - "X3NpbnQ2NBgkIAMoEhIYChByZXBlYXRlZF9maXhlZDMyGCUgAygHEhgKEHJl", - "cGVhdGVkX2ZpeGVkNjQYJiADKAYSGQoRcmVwZWF0ZWRfc2ZpeGVkMzIYJyAD", - "KA8SGQoRcmVwZWF0ZWRfc2ZpeGVkNjQYKCADKBASFgoOcmVwZWF0ZWRfZmxv", - "YXQYKSADKAISFwoPcmVwZWF0ZWRfZG91YmxlGCogAygBEhUKDXJlcGVhdGVk", - "X2Jvb2wYKyADKAgSFwoPcmVwZWF0ZWRfc3RyaW5nGCwgAygJEhYKDnJlcGVh", - "dGVkX2J5dGVzGC0gAygMEkQKDXJlcGVhdGVkZ3JvdXAYLiADKAoyLS5wcm90", - "b2J1Zl91bml0dGVzdC5UZXN0QWxsVHlwZXMuUmVwZWF0ZWRHcm91cBJOChdy", - "ZXBlYXRlZF9uZXN0ZWRfbWVzc2FnZRgwIAMoCzItLnByb3RvYnVmX3VuaXR0", - "ZXN0LlRlc3RBbGxUeXBlcy5OZXN0ZWRNZXNzYWdlEkMKGHJlcGVhdGVkX2Zv", - "cmVpZ25fbWVzc2FnZRgxIAMoCzIhLnByb3RvYnVmX3VuaXR0ZXN0LkZvcmVp", - "Z25NZXNzYWdlEkgKF3JlcGVhdGVkX2ltcG9ydF9tZXNzYWdlGDIgAygLMicu", - "cHJvdG9idWZfdW5pdHRlc3RfaW1wb3J0LkltcG9ydE1lc3NhZ2USSAoUcmVw", - "ZWF0ZWRfbmVzdGVkX2VudW0YMyADKA4yKi5wcm90b2J1Zl91bml0dGVzdC5U", - "ZXN0QWxsVHlwZXMuTmVzdGVkRW51bRI9ChVyZXBlYXRlZF9mb3JlaWduX2Vu", - "dW0YNCADKA4yHi5wcm90b2J1Zl91bml0dGVzdC5Gb3JlaWduRW51bRJCChRy", - "ZXBlYXRlZF9pbXBvcnRfZW51bRg1IAMoDjIkLnByb3RvYnVmX3VuaXR0ZXN0", - "X2ltcG9ydC5JbXBvcnRFbnVtEiEKFXJlcGVhdGVkX3N0cmluZ19waWVjZRg2", - "IAMoCUICCAISGQoNcmVwZWF0ZWRfY29yZBg3IAMoCUICCAESGQoNZGVmYXVs", - "dF9pbnQzMhg9IAEoBToCNDESGQoNZGVmYXVsdF9pbnQ2NBg+IAEoAzoCNDIS", - "GgoOZGVmYXVsdF91aW50MzIYPyABKA06AjQzEhoKDmRlZmF1bHRfdWludDY0", - "GEAgASgEOgI0NBIbCg5kZWZhdWx0X3NpbnQzMhhBIAEoEToDLTQ1EhoKDmRl", - "ZmF1bHRfc2ludDY0GEIgASgSOgI0NhIbCg9kZWZhdWx0X2ZpeGVkMzIYQyAB", - "KAc6AjQ3EhsKD2RlZmF1bHRfZml4ZWQ2NBhEIAEoBjoCNDgSHAoQZGVmYXVs", - "dF9zZml4ZWQzMhhFIAEoDzoCNDkSHQoQZGVmYXVsdF9zZml4ZWQ2NBhGIAEo", - "EDoDLTUwEhsKDWRlZmF1bHRfZmxvYXQYRyABKAI6BDUxLjUSHQoOZGVmYXVs", - "dF9kb3VibGUYSCABKAE6BTUyMDAwEhoKDGRlZmF1bHRfYm9vbBhJIAEoCDoE", - "dHJ1ZRIdCg5kZWZhdWx0X3N0cmluZxhKIAEoCToFaGVsbG8SHAoNZGVmYXVs", - "dF9ieXRlcxhLIAEoDDoFd29ybGQSTAoTZGVmYXVsdF9uZXN0ZWRfZW51bRhR", - "IAEoDjIqLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RBbGxUeXBlcy5OZXN0ZWRF", - "bnVtOgNCQVISSQoUZGVmYXVsdF9mb3JlaWduX2VudW0YUiABKA4yHi5wcm90", - "b2J1Zl91bml0dGVzdC5Gb3JlaWduRW51bToLRk9SRUlHTl9CQVISTQoTZGVm", - "YXVsdF9pbXBvcnRfZW51bRhTIAEoDjIkLnByb3RvYnVmX3VuaXR0ZXN0X2lt", - "cG9ydC5JbXBvcnRFbnVtOgpJTVBPUlRfQkFSEiUKFGRlZmF1bHRfc3RyaW5n", - "X3BpZWNlGFQgASgJOgNhYmNCAggCEh0KDGRlZmF1bHRfY29yZBhVIAEoCToD", - "MTIzQgIIARobCg1OZXN0ZWRNZXNzYWdlEgoKAmJiGAEgASgFGhoKDU9wdGlv", - "bmFsR3JvdXASCQoBYRgRIAEoBRoaCg1SZXBlYXRlZEdyb3VwEgkKAWEYLyAB", - "KAUiJwoKTmVzdGVkRW51bRIHCgNGT08QARIHCgNCQVIQAhIHCgNCQVoQAyI0", - "ChRUZXN0RGVwcmVjYXRlZEZpZWxkcxIcChBkZXByZWNhdGVkX2ludDMyGAEg", - "ASgFQgIYASIbCg5Gb3JlaWduTWVzc2FnZRIJCgFjGAEgASgFIh0KEVRlc3RB", - "bGxFeHRlbnNpb25zKggIARCAgICAAiIkChdPcHRpb25hbEdyb3VwX2V4dGVu", - "c2lvbhIJCgFhGBEgASgFIiQKF1JlcGVhdGVkR3JvdXBfZXh0ZW5zaW9uEgkK", - "AWEYLyABKAUiUAoTVGVzdE5lc3RlZEV4dGVuc2lvbjI5CgR0ZXN0EiQucHJv", - "dG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMY6gcgASgJOgR0ZXN0", - "ItUFCgxUZXN0UmVxdWlyZWQSCQoBYRgBIAIoBRIOCgZkdW1teTIYAiABKAUS", - "CQoBYhgDIAIoBRIOCgZkdW1teTQYBCABKAUSDgoGZHVtbXk1GAUgASgFEg4K", - "BmR1bW15NhgGIAEoBRIOCgZkdW1teTcYByABKAUSDgoGZHVtbXk4GAggASgF", - "Eg4KBmR1bW15ORgJIAEoBRIPCgdkdW1teTEwGAogASgFEg8KB2R1bW15MTEY", - "CyABKAUSDwoHZHVtbXkxMhgMIAEoBRIPCgdkdW1teTEzGA0gASgFEg8KB2R1", - "bW15MTQYDiABKAUSDwoHZHVtbXkxNRgPIAEoBRIPCgdkdW1teTE2GBAgASgF", - "Eg8KB2R1bW15MTcYESABKAUSDwoHZHVtbXkxOBgSIAEoBRIPCgdkdW1teTE5", - "GBMgASgFEg8KB2R1bW15MjAYFCABKAUSDwoHZHVtbXkyMRgVIAEoBRIPCgdk", - "dW1teTIyGBYgASgFEg8KB2R1bW15MjMYFyABKAUSDwoHZHVtbXkyNBgYIAEo", - "BRIPCgdkdW1teTI1GBkgASgFEg8KB2R1bW15MjYYGiABKAUSDwoHZHVtbXky", - "NxgbIAEoBRIPCgdkdW1teTI4GBwgASgFEg8KB2R1bW15MjkYHSABKAUSDwoH", - "ZHVtbXkzMBgeIAEoBRIPCgdkdW1teTMxGB8gASgFEg8KB2R1bW15MzIYICAB", - "KAUSCQoBYxghIAIoBTJWCgZzaW5nbGUSJC5wcm90b2J1Zl91bml0dGVzdC5U", - "ZXN0QWxsRXh0ZW5zaW9ucxjoByABKAsyHy5wcm90b2J1Zl91bml0dGVzdC5U", - "ZXN0UmVxdWlyZWQyVQoFbXVsdGkSJC5wcm90b2J1Zl91bml0dGVzdC5UZXN0", - "QWxsRXh0ZW5zaW9ucxjpByADKAsyHy5wcm90b2J1Zl91bml0dGVzdC5UZXN0", - "UmVxdWlyZWQimgEKE1Rlc3RSZXF1aXJlZEZvcmVpZ24SOQoQb3B0aW9uYWxf", - "bWVzc2FnZRgBIAEoCzIfLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RSZXF1aXJl", - "ZBI5ChByZXBlYXRlZF9tZXNzYWdlGAIgAygLMh8ucHJvdG9idWZfdW5pdHRl", - "c3QuVGVzdFJlcXVpcmVkEg0KBWR1bW15GAMgASgFIloKEVRlc3RGb3JlaWdu", - "TmVzdGVkEkUKDmZvcmVpZ25fbmVzdGVkGAEgASgLMi0ucHJvdG9idWZfdW5p", - "dHRlc3QuVGVzdEFsbFR5cGVzLk5lc3RlZE1lc3NhZ2UiEgoQVGVzdEVtcHR5", - "TWVzc2FnZSIqCh5UZXN0RW1wdHlNZXNzYWdlV2l0aEV4dGVuc2lvbnMqCAgB", - "EICAgIACIjcKG1Rlc3RNdWx0aXBsZUV4dGVuc2lvblJhbmdlcyoECCoQKyoG", - "CK8gEJQhKgoIgIAEEICAgIACIjQKGFRlc3RSZWFsbHlMYXJnZVRhZ051bWJl", - "chIJCgFhGAEgASgFEg0KAmJiGP///38gASgFIlUKFFRlc3RSZWN1cnNpdmVN", - "ZXNzYWdlEjIKAWEYASABKAsyJy5wcm90b2J1Zl91bml0dGVzdC5UZXN0UmVj", - "dXJzaXZlTWVzc2FnZRIJCgFpGAIgASgFIksKFFRlc3RNdXR1YWxSZWN1cnNp", - "b25BEjMKAmJiGAEgASgLMicucHJvdG9idWZfdW5pdHRlc3QuVGVzdE11dHVh", - "bFJlY3Vyc2lvbkIiYgoUVGVzdE11dHVhbFJlY3Vyc2lvbkISMgoBYRgBIAEo", - "CzInLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RNdXR1YWxSZWN1cnNpb25BEhYK", - "Dm9wdGlvbmFsX2ludDMyGAIgASgFIrMBChJUZXN0RHVwRmllbGROdW1iZXIS", - "CQoBYRgBIAEoBRI2CgNmb28YAiABKAoyKS5wcm90b2J1Zl91bml0dGVzdC5U", - "ZXN0RHVwRmllbGROdW1iZXIuRm9vEjYKA2JhchgDIAEoCjIpLnByb3RvYnVm", - "X3VuaXR0ZXN0LlRlc3REdXBGaWVsZE51bWJlci5CYXIaEAoDRm9vEgkKAWEY", - "ASABKAUaEAoDQmFyEgkKAWEYASABKAUigAIKGFRlc3ROZXN0ZWRNZXNzYWdl", - "SGFzQml0cxJaChdvcHRpb25hbF9uZXN0ZWRfbWVzc2FnZRgBIAEoCzI5LnBy", - "b3RvYnVmX3VuaXR0ZXN0LlRlc3ROZXN0ZWRNZXNzYWdlSGFzQml0cy5OZXN0", - "ZWRNZXNzYWdlGocBCg1OZXN0ZWRNZXNzYWdlEiQKHG5lc3RlZG1lc3NhZ2Vf", - "cmVwZWF0ZWRfaW50MzIYASADKAUSUAolbmVzdGVkbWVzc2FnZV9yZXBlYXRl", - "ZF9mb3JlaWdubWVzc2FnZRgCIAMoCzIhLnByb3RvYnVmX3VuaXR0ZXN0LkZv", - "cmVpZ25NZXNzYWdlIuUDChdUZXN0Q2FtZWxDYXNlRmllbGROYW1lcxIWCg5Q", - "cmltaXRpdmVGaWVsZBgBIAEoBRITCgtTdHJpbmdGaWVsZBgCIAEoCRIxCglF", - "bnVtRmllbGQYAyABKA4yHi5wcm90b2J1Zl91bml0dGVzdC5Gb3JlaWduRW51", - "bRI3CgxNZXNzYWdlRmllbGQYBCABKAsyIS5wcm90b2J1Zl91bml0dGVzdC5G", - "b3JlaWduTWVzc2FnZRIcChBTdHJpbmdQaWVjZUZpZWxkGAUgASgJQgIIAhIV", - "CglDb3JkRmllbGQYBiABKAlCAggBEh4KFlJlcGVhdGVkUHJpbWl0aXZlRmll", - "bGQYByADKAUSGwoTUmVwZWF0ZWRTdHJpbmdGaWVsZBgIIAMoCRI5ChFSZXBl", - "YXRlZEVudW1GaWVsZBgJIAMoDjIeLnByb3RvYnVmX3VuaXR0ZXN0LkZvcmVp", - "Z25FbnVtEj8KFFJlcGVhdGVkTWVzc2FnZUZpZWxkGAogAygLMiEucHJvdG9i", - "dWZfdW5pdHRlc3QuRm9yZWlnbk1lc3NhZ2USJAoYUmVwZWF0ZWRTdHJpbmdQ", - "aWVjZUZpZWxkGAsgAygJQgIIAhIdChFSZXBlYXRlZENvcmRGaWVsZBgMIAMo", - "CUICCAEiVQoSVGVzdEZpZWxkT3JkZXJpbmdzEhEKCW15X3N0cmluZxgLIAEo", - "CRIOCgZteV9pbnQYASABKAMSEAoIbXlfZmxvYXQYZSABKAIqBAgCEAsqBAgM", - "EGUiowUKGFRlc3RFeHRyZW1lRGVmYXVsdFZhbHVlcxI/Cg1lc2NhcGVkX2J5", - "dGVzGAEgASgMOihcMDAwXDAwMVwwMDdcMDEwXDAxNFxuXHJcdFwwMTNcXFwn", - "XCJcMzc2EiAKDGxhcmdlX3VpbnQzMhgCIAEoDToKNDI5NDk2NzI5NRIqCgxs", - "YXJnZV91aW50NjQYAyABKAQ6FDE4NDQ2NzQ0MDczNzA5NTUxNjE1EiAKC3Nt", - "YWxsX2ludDMyGAQgASgFOgstMjE0NzQ4MzY0NxIpCgtzbWFsbF9pbnQ2NBgF", - "IAEoAzoULTkyMjMzNzIwMzY4NTQ3NzU4MDcSGAoLdXRmOF9zdHJpbmcYBiAB", - "KAk6A+GItBIVCgp6ZXJvX2Zsb2F0GAcgASgCOgEwEhQKCW9uZV9mbG9hdBgI", - "IAEoAjoBMRIYCgtzbWFsbF9mbG9hdBgJIAEoAjoDMS41Eh4KEm5lZ2F0aXZl", - "X29uZV9mbG9hdBgKIAEoAjoCLTESHAoObmVnYXRpdmVfZmxvYXQYCyABKAI6", - "BC0xLjUSGwoLbGFyZ2VfZmxvYXQYDCABKAI6BjJlKzAwOBIlChRzbWFsbF9u", - "ZWdhdGl2ZV9mbG9hdBgNIAEoAjoHLThlLTAyOBIXCgppbmZfZG91YmxlGA4g", - "ASgBOgNpbmYSHAoObmVnX2luZl9kb3VibGUYDyABKAE6BC1pbmYSFwoKbmFu", - "X2RvdWJsZRgQIAEoAToDbmFuEhYKCWluZl9mbG9hdBgRIAEoAjoDaW5mEhsK", - "DW5lZ19pbmZfZmxvYXQYEiABKAI6BC1pbmYSFgoJbmFuX2Zsb2F0GBMgASgC", - "OgNuYW4SKwoMY3BwX3RyaWdyYXBoGBQgASgJOhU/ID8gPz8gPz8gPz8/ID8/", - "LyA/Py0iSwoRU3BhcnNlRW51bU1lc3NhZ2USNgoLc3BhcnNlX2VudW0YASAB", - "KA4yIS5wcm90b2J1Zl91bml0dGVzdC5UZXN0U3BhcnNlRW51bSIZCglPbmVT", - "dHJpbmcSDAoEZGF0YRgBIAEoCSIYCghPbmVCeXRlcxIMCgRkYXRhGAEgASgM", - "IqoDCg9UZXN0UGFja2VkVHlwZXMSGAoMcGFja2VkX2ludDMyGFogAygFQgIQ", - "ARIYCgxwYWNrZWRfaW50NjQYWyADKANCAhABEhkKDXBhY2tlZF91aW50MzIY", - "XCADKA1CAhABEhkKDXBhY2tlZF91aW50NjQYXSADKARCAhABEhkKDXBhY2tl", - "ZF9zaW50MzIYXiADKBFCAhABEhkKDXBhY2tlZF9zaW50NjQYXyADKBJCAhAB", - "EhoKDnBhY2tlZF9maXhlZDMyGGAgAygHQgIQARIaCg5wYWNrZWRfZml4ZWQ2", - "NBhhIAMoBkICEAESGwoPcGFja2VkX3NmaXhlZDMyGGIgAygPQgIQARIbCg9w", - "YWNrZWRfc2ZpeGVkNjQYYyADKBBCAhABEhgKDHBhY2tlZF9mbG9hdBhkIAMo", - "AkICEAESGQoNcGFja2VkX2RvdWJsZRhlIAMoAUICEAESFwoLcGFja2VkX2Jv", - "b2wYZiADKAhCAhABEjcKC3BhY2tlZF9lbnVtGGcgAygOMh4ucHJvdG9idWZf", - "dW5pdHRlc3QuRm9yZWlnbkVudW1CAhABIsgDChFUZXN0VW5wYWNrZWRUeXBl", - "cxIaCg51bnBhY2tlZF9pbnQzMhhaIAMoBUICEAASGgoOdW5wYWNrZWRfaW50", - "NjQYWyADKANCAhAAEhsKD3VucGFja2VkX3VpbnQzMhhcIAMoDUICEAASGwoP", - "dW5wYWNrZWRfdWludDY0GF0gAygEQgIQABIbCg91bnBhY2tlZF9zaW50MzIY", - "XiADKBFCAhAAEhsKD3VucGFja2VkX3NpbnQ2NBhfIAMoEkICEAASHAoQdW5w", - "YWNrZWRfZml4ZWQzMhhgIAMoB0ICEAASHAoQdW5wYWNrZWRfZml4ZWQ2NBhh", - "IAMoBkICEAASHQoRdW5wYWNrZWRfc2ZpeGVkMzIYYiADKA9CAhAAEh0KEXVu", - "cGFja2VkX3NmaXhlZDY0GGMgAygQQgIQABIaCg51bnBhY2tlZF9mbG9hdBhk", - "IAMoAkICEAASGwoPdW5wYWNrZWRfZG91YmxlGGUgAygBQgIQABIZCg11bnBh", - "Y2tlZF9ib29sGGYgAygIQgIQABI5Cg11bnBhY2tlZF9lbnVtGGcgAygOMh4u", - "cHJvdG9idWZfdW5pdHRlc3QuRm9yZWlnbkVudW1CAhAAIiAKFFRlc3RQYWNr", - "ZWRFeHRlbnNpb25zKggIARCAgICAAiKZBAoVVGVzdER5bmFtaWNFeHRlbnNp", - "b25zEhkKEHNjYWxhcl9leHRlbnNpb24Y0A8gASgHEjcKDmVudW1fZXh0ZW5z", - "aW9uGNEPIAEoDjIeLnByb3RvYnVmX3VuaXR0ZXN0LkZvcmVpZ25FbnVtElkK", - "FmR5bmFtaWNfZW51bV9leHRlbnNpb24Y0g8gASgOMjgucHJvdG9idWZfdW5p", - "dHRlc3QuVGVzdER5bmFtaWNFeHRlbnNpb25zLkR5bmFtaWNFbnVtVHlwZRI9", - "ChFtZXNzYWdlX2V4dGVuc2lvbhjTDyABKAsyIS5wcm90b2J1Zl91bml0dGVz", - "dC5Gb3JlaWduTWVzc2FnZRJfChlkeW5hbWljX21lc3NhZ2VfZXh0ZW5zaW9u", - "GNQPIAEoCzI7LnByb3RvYnVmX3VuaXR0ZXN0LlRlc3REeW5hbWljRXh0ZW5z", - "aW9ucy5EeW5hbWljTWVzc2FnZVR5cGUSGwoScmVwZWF0ZWRfZXh0ZW5zaW9u", - "GNUPIAMoCRIdChBwYWNrZWRfZXh0ZW5zaW9uGNYPIAMoEUICEAEaLAoSRHlu", - "YW1pY01lc3NhZ2VUeXBlEhYKDWR5bmFtaWNfZmllbGQYtBAgASgFIkcKD0R5", - "bmFtaWNFbnVtVHlwZRIQCgtEWU5BTUlDX0ZPTxCYERIQCgtEWU5BTUlDX0JB", - "UhCZERIQCgtEWU5BTUlDX0JBWhCaESLAAQojVGVzdFJlcGVhdGVkU2NhbGFy", - "RGlmZmVyZW50VGFnU2l6ZXMSGAoQcmVwZWF0ZWRfZml4ZWQzMhgMIAMoBxIW", - "Cg5yZXBlYXRlZF9pbnQzMhgNIAMoBRIZChByZXBlYXRlZF9maXhlZDY0GP4P", - "IAMoBhIXCg5yZXBlYXRlZF9pbnQ2NBj/DyADKAMSGAoOcmVwZWF0ZWRfZmxv", - "YXQY/v8PIAMoAhIZCg9yZXBlYXRlZF91aW50NjQY//8PIAMoBCIMCgpGb29S", - "ZXF1ZXN0Ig0KC0Zvb1Jlc3BvbnNlIgwKCkJhclJlcXVlc3QiDQoLQmFyUmVz", - "cG9uc2UqQAoLRm9yZWlnbkVudW0SDwoLRk9SRUlHTl9GT08QBBIPCgtGT1JF", - "SUdOX0JBUhAFEg8KC0ZPUkVJR05fQkFaEAYqRwoUVGVzdEVudW1XaXRoRHVw", - "VmFsdWUSCAoERk9PMRABEggKBEJBUjEQAhIHCgNCQVoQAxIICgRGT08yEAES", - "CAoEQkFSMhACKokBCg5UZXN0U3BhcnNlRW51bRIMCghTUEFSU0VfQRB7Eg4K", - "CFNQQVJTRV9CEKbnAxIPCghTUEFSU0VfQxCysYAGEhUKCFNQQVJTRV9EEPH/", - "/////////wESFQoIU1BBUlNFX0UQtN78////////ARIMCghTUEFSU0VfRhAA", - "EgwKCFNQQVJTRV9HEAIymQEKC1Rlc3RTZXJ2aWNlEkQKA0ZvbxIdLnByb3Rv", - "YnVmX3VuaXR0ZXN0LkZvb1JlcXVlc3QaHi5wcm90b2J1Zl91bml0dGVzdC5G", - "b29SZXNwb25zZRJECgNCYXISHS5wcm90b2J1Zl91bml0dGVzdC5CYXJSZXF1", - "ZXN0Gh4ucHJvdG9idWZfdW5pdHRlc3QuQmFyUmVzcG9uc2U6RgoYb3B0aW9u", - "YWxfaW50MzJfZXh0ZW5zaW9uEiQucHJvdG9idWZfdW5pdHRlc3QuVGVzdEFs", - "bEV4dGVuc2lvbnMYASABKAU6RgoYb3B0aW9uYWxfaW50NjRfZXh0ZW5zaW9u", - "EiQucHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYAiABKAM6", - "RwoZb3B0aW9uYWxfdWludDMyX2V4dGVuc2lvbhIkLnByb3RvYnVmX3VuaXR0", - "ZXN0LlRlc3RBbGxFeHRlbnNpb25zGAMgASgNOkcKGW9wdGlvbmFsX3VpbnQ2", - "NF9leHRlbnNpb24SJC5wcm90b2J1Zl91bml0dGVzdC5UZXN0QWxsRXh0ZW5z", - "aW9ucxgEIAEoBDpHChlvcHRpb25hbF9zaW50MzJfZXh0ZW5zaW9uEiQucHJv", - "dG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYBSABKBE6RwoZb3B0", - "aW9uYWxfc2ludDY0X2V4dGVuc2lvbhIkLnByb3RvYnVmX3VuaXR0ZXN0LlRl", - "c3RBbGxFeHRlbnNpb25zGAYgASgSOkgKGm9wdGlvbmFsX2ZpeGVkMzJfZXh0", - "ZW5zaW9uEiQucHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMY", - "ByABKAc6SAoab3B0aW9uYWxfZml4ZWQ2NF9leHRlbnNpb24SJC5wcm90b2J1", - "Zl91bml0dGVzdC5UZXN0QWxsRXh0ZW5zaW9ucxgIIAEoBjpJChtvcHRpb25h", - "bF9zZml4ZWQzMl9leHRlbnNpb24SJC5wcm90b2J1Zl91bml0dGVzdC5UZXN0", - "QWxsRXh0ZW5zaW9ucxgJIAEoDzpJChtvcHRpb25hbF9zZml4ZWQ2NF9leHRl", - "bnNpb24SJC5wcm90b2J1Zl91bml0dGVzdC5UZXN0QWxsRXh0ZW5zaW9ucxgK", - "IAEoEDpGChhvcHRpb25hbF9mbG9hdF9leHRlbnNpb24SJC5wcm90b2J1Zl91", - "bml0dGVzdC5UZXN0QWxsRXh0ZW5zaW9ucxgLIAEoAjpHChlvcHRpb25hbF9k", - "b3VibGVfZXh0ZW5zaW9uEiQucHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4", - "dGVuc2lvbnMYDCABKAE6RQoXb3B0aW9uYWxfYm9vbF9leHRlbnNpb24SJC5w", - "cm90b2J1Zl91bml0dGVzdC5UZXN0QWxsRXh0ZW5zaW9ucxgNIAEoCDpHChlv", - "cHRpb25hbF9zdHJpbmdfZXh0ZW5zaW9uEiQucHJvdG9idWZfdW5pdHRlc3Qu", - "VGVzdEFsbEV4dGVuc2lvbnMYDiABKAk6RgoYb3B0aW9uYWxfYnl0ZXNfZXh0", - "ZW5zaW9uEiQucHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMY", - "DyABKAw6cQoXb3B0aW9uYWxncm91cF9leHRlbnNpb24SJC5wcm90b2J1Zl91", - "bml0dGVzdC5UZXN0QWxsRXh0ZW5zaW9ucxgQIAEoCjIqLnByb3RvYnVmX3Vu", - "aXR0ZXN0Lk9wdGlvbmFsR3JvdXBfZXh0ZW5zaW9uOn4KIW9wdGlvbmFsX25l", - "c3RlZF9tZXNzYWdlX2V4dGVuc2lvbhIkLnByb3RvYnVmX3VuaXR0ZXN0LlRl", - "c3RBbGxFeHRlbnNpb25zGBIgASgLMi0ucHJvdG9idWZfdW5pdHRlc3QuVGVz", - "dEFsbFR5cGVzLk5lc3RlZE1lc3NhZ2U6cwoib3B0aW9uYWxfZm9yZWlnbl9t", - "ZXNzYWdlX2V4dGVuc2lvbhIkLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RBbGxF", - "eHRlbnNpb25zGBMgASgLMiEucHJvdG9idWZfdW5pdHRlc3QuRm9yZWlnbk1l", - "c3NhZ2U6eAohb3B0aW9uYWxfaW1wb3J0X21lc3NhZ2VfZXh0ZW5zaW9uEiQu", - "cHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYFCABKAsyJy5w", - "cm90b2J1Zl91bml0dGVzdF9pbXBvcnQuSW1wb3J0TWVzc2FnZTp4Ch5vcHRp", - "b25hbF9uZXN0ZWRfZW51bV9leHRlbnNpb24SJC5wcm90b2J1Zl91bml0dGVz", - "dC5UZXN0QWxsRXh0ZW5zaW9ucxgVIAEoDjIqLnByb3RvYnVmX3VuaXR0ZXN0", - "LlRlc3RBbGxUeXBlcy5OZXN0ZWRFbnVtOm0KH29wdGlvbmFsX2ZvcmVpZ25f", - "ZW51bV9leHRlbnNpb24SJC5wcm90b2J1Zl91bml0dGVzdC5UZXN0QWxsRXh0", - "ZW5zaW9ucxgWIAEoDjIeLnByb3RvYnVmX3VuaXR0ZXN0LkZvcmVpZ25FbnVt", - "OnIKHm9wdGlvbmFsX2ltcG9ydF9lbnVtX2V4dGVuc2lvbhIkLnByb3RvYnVm", - "X3VuaXR0ZXN0LlRlc3RBbGxFeHRlbnNpb25zGBcgASgOMiQucHJvdG9idWZf", - "dW5pdHRlc3RfaW1wb3J0LkltcG9ydEVudW06UQofb3B0aW9uYWxfc3RyaW5n", - "X3BpZWNlX2V4dGVuc2lvbhIkLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RBbGxF", - "eHRlbnNpb25zGBggASgJQgIIAjpJChdvcHRpb25hbF9jb3JkX2V4dGVuc2lv", - "bhIkLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RBbGxFeHRlbnNpb25zGBkgASgJ", - "QgIIATpGChhyZXBlYXRlZF9pbnQzMl9leHRlbnNpb24SJC5wcm90b2J1Zl91", - "bml0dGVzdC5UZXN0QWxsRXh0ZW5zaW9ucxgfIAMoBTpGChhyZXBlYXRlZF9p", - "bnQ2NF9leHRlbnNpb24SJC5wcm90b2J1Zl91bml0dGVzdC5UZXN0QWxsRXh0", - "ZW5zaW9ucxggIAMoAzpHChlyZXBlYXRlZF91aW50MzJfZXh0ZW5zaW9uEiQu", - "cHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYISADKA06RwoZ", - "cmVwZWF0ZWRfdWludDY0X2V4dGVuc2lvbhIkLnByb3RvYnVmX3VuaXR0ZXN0", - "LlRlc3RBbGxFeHRlbnNpb25zGCIgAygEOkcKGXJlcGVhdGVkX3NpbnQzMl9l", - "eHRlbnNpb24SJC5wcm90b2J1Zl91bml0dGVzdC5UZXN0QWxsRXh0ZW5zaW9u", - "cxgjIAMoETpHChlyZXBlYXRlZF9zaW50NjRfZXh0ZW5zaW9uEiQucHJvdG9i", - "dWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYJCADKBI6SAoacmVwZWF0", - "ZWRfZml4ZWQzMl9leHRlbnNpb24SJC5wcm90b2J1Zl91bml0dGVzdC5UZXN0", - "QWxsRXh0ZW5zaW9ucxglIAMoBzpIChpyZXBlYXRlZF9maXhlZDY0X2V4dGVu", - "c2lvbhIkLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RBbGxFeHRlbnNpb25zGCYg", - "AygGOkkKG3JlcGVhdGVkX3NmaXhlZDMyX2V4dGVuc2lvbhIkLnByb3RvYnVm", - "X3VuaXR0ZXN0LlRlc3RBbGxFeHRlbnNpb25zGCcgAygPOkkKG3JlcGVhdGVk", - "X3NmaXhlZDY0X2V4dGVuc2lvbhIkLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RB", - "bGxFeHRlbnNpb25zGCggAygQOkYKGHJlcGVhdGVkX2Zsb2F0X2V4dGVuc2lv", - "bhIkLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RBbGxFeHRlbnNpb25zGCkgAygC", - "OkcKGXJlcGVhdGVkX2RvdWJsZV9leHRlbnNpb24SJC5wcm90b2J1Zl91bml0", - "dGVzdC5UZXN0QWxsRXh0ZW5zaW9ucxgqIAMoATpFChdyZXBlYXRlZF9ib29s", - "X2V4dGVuc2lvbhIkLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RBbGxFeHRlbnNp", - "b25zGCsgAygIOkcKGXJlcGVhdGVkX3N0cmluZ19leHRlbnNpb24SJC5wcm90", - "b2J1Zl91bml0dGVzdC5UZXN0QWxsRXh0ZW5zaW9ucxgsIAMoCTpGChhyZXBl", - "YXRlZF9ieXRlc19leHRlbnNpb24SJC5wcm90b2J1Zl91bml0dGVzdC5UZXN0", - "QWxsRXh0ZW5zaW9ucxgtIAMoDDpxChdyZXBlYXRlZGdyb3VwX2V4dGVuc2lv", - "bhIkLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RBbGxFeHRlbnNpb25zGC4gAygK", - "MioucHJvdG9idWZfdW5pdHRlc3QuUmVwZWF0ZWRHcm91cF9leHRlbnNpb246", - "fgohcmVwZWF0ZWRfbmVzdGVkX21lc3NhZ2VfZXh0ZW5zaW9uEiQucHJvdG9i", - "dWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYMCADKAsyLS5wcm90b2J1", - "Zl91bml0dGVzdC5UZXN0QWxsVHlwZXMuTmVzdGVkTWVzc2FnZTpzCiJyZXBl", - "YXRlZF9mb3JlaWduX21lc3NhZ2VfZXh0ZW5zaW9uEiQucHJvdG9idWZfdW5p", - "dHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYMSADKAsyIS5wcm90b2J1Zl91bml0", - "dGVzdC5Gb3JlaWduTWVzc2FnZTp4CiFyZXBlYXRlZF9pbXBvcnRfbWVzc2Fn", - "ZV9leHRlbnNpb24SJC5wcm90b2J1Zl91bml0dGVzdC5UZXN0QWxsRXh0ZW5z", - "aW9ucxgyIAMoCzInLnByb3RvYnVmX3VuaXR0ZXN0X2ltcG9ydC5JbXBvcnRN", - "ZXNzYWdlOngKHnJlcGVhdGVkX25lc3RlZF9lbnVtX2V4dGVuc2lvbhIkLnBy", - "b3RvYnVmX3VuaXR0ZXN0LlRlc3RBbGxFeHRlbnNpb25zGDMgAygOMioucHJv", - "dG9idWZfdW5pdHRlc3QuVGVzdEFsbFR5cGVzLk5lc3RlZEVudW06bQofcmVw", - "ZWF0ZWRfZm9yZWlnbl9lbnVtX2V4dGVuc2lvbhIkLnByb3RvYnVmX3VuaXR0", - "ZXN0LlRlc3RBbGxFeHRlbnNpb25zGDQgAygOMh4ucHJvdG9idWZfdW5pdHRl", - "c3QuRm9yZWlnbkVudW06cgoecmVwZWF0ZWRfaW1wb3J0X2VudW1fZXh0ZW5z", - "aW9uEiQucHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYNSAD", - "KA4yJC5wcm90b2J1Zl91bml0dGVzdF9pbXBvcnQuSW1wb3J0RW51bTpRCh9y", - "ZXBlYXRlZF9zdHJpbmdfcGllY2VfZXh0ZW5zaW9uEiQucHJvdG9idWZfdW5p", - "dHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYNiADKAlCAggCOkkKF3JlcGVhdGVk", - "X2NvcmRfZXh0ZW5zaW9uEiQucHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4", - "dGVuc2lvbnMYNyADKAlCAggBOkkKF2RlZmF1bHRfaW50MzJfZXh0ZW5zaW9u", - "EiQucHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYPSABKAU6", - "AjQxOkkKF2RlZmF1bHRfaW50NjRfZXh0ZW5zaW9uEiQucHJvdG9idWZfdW5p", - "dHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYPiABKAM6AjQyOkoKGGRlZmF1bHRf", - "dWludDMyX2V4dGVuc2lvbhIkLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RBbGxF", - "eHRlbnNpb25zGD8gASgNOgI0MzpKChhkZWZhdWx0X3VpbnQ2NF9leHRlbnNp", - "b24SJC5wcm90b2J1Zl91bml0dGVzdC5UZXN0QWxsRXh0ZW5zaW9ucxhAIAEo", - "BDoCNDQ6SwoYZGVmYXVsdF9zaW50MzJfZXh0ZW5zaW9uEiQucHJvdG9idWZf", - "dW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYQSABKBE6Ay00NTpKChhkZWZh", - "dWx0X3NpbnQ2NF9leHRlbnNpb24SJC5wcm90b2J1Zl91bml0dGVzdC5UZXN0", - "QWxsRXh0ZW5zaW9ucxhCIAEoEjoCNDY6SwoZZGVmYXVsdF9maXhlZDMyX2V4", - "dGVuc2lvbhIkLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RBbGxFeHRlbnNpb25z", - "GEMgASgHOgI0NzpLChlkZWZhdWx0X2ZpeGVkNjRfZXh0ZW5zaW9uEiQucHJv", - "dG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYRCABKAY6AjQ4OkwK", - "GmRlZmF1bHRfc2ZpeGVkMzJfZXh0ZW5zaW9uEiQucHJvdG9idWZfdW5pdHRl", - "c3QuVGVzdEFsbEV4dGVuc2lvbnMYRSABKA86AjQ5Ok0KGmRlZmF1bHRfc2Zp", - "eGVkNjRfZXh0ZW5zaW9uEiQucHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4", - "dGVuc2lvbnMYRiABKBA6Ay01MDpLChdkZWZhdWx0X2Zsb2F0X2V4dGVuc2lv", - "bhIkLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RBbGxFeHRlbnNpb25zGEcgASgC", - "OgQ1MS41Ok0KGGRlZmF1bHRfZG91YmxlX2V4dGVuc2lvbhIkLnByb3RvYnVm", - "X3VuaXR0ZXN0LlRlc3RBbGxFeHRlbnNpb25zGEggASgBOgU1MjAwMDpKChZk", - "ZWZhdWx0X2Jvb2xfZXh0ZW5zaW9uEiQucHJvdG9idWZfdW5pdHRlc3QuVGVz", - "dEFsbEV4dGVuc2lvbnMYSSABKAg6BHRydWU6TQoYZGVmYXVsdF9zdHJpbmdf", - "ZXh0ZW5zaW9uEiQucHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lv", - "bnMYSiABKAk6BWhlbGxvOkwKF2RlZmF1bHRfYnl0ZXNfZXh0ZW5zaW9uEiQu", - "cHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYSyABKAw6BXdv", - "cmxkOnwKHWRlZmF1bHRfbmVzdGVkX2VudW1fZXh0ZW5zaW9uEiQucHJvdG9i", - "dWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYUSABKA4yKi5wcm90b2J1", - "Zl91bml0dGVzdC5UZXN0QWxsVHlwZXMuTmVzdGVkRW51bToDQkFSOnkKHmRl", - "ZmF1bHRfZm9yZWlnbl9lbnVtX2V4dGVuc2lvbhIkLnByb3RvYnVmX3VuaXR0", - "ZXN0LlRlc3RBbGxFeHRlbnNpb25zGFIgASgOMh4ucHJvdG9idWZfdW5pdHRl", - "c3QuRm9yZWlnbkVudW06C0ZPUkVJR05fQkFSOn0KHWRlZmF1bHRfaW1wb3J0", - "X2VudW1fZXh0ZW5zaW9uEiQucHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4", - "dGVuc2lvbnMYUyABKA4yJC5wcm90b2J1Zl91bml0dGVzdF9pbXBvcnQuSW1w", - "b3J0RW51bToKSU1QT1JUX0JBUjpVCh5kZWZhdWx0X3N0cmluZ19waWVjZV9l", - "eHRlbnNpb24SJC5wcm90b2J1Zl91bml0dGVzdC5UZXN0QWxsRXh0ZW5zaW9u", - "cxhUIAEoCToDYWJjQgIIAjpNChZkZWZhdWx0X2NvcmRfZXh0ZW5zaW9uEiQu", - "cHJvdG9idWZfdW5pdHRlc3QuVGVzdEFsbEV4dGVuc2lvbnMYVSABKAk6AzEy", - "M0ICCAE6QgoTbXlfZXh0ZW5zaW9uX3N0cmluZxIlLnByb3RvYnVmX3VuaXR0", - "ZXN0LlRlc3RGaWVsZE9yZGVyaW5ncxgyIAEoCTo/ChBteV9leHRlbnNpb25f", - "aW50EiUucHJvdG9idWZfdW5pdHRlc3QuVGVzdEZpZWxkT3JkZXJpbmdzGAUg", - "ASgFOksKFnBhY2tlZF9pbnQzMl9leHRlbnNpb24SJy5wcm90b2J1Zl91bml0", - "dGVzdC5UZXN0UGFja2VkRXh0ZW5zaW9ucxhaIAMoBUICEAE6SwoWcGFja2Vk", - "X2ludDY0X2V4dGVuc2lvbhInLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RQYWNr", - "ZWRFeHRlbnNpb25zGFsgAygDQgIQATpMChdwYWNrZWRfdWludDMyX2V4dGVu", - "c2lvbhInLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RQYWNrZWRFeHRlbnNpb25z", - "GFwgAygNQgIQATpMChdwYWNrZWRfdWludDY0X2V4dGVuc2lvbhInLnByb3Rv", - "YnVmX3VuaXR0ZXN0LlRlc3RQYWNrZWRFeHRlbnNpb25zGF0gAygEQgIQATpM", - "ChdwYWNrZWRfc2ludDMyX2V4dGVuc2lvbhInLnByb3RvYnVmX3VuaXR0ZXN0", - "LlRlc3RQYWNrZWRFeHRlbnNpb25zGF4gAygRQgIQATpMChdwYWNrZWRfc2lu", - "dDY0X2V4dGVuc2lvbhInLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RQYWNrZWRF", - "eHRlbnNpb25zGF8gAygSQgIQATpNChhwYWNrZWRfZml4ZWQzMl9leHRlbnNp", - "b24SJy5wcm90b2J1Zl91bml0dGVzdC5UZXN0UGFja2VkRXh0ZW5zaW9ucxhg", - "IAMoB0ICEAE6TQoYcGFja2VkX2ZpeGVkNjRfZXh0ZW5zaW9uEicucHJvdG9i", - "dWZfdW5pdHRlc3QuVGVzdFBhY2tlZEV4dGVuc2lvbnMYYSADKAZCAhABOk4K", - "GXBhY2tlZF9zZml4ZWQzMl9leHRlbnNpb24SJy5wcm90b2J1Zl91bml0dGVz", - "dC5UZXN0UGFja2VkRXh0ZW5zaW9ucxhiIAMoD0ICEAE6TgoZcGFja2VkX3Nm", - "aXhlZDY0X2V4dGVuc2lvbhInLnByb3RvYnVmX3VuaXR0ZXN0LlRlc3RQYWNr", - "ZWRFeHRlbnNpb25zGGMgAygQQgIQATpLChZwYWNrZWRfZmxvYXRfZXh0ZW5z", - "aW9uEicucHJvdG9idWZfdW5pdHRlc3QuVGVzdFBhY2tlZEV4dGVuc2lvbnMY", - "ZCADKAJCAhABOkwKF3BhY2tlZF9kb3VibGVfZXh0ZW5zaW9uEicucHJvdG9i", - "dWZfdW5pdHRlc3QuVGVzdFBhY2tlZEV4dGVuc2lvbnMYZSADKAFCAhABOkoK", - "FXBhY2tlZF9ib29sX2V4dGVuc2lvbhInLnByb3RvYnVmX3VuaXR0ZXN0LlRl", - "c3RQYWNrZWRFeHRlbnNpb25zGGYgAygIQgIQATpqChVwYWNrZWRfZW51bV9l", - "eHRlbnNpb24SJy5wcm90b2J1Zl91bml0dGVzdC5UZXN0UGFja2VkRXh0ZW5z", - "aW9ucxhnIAMoDjIeLnByb3RvYnVmX3VuaXR0ZXN0LkZvcmVpZ25FbnVtQgIQ", - "AUJTQg1Vbml0dGVzdFByb3RvSAGAAQGIAQGQAQHCPjYKIUdvb2dsZS5Qcm90", - "b2NvbEJ1ZmZlcnMuVGVzdFByb3RvcxIRVW5pdFRlc3RQcm90b0ZpbGU=")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_protobuf_unittest_TestAllTypes__Descriptor = Descriptor.MessageTypes[0]; - internal__static_protobuf_unittest_TestAllTypes__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestAllTypes__Descriptor, - new string[] { "OptionalInt32", "OptionalInt64", "OptionalUint32", "OptionalUint64", "OptionalSint32", "OptionalSint64", "OptionalFixed32", "OptionalFixed64", "OptionalSfixed32", "OptionalSfixed64", "OptionalFloat", "OptionalDouble", "OptionalBool", "OptionalString", "OptionalBytes", "OptionalGroup", "OptionalNestedMessage", "OptionalForeignMessage", "OptionalImportMessage", "OptionalNestedEnum", "OptionalForeignEnum", "OptionalImportEnum", "OptionalStringPiece", "OptionalCord", "RepeatedInt32", "RepeatedInt64", "RepeatedUint32", "RepeatedUint64", "RepeatedSint32", "RepeatedSint64", "RepeatedFixed32", "RepeatedFixed64", "RepeatedSfixed32", "RepeatedSfixed64", "RepeatedFloat", "RepeatedDouble", "RepeatedBool", "RepeatedString", "RepeatedBytes", "RepeatedGroup", "RepeatedNestedMessage", "RepeatedForeignMessage", "RepeatedImportMessage", "RepeatedNestedEnum", "RepeatedForeignEnum", "RepeatedImportEnum", "RepeatedStringPiece", "RepeatedCord", "DefaultInt32", "DefaultInt64", "DefaultUint32", "DefaultUint64", "DefaultSint32", "DefaultSint64", "DefaultFixed32", "DefaultFixed64", "DefaultSfixed32", "DefaultSfixed64", "DefaultFloat", "DefaultDouble", "DefaultBool", "DefaultString", "DefaultBytes", "DefaultNestedEnum", "DefaultForeignEnum", "DefaultImportEnum", "DefaultStringPiece", "DefaultCord", }); - internal__static_protobuf_unittest_TestAllTypes_NestedMessage__Descriptor = internal__static_protobuf_unittest_TestAllTypes__Descriptor.NestedTypes[0]; - internal__static_protobuf_unittest_TestAllTypes_NestedMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestAllTypes_NestedMessage__Descriptor, - new string[] { "Bb", }); - internal__static_protobuf_unittest_TestAllTypes_OptionalGroup__Descriptor = internal__static_protobuf_unittest_TestAllTypes__Descriptor.NestedTypes[1]; - internal__static_protobuf_unittest_TestAllTypes_OptionalGroup__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestAllTypes_OptionalGroup__Descriptor, - new string[] { "A", }); - internal__static_protobuf_unittest_TestAllTypes_RepeatedGroup__Descriptor = internal__static_protobuf_unittest_TestAllTypes__Descriptor.NestedTypes[2]; - internal__static_protobuf_unittest_TestAllTypes_RepeatedGroup__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestAllTypes_RepeatedGroup__Descriptor, - new string[] { "A", }); - internal__static_protobuf_unittest_TestDeprecatedFields__Descriptor = Descriptor.MessageTypes[1]; - internal__static_protobuf_unittest_TestDeprecatedFields__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestDeprecatedFields__Descriptor, - new string[] { "DeprecatedInt32", }); - internal__static_protobuf_unittest_ForeignMessage__Descriptor = Descriptor.MessageTypes[2]; - internal__static_protobuf_unittest_ForeignMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_ForeignMessage__Descriptor, - new string[] { "C", }); - internal__static_protobuf_unittest_TestAllExtensions__Descriptor = Descriptor.MessageTypes[3]; - internal__static_protobuf_unittest_TestAllExtensions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestAllExtensions__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_OptionalGroup_extension__Descriptor = Descriptor.MessageTypes[4]; - internal__static_protobuf_unittest_OptionalGroup_extension__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_OptionalGroup_extension__Descriptor, - new string[] { "A", }); - internal__static_protobuf_unittest_RepeatedGroup_extension__Descriptor = Descriptor.MessageTypes[5]; - internal__static_protobuf_unittest_RepeatedGroup_extension__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_RepeatedGroup_extension__Descriptor, - new string[] { "A", }); - internal__static_protobuf_unittest_TestNestedExtension__Descriptor = Descriptor.MessageTypes[6]; - internal__static_protobuf_unittest_TestNestedExtension__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestNestedExtension__Descriptor, - new string[] { }); - global::Google.ProtocolBuffers.TestProtos.TestNestedExtension.Test = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.TestNestedExtension.Descriptor.Extensions[0]); - internal__static_protobuf_unittest_TestRequired__Descriptor = Descriptor.MessageTypes[7]; - internal__static_protobuf_unittest_TestRequired__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestRequired__Descriptor, - new string[] { "A", "Dummy2", "B", "Dummy4", "Dummy5", "Dummy6", "Dummy7", "Dummy8", "Dummy9", "Dummy10", "Dummy11", "Dummy12", "Dummy13", "Dummy14", "Dummy15", "Dummy16", "Dummy17", "Dummy18", "Dummy19", "Dummy20", "Dummy21", "Dummy22", "Dummy23", "Dummy24", "Dummy25", "Dummy26", "Dummy27", "Dummy28", "Dummy29", "Dummy30", "Dummy31", "Dummy32", "C", }); - global::Google.ProtocolBuffers.TestProtos.TestRequired.Single = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.TestRequired.Descriptor.Extensions[0]); - global::Google.ProtocolBuffers.TestProtos.TestRequired.Multi = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.TestRequired.Descriptor.Extensions[1]); - internal__static_protobuf_unittest_TestRequiredForeign__Descriptor = Descriptor.MessageTypes[8]; - internal__static_protobuf_unittest_TestRequiredForeign__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestRequiredForeign__Descriptor, - new string[] { "OptionalMessage", "RepeatedMessage", "Dummy", }); - internal__static_protobuf_unittest_TestForeignNested__Descriptor = Descriptor.MessageTypes[9]; - internal__static_protobuf_unittest_TestForeignNested__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestForeignNested__Descriptor, - new string[] { "ForeignNested", }); - internal__static_protobuf_unittest_TestEmptyMessage__Descriptor = Descriptor.MessageTypes[10]; - internal__static_protobuf_unittest_TestEmptyMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestEmptyMessage__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_TestEmptyMessageWithExtensions__Descriptor = Descriptor.MessageTypes[11]; - internal__static_protobuf_unittest_TestEmptyMessageWithExtensions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestEmptyMessageWithExtensions__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_TestMultipleExtensionRanges__Descriptor = Descriptor.MessageTypes[12]; - internal__static_protobuf_unittest_TestMultipleExtensionRanges__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestMultipleExtensionRanges__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_TestReallyLargeTagNumber__Descriptor = Descriptor.MessageTypes[13]; - internal__static_protobuf_unittest_TestReallyLargeTagNumber__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestReallyLargeTagNumber__Descriptor, - new string[] { "A", "Bb", }); - internal__static_protobuf_unittest_TestRecursiveMessage__Descriptor = Descriptor.MessageTypes[14]; - internal__static_protobuf_unittest_TestRecursiveMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestRecursiveMessage__Descriptor, - new string[] { "A", "I", }); - internal__static_protobuf_unittest_TestMutualRecursionA__Descriptor = Descriptor.MessageTypes[15]; - internal__static_protobuf_unittest_TestMutualRecursionA__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestMutualRecursionA__Descriptor, - new string[] { "Bb", }); - internal__static_protobuf_unittest_TestMutualRecursionB__Descriptor = Descriptor.MessageTypes[16]; - internal__static_protobuf_unittest_TestMutualRecursionB__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestMutualRecursionB__Descriptor, - new string[] { "A", "OptionalInt32", }); - internal__static_protobuf_unittest_TestDupFieldNumber__Descriptor = Descriptor.MessageTypes[17]; - internal__static_protobuf_unittest_TestDupFieldNumber__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestDupFieldNumber__Descriptor, - new string[] { "A", "Foo", "Bar", }); - internal__static_protobuf_unittest_TestDupFieldNumber_Foo__Descriptor = internal__static_protobuf_unittest_TestDupFieldNumber__Descriptor.NestedTypes[0]; - internal__static_protobuf_unittest_TestDupFieldNumber_Foo__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestDupFieldNumber_Foo__Descriptor, - new string[] { "A", }); - internal__static_protobuf_unittest_TestDupFieldNumber_Bar__Descriptor = internal__static_protobuf_unittest_TestDupFieldNumber__Descriptor.NestedTypes[1]; - internal__static_protobuf_unittest_TestDupFieldNumber_Bar__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestDupFieldNumber_Bar__Descriptor, - new string[] { "A", }); - internal__static_protobuf_unittest_TestNestedMessageHasBits__Descriptor = Descriptor.MessageTypes[18]; - internal__static_protobuf_unittest_TestNestedMessageHasBits__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestNestedMessageHasBits__Descriptor, - new string[] { "OptionalNestedMessage", }); - internal__static_protobuf_unittest_TestNestedMessageHasBits_NestedMessage__Descriptor = internal__static_protobuf_unittest_TestNestedMessageHasBits__Descriptor.NestedTypes[0]; - internal__static_protobuf_unittest_TestNestedMessageHasBits_NestedMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestNestedMessageHasBits_NestedMessage__Descriptor, - new string[] { "NestedmessageRepeatedInt32", "NestedmessageRepeatedForeignmessage", }); - internal__static_protobuf_unittest_TestCamelCaseFieldNames__Descriptor = Descriptor.MessageTypes[19]; - internal__static_protobuf_unittest_TestCamelCaseFieldNames__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestCamelCaseFieldNames__Descriptor, - new string[] { "PrimitiveField", "StringField", "EnumField", "MessageField", "StringPieceField", "CordField", "RepeatedPrimitiveField", "RepeatedStringField", "RepeatedEnumField", "RepeatedMessageField", "RepeatedStringPieceField", "RepeatedCordField", }); - internal__static_protobuf_unittest_TestFieldOrderings__Descriptor = Descriptor.MessageTypes[20]; - internal__static_protobuf_unittest_TestFieldOrderings__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestFieldOrderings__Descriptor, - new string[] { "MyString", "MyInt", "MyFloat", }); - internal__static_protobuf_unittest_TestExtremeDefaultValues__Descriptor = Descriptor.MessageTypes[21]; - internal__static_protobuf_unittest_TestExtremeDefaultValues__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestExtremeDefaultValues__Descriptor, - new string[] { "EscapedBytes", "LargeUint32", "LargeUint64", "SmallInt32", "SmallInt64", "Utf8String", "ZeroFloat", "OneFloat", "SmallFloat", "NegativeOneFloat", "NegativeFloat", "LargeFloat", "SmallNegativeFloat", "InfDouble", "NegInfDouble", "NanDouble", "InfFloat", "NegInfFloat", "NanFloat", "CppTrigraph", }); - internal__static_protobuf_unittest_SparseEnumMessage__Descriptor = Descriptor.MessageTypes[22]; - internal__static_protobuf_unittest_SparseEnumMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_SparseEnumMessage__Descriptor, - new string[] { "SparseEnum", }); - internal__static_protobuf_unittest_OneString__Descriptor = Descriptor.MessageTypes[23]; - internal__static_protobuf_unittest_OneString__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_OneString__Descriptor, - new string[] { "Data", }); - internal__static_protobuf_unittest_OneBytes__Descriptor = Descriptor.MessageTypes[24]; - internal__static_protobuf_unittest_OneBytes__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_OneBytes__Descriptor, - new string[] { "Data", }); - internal__static_protobuf_unittest_TestPackedTypes__Descriptor = Descriptor.MessageTypes[25]; - internal__static_protobuf_unittest_TestPackedTypes__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestPackedTypes__Descriptor, - new string[] { "PackedInt32", "PackedInt64", "PackedUint32", "PackedUint64", "PackedSint32", "PackedSint64", "PackedFixed32", "PackedFixed64", "PackedSfixed32", "PackedSfixed64", "PackedFloat", "PackedDouble", "PackedBool", "PackedEnum", }); - internal__static_protobuf_unittest_TestUnpackedTypes__Descriptor = Descriptor.MessageTypes[26]; - internal__static_protobuf_unittest_TestUnpackedTypes__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestUnpackedTypes__Descriptor, - new string[] { "UnpackedInt32", "UnpackedInt64", "UnpackedUint32", "UnpackedUint64", "UnpackedSint32", "UnpackedSint64", "UnpackedFixed32", "UnpackedFixed64", "UnpackedSfixed32", "UnpackedSfixed64", "UnpackedFloat", "UnpackedDouble", "UnpackedBool", "UnpackedEnum", }); - internal__static_protobuf_unittest_TestPackedExtensions__Descriptor = Descriptor.MessageTypes[27]; - internal__static_protobuf_unittest_TestPackedExtensions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestPackedExtensions__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_TestDynamicExtensions__Descriptor = Descriptor.MessageTypes[28]; - internal__static_protobuf_unittest_TestDynamicExtensions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestDynamicExtensions__Descriptor, - new string[] { "ScalarExtension", "EnumExtension", "DynamicEnumExtension", "MessageExtension", "DynamicMessageExtension", "RepeatedExtension", "PackedExtension", }); - internal__static_protobuf_unittest_TestDynamicExtensions_DynamicMessageType__Descriptor = internal__static_protobuf_unittest_TestDynamicExtensions__Descriptor.NestedTypes[0]; - internal__static_protobuf_unittest_TestDynamicExtensions_DynamicMessageType__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestDynamicExtensions_DynamicMessageType__Descriptor, - new string[] { "DynamicField", }); - internal__static_protobuf_unittest_TestRepeatedScalarDifferentTagSizes__Descriptor = Descriptor.MessageTypes[29]; - internal__static_protobuf_unittest_TestRepeatedScalarDifferentTagSizes__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestRepeatedScalarDifferentTagSizes__Descriptor, - new string[] { "RepeatedFixed32", "RepeatedInt32", "RepeatedFixed64", "RepeatedInt64", "RepeatedFloat", "RepeatedUint64", }); - internal__static_protobuf_unittest_FooRequest__Descriptor = Descriptor.MessageTypes[30]; - internal__static_protobuf_unittest_FooRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_FooRequest__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_FooResponse__Descriptor = Descriptor.MessageTypes[31]; - internal__static_protobuf_unittest_FooResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_FooResponse__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_BarRequest__Descriptor = Descriptor.MessageTypes[32]; - internal__static_protobuf_unittest_BarRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_BarRequest__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_BarResponse__Descriptor = Descriptor.MessageTypes[33]; - internal__static_protobuf_unittest_BarResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_BarResponse__Descriptor, - new string[] { }); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalInt32Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[0]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalInt64Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[1]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalUint32Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[2]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalUint64Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[3]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalSint32Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[4]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalSint64Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[5]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalFixed32Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[6]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalFixed64Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[7]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalSfixed32Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[8]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalSfixed64Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[9]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalFloatExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[10]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalDoubleExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[11]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalBoolExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[12]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalStringExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[13]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalBytesExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[14]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalGroupExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[15]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalNestedMessageExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[16]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalForeignMessageExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[17]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalImportMessageExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[18]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalNestedEnumExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[19]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalForeignEnumExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[20]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalImportEnumExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[21]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalStringPieceExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[22]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.OptionalCordExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[23]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedInt32Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[24]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedInt64Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[25]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedUint32Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[26]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedUint64Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[27]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedSint32Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[28]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedSint64Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[29]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedFixed32Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[30]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedFixed64Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[31]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedSfixed32Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[32]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedSfixed64Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[33]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedFloatExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[34]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedDoubleExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[35]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedBoolExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[36]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedStringExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[37]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedBytesExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[38]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedGroupExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[39]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedNestedMessageExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[40]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedForeignMessageExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[41]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedImportMessageExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[42]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedNestedEnumExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[43]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedForeignEnumExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[44]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedImportEnumExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[45]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedStringPieceExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[46]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RepeatedCordExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[47]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultInt32Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[48]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultInt64Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[49]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultUint32Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[50]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultUint64Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[51]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultSint32Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[52]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultSint64Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[53]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultFixed32Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[54]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultFixed64Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[55]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultSfixed32Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[56]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultSfixed64Extension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[57]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultFloatExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[58]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultDoubleExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[59]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultBoolExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[60]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultStringExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[61]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultBytesExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[62]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultNestedEnumExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[63]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultForeignEnumExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[64]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultImportEnumExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[65]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultStringPieceExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[66]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.DefaultCordExtension = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[67]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.MyExtensionString = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[68]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.MyExtensionInt = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[69]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedInt32Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[70]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedInt64Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[71]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedUint32Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[72]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedUint64Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[73]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedSint32Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[74]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedSint64Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[75]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedFixed32Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[76]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedFixed64Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[77]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedSfixed32Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[78]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedSfixed64Extension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[79]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedFloatExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[80]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedDoubleExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[81]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedBoolExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[82]); - global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.PackedEnumExtension = pb::GeneratedRepeatExtension.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor.Extensions[83]); - pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); - RegisterAllExtensions(registry); - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.RegisterAllExtensions(registry); - global::Google.ProtocolBuffers.TestProtos.UnitTestImportProtoFile.RegisterAllExtensions(registry); - return registry; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, - global::Google.ProtocolBuffers.TestProtos.UnitTestImportProtoFile.Descriptor, - }, assigner); - } - #endregion - - } - #region Enums - public enum ForeignEnum { - FOREIGN_FOO = 4, - FOREIGN_BAR = 5, - FOREIGN_BAZ = 6, - } - - public enum TestEnumWithDupValue { - FOO1 = 1, - BAR1 = 2, - BAZ = 3, - FOO2 = 1, - BAR2 = 2, - } - - public enum TestSparseEnum { - SPARSE_A = 123, - SPARSE_B = 62374, - SPARSE_C = 12589234, - SPARSE_D = -15, - SPARSE_E = -53452, - SPARSE_F = 0, - SPARSE_G = 2, - } - - #endregion - - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestAllTypes : pb::GeneratedMessage { - private TestAllTypes() { } - private static readonly TestAllTypes defaultInstance = new TestAllTypes().MakeReadOnly(); - private static readonly string[] _testAllTypesFieldNames = new string[] { "default_bool", "default_bytes", "default_cord", "default_double", "default_fixed32", "default_fixed64", "default_float", "default_foreign_enum", "default_import_enum", "default_int32", "default_int64", "default_nested_enum", "default_sfixed32", "default_sfixed64", "default_sint32", "default_sint64", "default_string", "default_string_piece", "default_uint32", "default_uint64", "optional_bool", "optional_bytes", "optional_cord", "optional_double", "optional_fixed32", "optional_fixed64", "optional_float", "optional_foreign_enum", "optional_foreign_message", "optional_import_enum", "optional_import_message", "optional_int32", "optional_int64", "optional_nested_enum", "optional_nested_message", "optional_sfixed32", "optional_sfixed64", "optional_sint32", "optional_sint64", "optional_string", "optional_string_piece", "optional_uint32", "optional_uint64", "optionalgroup", "repeated_bool", "repeated_bytes", "repeated_cord", "repeated_double", "repeated_fixed32", "repeated_fixed64", "repeated_float", "repeated_foreign_enum", "repeated_foreign_message", "repeated_import_enum", "repeated_import_message", "repeated_int32", "repeated_int64", "repeated_nested_enum", "repeated_nested_message", "repeated_sfixed32", "repeated_sfixed64", "repeated_sint32", "repeated_sint64", "repeated_string", "repeated_string_piece", "repeated_uint32", "repeated_uint64", "repeatedgroup" }; - private static readonly uint[] _testAllTypesFieldTags = new uint[] { 584, 602, 682, 577, 541, 545, 573, 656, 664, 488, 496, 648, 557, 561, 520, 528, 594, 674, 504, 512, 104, 122, 202, 97, 61, 65, 93, 176, 154, 184, 162, 8, 16, 168, 146, 77, 81, 40, 48, 114, 194, 24, 32, 131, 344, 362, 442, 337, 301, 305, 333, 416, 394, 424, 402, 248, 256, 408, 386, 317, 321, 280, 288, 354, 434, 264, 272, 371 }; - public static TestAllTypes DefaultInstance { - get { return defaultInstance; } - } - - public override TestAllTypes DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestAllTypes ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllTypes__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllTypes__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - public enum NestedEnum { - FOO = 1, - BAR = 2, - BAZ = 3, - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class NestedMessage : pb::GeneratedMessage { - private NestedMessage() { } - private static readonly NestedMessage defaultInstance = new NestedMessage().MakeReadOnly(); - private static readonly string[] _nestedMessageFieldNames = new string[] { "bb" }; - private static readonly uint[] _nestedMessageFieldTags = new uint[] { 8 }; - public static NestedMessage DefaultInstance { - get { return defaultInstance; } - } - - public override NestedMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override NestedMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllTypes_NestedMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllTypes_NestedMessage__FieldAccessorTable; } - } - - public const int BbFieldNumber = 1; - private bool hasBb; - private int bb_; - public bool HasBb { - get { return hasBb; } - } - public int Bb { - get { return bb_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _nestedMessageFieldNames; - if (hasBb) { - output.WriteInt32(1, field_names[0], Bb); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasBb) { - size += pb::CodedOutputStream.ComputeInt32Size(1, Bb); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static NestedMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NestedMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NestedMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NestedMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NestedMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NestedMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static NestedMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NestedMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private NestedMessage MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(NestedMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(NestedMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private NestedMessage result; - - private NestedMessage PrepareBuilder() { - if (resultIsReadOnly) { - NestedMessage original = result; - result = new NestedMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override NestedMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Descriptor; } - } - - public override NestedMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.DefaultInstance; } - } - - public override NestedMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is NestedMessage) { - return MergeFrom((NestedMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(NestedMessage other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasBb) { - Bb = other.Bb; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_nestedMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _nestedMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasBb = input.ReadInt32(ref result.bb_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasBb { - get { return result.hasBb; } - } - public int Bb { - get { return result.Bb; } - set { SetBb(value); } - } - public Builder SetBb(int value) { - PrepareBuilder(); - result.hasBb = true; - result.bb_ = value; - return this; - } - public Builder ClearBb() { - PrepareBuilder(); - result.hasBb = false; - result.bb_ = 0; - return this; - } - } - static NestedMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class OptionalGroup : pb::GeneratedMessage { - private OptionalGroup() { } - private static readonly OptionalGroup defaultInstance = new OptionalGroup().MakeReadOnly(); - private static readonly string[] _optionalGroupFieldNames = new string[] { "a" }; - private static readonly uint[] _optionalGroupFieldTags = new uint[] { 136 }; - public static OptionalGroup DefaultInstance { - get { return defaultInstance; } - } - - public override OptionalGroup DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override OptionalGroup ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllTypes_OptionalGroup__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllTypes_OptionalGroup__FieldAccessorTable; } - } - - public const int AFieldNumber = 17; - private bool hasA; - private int a_; - public bool HasA { - get { return hasA; } - } - public int A { - get { return a_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _optionalGroupFieldNames; - if (hasA) { - output.WriteInt32(17, field_names[0], A); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA) { - size += pb::CodedOutputStream.ComputeInt32Size(17, A); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static OptionalGroup ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OptionalGroup ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OptionalGroup ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OptionalGroup ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OptionalGroup ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OptionalGroup ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static OptionalGroup ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static OptionalGroup ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static OptionalGroup ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OptionalGroup ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private OptionalGroup MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(OptionalGroup prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(OptionalGroup cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private OptionalGroup result; - - private OptionalGroup PrepareBuilder() { - if (resultIsReadOnly) { - OptionalGroup original = result; - result = new OptionalGroup(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override OptionalGroup MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.Descriptor; } - } - - public override OptionalGroup DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.DefaultInstance; } - } - - public override OptionalGroup BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is OptionalGroup) { - return MergeFrom((OptionalGroup) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(OptionalGroup other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA) { - A = other.A; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_optionalGroupFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _optionalGroupFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 136: { - result.hasA = input.ReadInt32(ref result.a_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasA { - get { return result.hasA; } - } - public int A { - get { return result.A; } - set { SetA(value); } - } - public Builder SetA(int value) { - PrepareBuilder(); - result.hasA = true; - result.a_ = value; - return this; - } - public Builder ClearA() { - PrepareBuilder(); - result.hasA = false; - result.a_ = 0; - return this; - } - } - static OptionalGroup() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class RepeatedGroup : pb::GeneratedMessage { - private RepeatedGroup() { } - private static readonly RepeatedGroup defaultInstance = new RepeatedGroup().MakeReadOnly(); - private static readonly string[] _repeatedGroupFieldNames = new string[] { "a" }; - private static readonly uint[] _repeatedGroupFieldTags = new uint[] { 376 }; - public static RepeatedGroup DefaultInstance { - get { return defaultInstance; } - } - - public override RepeatedGroup DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override RepeatedGroup ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllTypes_RepeatedGroup__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllTypes_RepeatedGroup__FieldAccessorTable; } - } - - public const int AFieldNumber = 47; - private bool hasA; - private int a_; - public bool HasA { - get { return hasA; } - } - public int A { - get { return a_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _repeatedGroupFieldNames; - if (hasA) { - output.WriteInt32(47, field_names[0], A); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA) { - size += pb::CodedOutputStream.ComputeInt32Size(47, A); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static RepeatedGroup ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RepeatedGroup ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RepeatedGroup ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RepeatedGroup ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RepeatedGroup ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RepeatedGroup ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static RepeatedGroup ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static RepeatedGroup ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static RepeatedGroup ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RepeatedGroup ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private RepeatedGroup MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(RepeatedGroup prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(RepeatedGroup cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private RepeatedGroup result; - - private RepeatedGroup PrepareBuilder() { - if (resultIsReadOnly) { - RepeatedGroup original = result; - result = new RepeatedGroup(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override RepeatedGroup MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup.Descriptor; } - } - - public override RepeatedGroup DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup.DefaultInstance; } - } - - public override RepeatedGroup BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is RepeatedGroup) { - return MergeFrom((RepeatedGroup) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(RepeatedGroup other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA) { - A = other.A; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_repeatedGroupFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _repeatedGroupFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 376: { - result.hasA = input.ReadInt32(ref result.a_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasA { - get { return result.hasA; } - } - public int A { - get { return result.A; } - set { SetA(value); } - } - public Builder SetA(int value) { - PrepareBuilder(); - result.hasA = true; - result.a_ = value; - return this; - } - public Builder ClearA() { - PrepareBuilder(); - result.hasA = false; - result.a_ = 0; - return this; - } - } - static RepeatedGroup() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - } - #endregion - - public const int OptionalInt32FieldNumber = 1; - private bool hasOptionalInt32; - private int optionalInt32_; - public bool HasOptionalInt32 { - get { return hasOptionalInt32; } - } - public int OptionalInt32 { - get { return optionalInt32_; } - } - - public const int OptionalInt64FieldNumber = 2; - private bool hasOptionalInt64; - private long optionalInt64_; - public bool HasOptionalInt64 { - get { return hasOptionalInt64; } - } - public long OptionalInt64 { - get { return optionalInt64_; } - } - - public const int OptionalUint32FieldNumber = 3; - private bool hasOptionalUint32; - private uint optionalUint32_; - public bool HasOptionalUint32 { - get { return hasOptionalUint32; } - } - [global::System.CLSCompliant(false)] - public uint OptionalUint32 { - get { return optionalUint32_; } - } - - public const int OptionalUint64FieldNumber = 4; - private bool hasOptionalUint64; - private ulong optionalUint64_; - public bool HasOptionalUint64 { - get { return hasOptionalUint64; } - } - [global::System.CLSCompliant(false)] - public ulong OptionalUint64 { - get { return optionalUint64_; } - } - - public const int OptionalSint32FieldNumber = 5; - private bool hasOptionalSint32; - private int optionalSint32_; - public bool HasOptionalSint32 { - get { return hasOptionalSint32; } - } - public int OptionalSint32 { - get { return optionalSint32_; } - } - - public const int OptionalSint64FieldNumber = 6; - private bool hasOptionalSint64; - private long optionalSint64_; - public bool HasOptionalSint64 { - get { return hasOptionalSint64; } - } - public long OptionalSint64 { - get { return optionalSint64_; } - } - - public const int OptionalFixed32FieldNumber = 7; - private bool hasOptionalFixed32; - private uint optionalFixed32_; - public bool HasOptionalFixed32 { - get { return hasOptionalFixed32; } - } - [global::System.CLSCompliant(false)] - public uint OptionalFixed32 { - get { return optionalFixed32_; } - } - - public const int OptionalFixed64FieldNumber = 8; - private bool hasOptionalFixed64; - private ulong optionalFixed64_; - public bool HasOptionalFixed64 { - get { return hasOptionalFixed64; } - } - [global::System.CLSCompliant(false)] - public ulong OptionalFixed64 { - get { return optionalFixed64_; } - } - - public const int OptionalSfixed32FieldNumber = 9; - private bool hasOptionalSfixed32; - private int optionalSfixed32_; - public bool HasOptionalSfixed32 { - get { return hasOptionalSfixed32; } - } - public int OptionalSfixed32 { - get { return optionalSfixed32_; } - } - - public const int OptionalSfixed64FieldNumber = 10; - private bool hasOptionalSfixed64; - private long optionalSfixed64_; - public bool HasOptionalSfixed64 { - get { return hasOptionalSfixed64; } - } - public long OptionalSfixed64 { - get { return optionalSfixed64_; } - } - - public const int OptionalFloatFieldNumber = 11; - private bool hasOptionalFloat; - private float optionalFloat_; - public bool HasOptionalFloat { - get { return hasOptionalFloat; } - } - public float OptionalFloat { - get { return optionalFloat_; } - } - - public const int OptionalDoubleFieldNumber = 12; - private bool hasOptionalDouble; - private double optionalDouble_; - public bool HasOptionalDouble { - get { return hasOptionalDouble; } - } - public double OptionalDouble { - get { return optionalDouble_; } - } - - public const int OptionalBoolFieldNumber = 13; - private bool hasOptionalBool; - private bool optionalBool_; - public bool HasOptionalBool { - get { return hasOptionalBool; } - } - public bool OptionalBool { - get { return optionalBool_; } - } - - public const int OptionalStringFieldNumber = 14; - private bool hasOptionalString; - private string optionalString_ = ""; - public bool HasOptionalString { - get { return hasOptionalString; } - } - public string OptionalString { - get { return optionalString_; } - } - - public const int OptionalBytesFieldNumber = 15; - private bool hasOptionalBytes; - private pb::ByteString optionalBytes_ = pb::ByteString.Empty; - public bool HasOptionalBytes { - get { return hasOptionalBytes; } - } - public pb::ByteString OptionalBytes { - get { return optionalBytes_; } - } - - public const int OptionalGroupFieldNumber = 16; - private bool hasOptionalGroup; - private global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup optionalGroup_; - public bool HasOptionalGroup { - get { return hasOptionalGroup; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup OptionalGroup { - get { return optionalGroup_ ?? global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.DefaultInstance; } - } - - public const int OptionalNestedMessageFieldNumber = 18; - private bool hasOptionalNestedMessage; - private global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage optionalNestedMessage_; - public bool HasOptionalNestedMessage { - get { return hasOptionalNestedMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage OptionalNestedMessage { - get { return optionalNestedMessage_ ?? global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.DefaultInstance; } - } - - public const int OptionalForeignMessageFieldNumber = 19; - private bool hasOptionalForeignMessage; - private global::Google.ProtocolBuffers.TestProtos.ForeignMessage optionalForeignMessage_; - public bool HasOptionalForeignMessage { - get { return hasOptionalForeignMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage OptionalForeignMessage { - get { return optionalForeignMessage_ ?? global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance; } - } - - public const int OptionalImportMessageFieldNumber = 20; - private bool hasOptionalImportMessage; - private global::Google.ProtocolBuffers.TestProtos.ImportMessage optionalImportMessage_; - public bool HasOptionalImportMessage { - get { return hasOptionalImportMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportMessage OptionalImportMessage { - get { return optionalImportMessage_ ?? global::Google.ProtocolBuffers.TestProtos.ImportMessage.DefaultInstance; } - } - - public const int OptionalNestedEnumFieldNumber = 21; - private bool hasOptionalNestedEnum; - private global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum optionalNestedEnum_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum.FOO; - public bool HasOptionalNestedEnum { - get { return hasOptionalNestedEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum OptionalNestedEnum { - get { return optionalNestedEnum_; } - } - - public const int OptionalForeignEnumFieldNumber = 22; - private bool hasOptionalForeignEnum; - private global::Google.ProtocolBuffers.TestProtos.ForeignEnum optionalForeignEnum_ = global::Google.ProtocolBuffers.TestProtos.ForeignEnum.FOREIGN_FOO; - public bool HasOptionalForeignEnum { - get { return hasOptionalForeignEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum OptionalForeignEnum { - get { return optionalForeignEnum_; } - } - - public const int OptionalImportEnumFieldNumber = 23; - private bool hasOptionalImportEnum; - private global::Google.ProtocolBuffers.TestProtos.ImportEnum optionalImportEnum_ = global::Google.ProtocolBuffers.TestProtos.ImportEnum.IMPORT_FOO; - public bool HasOptionalImportEnum { - get { return hasOptionalImportEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportEnum OptionalImportEnum { - get { return optionalImportEnum_; } - } - - public const int OptionalStringPieceFieldNumber = 24; - private bool hasOptionalStringPiece; - private string optionalStringPiece_ = ""; - public bool HasOptionalStringPiece { - get { return hasOptionalStringPiece; } - } - public string OptionalStringPiece { - get { return optionalStringPiece_; } - } - - public const int OptionalCordFieldNumber = 25; - private bool hasOptionalCord; - private string optionalCord_ = ""; - public bool HasOptionalCord { - get { return hasOptionalCord; } - } - public string OptionalCord { - get { return optionalCord_; } - } - - public const int RepeatedInt32FieldNumber = 31; - private pbc::PopsicleList repeatedInt32_ = new pbc::PopsicleList(); - public scg::IList RepeatedInt32List { - get { return pbc::Lists.AsReadOnly(repeatedInt32_); } - } - public int RepeatedInt32Count { - get { return repeatedInt32_.Count; } - } - public int GetRepeatedInt32(int index) { - return repeatedInt32_[index]; - } - - public const int RepeatedInt64FieldNumber = 32; - private pbc::PopsicleList repeatedInt64_ = new pbc::PopsicleList(); - public scg::IList RepeatedInt64List { - get { return pbc::Lists.AsReadOnly(repeatedInt64_); } - } - public int RepeatedInt64Count { - get { return repeatedInt64_.Count; } - } - public long GetRepeatedInt64(int index) { - return repeatedInt64_[index]; - } - - public const int RepeatedUint32FieldNumber = 33; - private pbc::PopsicleList repeatedUint32_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList RepeatedUint32List { - get { return pbc::Lists.AsReadOnly(repeatedUint32_); } - } - public int RepeatedUint32Count { - get { return repeatedUint32_.Count; } - } - [global::System.CLSCompliant(false)] - public uint GetRepeatedUint32(int index) { - return repeatedUint32_[index]; - } - - public const int RepeatedUint64FieldNumber = 34; - private pbc::PopsicleList repeatedUint64_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList RepeatedUint64List { - get { return pbc::Lists.AsReadOnly(repeatedUint64_); } - } - public int RepeatedUint64Count { - get { return repeatedUint64_.Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetRepeatedUint64(int index) { - return repeatedUint64_[index]; - } - - public const int RepeatedSint32FieldNumber = 35; - private pbc::PopsicleList repeatedSint32_ = new pbc::PopsicleList(); - public scg::IList RepeatedSint32List { - get { return pbc::Lists.AsReadOnly(repeatedSint32_); } - } - public int RepeatedSint32Count { - get { return repeatedSint32_.Count; } - } - public int GetRepeatedSint32(int index) { - return repeatedSint32_[index]; - } - - public const int RepeatedSint64FieldNumber = 36; - private pbc::PopsicleList repeatedSint64_ = new pbc::PopsicleList(); - public scg::IList RepeatedSint64List { - get { return pbc::Lists.AsReadOnly(repeatedSint64_); } - } - public int RepeatedSint64Count { - get { return repeatedSint64_.Count; } - } - public long GetRepeatedSint64(int index) { - return repeatedSint64_[index]; - } - - public const int RepeatedFixed32FieldNumber = 37; - private pbc::PopsicleList repeatedFixed32_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList RepeatedFixed32List { - get { return pbc::Lists.AsReadOnly(repeatedFixed32_); } - } - public int RepeatedFixed32Count { - get { return repeatedFixed32_.Count; } - } - [global::System.CLSCompliant(false)] - public uint GetRepeatedFixed32(int index) { - return repeatedFixed32_[index]; - } - - public const int RepeatedFixed64FieldNumber = 38; - private pbc::PopsicleList repeatedFixed64_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList RepeatedFixed64List { - get { return pbc::Lists.AsReadOnly(repeatedFixed64_); } - } - public int RepeatedFixed64Count { - get { return repeatedFixed64_.Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetRepeatedFixed64(int index) { - return repeatedFixed64_[index]; - } - - public const int RepeatedSfixed32FieldNumber = 39; - private pbc::PopsicleList repeatedSfixed32_ = new pbc::PopsicleList(); - public scg::IList RepeatedSfixed32List { - get { return pbc::Lists.AsReadOnly(repeatedSfixed32_); } - } - public int RepeatedSfixed32Count { - get { return repeatedSfixed32_.Count; } - } - public int GetRepeatedSfixed32(int index) { - return repeatedSfixed32_[index]; - } - - public const int RepeatedSfixed64FieldNumber = 40; - private pbc::PopsicleList repeatedSfixed64_ = new pbc::PopsicleList(); - public scg::IList RepeatedSfixed64List { - get { return pbc::Lists.AsReadOnly(repeatedSfixed64_); } - } - public int RepeatedSfixed64Count { - get { return repeatedSfixed64_.Count; } - } - public long GetRepeatedSfixed64(int index) { - return repeatedSfixed64_[index]; - } - - public const int RepeatedFloatFieldNumber = 41; - private pbc::PopsicleList repeatedFloat_ = new pbc::PopsicleList(); - public scg::IList RepeatedFloatList { - get { return pbc::Lists.AsReadOnly(repeatedFloat_); } - } - public int RepeatedFloatCount { - get { return repeatedFloat_.Count; } - } - public float GetRepeatedFloat(int index) { - return repeatedFloat_[index]; - } - - public const int RepeatedDoubleFieldNumber = 42; - private pbc::PopsicleList repeatedDouble_ = new pbc::PopsicleList(); - public scg::IList RepeatedDoubleList { - get { return pbc::Lists.AsReadOnly(repeatedDouble_); } - } - public int RepeatedDoubleCount { - get { return repeatedDouble_.Count; } - } - public double GetRepeatedDouble(int index) { - return repeatedDouble_[index]; - } - - public const int RepeatedBoolFieldNumber = 43; - private pbc::PopsicleList repeatedBool_ = new pbc::PopsicleList(); - public scg::IList RepeatedBoolList { - get { return pbc::Lists.AsReadOnly(repeatedBool_); } - } - public int RepeatedBoolCount { - get { return repeatedBool_.Count; } - } - public bool GetRepeatedBool(int index) { - return repeatedBool_[index]; - } - - public const int RepeatedStringFieldNumber = 44; - private pbc::PopsicleList repeatedString_ = new pbc::PopsicleList(); - public scg::IList RepeatedStringList { - get { return pbc::Lists.AsReadOnly(repeatedString_); } - } - public int RepeatedStringCount { - get { return repeatedString_.Count; } - } - public string GetRepeatedString(int index) { - return repeatedString_[index]; - } - - public const int RepeatedBytesFieldNumber = 45; - private pbc::PopsicleList repeatedBytes_ = new pbc::PopsicleList(); - public scg::IList RepeatedBytesList { - get { return pbc::Lists.AsReadOnly(repeatedBytes_); } - } - public int RepeatedBytesCount { - get { return repeatedBytes_.Count; } - } - public pb::ByteString GetRepeatedBytes(int index) { - return repeatedBytes_[index]; - } - - public const int RepeatedGroupFieldNumber = 46; - private pbc::PopsicleList repeatedGroup_ = new pbc::PopsicleList(); - public scg::IList RepeatedGroupList { - get { return repeatedGroup_; } - } - public int RepeatedGroupCount { - get { return repeatedGroup_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup GetRepeatedGroup(int index) { - return repeatedGroup_[index]; - } - - public const int RepeatedNestedMessageFieldNumber = 48; - private pbc::PopsicleList repeatedNestedMessage_ = new pbc::PopsicleList(); - public scg::IList RepeatedNestedMessageList { - get { return repeatedNestedMessage_; } - } - public int RepeatedNestedMessageCount { - get { return repeatedNestedMessage_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage GetRepeatedNestedMessage(int index) { - return repeatedNestedMessage_[index]; - } - - public const int RepeatedForeignMessageFieldNumber = 49; - private pbc::PopsicleList repeatedForeignMessage_ = new pbc::PopsicleList(); - public scg::IList RepeatedForeignMessageList { - get { return repeatedForeignMessage_; } - } - public int RepeatedForeignMessageCount { - get { return repeatedForeignMessage_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage GetRepeatedForeignMessage(int index) { - return repeatedForeignMessage_[index]; - } - - public const int RepeatedImportMessageFieldNumber = 50; - private pbc::PopsicleList repeatedImportMessage_ = new pbc::PopsicleList(); - public scg::IList RepeatedImportMessageList { - get { return repeatedImportMessage_; } - } - public int RepeatedImportMessageCount { - get { return repeatedImportMessage_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportMessage GetRepeatedImportMessage(int index) { - return repeatedImportMessage_[index]; - } - - public const int RepeatedNestedEnumFieldNumber = 51; - private pbc::PopsicleList repeatedNestedEnum_ = new pbc::PopsicleList(); - public scg::IList RepeatedNestedEnumList { - get { return pbc::Lists.AsReadOnly(repeatedNestedEnum_); } - } - public int RepeatedNestedEnumCount { - get { return repeatedNestedEnum_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum GetRepeatedNestedEnum(int index) { - return repeatedNestedEnum_[index]; - } - - public const int RepeatedForeignEnumFieldNumber = 52; - private pbc::PopsicleList repeatedForeignEnum_ = new pbc::PopsicleList(); - public scg::IList RepeatedForeignEnumList { - get { return pbc::Lists.AsReadOnly(repeatedForeignEnum_); } - } - public int RepeatedForeignEnumCount { - get { return repeatedForeignEnum_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum GetRepeatedForeignEnum(int index) { - return repeatedForeignEnum_[index]; - } - - public const int RepeatedImportEnumFieldNumber = 53; - private pbc::PopsicleList repeatedImportEnum_ = new pbc::PopsicleList(); - public scg::IList RepeatedImportEnumList { - get { return pbc::Lists.AsReadOnly(repeatedImportEnum_); } - } - public int RepeatedImportEnumCount { - get { return repeatedImportEnum_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportEnum GetRepeatedImportEnum(int index) { - return repeatedImportEnum_[index]; - } - - public const int RepeatedStringPieceFieldNumber = 54; - private pbc::PopsicleList repeatedStringPiece_ = new pbc::PopsicleList(); - public scg::IList RepeatedStringPieceList { - get { return pbc::Lists.AsReadOnly(repeatedStringPiece_); } - } - public int RepeatedStringPieceCount { - get { return repeatedStringPiece_.Count; } - } - public string GetRepeatedStringPiece(int index) { - return repeatedStringPiece_[index]; - } - - public const int RepeatedCordFieldNumber = 55; - private pbc::PopsicleList repeatedCord_ = new pbc::PopsicleList(); - public scg::IList RepeatedCordList { - get { return pbc::Lists.AsReadOnly(repeatedCord_); } - } - public int RepeatedCordCount { - get { return repeatedCord_.Count; } - } - public string GetRepeatedCord(int index) { - return repeatedCord_[index]; - } - - public const int DefaultInt32FieldNumber = 61; - private bool hasDefaultInt32; - private int defaultInt32_ = 41; - public bool HasDefaultInt32 { - get { return hasDefaultInt32; } - } - public int DefaultInt32 { - get { return defaultInt32_; } - } - - public const int DefaultInt64FieldNumber = 62; - private bool hasDefaultInt64; - private long defaultInt64_ = 42L; - public bool HasDefaultInt64 { - get { return hasDefaultInt64; } - } - public long DefaultInt64 { - get { return defaultInt64_; } - } - - public const int DefaultUint32FieldNumber = 63; - private bool hasDefaultUint32; - private uint defaultUint32_ = 43; - public bool HasDefaultUint32 { - get { return hasDefaultUint32; } - } - [global::System.CLSCompliant(false)] - public uint DefaultUint32 { - get { return defaultUint32_; } - } - - public const int DefaultUint64FieldNumber = 64; - private bool hasDefaultUint64; - private ulong defaultUint64_ = 44UL; - public bool HasDefaultUint64 { - get { return hasDefaultUint64; } - } - [global::System.CLSCompliant(false)] - public ulong DefaultUint64 { - get { return defaultUint64_; } - } - - public const int DefaultSint32FieldNumber = 65; - private bool hasDefaultSint32; - private int defaultSint32_ = -45; - public bool HasDefaultSint32 { - get { return hasDefaultSint32; } - } - public int DefaultSint32 { - get { return defaultSint32_; } - } - - public const int DefaultSint64FieldNumber = 66; - private bool hasDefaultSint64; - private long defaultSint64_ = 46; - public bool HasDefaultSint64 { - get { return hasDefaultSint64; } - } - public long DefaultSint64 { - get { return defaultSint64_; } - } - - public const int DefaultFixed32FieldNumber = 67; - private bool hasDefaultFixed32; - private uint defaultFixed32_ = 47; - public bool HasDefaultFixed32 { - get { return hasDefaultFixed32; } - } - [global::System.CLSCompliant(false)] - public uint DefaultFixed32 { - get { return defaultFixed32_; } - } - - public const int DefaultFixed64FieldNumber = 68; - private bool hasDefaultFixed64; - private ulong defaultFixed64_ = 48; - public bool HasDefaultFixed64 { - get { return hasDefaultFixed64; } - } - [global::System.CLSCompliant(false)] - public ulong DefaultFixed64 { - get { return defaultFixed64_; } - } - - public const int DefaultSfixed32FieldNumber = 69; - private bool hasDefaultSfixed32; - private int defaultSfixed32_ = 49; - public bool HasDefaultSfixed32 { - get { return hasDefaultSfixed32; } - } - public int DefaultSfixed32 { - get { return defaultSfixed32_; } - } - - public const int DefaultSfixed64FieldNumber = 70; - private bool hasDefaultSfixed64; - private long defaultSfixed64_ = -50; - public bool HasDefaultSfixed64 { - get { return hasDefaultSfixed64; } - } - public long DefaultSfixed64 { - get { return defaultSfixed64_; } - } - - public const int DefaultFloatFieldNumber = 71; - private bool hasDefaultFloat; - private float defaultFloat_ = 51.5F; - public bool HasDefaultFloat { - get { return hasDefaultFloat; } - } - public float DefaultFloat { - get { return defaultFloat_; } - } - - public const int DefaultDoubleFieldNumber = 72; - private bool hasDefaultDouble; - private double defaultDouble_ = 52000D; - public bool HasDefaultDouble { - get { return hasDefaultDouble; } - } - public double DefaultDouble { - get { return defaultDouble_; } - } - - public const int DefaultBoolFieldNumber = 73; - private bool hasDefaultBool; - private bool defaultBool_ = true; - public bool HasDefaultBool { - get { return hasDefaultBool; } - } - public bool DefaultBool { - get { return defaultBool_; } - } - - public const int DefaultStringFieldNumber = 74; - private bool hasDefaultString; - private string defaultString_ = "hello"; - public bool HasDefaultString { - get { return hasDefaultString; } - } - public string DefaultString { - get { return defaultString_; } - } - - public const int DefaultBytesFieldNumber = 75; - private bool hasDefaultBytes; - private pb::ByteString defaultBytes_ = (pb::ByteString) global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Descriptor.Fields[62].DefaultValue; - public bool HasDefaultBytes { - get { return hasDefaultBytes; } - } - public pb::ByteString DefaultBytes { - get { return defaultBytes_; } - } - - public const int DefaultNestedEnumFieldNumber = 81; - private bool hasDefaultNestedEnum; - private global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum defaultNestedEnum_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum.BAR; - public bool HasDefaultNestedEnum { - get { return hasDefaultNestedEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum DefaultNestedEnum { - get { return defaultNestedEnum_; } - } - - public const int DefaultForeignEnumFieldNumber = 82; - private bool hasDefaultForeignEnum; - private global::Google.ProtocolBuffers.TestProtos.ForeignEnum defaultForeignEnum_ = global::Google.ProtocolBuffers.TestProtos.ForeignEnum.FOREIGN_BAR; - public bool HasDefaultForeignEnum { - get { return hasDefaultForeignEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum DefaultForeignEnum { - get { return defaultForeignEnum_; } - } - - public const int DefaultImportEnumFieldNumber = 83; - private bool hasDefaultImportEnum; - private global::Google.ProtocolBuffers.TestProtos.ImportEnum defaultImportEnum_ = global::Google.ProtocolBuffers.TestProtos.ImportEnum.IMPORT_BAR; - public bool HasDefaultImportEnum { - get { return hasDefaultImportEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportEnum DefaultImportEnum { - get { return defaultImportEnum_; } - } - - public const int DefaultStringPieceFieldNumber = 84; - private bool hasDefaultStringPiece; - private string defaultStringPiece_ = "abc"; - public bool HasDefaultStringPiece { - get { return hasDefaultStringPiece; } - } - public string DefaultStringPiece { - get { return defaultStringPiece_; } - } - - public const int DefaultCordFieldNumber = 85; - private bool hasDefaultCord; - private string defaultCord_ = "123"; - public bool HasDefaultCord { - get { return hasDefaultCord; } - } - public string DefaultCord { - get { return defaultCord_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testAllTypesFieldNames; - if (hasOptionalInt32) { - output.WriteInt32(1, field_names[31], OptionalInt32); - } - if (hasOptionalInt64) { - output.WriteInt64(2, field_names[32], OptionalInt64); - } - if (hasOptionalUint32) { - output.WriteUInt32(3, field_names[41], OptionalUint32); - } - if (hasOptionalUint64) { - output.WriteUInt64(4, field_names[42], OptionalUint64); - } - if (hasOptionalSint32) { - output.WriteSInt32(5, field_names[37], OptionalSint32); - } - if (hasOptionalSint64) { - output.WriteSInt64(6, field_names[38], OptionalSint64); - } - if (hasOptionalFixed32) { - output.WriteFixed32(7, field_names[24], OptionalFixed32); - } - if (hasOptionalFixed64) { - output.WriteFixed64(8, field_names[25], OptionalFixed64); - } - if (hasOptionalSfixed32) { - output.WriteSFixed32(9, field_names[35], OptionalSfixed32); - } - if (hasOptionalSfixed64) { - output.WriteSFixed64(10, field_names[36], OptionalSfixed64); - } - if (hasOptionalFloat) { - output.WriteFloat(11, field_names[26], OptionalFloat); - } - if (hasOptionalDouble) { - output.WriteDouble(12, field_names[23], OptionalDouble); - } - if (hasOptionalBool) { - output.WriteBool(13, field_names[20], OptionalBool); - } - if (hasOptionalString) { - output.WriteString(14, field_names[39], OptionalString); - } - if (hasOptionalBytes) { - output.WriteBytes(15, field_names[21], OptionalBytes); - } - if (hasOptionalGroup) { - output.WriteGroup(16, field_names[43], OptionalGroup); - } - if (hasOptionalNestedMessage) { - output.WriteMessage(18, field_names[34], OptionalNestedMessage); - } - if (hasOptionalForeignMessage) { - output.WriteMessage(19, field_names[28], OptionalForeignMessage); - } - if (hasOptionalImportMessage) { - output.WriteMessage(20, field_names[30], OptionalImportMessage); - } - if (hasOptionalNestedEnum) { - output.WriteEnum(21, field_names[33], (int) OptionalNestedEnum, OptionalNestedEnum); - } - if (hasOptionalForeignEnum) { - output.WriteEnum(22, field_names[27], (int) OptionalForeignEnum, OptionalForeignEnum); - } - if (hasOptionalImportEnum) { - output.WriteEnum(23, field_names[29], (int) OptionalImportEnum, OptionalImportEnum); - } - if (hasOptionalStringPiece) { - output.WriteString(24, field_names[40], OptionalStringPiece); - } - if (hasOptionalCord) { - output.WriteString(25, field_names[22], OptionalCord); - } - if (repeatedInt32_.Count > 0) { - output.WriteInt32Array(31, field_names[55], repeatedInt32_); - } - if (repeatedInt64_.Count > 0) { - output.WriteInt64Array(32, field_names[56], repeatedInt64_); - } - if (repeatedUint32_.Count > 0) { - output.WriteUInt32Array(33, field_names[65], repeatedUint32_); - } - if (repeatedUint64_.Count > 0) { - output.WriteUInt64Array(34, field_names[66], repeatedUint64_); - } - if (repeatedSint32_.Count > 0) { - output.WriteSInt32Array(35, field_names[61], repeatedSint32_); - } - if (repeatedSint64_.Count > 0) { - output.WriteSInt64Array(36, field_names[62], repeatedSint64_); - } - if (repeatedFixed32_.Count > 0) { - output.WriteFixed32Array(37, field_names[48], repeatedFixed32_); - } - if (repeatedFixed64_.Count > 0) { - output.WriteFixed64Array(38, field_names[49], repeatedFixed64_); - } - if (repeatedSfixed32_.Count > 0) { - output.WriteSFixed32Array(39, field_names[59], repeatedSfixed32_); - } - if (repeatedSfixed64_.Count > 0) { - output.WriteSFixed64Array(40, field_names[60], repeatedSfixed64_); - } - if (repeatedFloat_.Count > 0) { - output.WriteFloatArray(41, field_names[50], repeatedFloat_); - } - if (repeatedDouble_.Count > 0) { - output.WriteDoubleArray(42, field_names[47], repeatedDouble_); - } - if (repeatedBool_.Count > 0) { - output.WriteBoolArray(43, field_names[44], repeatedBool_); - } - if (repeatedString_.Count > 0) { - output.WriteStringArray(44, field_names[63], repeatedString_); - } - if (repeatedBytes_.Count > 0) { - output.WriteBytesArray(45, field_names[45], repeatedBytes_); - } - if (repeatedGroup_.Count > 0) { - output.WriteGroupArray(46, field_names[67], repeatedGroup_); - } - if (repeatedNestedMessage_.Count > 0) { - output.WriteMessageArray(48, field_names[58], repeatedNestedMessage_); - } - if (repeatedForeignMessage_.Count > 0) { - output.WriteMessageArray(49, field_names[52], repeatedForeignMessage_); - } - if (repeatedImportMessage_.Count > 0) { - output.WriteMessageArray(50, field_names[54], repeatedImportMessage_); - } - if (repeatedNestedEnum_.Count > 0) { - output.WriteEnumArray(51, field_names[57], repeatedNestedEnum_); - } - if (repeatedForeignEnum_.Count > 0) { - output.WriteEnumArray(52, field_names[51], repeatedForeignEnum_); - } - if (repeatedImportEnum_.Count > 0) { - output.WriteEnumArray(53, field_names[53], repeatedImportEnum_); - } - if (repeatedStringPiece_.Count > 0) { - output.WriteStringArray(54, field_names[64], repeatedStringPiece_); - } - if (repeatedCord_.Count > 0) { - output.WriteStringArray(55, field_names[46], repeatedCord_); - } - if (hasDefaultInt32) { - output.WriteInt32(61, field_names[9], DefaultInt32); - } - if (hasDefaultInt64) { - output.WriteInt64(62, field_names[10], DefaultInt64); - } - if (hasDefaultUint32) { - output.WriteUInt32(63, field_names[18], DefaultUint32); - } - if (hasDefaultUint64) { - output.WriteUInt64(64, field_names[19], DefaultUint64); - } - if (hasDefaultSint32) { - output.WriteSInt32(65, field_names[14], DefaultSint32); - } - if (hasDefaultSint64) { - output.WriteSInt64(66, field_names[15], DefaultSint64); - } - if (hasDefaultFixed32) { - output.WriteFixed32(67, field_names[4], DefaultFixed32); - } - if (hasDefaultFixed64) { - output.WriteFixed64(68, field_names[5], DefaultFixed64); - } - if (hasDefaultSfixed32) { - output.WriteSFixed32(69, field_names[12], DefaultSfixed32); - } - if (hasDefaultSfixed64) { - output.WriteSFixed64(70, field_names[13], DefaultSfixed64); - } - if (hasDefaultFloat) { - output.WriteFloat(71, field_names[6], DefaultFloat); - } - if (hasDefaultDouble) { - output.WriteDouble(72, field_names[3], DefaultDouble); - } - if (hasDefaultBool) { - output.WriteBool(73, field_names[0], DefaultBool); - } - if (hasDefaultString) { - output.WriteString(74, field_names[16], DefaultString); - } - if (hasDefaultBytes) { - output.WriteBytes(75, field_names[1], DefaultBytes); - } - if (hasDefaultNestedEnum) { - output.WriteEnum(81, field_names[11], (int) DefaultNestedEnum, DefaultNestedEnum); - } - if (hasDefaultForeignEnum) { - output.WriteEnum(82, field_names[7], (int) DefaultForeignEnum, DefaultForeignEnum); - } - if (hasDefaultImportEnum) { - output.WriteEnum(83, field_names[8], (int) DefaultImportEnum, DefaultImportEnum); - } - if (hasDefaultStringPiece) { - output.WriteString(84, field_names[17], DefaultStringPiece); - } - if (hasDefaultCord) { - output.WriteString(85, field_names[2], DefaultCord); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasOptionalInt32) { - size += pb::CodedOutputStream.ComputeInt32Size(1, OptionalInt32); - } - if (hasOptionalInt64) { - size += pb::CodedOutputStream.ComputeInt64Size(2, OptionalInt64); - } - if (hasOptionalUint32) { - size += pb::CodedOutputStream.ComputeUInt32Size(3, OptionalUint32); - } - if (hasOptionalUint64) { - size += pb::CodedOutputStream.ComputeUInt64Size(4, OptionalUint64); - } - if (hasOptionalSint32) { - size += pb::CodedOutputStream.ComputeSInt32Size(5, OptionalSint32); - } - if (hasOptionalSint64) { - size += pb::CodedOutputStream.ComputeSInt64Size(6, OptionalSint64); - } - if (hasOptionalFixed32) { - size += pb::CodedOutputStream.ComputeFixed32Size(7, OptionalFixed32); - } - if (hasOptionalFixed64) { - size += pb::CodedOutputStream.ComputeFixed64Size(8, OptionalFixed64); - } - if (hasOptionalSfixed32) { - size += pb::CodedOutputStream.ComputeSFixed32Size(9, OptionalSfixed32); - } - if (hasOptionalSfixed64) { - size += pb::CodedOutputStream.ComputeSFixed64Size(10, OptionalSfixed64); - } - if (hasOptionalFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(11, OptionalFloat); - } - if (hasOptionalDouble) { - size += pb::CodedOutputStream.ComputeDoubleSize(12, OptionalDouble); - } - if (hasOptionalBool) { - size += pb::CodedOutputStream.ComputeBoolSize(13, OptionalBool); - } - if (hasOptionalString) { - size += pb::CodedOutputStream.ComputeStringSize(14, OptionalString); - } - if (hasOptionalBytes) { - size += pb::CodedOutputStream.ComputeBytesSize(15, OptionalBytes); - } - if (hasOptionalGroup) { - size += pb::CodedOutputStream.ComputeGroupSize(16, OptionalGroup); - } - if (hasOptionalNestedMessage) { - size += pb::CodedOutputStream.ComputeMessageSize(18, OptionalNestedMessage); - } - if (hasOptionalForeignMessage) { - size += pb::CodedOutputStream.ComputeMessageSize(19, OptionalForeignMessage); - } - if (hasOptionalImportMessage) { - size += pb::CodedOutputStream.ComputeMessageSize(20, OptionalImportMessage); - } - if (hasOptionalNestedEnum) { - size += pb::CodedOutputStream.ComputeEnumSize(21, (int) OptionalNestedEnum); - } - if (hasOptionalForeignEnum) { - size += pb::CodedOutputStream.ComputeEnumSize(22, (int) OptionalForeignEnum); - } - if (hasOptionalImportEnum) { - size += pb::CodedOutputStream.ComputeEnumSize(23, (int) OptionalImportEnum); - } - if (hasOptionalStringPiece) { - size += pb::CodedOutputStream.ComputeStringSize(24, OptionalStringPiece); - } - if (hasOptionalCord) { - size += pb::CodedOutputStream.ComputeStringSize(25, OptionalCord); - } - { - int dataSize = 0; - foreach (int element in RepeatedInt32List) { - dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedInt32_.Count; - } - { - int dataSize = 0; - foreach (long element in RepeatedInt64List) { - dataSize += pb::CodedOutputStream.ComputeInt64SizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedInt64_.Count; - } - { - int dataSize = 0; - foreach (uint element in RepeatedUint32List) { - dataSize += pb::CodedOutputStream.ComputeUInt32SizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedUint32_.Count; - } - { - int dataSize = 0; - foreach (ulong element in RepeatedUint64List) { - dataSize += pb::CodedOutputStream.ComputeUInt64SizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedUint64_.Count; - } - { - int dataSize = 0; - foreach (int element in RepeatedSint32List) { - dataSize += pb::CodedOutputStream.ComputeSInt32SizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedSint32_.Count; - } - { - int dataSize = 0; - foreach (long element in RepeatedSint64List) { - dataSize += pb::CodedOutputStream.ComputeSInt64SizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedSint64_.Count; - } - { - int dataSize = 0; - dataSize = 4 * repeatedFixed32_.Count; - size += dataSize; - size += 2 * repeatedFixed32_.Count; - } - { - int dataSize = 0; - dataSize = 8 * repeatedFixed64_.Count; - size += dataSize; - size += 2 * repeatedFixed64_.Count; - } - { - int dataSize = 0; - dataSize = 4 * repeatedSfixed32_.Count; - size += dataSize; - size += 2 * repeatedSfixed32_.Count; - } - { - int dataSize = 0; - dataSize = 8 * repeatedSfixed64_.Count; - size += dataSize; - size += 2 * repeatedSfixed64_.Count; - } - { - int dataSize = 0; - dataSize = 4 * repeatedFloat_.Count; - size += dataSize; - size += 2 * repeatedFloat_.Count; - } - { - int dataSize = 0; - dataSize = 8 * repeatedDouble_.Count; - size += dataSize; - size += 2 * repeatedDouble_.Count; - } - { - int dataSize = 0; - dataSize = 1 * repeatedBool_.Count; - size += dataSize; - size += 2 * repeatedBool_.Count; - } - { - int dataSize = 0; - foreach (string element in RepeatedStringList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedString_.Count; - } - { - int dataSize = 0; - foreach (pb::ByteString element in RepeatedBytesList) { - dataSize += pb::CodedOutputStream.ComputeBytesSizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedBytes_.Count; - } - foreach (global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup element in RepeatedGroupList) { - size += pb::CodedOutputStream.ComputeGroupSize(46, element); - } - foreach (global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage element in RepeatedNestedMessageList) { - size += pb::CodedOutputStream.ComputeMessageSize(48, element); - } - foreach (global::Google.ProtocolBuffers.TestProtos.ForeignMessage element in RepeatedForeignMessageList) { - size += pb::CodedOutputStream.ComputeMessageSize(49, element); - } - foreach (global::Google.ProtocolBuffers.TestProtos.ImportMessage element in RepeatedImportMessageList) { - size += pb::CodedOutputStream.ComputeMessageSize(50, element); - } - { - int dataSize = 0; - if (repeatedNestedEnum_.Count > 0) { - foreach (global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum element in repeatedNestedEnum_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 2 * repeatedNestedEnum_.Count; - } - } - { - int dataSize = 0; - if (repeatedForeignEnum_.Count > 0) { - foreach (global::Google.ProtocolBuffers.TestProtos.ForeignEnum element in repeatedForeignEnum_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 2 * repeatedForeignEnum_.Count; - } - } - { - int dataSize = 0; - if (repeatedImportEnum_.Count > 0) { - foreach (global::Google.ProtocolBuffers.TestProtos.ImportEnum element in repeatedImportEnum_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 2 * repeatedImportEnum_.Count; - } - } - { - int dataSize = 0; - foreach (string element in RepeatedStringPieceList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedStringPiece_.Count; - } - { - int dataSize = 0; - foreach (string element in RepeatedCordList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedCord_.Count; - } - if (hasDefaultInt32) { - size += pb::CodedOutputStream.ComputeInt32Size(61, DefaultInt32); - } - if (hasDefaultInt64) { - size += pb::CodedOutputStream.ComputeInt64Size(62, DefaultInt64); - } - if (hasDefaultUint32) { - size += pb::CodedOutputStream.ComputeUInt32Size(63, DefaultUint32); - } - if (hasDefaultUint64) { - size += pb::CodedOutputStream.ComputeUInt64Size(64, DefaultUint64); - } - if (hasDefaultSint32) { - size += pb::CodedOutputStream.ComputeSInt32Size(65, DefaultSint32); - } - if (hasDefaultSint64) { - size += pb::CodedOutputStream.ComputeSInt64Size(66, DefaultSint64); - } - if (hasDefaultFixed32) { - size += pb::CodedOutputStream.ComputeFixed32Size(67, DefaultFixed32); - } - if (hasDefaultFixed64) { - size += pb::CodedOutputStream.ComputeFixed64Size(68, DefaultFixed64); - } - if (hasDefaultSfixed32) { - size += pb::CodedOutputStream.ComputeSFixed32Size(69, DefaultSfixed32); - } - if (hasDefaultSfixed64) { - size += pb::CodedOutputStream.ComputeSFixed64Size(70, DefaultSfixed64); - } - if (hasDefaultFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(71, DefaultFloat); - } - if (hasDefaultDouble) { - size += pb::CodedOutputStream.ComputeDoubleSize(72, DefaultDouble); - } - if (hasDefaultBool) { - size += pb::CodedOutputStream.ComputeBoolSize(73, DefaultBool); - } - if (hasDefaultString) { - size += pb::CodedOutputStream.ComputeStringSize(74, DefaultString); - } - if (hasDefaultBytes) { - size += pb::CodedOutputStream.ComputeBytesSize(75, DefaultBytes); - } - if (hasDefaultNestedEnum) { - size += pb::CodedOutputStream.ComputeEnumSize(81, (int) DefaultNestedEnum); - } - if (hasDefaultForeignEnum) { - size += pb::CodedOutputStream.ComputeEnumSize(82, (int) DefaultForeignEnum); - } - if (hasDefaultImportEnum) { - size += pb::CodedOutputStream.ComputeEnumSize(83, (int) DefaultImportEnum); - } - if (hasDefaultStringPiece) { - size += pb::CodedOutputStream.ComputeStringSize(84, DefaultStringPiece); - } - if (hasDefaultCord) { - size += pb::CodedOutputStream.ComputeStringSize(85, DefaultCord); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestAllTypes ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestAllTypes ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestAllTypes ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestAllTypes ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestAllTypes ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestAllTypes ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestAllTypes ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestAllTypes ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestAllTypes ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestAllTypes ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestAllTypes MakeReadOnly() { - repeatedInt32_.MakeReadOnly(); - repeatedInt64_.MakeReadOnly(); - repeatedUint32_.MakeReadOnly(); - repeatedUint64_.MakeReadOnly(); - repeatedSint32_.MakeReadOnly(); - repeatedSint64_.MakeReadOnly(); - repeatedFixed32_.MakeReadOnly(); - repeatedFixed64_.MakeReadOnly(); - repeatedSfixed32_.MakeReadOnly(); - repeatedSfixed64_.MakeReadOnly(); - repeatedFloat_.MakeReadOnly(); - repeatedDouble_.MakeReadOnly(); - repeatedBool_.MakeReadOnly(); - repeatedString_.MakeReadOnly(); - repeatedBytes_.MakeReadOnly(); - repeatedGroup_.MakeReadOnly(); - repeatedNestedMessage_.MakeReadOnly(); - repeatedForeignMessage_.MakeReadOnly(); - repeatedImportMessage_.MakeReadOnly(); - repeatedNestedEnum_.MakeReadOnly(); - repeatedForeignEnum_.MakeReadOnly(); - repeatedImportEnum_.MakeReadOnly(); - repeatedStringPiece_.MakeReadOnly(); - repeatedCord_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestAllTypes prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestAllTypes cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestAllTypes result; - - private TestAllTypes PrepareBuilder() { - if (resultIsReadOnly) { - TestAllTypes original = result; - result = new TestAllTypes(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestAllTypes MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Descriptor; } - } - - public override TestAllTypes DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestAllTypes.DefaultInstance; } - } - - public override TestAllTypes BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestAllTypes) { - return MergeFrom((TestAllTypes) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestAllTypes other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestAllTypes.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasOptionalInt32) { - OptionalInt32 = other.OptionalInt32; - } - if (other.HasOptionalInt64) { - OptionalInt64 = other.OptionalInt64; - } - if (other.HasOptionalUint32) { - OptionalUint32 = other.OptionalUint32; - } - if (other.HasOptionalUint64) { - OptionalUint64 = other.OptionalUint64; - } - if (other.HasOptionalSint32) { - OptionalSint32 = other.OptionalSint32; - } - if (other.HasOptionalSint64) { - OptionalSint64 = other.OptionalSint64; - } - if (other.HasOptionalFixed32) { - OptionalFixed32 = other.OptionalFixed32; - } - if (other.HasOptionalFixed64) { - OptionalFixed64 = other.OptionalFixed64; - } - if (other.HasOptionalSfixed32) { - OptionalSfixed32 = other.OptionalSfixed32; - } - if (other.HasOptionalSfixed64) { - OptionalSfixed64 = other.OptionalSfixed64; - } - if (other.HasOptionalFloat) { - OptionalFloat = other.OptionalFloat; - } - if (other.HasOptionalDouble) { - OptionalDouble = other.OptionalDouble; - } - if (other.HasOptionalBool) { - OptionalBool = other.OptionalBool; - } - if (other.HasOptionalString) { - OptionalString = other.OptionalString; - } - if (other.HasOptionalBytes) { - OptionalBytes = other.OptionalBytes; - } - if (other.HasOptionalGroup) { - MergeOptionalGroup(other.OptionalGroup); - } - if (other.HasOptionalNestedMessage) { - MergeOptionalNestedMessage(other.OptionalNestedMessage); - } - if (other.HasOptionalForeignMessage) { - MergeOptionalForeignMessage(other.OptionalForeignMessage); - } - if (other.HasOptionalImportMessage) { - MergeOptionalImportMessage(other.OptionalImportMessage); - } - if (other.HasOptionalNestedEnum) { - OptionalNestedEnum = other.OptionalNestedEnum; - } - if (other.HasOptionalForeignEnum) { - OptionalForeignEnum = other.OptionalForeignEnum; - } - if (other.HasOptionalImportEnum) { - OptionalImportEnum = other.OptionalImportEnum; - } - if (other.HasOptionalStringPiece) { - OptionalStringPiece = other.OptionalStringPiece; - } - if (other.HasOptionalCord) { - OptionalCord = other.OptionalCord; - } - if (other.repeatedInt32_.Count != 0) { - result.repeatedInt32_.Add(other.repeatedInt32_); - } - if (other.repeatedInt64_.Count != 0) { - result.repeatedInt64_.Add(other.repeatedInt64_); - } - if (other.repeatedUint32_.Count != 0) { - result.repeatedUint32_.Add(other.repeatedUint32_); - } - if (other.repeatedUint64_.Count != 0) { - result.repeatedUint64_.Add(other.repeatedUint64_); - } - if (other.repeatedSint32_.Count != 0) { - result.repeatedSint32_.Add(other.repeatedSint32_); - } - if (other.repeatedSint64_.Count != 0) { - result.repeatedSint64_.Add(other.repeatedSint64_); - } - if (other.repeatedFixed32_.Count != 0) { - result.repeatedFixed32_.Add(other.repeatedFixed32_); - } - if (other.repeatedFixed64_.Count != 0) { - result.repeatedFixed64_.Add(other.repeatedFixed64_); - } - if (other.repeatedSfixed32_.Count != 0) { - result.repeatedSfixed32_.Add(other.repeatedSfixed32_); - } - if (other.repeatedSfixed64_.Count != 0) { - result.repeatedSfixed64_.Add(other.repeatedSfixed64_); - } - if (other.repeatedFloat_.Count != 0) { - result.repeatedFloat_.Add(other.repeatedFloat_); - } - if (other.repeatedDouble_.Count != 0) { - result.repeatedDouble_.Add(other.repeatedDouble_); - } - if (other.repeatedBool_.Count != 0) { - result.repeatedBool_.Add(other.repeatedBool_); - } - if (other.repeatedString_.Count != 0) { - result.repeatedString_.Add(other.repeatedString_); - } - if (other.repeatedBytes_.Count != 0) { - result.repeatedBytes_.Add(other.repeatedBytes_); - } - if (other.repeatedGroup_.Count != 0) { - result.repeatedGroup_.Add(other.repeatedGroup_); - } - if (other.repeatedNestedMessage_.Count != 0) { - result.repeatedNestedMessage_.Add(other.repeatedNestedMessage_); - } - if (other.repeatedForeignMessage_.Count != 0) { - result.repeatedForeignMessage_.Add(other.repeatedForeignMessage_); - } - if (other.repeatedImportMessage_.Count != 0) { - result.repeatedImportMessage_.Add(other.repeatedImportMessage_); - } - if (other.repeatedNestedEnum_.Count != 0) { - result.repeatedNestedEnum_.Add(other.repeatedNestedEnum_); - } - if (other.repeatedForeignEnum_.Count != 0) { - result.repeatedForeignEnum_.Add(other.repeatedForeignEnum_); - } - if (other.repeatedImportEnum_.Count != 0) { - result.repeatedImportEnum_.Add(other.repeatedImportEnum_); - } - if (other.repeatedStringPiece_.Count != 0) { - result.repeatedStringPiece_.Add(other.repeatedStringPiece_); - } - if (other.repeatedCord_.Count != 0) { - result.repeatedCord_.Add(other.repeatedCord_); - } - if (other.HasDefaultInt32) { - DefaultInt32 = other.DefaultInt32; - } - if (other.HasDefaultInt64) { - DefaultInt64 = other.DefaultInt64; - } - if (other.HasDefaultUint32) { - DefaultUint32 = other.DefaultUint32; - } - if (other.HasDefaultUint64) { - DefaultUint64 = other.DefaultUint64; - } - if (other.HasDefaultSint32) { - DefaultSint32 = other.DefaultSint32; - } - if (other.HasDefaultSint64) { - DefaultSint64 = other.DefaultSint64; - } - if (other.HasDefaultFixed32) { - DefaultFixed32 = other.DefaultFixed32; - } - if (other.HasDefaultFixed64) { - DefaultFixed64 = other.DefaultFixed64; - } - if (other.HasDefaultSfixed32) { - DefaultSfixed32 = other.DefaultSfixed32; - } - if (other.HasDefaultSfixed64) { - DefaultSfixed64 = other.DefaultSfixed64; - } - if (other.HasDefaultFloat) { - DefaultFloat = other.DefaultFloat; - } - if (other.HasDefaultDouble) { - DefaultDouble = other.DefaultDouble; - } - if (other.HasDefaultBool) { - DefaultBool = other.DefaultBool; - } - if (other.HasDefaultString) { - DefaultString = other.DefaultString; - } - if (other.HasDefaultBytes) { - DefaultBytes = other.DefaultBytes; - } - if (other.HasDefaultNestedEnum) { - DefaultNestedEnum = other.DefaultNestedEnum; - } - if (other.HasDefaultForeignEnum) { - DefaultForeignEnum = other.DefaultForeignEnum; - } - if (other.HasDefaultImportEnum) { - DefaultImportEnum = other.DefaultImportEnum; - } - if (other.HasDefaultStringPiece) { - DefaultStringPiece = other.DefaultStringPiece; - } - if (other.HasDefaultCord) { - DefaultCord = other.DefaultCord; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testAllTypesFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testAllTypesFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasOptionalInt32 = input.ReadInt32(ref result.optionalInt32_); - break; - } - case 16: { - result.hasOptionalInt64 = input.ReadInt64(ref result.optionalInt64_); - break; - } - case 24: { - result.hasOptionalUint32 = input.ReadUInt32(ref result.optionalUint32_); - break; - } - case 32: { - result.hasOptionalUint64 = input.ReadUInt64(ref result.optionalUint64_); - break; - } - case 40: { - result.hasOptionalSint32 = input.ReadSInt32(ref result.optionalSint32_); - break; - } - case 48: { - result.hasOptionalSint64 = input.ReadSInt64(ref result.optionalSint64_); - break; - } - case 61: { - result.hasOptionalFixed32 = input.ReadFixed32(ref result.optionalFixed32_); - break; - } - case 65: { - result.hasOptionalFixed64 = input.ReadFixed64(ref result.optionalFixed64_); - break; - } - case 77: { - result.hasOptionalSfixed32 = input.ReadSFixed32(ref result.optionalSfixed32_); - break; - } - case 81: { - result.hasOptionalSfixed64 = input.ReadSFixed64(ref result.optionalSfixed64_); - break; - } - case 93: { - result.hasOptionalFloat = input.ReadFloat(ref result.optionalFloat_); - break; - } - case 97: { - result.hasOptionalDouble = input.ReadDouble(ref result.optionalDouble_); - break; - } - case 104: { - result.hasOptionalBool = input.ReadBool(ref result.optionalBool_); - break; - } - case 114: { - result.hasOptionalString = input.ReadString(ref result.optionalString_); - break; - } - case 122: { - result.hasOptionalBytes = input.ReadBytes(ref result.optionalBytes_); - break; - } - case 131: { - global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.CreateBuilder(); - if (result.hasOptionalGroup) { - subBuilder.MergeFrom(OptionalGroup); - } - input.ReadGroup(16, subBuilder, extensionRegistry); - OptionalGroup = subBuilder.BuildPartial(); - break; - } - case 146: { - global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.CreateBuilder(); - if (result.hasOptionalNestedMessage) { - subBuilder.MergeFrom(OptionalNestedMessage); - } - input.ReadMessage(subBuilder, extensionRegistry); - OptionalNestedMessage = subBuilder.BuildPartial(); - break; - } - case 154: { - global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.ForeignMessage.CreateBuilder(); - if (result.hasOptionalForeignMessage) { - subBuilder.MergeFrom(OptionalForeignMessage); - } - input.ReadMessage(subBuilder, extensionRegistry); - OptionalForeignMessage = subBuilder.BuildPartial(); - break; - } - case 162: { - global::Google.ProtocolBuffers.TestProtos.ImportMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.ImportMessage.CreateBuilder(); - if (result.hasOptionalImportMessage) { - subBuilder.MergeFrom(OptionalImportMessage); - } - input.ReadMessage(subBuilder, extensionRegistry); - OptionalImportMessage = subBuilder.BuildPartial(); - break; - } - case 168: { - object unknown; - if(input.ReadEnum(ref result.optionalNestedEnum_, out unknown)) { - result.hasOptionalNestedEnum = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(21, (ulong)(int)unknown); - } - break; - } - case 176: { - object unknown; - if(input.ReadEnum(ref result.optionalForeignEnum_, out unknown)) { - result.hasOptionalForeignEnum = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(22, (ulong)(int)unknown); - } - break; - } - case 184: { - object unknown; - if(input.ReadEnum(ref result.optionalImportEnum_, out unknown)) { - result.hasOptionalImportEnum = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(23, (ulong)(int)unknown); - } - break; - } - case 194: { - result.hasOptionalStringPiece = input.ReadString(ref result.optionalStringPiece_); - break; - } - case 202: { - result.hasOptionalCord = input.ReadString(ref result.optionalCord_); - break; - } - case 250: - case 248: { - input.ReadInt32Array(tag, field_name, result.repeatedInt32_); - break; - } - case 258: - case 256: { - input.ReadInt64Array(tag, field_name, result.repeatedInt64_); - break; - } - case 266: - case 264: { - input.ReadUInt32Array(tag, field_name, result.repeatedUint32_); - break; - } - case 274: - case 272: { - input.ReadUInt64Array(tag, field_name, result.repeatedUint64_); - break; - } - case 282: - case 280: { - input.ReadSInt32Array(tag, field_name, result.repeatedSint32_); - break; - } - case 290: - case 288: { - input.ReadSInt64Array(tag, field_name, result.repeatedSint64_); - break; - } - case 298: - case 301: { - input.ReadFixed32Array(tag, field_name, result.repeatedFixed32_); - break; - } - case 306: - case 305: { - input.ReadFixed64Array(tag, field_name, result.repeatedFixed64_); - break; - } - case 314: - case 317: { - input.ReadSFixed32Array(tag, field_name, result.repeatedSfixed32_); - break; - } - case 322: - case 321: { - input.ReadSFixed64Array(tag, field_name, result.repeatedSfixed64_); - break; - } - case 330: - case 333: { - input.ReadFloatArray(tag, field_name, result.repeatedFloat_); - break; - } - case 338: - case 337: { - input.ReadDoubleArray(tag, field_name, result.repeatedDouble_); - break; - } - case 346: - case 344: { - input.ReadBoolArray(tag, field_name, result.repeatedBool_); - break; - } - case 354: { - input.ReadStringArray(tag, field_name, result.repeatedString_); - break; - } - case 362: { - input.ReadBytesArray(tag, field_name, result.repeatedBytes_); - break; - } - case 371: { - input.ReadGroupArray(tag, field_name, result.repeatedGroup_, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup.DefaultInstance, extensionRegistry); - break; - } - case 386: { - input.ReadMessageArray(tag, field_name, result.repeatedNestedMessage_, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.DefaultInstance, extensionRegistry); - break; - } - case 394: { - input.ReadMessageArray(tag, field_name, result.repeatedForeignMessage_, global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance, extensionRegistry); - break; - } - case 402: { - input.ReadMessageArray(tag, field_name, result.repeatedImportMessage_, global::Google.ProtocolBuffers.TestProtos.ImportMessage.DefaultInstance, extensionRegistry); - break; - } - case 410: - case 408: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.repeatedNestedEnum_, out unknownItems); - if (unknownItems != null) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - foreach (object rawValue in unknownItems) - if (rawValue is int) - unknownFields.MergeVarintField(51, (ulong)(int)rawValue); - } - break; - } - case 418: - case 416: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.repeatedForeignEnum_, out unknownItems); - if (unknownItems != null) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - foreach (object rawValue in unknownItems) - if (rawValue is int) - unknownFields.MergeVarintField(52, (ulong)(int)rawValue); - } - break; - } - case 426: - case 424: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.repeatedImportEnum_, out unknownItems); - if (unknownItems != null) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - foreach (object rawValue in unknownItems) - if (rawValue is int) - unknownFields.MergeVarintField(53, (ulong)(int)rawValue); - } - break; - } - case 434: { - input.ReadStringArray(tag, field_name, result.repeatedStringPiece_); - break; - } - case 442: { - input.ReadStringArray(tag, field_name, result.repeatedCord_); - break; - } - case 488: { - result.hasDefaultInt32 = input.ReadInt32(ref result.defaultInt32_); - break; - } - case 496: { - result.hasDefaultInt64 = input.ReadInt64(ref result.defaultInt64_); - break; - } - case 504: { - result.hasDefaultUint32 = input.ReadUInt32(ref result.defaultUint32_); - break; - } - case 512: { - result.hasDefaultUint64 = input.ReadUInt64(ref result.defaultUint64_); - break; - } - case 520: { - result.hasDefaultSint32 = input.ReadSInt32(ref result.defaultSint32_); - break; - } - case 528: { - result.hasDefaultSint64 = input.ReadSInt64(ref result.defaultSint64_); - break; - } - case 541: { - result.hasDefaultFixed32 = input.ReadFixed32(ref result.defaultFixed32_); - break; - } - case 545: { - result.hasDefaultFixed64 = input.ReadFixed64(ref result.defaultFixed64_); - break; - } - case 557: { - result.hasDefaultSfixed32 = input.ReadSFixed32(ref result.defaultSfixed32_); - break; - } - case 561: { - result.hasDefaultSfixed64 = input.ReadSFixed64(ref result.defaultSfixed64_); - break; - } - case 573: { - result.hasDefaultFloat = input.ReadFloat(ref result.defaultFloat_); - break; - } - case 577: { - result.hasDefaultDouble = input.ReadDouble(ref result.defaultDouble_); - break; - } - case 584: { - result.hasDefaultBool = input.ReadBool(ref result.defaultBool_); - break; - } - case 594: { - result.hasDefaultString = input.ReadString(ref result.defaultString_); - break; - } - case 602: { - result.hasDefaultBytes = input.ReadBytes(ref result.defaultBytes_); - break; - } - case 648: { - object unknown; - if(input.ReadEnum(ref result.defaultNestedEnum_, out unknown)) { - result.hasDefaultNestedEnum = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(81, (ulong)(int)unknown); - } - break; - } - case 656: { - object unknown; - if(input.ReadEnum(ref result.defaultForeignEnum_, out unknown)) { - result.hasDefaultForeignEnum = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(82, (ulong)(int)unknown); - } - break; - } - case 664: { - object unknown; - if(input.ReadEnum(ref result.defaultImportEnum_, out unknown)) { - result.hasDefaultImportEnum = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(83, (ulong)(int)unknown); - } - break; - } - case 674: { - result.hasDefaultStringPiece = input.ReadString(ref result.defaultStringPiece_); - break; - } - case 682: { - result.hasDefaultCord = input.ReadString(ref result.defaultCord_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasOptionalInt32 { - get { return result.hasOptionalInt32; } - } - public int OptionalInt32 { - get { return result.OptionalInt32; } - set { SetOptionalInt32(value); } - } - public Builder SetOptionalInt32(int value) { - PrepareBuilder(); - result.hasOptionalInt32 = true; - result.optionalInt32_ = value; - return this; - } - public Builder ClearOptionalInt32() { - PrepareBuilder(); - result.hasOptionalInt32 = false; - result.optionalInt32_ = 0; - return this; - } - - public bool HasOptionalInt64 { - get { return result.hasOptionalInt64; } - } - public long OptionalInt64 { - get { return result.OptionalInt64; } - set { SetOptionalInt64(value); } - } - public Builder SetOptionalInt64(long value) { - PrepareBuilder(); - result.hasOptionalInt64 = true; - result.optionalInt64_ = value; - return this; - } - public Builder ClearOptionalInt64() { - PrepareBuilder(); - result.hasOptionalInt64 = false; - result.optionalInt64_ = 0L; - return this; - } - - public bool HasOptionalUint32 { - get { return result.hasOptionalUint32; } - } - [global::System.CLSCompliant(false)] - public uint OptionalUint32 { - get { return result.OptionalUint32; } - set { SetOptionalUint32(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetOptionalUint32(uint value) { - PrepareBuilder(); - result.hasOptionalUint32 = true; - result.optionalUint32_ = value; - return this; - } - public Builder ClearOptionalUint32() { - PrepareBuilder(); - result.hasOptionalUint32 = false; - result.optionalUint32_ = 0; - return this; - } - - public bool HasOptionalUint64 { - get { return result.hasOptionalUint64; } - } - [global::System.CLSCompliant(false)] - public ulong OptionalUint64 { - get { return result.OptionalUint64; } - set { SetOptionalUint64(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetOptionalUint64(ulong value) { - PrepareBuilder(); - result.hasOptionalUint64 = true; - result.optionalUint64_ = value; - return this; - } - public Builder ClearOptionalUint64() { - PrepareBuilder(); - result.hasOptionalUint64 = false; - result.optionalUint64_ = 0UL; - return this; - } - - public bool HasOptionalSint32 { - get { return result.hasOptionalSint32; } - } - public int OptionalSint32 { - get { return result.OptionalSint32; } - set { SetOptionalSint32(value); } - } - public Builder SetOptionalSint32(int value) { - PrepareBuilder(); - result.hasOptionalSint32 = true; - result.optionalSint32_ = value; - return this; - } - public Builder ClearOptionalSint32() { - PrepareBuilder(); - result.hasOptionalSint32 = false; - result.optionalSint32_ = 0; - return this; - } - - public bool HasOptionalSint64 { - get { return result.hasOptionalSint64; } - } - public long OptionalSint64 { - get { return result.OptionalSint64; } - set { SetOptionalSint64(value); } - } - public Builder SetOptionalSint64(long value) { - PrepareBuilder(); - result.hasOptionalSint64 = true; - result.optionalSint64_ = value; - return this; - } - public Builder ClearOptionalSint64() { - PrepareBuilder(); - result.hasOptionalSint64 = false; - result.optionalSint64_ = 0; - return this; - } - - public bool HasOptionalFixed32 { - get { return result.hasOptionalFixed32; } - } - [global::System.CLSCompliant(false)] - public uint OptionalFixed32 { - get { return result.OptionalFixed32; } - set { SetOptionalFixed32(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetOptionalFixed32(uint value) { - PrepareBuilder(); - result.hasOptionalFixed32 = true; - result.optionalFixed32_ = value; - return this; - } - public Builder ClearOptionalFixed32() { - PrepareBuilder(); - result.hasOptionalFixed32 = false; - result.optionalFixed32_ = 0; - return this; - } - - public bool HasOptionalFixed64 { - get { return result.hasOptionalFixed64; } - } - [global::System.CLSCompliant(false)] - public ulong OptionalFixed64 { - get { return result.OptionalFixed64; } - set { SetOptionalFixed64(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetOptionalFixed64(ulong value) { - PrepareBuilder(); - result.hasOptionalFixed64 = true; - result.optionalFixed64_ = value; - return this; - } - public Builder ClearOptionalFixed64() { - PrepareBuilder(); - result.hasOptionalFixed64 = false; - result.optionalFixed64_ = 0; - return this; - } - - public bool HasOptionalSfixed32 { - get { return result.hasOptionalSfixed32; } - } - public int OptionalSfixed32 { - get { return result.OptionalSfixed32; } - set { SetOptionalSfixed32(value); } - } - public Builder SetOptionalSfixed32(int value) { - PrepareBuilder(); - result.hasOptionalSfixed32 = true; - result.optionalSfixed32_ = value; - return this; - } - public Builder ClearOptionalSfixed32() { - PrepareBuilder(); - result.hasOptionalSfixed32 = false; - result.optionalSfixed32_ = 0; - return this; - } - - public bool HasOptionalSfixed64 { - get { return result.hasOptionalSfixed64; } - } - public long OptionalSfixed64 { - get { return result.OptionalSfixed64; } - set { SetOptionalSfixed64(value); } - } - public Builder SetOptionalSfixed64(long value) { - PrepareBuilder(); - result.hasOptionalSfixed64 = true; - result.optionalSfixed64_ = value; - return this; - } - public Builder ClearOptionalSfixed64() { - PrepareBuilder(); - result.hasOptionalSfixed64 = false; - result.optionalSfixed64_ = 0; - return this; - } - - public bool HasOptionalFloat { - get { return result.hasOptionalFloat; } - } - public float OptionalFloat { - get { return result.OptionalFloat; } - set { SetOptionalFloat(value); } - } - public Builder SetOptionalFloat(float value) { - PrepareBuilder(); - result.hasOptionalFloat = true; - result.optionalFloat_ = value; - return this; - } - public Builder ClearOptionalFloat() { - PrepareBuilder(); - result.hasOptionalFloat = false; - result.optionalFloat_ = 0F; - return this; - } - - public bool HasOptionalDouble { - get { return result.hasOptionalDouble; } - } - public double OptionalDouble { - get { return result.OptionalDouble; } - set { SetOptionalDouble(value); } - } - public Builder SetOptionalDouble(double value) { - PrepareBuilder(); - result.hasOptionalDouble = true; - result.optionalDouble_ = value; - return this; - } - public Builder ClearOptionalDouble() { - PrepareBuilder(); - result.hasOptionalDouble = false; - result.optionalDouble_ = 0D; - return this; - } - - public bool HasOptionalBool { - get { return result.hasOptionalBool; } - } - public bool OptionalBool { - get { return result.OptionalBool; } - set { SetOptionalBool(value); } - } - public Builder SetOptionalBool(bool value) { - PrepareBuilder(); - result.hasOptionalBool = true; - result.optionalBool_ = value; - return this; - } - public Builder ClearOptionalBool() { - PrepareBuilder(); - result.hasOptionalBool = false; - result.optionalBool_ = false; - return this; - } - - public bool HasOptionalString { - get { return result.hasOptionalString; } - } - public string OptionalString { - get { return result.OptionalString; } - set { SetOptionalString(value); } - } - public Builder SetOptionalString(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalString = true; - result.optionalString_ = value; - return this; - } - public Builder ClearOptionalString() { - PrepareBuilder(); - result.hasOptionalString = false; - result.optionalString_ = ""; - return this; - } - - public bool HasOptionalBytes { - get { return result.hasOptionalBytes; } - } - public pb::ByteString OptionalBytes { - get { return result.OptionalBytes; } - set { SetOptionalBytes(value); } - } - public Builder SetOptionalBytes(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalBytes = true; - result.optionalBytes_ = value; - return this; - } - public Builder ClearOptionalBytes() { - PrepareBuilder(); - result.hasOptionalBytes = false; - result.optionalBytes_ = pb::ByteString.Empty; - return this; - } - - public bool HasOptionalGroup { - get { return result.hasOptionalGroup; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup OptionalGroup { - get { return result.OptionalGroup; } - set { SetOptionalGroup(value); } - } - public Builder SetOptionalGroup(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalGroup = true; - result.optionalGroup_ = value; - return this; - } - public Builder SetOptionalGroup(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptionalGroup = true; - result.optionalGroup_ = builderForValue.Build(); - return this; - } - public Builder MergeOptionalGroup(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptionalGroup && - result.optionalGroup_ != global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.DefaultInstance) { - result.optionalGroup_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.OptionalGroup.CreateBuilder(result.optionalGroup_).MergeFrom(value).BuildPartial(); - } else { - result.optionalGroup_ = value; - } - result.hasOptionalGroup = true; - return this; - } - public Builder ClearOptionalGroup() { - PrepareBuilder(); - result.hasOptionalGroup = false; - result.optionalGroup_ = null; - return this; - } - - public bool HasOptionalNestedMessage { - get { return result.hasOptionalNestedMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage OptionalNestedMessage { - get { return result.OptionalNestedMessage; } - set { SetOptionalNestedMessage(value); } - } - public Builder SetOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalNestedMessage = true; - result.optionalNestedMessage_ = value; - return this; - } - public Builder SetOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptionalNestedMessage = true; - result.optionalNestedMessage_ = builderForValue.Build(); - return this; - } - public Builder MergeOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptionalNestedMessage && - result.optionalNestedMessage_ != global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.DefaultInstance) { - result.optionalNestedMessage_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.CreateBuilder(result.optionalNestedMessage_).MergeFrom(value).BuildPartial(); - } else { - result.optionalNestedMessage_ = value; - } - result.hasOptionalNestedMessage = true; - return this; - } - public Builder ClearOptionalNestedMessage() { - PrepareBuilder(); - result.hasOptionalNestedMessage = false; - result.optionalNestedMessage_ = null; - return this; - } - - public bool HasOptionalForeignMessage { - get { return result.hasOptionalForeignMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage OptionalForeignMessage { - get { return result.OptionalForeignMessage; } - set { SetOptionalForeignMessage(value); } - } - public Builder SetOptionalForeignMessage(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalForeignMessage = true; - result.optionalForeignMessage_ = value; - return this; - } - public Builder SetOptionalForeignMessage(global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptionalForeignMessage = true; - result.optionalForeignMessage_ = builderForValue.Build(); - return this; - } - public Builder MergeOptionalForeignMessage(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptionalForeignMessage && - result.optionalForeignMessage_ != global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance) { - result.optionalForeignMessage_ = global::Google.ProtocolBuffers.TestProtos.ForeignMessage.CreateBuilder(result.optionalForeignMessage_).MergeFrom(value).BuildPartial(); - } else { - result.optionalForeignMessage_ = value; - } - result.hasOptionalForeignMessage = true; - return this; - } - public Builder ClearOptionalForeignMessage() { - PrepareBuilder(); - result.hasOptionalForeignMessage = false; - result.optionalForeignMessage_ = null; - return this; - } - - public bool HasOptionalImportMessage { - get { return result.hasOptionalImportMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportMessage OptionalImportMessage { - get { return result.OptionalImportMessage; } - set { SetOptionalImportMessage(value); } - } - public Builder SetOptionalImportMessage(global::Google.ProtocolBuffers.TestProtos.ImportMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalImportMessage = true; - result.optionalImportMessage_ = value; - return this; - } - public Builder SetOptionalImportMessage(global::Google.ProtocolBuffers.TestProtos.ImportMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptionalImportMessage = true; - result.optionalImportMessage_ = builderForValue.Build(); - return this; - } - public Builder MergeOptionalImportMessage(global::Google.ProtocolBuffers.TestProtos.ImportMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptionalImportMessage && - result.optionalImportMessage_ != global::Google.ProtocolBuffers.TestProtos.ImportMessage.DefaultInstance) { - result.optionalImportMessage_ = global::Google.ProtocolBuffers.TestProtos.ImportMessage.CreateBuilder(result.optionalImportMessage_).MergeFrom(value).BuildPartial(); - } else { - result.optionalImportMessage_ = value; - } - result.hasOptionalImportMessage = true; - return this; - } - public Builder ClearOptionalImportMessage() { - PrepareBuilder(); - result.hasOptionalImportMessage = false; - result.optionalImportMessage_ = null; - return this; - } - - public bool HasOptionalNestedEnum { - get { return result.hasOptionalNestedEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum OptionalNestedEnum { - get { return result.OptionalNestedEnum; } - set { SetOptionalNestedEnum(value); } - } - public Builder SetOptionalNestedEnum(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum value) { - PrepareBuilder(); - result.hasOptionalNestedEnum = true; - result.optionalNestedEnum_ = value; - return this; - } - public Builder ClearOptionalNestedEnum() { - PrepareBuilder(); - result.hasOptionalNestedEnum = false; - result.optionalNestedEnum_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum.FOO; - return this; - } - - public bool HasOptionalForeignEnum { - get { return result.hasOptionalForeignEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum OptionalForeignEnum { - get { return result.OptionalForeignEnum; } - set { SetOptionalForeignEnum(value); } - } - public Builder SetOptionalForeignEnum(global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) { - PrepareBuilder(); - result.hasOptionalForeignEnum = true; - result.optionalForeignEnum_ = value; - return this; - } - public Builder ClearOptionalForeignEnum() { - PrepareBuilder(); - result.hasOptionalForeignEnum = false; - result.optionalForeignEnum_ = global::Google.ProtocolBuffers.TestProtos.ForeignEnum.FOREIGN_FOO; - return this; - } - - public bool HasOptionalImportEnum { - get { return result.hasOptionalImportEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportEnum OptionalImportEnum { - get { return result.OptionalImportEnum; } - set { SetOptionalImportEnum(value); } - } - public Builder SetOptionalImportEnum(global::Google.ProtocolBuffers.TestProtos.ImportEnum value) { - PrepareBuilder(); - result.hasOptionalImportEnum = true; - result.optionalImportEnum_ = value; - return this; - } - public Builder ClearOptionalImportEnum() { - PrepareBuilder(); - result.hasOptionalImportEnum = false; - result.optionalImportEnum_ = global::Google.ProtocolBuffers.TestProtos.ImportEnum.IMPORT_FOO; - return this; - } - - public bool HasOptionalStringPiece { - get { return result.hasOptionalStringPiece; } - } - public string OptionalStringPiece { - get { return result.OptionalStringPiece; } - set { SetOptionalStringPiece(value); } - } - public Builder SetOptionalStringPiece(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalStringPiece = true; - result.optionalStringPiece_ = value; - return this; - } - public Builder ClearOptionalStringPiece() { - PrepareBuilder(); - result.hasOptionalStringPiece = false; - result.optionalStringPiece_ = ""; - return this; - } - - public bool HasOptionalCord { - get { return result.hasOptionalCord; } - } - public string OptionalCord { - get { return result.OptionalCord; } - set { SetOptionalCord(value); } - } - public Builder SetOptionalCord(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalCord = true; - result.optionalCord_ = value; - return this; - } - public Builder ClearOptionalCord() { - PrepareBuilder(); - result.hasOptionalCord = false; - result.optionalCord_ = ""; - return this; - } - - public pbc::IPopsicleList RepeatedInt32List { - get { return PrepareBuilder().repeatedInt32_; } - } - public int RepeatedInt32Count { - get { return result.RepeatedInt32Count; } - } - public int GetRepeatedInt32(int index) { - return result.GetRepeatedInt32(index); - } - public Builder SetRepeatedInt32(int index, int value) { - PrepareBuilder(); - result.repeatedInt32_[index] = value; - return this; - } - public Builder AddRepeatedInt32(int value) { - PrepareBuilder(); - result.repeatedInt32_.Add(value); - return this; - } - public Builder AddRangeRepeatedInt32(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedInt32_.Add(values); - return this; - } - public Builder ClearRepeatedInt32() { - PrepareBuilder(); - result.repeatedInt32_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedInt64List { - get { return PrepareBuilder().repeatedInt64_; } - } - public int RepeatedInt64Count { - get { return result.RepeatedInt64Count; } - } - public long GetRepeatedInt64(int index) { - return result.GetRepeatedInt64(index); - } - public Builder SetRepeatedInt64(int index, long value) { - PrepareBuilder(); - result.repeatedInt64_[index] = value; - return this; - } - public Builder AddRepeatedInt64(long value) { - PrepareBuilder(); - result.repeatedInt64_.Add(value); - return this; - } - public Builder AddRangeRepeatedInt64(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedInt64_.Add(values); - return this; - } - public Builder ClearRepeatedInt64() { - PrepareBuilder(); - result.repeatedInt64_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList RepeatedUint32List { - get { return PrepareBuilder().repeatedUint32_; } - } - public int RepeatedUint32Count { - get { return result.RepeatedUint32Count; } - } - [global::System.CLSCompliant(false)] - public uint GetRepeatedUint32(int index) { - return result.GetRepeatedUint32(index); - } - [global::System.CLSCompliant(false)] - public Builder SetRepeatedUint32(int index, uint value) { - PrepareBuilder(); - result.repeatedUint32_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRepeatedUint32(uint value) { - PrepareBuilder(); - result.repeatedUint32_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeRepeatedUint32(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedUint32_.Add(values); - return this; - } - public Builder ClearRepeatedUint32() { - PrepareBuilder(); - result.repeatedUint32_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList RepeatedUint64List { - get { return PrepareBuilder().repeatedUint64_; } - } - public int RepeatedUint64Count { - get { return result.RepeatedUint64Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetRepeatedUint64(int index) { - return result.GetRepeatedUint64(index); - } - [global::System.CLSCompliant(false)] - public Builder SetRepeatedUint64(int index, ulong value) { - PrepareBuilder(); - result.repeatedUint64_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRepeatedUint64(ulong value) { - PrepareBuilder(); - result.repeatedUint64_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeRepeatedUint64(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedUint64_.Add(values); - return this; - } - public Builder ClearRepeatedUint64() { - PrepareBuilder(); - result.repeatedUint64_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedSint32List { - get { return PrepareBuilder().repeatedSint32_; } - } - public int RepeatedSint32Count { - get { return result.RepeatedSint32Count; } - } - public int GetRepeatedSint32(int index) { - return result.GetRepeatedSint32(index); - } - public Builder SetRepeatedSint32(int index, int value) { - PrepareBuilder(); - result.repeatedSint32_[index] = value; - return this; - } - public Builder AddRepeatedSint32(int value) { - PrepareBuilder(); - result.repeatedSint32_.Add(value); - return this; - } - public Builder AddRangeRepeatedSint32(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedSint32_.Add(values); - return this; - } - public Builder ClearRepeatedSint32() { - PrepareBuilder(); - result.repeatedSint32_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedSint64List { - get { return PrepareBuilder().repeatedSint64_; } - } - public int RepeatedSint64Count { - get { return result.RepeatedSint64Count; } - } - public long GetRepeatedSint64(int index) { - return result.GetRepeatedSint64(index); - } - public Builder SetRepeatedSint64(int index, long value) { - PrepareBuilder(); - result.repeatedSint64_[index] = value; - return this; - } - public Builder AddRepeatedSint64(long value) { - PrepareBuilder(); - result.repeatedSint64_.Add(value); - return this; - } - public Builder AddRangeRepeatedSint64(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedSint64_.Add(values); - return this; - } - public Builder ClearRepeatedSint64() { - PrepareBuilder(); - result.repeatedSint64_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList RepeatedFixed32List { - get { return PrepareBuilder().repeatedFixed32_; } - } - public int RepeatedFixed32Count { - get { return result.RepeatedFixed32Count; } - } - [global::System.CLSCompliant(false)] - public uint GetRepeatedFixed32(int index) { - return result.GetRepeatedFixed32(index); - } - [global::System.CLSCompliant(false)] - public Builder SetRepeatedFixed32(int index, uint value) { - PrepareBuilder(); - result.repeatedFixed32_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRepeatedFixed32(uint value) { - PrepareBuilder(); - result.repeatedFixed32_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeRepeatedFixed32(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedFixed32_.Add(values); - return this; - } - public Builder ClearRepeatedFixed32() { - PrepareBuilder(); - result.repeatedFixed32_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList RepeatedFixed64List { - get { return PrepareBuilder().repeatedFixed64_; } - } - public int RepeatedFixed64Count { - get { return result.RepeatedFixed64Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetRepeatedFixed64(int index) { - return result.GetRepeatedFixed64(index); - } - [global::System.CLSCompliant(false)] - public Builder SetRepeatedFixed64(int index, ulong value) { - PrepareBuilder(); - result.repeatedFixed64_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRepeatedFixed64(ulong value) { - PrepareBuilder(); - result.repeatedFixed64_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeRepeatedFixed64(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedFixed64_.Add(values); - return this; - } - public Builder ClearRepeatedFixed64() { - PrepareBuilder(); - result.repeatedFixed64_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedSfixed32List { - get { return PrepareBuilder().repeatedSfixed32_; } - } - public int RepeatedSfixed32Count { - get { return result.RepeatedSfixed32Count; } - } - public int GetRepeatedSfixed32(int index) { - return result.GetRepeatedSfixed32(index); - } - public Builder SetRepeatedSfixed32(int index, int value) { - PrepareBuilder(); - result.repeatedSfixed32_[index] = value; - return this; - } - public Builder AddRepeatedSfixed32(int value) { - PrepareBuilder(); - result.repeatedSfixed32_.Add(value); - return this; - } - public Builder AddRangeRepeatedSfixed32(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedSfixed32_.Add(values); - return this; - } - public Builder ClearRepeatedSfixed32() { - PrepareBuilder(); - result.repeatedSfixed32_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedSfixed64List { - get { return PrepareBuilder().repeatedSfixed64_; } - } - public int RepeatedSfixed64Count { - get { return result.RepeatedSfixed64Count; } - } - public long GetRepeatedSfixed64(int index) { - return result.GetRepeatedSfixed64(index); - } - public Builder SetRepeatedSfixed64(int index, long value) { - PrepareBuilder(); - result.repeatedSfixed64_[index] = value; - return this; - } - public Builder AddRepeatedSfixed64(long value) { - PrepareBuilder(); - result.repeatedSfixed64_.Add(value); - return this; - } - public Builder AddRangeRepeatedSfixed64(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedSfixed64_.Add(values); - return this; - } - public Builder ClearRepeatedSfixed64() { - PrepareBuilder(); - result.repeatedSfixed64_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedFloatList { - get { return PrepareBuilder().repeatedFloat_; } - } - public int RepeatedFloatCount { - get { return result.RepeatedFloatCount; } - } - public float GetRepeatedFloat(int index) { - return result.GetRepeatedFloat(index); - } - public Builder SetRepeatedFloat(int index, float value) { - PrepareBuilder(); - result.repeatedFloat_[index] = value; - return this; - } - public Builder AddRepeatedFloat(float value) { - PrepareBuilder(); - result.repeatedFloat_.Add(value); - return this; - } - public Builder AddRangeRepeatedFloat(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedFloat_.Add(values); - return this; - } - public Builder ClearRepeatedFloat() { - PrepareBuilder(); - result.repeatedFloat_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedDoubleList { - get { return PrepareBuilder().repeatedDouble_; } - } - public int RepeatedDoubleCount { - get { return result.RepeatedDoubleCount; } - } - public double GetRepeatedDouble(int index) { - return result.GetRepeatedDouble(index); - } - public Builder SetRepeatedDouble(int index, double value) { - PrepareBuilder(); - result.repeatedDouble_[index] = value; - return this; - } - public Builder AddRepeatedDouble(double value) { - PrepareBuilder(); - result.repeatedDouble_.Add(value); - return this; - } - public Builder AddRangeRepeatedDouble(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedDouble_.Add(values); - return this; - } - public Builder ClearRepeatedDouble() { - PrepareBuilder(); - result.repeatedDouble_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedBoolList { - get { return PrepareBuilder().repeatedBool_; } - } - public int RepeatedBoolCount { - get { return result.RepeatedBoolCount; } - } - public bool GetRepeatedBool(int index) { - return result.GetRepeatedBool(index); - } - public Builder SetRepeatedBool(int index, bool value) { - PrepareBuilder(); - result.repeatedBool_[index] = value; - return this; - } - public Builder AddRepeatedBool(bool value) { - PrepareBuilder(); - result.repeatedBool_.Add(value); - return this; - } - public Builder AddRangeRepeatedBool(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedBool_.Add(values); - return this; - } - public Builder ClearRepeatedBool() { - PrepareBuilder(); - result.repeatedBool_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedStringList { - get { return PrepareBuilder().repeatedString_; } - } - public int RepeatedStringCount { - get { return result.RepeatedStringCount; } - } - public string GetRepeatedString(int index) { - return result.GetRepeatedString(index); - } - public Builder SetRepeatedString(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedString_[index] = value; - return this; - } - public Builder AddRepeatedString(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedString_.Add(value); - return this; - } - public Builder AddRangeRepeatedString(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedString_.Add(values); - return this; - } - public Builder ClearRepeatedString() { - PrepareBuilder(); - result.repeatedString_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedBytesList { - get { return PrepareBuilder().repeatedBytes_; } - } - public int RepeatedBytesCount { - get { return result.RepeatedBytesCount; } - } - public pb::ByteString GetRepeatedBytes(int index) { - return result.GetRepeatedBytes(index); - } - public Builder SetRepeatedBytes(int index, pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedBytes_[index] = value; - return this; - } - public Builder AddRepeatedBytes(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedBytes_.Add(value); - return this; - } - public Builder AddRangeRepeatedBytes(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedBytes_.Add(values); - return this; - } - public Builder ClearRepeatedBytes() { - PrepareBuilder(); - result.repeatedBytes_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedGroupList { - get { return PrepareBuilder().repeatedGroup_; } - } - public int RepeatedGroupCount { - get { return result.RepeatedGroupCount; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup GetRepeatedGroup(int index) { - return result.GetRepeatedGroup(index); - } - public Builder SetRepeatedGroup(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedGroup_[index] = value; - return this; - } - public Builder SetRepeatedGroup(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedGroup_[index] = builderForValue.Build(); - return this; - } - public Builder AddRepeatedGroup(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedGroup_.Add(value); - return this; - } - public Builder AddRepeatedGroup(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.RepeatedGroup.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedGroup_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeRepeatedGroup(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedGroup_.Add(values); - return this; - } - public Builder ClearRepeatedGroup() { - PrepareBuilder(); - result.repeatedGroup_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedNestedMessageList { - get { return PrepareBuilder().repeatedNestedMessage_; } - } - public int RepeatedNestedMessageCount { - get { return result.RepeatedNestedMessageCount; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage GetRepeatedNestedMessage(int index) { - return result.GetRepeatedNestedMessage(index); - } - public Builder SetRepeatedNestedMessage(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedNestedMessage_[index] = value; - return this; - } - public Builder SetRepeatedNestedMessage(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedNestedMessage_[index] = builderForValue.Build(); - return this; - } - public Builder AddRepeatedNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedNestedMessage_.Add(value); - return this; - } - public Builder AddRepeatedNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedNestedMessage_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeRepeatedNestedMessage(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedNestedMessage_.Add(values); - return this; - } - public Builder ClearRepeatedNestedMessage() { - PrepareBuilder(); - result.repeatedNestedMessage_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedForeignMessageList { - get { return PrepareBuilder().repeatedForeignMessage_; } - } - public int RepeatedForeignMessageCount { - get { return result.RepeatedForeignMessageCount; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage GetRepeatedForeignMessage(int index) { - return result.GetRepeatedForeignMessage(index); - } - public Builder SetRepeatedForeignMessage(int index, global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedForeignMessage_[index] = value; - return this; - } - public Builder SetRepeatedForeignMessage(int index, global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedForeignMessage_[index] = builderForValue.Build(); - return this; - } - public Builder AddRepeatedForeignMessage(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedForeignMessage_.Add(value); - return this; - } - public Builder AddRepeatedForeignMessage(global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedForeignMessage_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeRepeatedForeignMessage(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedForeignMessage_.Add(values); - return this; - } - public Builder ClearRepeatedForeignMessage() { - PrepareBuilder(); - result.repeatedForeignMessage_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedImportMessageList { - get { return PrepareBuilder().repeatedImportMessage_; } - } - public int RepeatedImportMessageCount { - get { return result.RepeatedImportMessageCount; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportMessage GetRepeatedImportMessage(int index) { - return result.GetRepeatedImportMessage(index); - } - public Builder SetRepeatedImportMessage(int index, global::Google.ProtocolBuffers.TestProtos.ImportMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedImportMessage_[index] = value; - return this; - } - public Builder SetRepeatedImportMessage(int index, global::Google.ProtocolBuffers.TestProtos.ImportMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedImportMessage_[index] = builderForValue.Build(); - return this; - } - public Builder AddRepeatedImportMessage(global::Google.ProtocolBuffers.TestProtos.ImportMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedImportMessage_.Add(value); - return this; - } - public Builder AddRepeatedImportMessage(global::Google.ProtocolBuffers.TestProtos.ImportMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedImportMessage_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeRepeatedImportMessage(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedImportMessage_.Add(values); - return this; - } - public Builder ClearRepeatedImportMessage() { - PrepareBuilder(); - result.repeatedImportMessage_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedNestedEnumList { - get { return PrepareBuilder().repeatedNestedEnum_; } - } - public int RepeatedNestedEnumCount { - get { return result.RepeatedNestedEnumCount; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum GetRepeatedNestedEnum(int index) { - return result.GetRepeatedNestedEnum(index); - } - public Builder SetRepeatedNestedEnum(int index, global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum value) { - PrepareBuilder(); - result.repeatedNestedEnum_[index] = value; - return this; - } - public Builder AddRepeatedNestedEnum(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum value) { - PrepareBuilder(); - result.repeatedNestedEnum_.Add(value); - return this; - } - public Builder AddRangeRepeatedNestedEnum(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedNestedEnum_.Add(values); - return this; - } - public Builder ClearRepeatedNestedEnum() { - PrepareBuilder(); - result.repeatedNestedEnum_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedForeignEnumList { - get { return PrepareBuilder().repeatedForeignEnum_; } - } - public int RepeatedForeignEnumCount { - get { return result.RepeatedForeignEnumCount; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum GetRepeatedForeignEnum(int index) { - return result.GetRepeatedForeignEnum(index); - } - public Builder SetRepeatedForeignEnum(int index, global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) { - PrepareBuilder(); - result.repeatedForeignEnum_[index] = value; - return this; - } - public Builder AddRepeatedForeignEnum(global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) { - PrepareBuilder(); - result.repeatedForeignEnum_.Add(value); - return this; - } - public Builder AddRangeRepeatedForeignEnum(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedForeignEnum_.Add(values); - return this; - } - public Builder ClearRepeatedForeignEnum() { - PrepareBuilder(); - result.repeatedForeignEnum_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedImportEnumList { - get { return PrepareBuilder().repeatedImportEnum_; } - } - public int RepeatedImportEnumCount { - get { return result.RepeatedImportEnumCount; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportEnum GetRepeatedImportEnum(int index) { - return result.GetRepeatedImportEnum(index); - } - public Builder SetRepeatedImportEnum(int index, global::Google.ProtocolBuffers.TestProtos.ImportEnum value) { - PrepareBuilder(); - result.repeatedImportEnum_[index] = value; - return this; - } - public Builder AddRepeatedImportEnum(global::Google.ProtocolBuffers.TestProtos.ImportEnum value) { - PrepareBuilder(); - result.repeatedImportEnum_.Add(value); - return this; - } - public Builder AddRangeRepeatedImportEnum(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedImportEnum_.Add(values); - return this; - } - public Builder ClearRepeatedImportEnum() { - PrepareBuilder(); - result.repeatedImportEnum_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedStringPieceList { - get { return PrepareBuilder().repeatedStringPiece_; } - } - public int RepeatedStringPieceCount { - get { return result.RepeatedStringPieceCount; } - } - public string GetRepeatedStringPiece(int index) { - return result.GetRepeatedStringPiece(index); - } - public Builder SetRepeatedStringPiece(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedStringPiece_[index] = value; - return this; - } - public Builder AddRepeatedStringPiece(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedStringPiece_.Add(value); - return this; - } - public Builder AddRangeRepeatedStringPiece(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedStringPiece_.Add(values); - return this; - } - public Builder ClearRepeatedStringPiece() { - PrepareBuilder(); - result.repeatedStringPiece_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedCordList { - get { return PrepareBuilder().repeatedCord_; } - } - public int RepeatedCordCount { - get { return result.RepeatedCordCount; } - } - public string GetRepeatedCord(int index) { - return result.GetRepeatedCord(index); - } - public Builder SetRepeatedCord(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedCord_[index] = value; - return this; - } - public Builder AddRepeatedCord(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedCord_.Add(value); - return this; - } - public Builder AddRangeRepeatedCord(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedCord_.Add(values); - return this; - } - public Builder ClearRepeatedCord() { - PrepareBuilder(); - result.repeatedCord_.Clear(); - return this; - } - - public bool HasDefaultInt32 { - get { return result.hasDefaultInt32; } - } - public int DefaultInt32 { - get { return result.DefaultInt32; } - set { SetDefaultInt32(value); } - } - public Builder SetDefaultInt32(int value) { - PrepareBuilder(); - result.hasDefaultInt32 = true; - result.defaultInt32_ = value; - return this; - } - public Builder ClearDefaultInt32() { - PrepareBuilder(); - result.hasDefaultInt32 = false; - result.defaultInt32_ = 41; - return this; - } - - public bool HasDefaultInt64 { - get { return result.hasDefaultInt64; } - } - public long DefaultInt64 { - get { return result.DefaultInt64; } - set { SetDefaultInt64(value); } - } - public Builder SetDefaultInt64(long value) { - PrepareBuilder(); - result.hasDefaultInt64 = true; - result.defaultInt64_ = value; - return this; - } - public Builder ClearDefaultInt64() { - PrepareBuilder(); - result.hasDefaultInt64 = false; - result.defaultInt64_ = 42L; - return this; - } - - public bool HasDefaultUint32 { - get { return result.hasDefaultUint32; } - } - [global::System.CLSCompliant(false)] - public uint DefaultUint32 { - get { return result.DefaultUint32; } - set { SetDefaultUint32(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetDefaultUint32(uint value) { - PrepareBuilder(); - result.hasDefaultUint32 = true; - result.defaultUint32_ = value; - return this; - } - public Builder ClearDefaultUint32() { - PrepareBuilder(); - result.hasDefaultUint32 = false; - result.defaultUint32_ = 43; - return this; - } - - public bool HasDefaultUint64 { - get { return result.hasDefaultUint64; } - } - [global::System.CLSCompliant(false)] - public ulong DefaultUint64 { - get { return result.DefaultUint64; } - set { SetDefaultUint64(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetDefaultUint64(ulong value) { - PrepareBuilder(); - result.hasDefaultUint64 = true; - result.defaultUint64_ = value; - return this; - } - public Builder ClearDefaultUint64() { - PrepareBuilder(); - result.hasDefaultUint64 = false; - result.defaultUint64_ = 44UL; - return this; - } - - public bool HasDefaultSint32 { - get { return result.hasDefaultSint32; } - } - public int DefaultSint32 { - get { return result.DefaultSint32; } - set { SetDefaultSint32(value); } - } - public Builder SetDefaultSint32(int value) { - PrepareBuilder(); - result.hasDefaultSint32 = true; - result.defaultSint32_ = value; - return this; - } - public Builder ClearDefaultSint32() { - PrepareBuilder(); - result.hasDefaultSint32 = false; - result.defaultSint32_ = -45; - return this; - } - - public bool HasDefaultSint64 { - get { return result.hasDefaultSint64; } - } - public long DefaultSint64 { - get { return result.DefaultSint64; } - set { SetDefaultSint64(value); } - } - public Builder SetDefaultSint64(long value) { - PrepareBuilder(); - result.hasDefaultSint64 = true; - result.defaultSint64_ = value; - return this; - } - public Builder ClearDefaultSint64() { - PrepareBuilder(); - result.hasDefaultSint64 = false; - result.defaultSint64_ = 46; - return this; - } - - public bool HasDefaultFixed32 { - get { return result.hasDefaultFixed32; } - } - [global::System.CLSCompliant(false)] - public uint DefaultFixed32 { - get { return result.DefaultFixed32; } - set { SetDefaultFixed32(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetDefaultFixed32(uint value) { - PrepareBuilder(); - result.hasDefaultFixed32 = true; - result.defaultFixed32_ = value; - return this; - } - public Builder ClearDefaultFixed32() { - PrepareBuilder(); - result.hasDefaultFixed32 = false; - result.defaultFixed32_ = 47; - return this; - } - - public bool HasDefaultFixed64 { - get { return result.hasDefaultFixed64; } - } - [global::System.CLSCompliant(false)] - public ulong DefaultFixed64 { - get { return result.DefaultFixed64; } - set { SetDefaultFixed64(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetDefaultFixed64(ulong value) { - PrepareBuilder(); - result.hasDefaultFixed64 = true; - result.defaultFixed64_ = value; - return this; - } - public Builder ClearDefaultFixed64() { - PrepareBuilder(); - result.hasDefaultFixed64 = false; - result.defaultFixed64_ = 48; - return this; - } - - public bool HasDefaultSfixed32 { - get { return result.hasDefaultSfixed32; } - } - public int DefaultSfixed32 { - get { return result.DefaultSfixed32; } - set { SetDefaultSfixed32(value); } - } - public Builder SetDefaultSfixed32(int value) { - PrepareBuilder(); - result.hasDefaultSfixed32 = true; - result.defaultSfixed32_ = value; - return this; - } - public Builder ClearDefaultSfixed32() { - PrepareBuilder(); - result.hasDefaultSfixed32 = false; - result.defaultSfixed32_ = 49; - return this; - } - - public bool HasDefaultSfixed64 { - get { return result.hasDefaultSfixed64; } - } - public long DefaultSfixed64 { - get { return result.DefaultSfixed64; } - set { SetDefaultSfixed64(value); } - } - public Builder SetDefaultSfixed64(long value) { - PrepareBuilder(); - result.hasDefaultSfixed64 = true; - result.defaultSfixed64_ = value; - return this; - } - public Builder ClearDefaultSfixed64() { - PrepareBuilder(); - result.hasDefaultSfixed64 = false; - result.defaultSfixed64_ = -50; - return this; - } - - public bool HasDefaultFloat { - get { return result.hasDefaultFloat; } - } - public float DefaultFloat { - get { return result.DefaultFloat; } - set { SetDefaultFloat(value); } - } - public Builder SetDefaultFloat(float value) { - PrepareBuilder(); - result.hasDefaultFloat = true; - result.defaultFloat_ = value; - return this; - } - public Builder ClearDefaultFloat() { - PrepareBuilder(); - result.hasDefaultFloat = false; - result.defaultFloat_ = 51.5F; - return this; - } - - public bool HasDefaultDouble { - get { return result.hasDefaultDouble; } - } - public double DefaultDouble { - get { return result.DefaultDouble; } - set { SetDefaultDouble(value); } - } - public Builder SetDefaultDouble(double value) { - PrepareBuilder(); - result.hasDefaultDouble = true; - result.defaultDouble_ = value; - return this; - } - public Builder ClearDefaultDouble() { - PrepareBuilder(); - result.hasDefaultDouble = false; - result.defaultDouble_ = 52000D; - return this; - } - - public bool HasDefaultBool { - get { return result.hasDefaultBool; } - } - public bool DefaultBool { - get { return result.DefaultBool; } - set { SetDefaultBool(value); } - } - public Builder SetDefaultBool(bool value) { - PrepareBuilder(); - result.hasDefaultBool = true; - result.defaultBool_ = value; - return this; - } - public Builder ClearDefaultBool() { - PrepareBuilder(); - result.hasDefaultBool = false; - result.defaultBool_ = true; - return this; - } - - public bool HasDefaultString { - get { return result.hasDefaultString; } - } - public string DefaultString { - get { return result.DefaultString; } - set { SetDefaultString(value); } - } - public Builder SetDefaultString(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasDefaultString = true; - result.defaultString_ = value; - return this; - } - public Builder ClearDefaultString() { - PrepareBuilder(); - result.hasDefaultString = false; - result.defaultString_ = "hello"; - return this; - } - - public bool HasDefaultBytes { - get { return result.hasDefaultBytes; } - } - public pb::ByteString DefaultBytes { - get { return result.DefaultBytes; } - set { SetDefaultBytes(value); } - } - public Builder SetDefaultBytes(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasDefaultBytes = true; - result.defaultBytes_ = value; - return this; - } - public Builder ClearDefaultBytes() { - PrepareBuilder(); - result.hasDefaultBytes = false; - result.defaultBytes_ = (pb::ByteString) global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Descriptor.Fields[62].DefaultValue; - return this; - } - - public bool HasDefaultNestedEnum { - get { return result.hasDefaultNestedEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum DefaultNestedEnum { - get { return result.DefaultNestedEnum; } - set { SetDefaultNestedEnum(value); } - } - public Builder SetDefaultNestedEnum(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum value) { - PrepareBuilder(); - result.hasDefaultNestedEnum = true; - result.defaultNestedEnum_ = value; - return this; - } - public Builder ClearDefaultNestedEnum() { - PrepareBuilder(); - result.hasDefaultNestedEnum = false; - result.defaultNestedEnum_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedEnum.BAR; - return this; - } - - public bool HasDefaultForeignEnum { - get { return result.hasDefaultForeignEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum DefaultForeignEnum { - get { return result.DefaultForeignEnum; } - set { SetDefaultForeignEnum(value); } - } - public Builder SetDefaultForeignEnum(global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) { - PrepareBuilder(); - result.hasDefaultForeignEnum = true; - result.defaultForeignEnum_ = value; - return this; - } - public Builder ClearDefaultForeignEnum() { - PrepareBuilder(); - result.hasDefaultForeignEnum = false; - result.defaultForeignEnum_ = global::Google.ProtocolBuffers.TestProtos.ForeignEnum.FOREIGN_BAR; - return this; - } - - public bool HasDefaultImportEnum { - get { return result.hasDefaultImportEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.ImportEnum DefaultImportEnum { - get { return result.DefaultImportEnum; } - set { SetDefaultImportEnum(value); } - } - public Builder SetDefaultImportEnum(global::Google.ProtocolBuffers.TestProtos.ImportEnum value) { - PrepareBuilder(); - result.hasDefaultImportEnum = true; - result.defaultImportEnum_ = value; - return this; - } - public Builder ClearDefaultImportEnum() { - PrepareBuilder(); - result.hasDefaultImportEnum = false; - result.defaultImportEnum_ = global::Google.ProtocolBuffers.TestProtos.ImportEnum.IMPORT_BAR; - return this; - } - - public bool HasDefaultStringPiece { - get { return result.hasDefaultStringPiece; } - } - public string DefaultStringPiece { - get { return result.DefaultStringPiece; } - set { SetDefaultStringPiece(value); } - } - public Builder SetDefaultStringPiece(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasDefaultStringPiece = true; - result.defaultStringPiece_ = value; - return this; - } - public Builder ClearDefaultStringPiece() { - PrepareBuilder(); - result.hasDefaultStringPiece = false; - result.defaultStringPiece_ = "abc"; - return this; - } - - public bool HasDefaultCord { - get { return result.hasDefaultCord; } - } - public string DefaultCord { - get { return result.DefaultCord; } - set { SetDefaultCord(value); } - } - public Builder SetDefaultCord(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasDefaultCord = true; - result.defaultCord_ = value; - return this; - } - public Builder ClearDefaultCord() { - PrepareBuilder(); - result.hasDefaultCord = false; - result.defaultCord_ = "123"; - return this; - } - } - static TestAllTypes() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestDeprecatedFields : pb::GeneratedMessage { - private TestDeprecatedFields() { } - private static readonly TestDeprecatedFields defaultInstance = new TestDeprecatedFields().MakeReadOnly(); - private static readonly string[] _testDeprecatedFieldsFieldNames = new string[] { "deprecated_int32" }; - private static readonly uint[] _testDeprecatedFieldsFieldTags = new uint[] { 8 }; - public static TestDeprecatedFields DefaultInstance { - get { return defaultInstance; } - } - - public override TestDeprecatedFields DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestDeprecatedFields ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDeprecatedFields__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDeprecatedFields__FieldAccessorTable; } - } - - public const int DeprecatedInt32FieldNumber = 1; - private bool hasDeprecatedInt32; - private int deprecatedInt32_; - [global::System.ObsoleteAttribute()] - public bool HasDeprecatedInt32 { - get { return hasDeprecatedInt32; } - } - [global::System.ObsoleteAttribute()] - public int DeprecatedInt32 { - get { return deprecatedInt32_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testDeprecatedFieldsFieldNames; - if (hasDeprecatedInt32) { - output.WriteInt32(1, field_names[0], DeprecatedInt32); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasDeprecatedInt32) { - size += pb::CodedOutputStream.ComputeInt32Size(1, DeprecatedInt32); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestDeprecatedFields ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestDeprecatedFields ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestDeprecatedFields ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestDeprecatedFields ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestDeprecatedFields ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestDeprecatedFields ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestDeprecatedFields ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestDeprecatedFields ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestDeprecatedFields ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestDeprecatedFields ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestDeprecatedFields MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestDeprecatedFields prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestDeprecatedFields cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestDeprecatedFields result; - - private TestDeprecatedFields PrepareBuilder() { - if (resultIsReadOnly) { - TestDeprecatedFields original = result; - result = new TestDeprecatedFields(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestDeprecatedFields MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestDeprecatedFields.Descriptor; } - } - - public override TestDeprecatedFields DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestDeprecatedFields.DefaultInstance; } - } - - public override TestDeprecatedFields BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestDeprecatedFields) { - return MergeFrom((TestDeprecatedFields) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestDeprecatedFields other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestDeprecatedFields.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasDeprecatedInt32) { - DeprecatedInt32 = other.DeprecatedInt32; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testDeprecatedFieldsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testDeprecatedFieldsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasDeprecatedInt32 = input.ReadInt32(ref result.deprecatedInt32_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - [global::System.ObsoleteAttribute()] - public bool HasDeprecatedInt32 { - get { return result.hasDeprecatedInt32; } - } - [global::System.ObsoleteAttribute()] - public int DeprecatedInt32 { - get { return result.DeprecatedInt32; } - set { SetDeprecatedInt32(value); } - } - [global::System.ObsoleteAttribute()] - public Builder SetDeprecatedInt32(int value) { - PrepareBuilder(); - result.hasDeprecatedInt32 = true; - result.deprecatedInt32_ = value; - return this; - } - [global::System.ObsoleteAttribute()] - public Builder ClearDeprecatedInt32() { - PrepareBuilder(); - result.hasDeprecatedInt32 = false; - result.deprecatedInt32_ = 0; - return this; - } - } - static TestDeprecatedFields() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class ForeignMessage : pb::GeneratedMessage { - private ForeignMessage() { } - private static readonly ForeignMessage defaultInstance = new ForeignMessage().MakeReadOnly(); - private static readonly string[] _foreignMessageFieldNames = new string[] { "c" }; - private static readonly uint[] _foreignMessageFieldTags = new uint[] { 8 }; - public static ForeignMessage DefaultInstance { - get { return defaultInstance; } - } - - public override ForeignMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override ForeignMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_ForeignMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_ForeignMessage__FieldAccessorTable; } - } - - public const int CFieldNumber = 1; - private bool hasC; - private int c_; - public bool HasC { - get { return hasC; } - } - public int C { - get { return c_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _foreignMessageFieldNames; - if (hasC) { - output.WriteInt32(1, field_names[0], C); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasC) { - size += pb::CodedOutputStream.ComputeInt32Size(1, C); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static ForeignMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ForeignMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ForeignMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ForeignMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ForeignMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ForeignMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ForeignMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ForeignMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ForeignMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ForeignMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private ForeignMessage MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ForeignMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(ForeignMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private ForeignMessage result; - - private ForeignMessage PrepareBuilder() { - if (resultIsReadOnly) { - ForeignMessage original = result; - result = new ForeignMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override ForeignMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Descriptor; } - } - - public override ForeignMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance; } - } - - public override ForeignMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ForeignMessage) { - return MergeFrom((ForeignMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ForeignMessage other) { - if (other == global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasC) { - C = other.C; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_foreignMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _foreignMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasC = input.ReadInt32(ref result.c_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasC { - get { return result.hasC; } - } - public int C { - get { return result.C; } - set { SetC(value); } - } - public Builder SetC(int value) { - PrepareBuilder(); - result.hasC = true; - result.c_ = value; - return this; - } - public Builder ClearC() { - PrepareBuilder(); - result.hasC = false; - result.c_ = 0; - return this; - } - } - static ForeignMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestAllExtensions : pb::ExtendableMessage { - private TestAllExtensions() { } - private static readonly TestAllExtensions defaultInstance = new TestAllExtensions().MakeReadOnly(); - private static readonly string[] _testAllExtensionsFieldNames = new string[] { }; - private static readonly uint[] _testAllExtensionsFieldTags = new uint[] { }; - public static TestAllExtensions DefaultInstance { - get { return defaultInstance; } - } - - public override TestAllExtensions DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestAllExtensions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllExtensions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestAllExtensions__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testAllExtensionsFieldNames; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - extensionWriter.WriteUntil(536870912, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestAllExtensions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestAllExtensions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestAllExtensions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestAllExtensions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestAllExtensions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestAllExtensions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestAllExtensions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestAllExtensions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestAllExtensions ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestAllExtensions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestAllExtensions MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestAllExtensions prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestAllExtensions cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestAllExtensions result; - - private TestAllExtensions PrepareBuilder() { - if (resultIsReadOnly) { - TestAllExtensions original = result; - result = new TestAllExtensions(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestAllExtensions MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestAllExtensions.Descriptor; } - } - - public override TestAllExtensions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestAllExtensions.DefaultInstance; } - } - - public override TestAllExtensions BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestAllExtensions) { - return MergeFrom((TestAllExtensions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestAllExtensions other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestAllExtensions.DefaultInstance) return this; - PrepareBuilder(); - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testAllExtensionsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testAllExtensionsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static TestAllExtensions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class OptionalGroup_extension : pb::GeneratedMessage { - private OptionalGroup_extension() { } - private static readonly OptionalGroup_extension defaultInstance = new OptionalGroup_extension().MakeReadOnly(); - private static readonly string[] _optionalGroupExtensionFieldNames = new string[] { "a" }; - private static readonly uint[] _optionalGroupExtensionFieldTags = new uint[] { 136 }; - public static OptionalGroup_extension DefaultInstance { - get { return defaultInstance; } - } - - public override OptionalGroup_extension DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override OptionalGroup_extension ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_OptionalGroup_extension__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_OptionalGroup_extension__FieldAccessorTable; } - } - - public const int AFieldNumber = 17; - private bool hasA; - private int a_; - public bool HasA { - get { return hasA; } - } - public int A { - get { return a_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _optionalGroupExtensionFieldNames; - if (hasA) { - output.WriteInt32(17, field_names[0], A); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA) { - size += pb::CodedOutputStream.ComputeInt32Size(17, A); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static OptionalGroup_extension ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OptionalGroup_extension ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OptionalGroup_extension ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OptionalGroup_extension ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OptionalGroup_extension ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OptionalGroup_extension ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static OptionalGroup_extension ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static OptionalGroup_extension ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static OptionalGroup_extension ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OptionalGroup_extension ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private OptionalGroup_extension MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(OptionalGroup_extension prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(OptionalGroup_extension cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private OptionalGroup_extension result; - - private OptionalGroup_extension PrepareBuilder() { - if (resultIsReadOnly) { - OptionalGroup_extension original = result; - result = new OptionalGroup_extension(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override OptionalGroup_extension MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension.Descriptor; } - } - - public override OptionalGroup_extension DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension.DefaultInstance; } - } - - public override OptionalGroup_extension BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is OptionalGroup_extension) { - return MergeFrom((OptionalGroup_extension) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(OptionalGroup_extension other) { - if (other == global::Google.ProtocolBuffers.TestProtos.OptionalGroup_extension.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA) { - A = other.A; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_optionalGroupExtensionFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _optionalGroupExtensionFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 136: { - result.hasA = input.ReadInt32(ref result.a_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasA { - get { return result.hasA; } - } - public int A { - get { return result.A; } - set { SetA(value); } - } - public Builder SetA(int value) { - PrepareBuilder(); - result.hasA = true; - result.a_ = value; - return this; - } - public Builder ClearA() { - PrepareBuilder(); - result.hasA = false; - result.a_ = 0; - return this; - } - } - static OptionalGroup_extension() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class RepeatedGroup_extension : pb::GeneratedMessage { - private RepeatedGroup_extension() { } - private static readonly RepeatedGroup_extension defaultInstance = new RepeatedGroup_extension().MakeReadOnly(); - private static readonly string[] _repeatedGroupExtensionFieldNames = new string[] { "a" }; - private static readonly uint[] _repeatedGroupExtensionFieldTags = new uint[] { 376 }; - public static RepeatedGroup_extension DefaultInstance { - get { return defaultInstance; } - } - - public override RepeatedGroup_extension DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override RepeatedGroup_extension ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_RepeatedGroup_extension__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_RepeatedGroup_extension__FieldAccessorTable; } - } - - public const int AFieldNumber = 47; - private bool hasA; - private int a_; - public bool HasA { - get { return hasA; } - } - public int A { - get { return a_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _repeatedGroupExtensionFieldNames; - if (hasA) { - output.WriteInt32(47, field_names[0], A); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA) { - size += pb::CodedOutputStream.ComputeInt32Size(47, A); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static RepeatedGroup_extension ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RepeatedGroup_extension ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RepeatedGroup_extension ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RepeatedGroup_extension ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RepeatedGroup_extension ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RepeatedGroup_extension ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static RepeatedGroup_extension ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static RepeatedGroup_extension ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static RepeatedGroup_extension ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RepeatedGroup_extension ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private RepeatedGroup_extension MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(RepeatedGroup_extension prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(RepeatedGroup_extension cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private RepeatedGroup_extension result; - - private RepeatedGroup_extension PrepareBuilder() { - if (resultIsReadOnly) { - RepeatedGroup_extension original = result; - result = new RepeatedGroup_extension(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override RepeatedGroup_extension MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension.Descriptor; } - } - - public override RepeatedGroup_extension DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension.DefaultInstance; } - } - - public override RepeatedGroup_extension BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is RepeatedGroup_extension) { - return MergeFrom((RepeatedGroup_extension) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(RepeatedGroup_extension other) { - if (other == global::Google.ProtocolBuffers.TestProtos.RepeatedGroup_extension.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA) { - A = other.A; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_repeatedGroupExtensionFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _repeatedGroupExtensionFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 376: { - result.hasA = input.ReadInt32(ref result.a_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasA { - get { return result.hasA; } - } - public int A { - get { return result.A; } - set { SetA(value); } - } - public Builder SetA(int value) { - PrepareBuilder(); - result.hasA = true; - result.a_ = value; - return this; - } - public Builder ClearA() { - PrepareBuilder(); - result.hasA = false; - result.a_ = 0; - return this; - } - } - static RepeatedGroup_extension() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestNestedExtension : pb::GeneratedMessage { - private TestNestedExtension() { } - private static readonly TestNestedExtension defaultInstance = new TestNestedExtension().MakeReadOnly(); - private static readonly string[] _testNestedExtensionFieldNames = new string[] { }; - private static readonly uint[] _testNestedExtensionFieldTags = new uint[] { }; - public static TestNestedExtension DefaultInstance { - get { return defaultInstance; } - } - - public override TestNestedExtension DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestNestedExtension ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestNestedExtension__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestNestedExtension__FieldAccessorTable; } - } - - public const int TestFieldNumber = 1002; - public static pb::GeneratedExtensionBase Test; - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testNestedExtensionFieldNames; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestNestedExtension ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestNestedExtension ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestNestedExtension ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestNestedExtension ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestNestedExtension ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestNestedExtension ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestNestedExtension ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestNestedExtension ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestNestedExtension ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestNestedExtension ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestNestedExtension MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestNestedExtension prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestNestedExtension cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestNestedExtension result; - - private TestNestedExtension PrepareBuilder() { - if (resultIsReadOnly) { - TestNestedExtension original = result; - result = new TestNestedExtension(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestNestedExtension MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestNestedExtension.Descriptor; } - } - - public override TestNestedExtension DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestNestedExtension.DefaultInstance; } - } - - public override TestNestedExtension BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestNestedExtension) { - return MergeFrom((TestNestedExtension) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestNestedExtension other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestNestedExtension.DefaultInstance) return this; - PrepareBuilder(); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testNestedExtensionFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testNestedExtensionFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static TestNestedExtension() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestRequired : pb::GeneratedMessage { - private TestRequired() { } - private static readonly TestRequired defaultInstance = new TestRequired().MakeReadOnly(); - private static readonly string[] _testRequiredFieldNames = new string[] { "a", "b", "c", "dummy10", "dummy11", "dummy12", "dummy13", "dummy14", "dummy15", "dummy16", "dummy17", "dummy18", "dummy19", "dummy2", "dummy20", "dummy21", "dummy22", "dummy23", "dummy24", "dummy25", "dummy26", "dummy27", "dummy28", "dummy29", "dummy30", "dummy31", "dummy32", "dummy4", "dummy5", "dummy6", "dummy7", "dummy8", "dummy9" }; - private static readonly uint[] _testRequiredFieldTags = new uint[] { 8, 24, 264, 80, 88, 96, 104, 112, 120, 128, 136, 144, 152, 16, 160, 168, 176, 184, 192, 200, 208, 216, 224, 232, 240, 248, 256, 32, 40, 48, 56, 64, 72 }; - public static TestRequired DefaultInstance { - get { return defaultInstance; } - } - - public override TestRequired DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestRequired ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestRequired__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestRequired__FieldAccessorTable; } - } - - public const int SingleFieldNumber = 1000; - public static pb::GeneratedExtensionBase Single; - public const int MultiFieldNumber = 1001; - public static pb::GeneratedExtensionBase> Multi; - public const int AFieldNumber = 1; - private bool hasA; - private int a_; - public bool HasA { - get { return hasA; } - } - public int A { - get { return a_; } - } - - public const int Dummy2FieldNumber = 2; - private bool hasDummy2; - private int dummy2_; - public bool HasDummy2 { - get { return hasDummy2; } - } - public int Dummy2 { - get { return dummy2_; } - } - - public const int BFieldNumber = 3; - private bool hasB; - private int b_; - public bool HasB { - get { return hasB; } - } - public int B { - get { return b_; } - } - - public const int Dummy4FieldNumber = 4; - private bool hasDummy4; - private int dummy4_; - public bool HasDummy4 { - get { return hasDummy4; } - } - public int Dummy4 { - get { return dummy4_; } - } - - public const int Dummy5FieldNumber = 5; - private bool hasDummy5; - private int dummy5_; - public bool HasDummy5 { - get { return hasDummy5; } - } - public int Dummy5 { - get { return dummy5_; } - } - - public const int Dummy6FieldNumber = 6; - private bool hasDummy6; - private int dummy6_; - public bool HasDummy6 { - get { return hasDummy6; } - } - public int Dummy6 { - get { return dummy6_; } - } - - public const int Dummy7FieldNumber = 7; - private bool hasDummy7; - private int dummy7_; - public bool HasDummy7 { - get { return hasDummy7; } - } - public int Dummy7 { - get { return dummy7_; } - } - - public const int Dummy8FieldNumber = 8; - private bool hasDummy8; - private int dummy8_; - public bool HasDummy8 { - get { return hasDummy8; } - } - public int Dummy8 { - get { return dummy8_; } - } - - public const int Dummy9FieldNumber = 9; - private bool hasDummy9; - private int dummy9_; - public bool HasDummy9 { - get { return hasDummy9; } - } - public int Dummy9 { - get { return dummy9_; } - } - - public const int Dummy10FieldNumber = 10; - private bool hasDummy10; - private int dummy10_; - public bool HasDummy10 { - get { return hasDummy10; } - } - public int Dummy10 { - get { return dummy10_; } - } - - public const int Dummy11FieldNumber = 11; - private bool hasDummy11; - private int dummy11_; - public bool HasDummy11 { - get { return hasDummy11; } - } - public int Dummy11 { - get { return dummy11_; } - } - - public const int Dummy12FieldNumber = 12; - private bool hasDummy12; - private int dummy12_; - public bool HasDummy12 { - get { return hasDummy12; } - } - public int Dummy12 { - get { return dummy12_; } - } - - public const int Dummy13FieldNumber = 13; - private bool hasDummy13; - private int dummy13_; - public bool HasDummy13 { - get { return hasDummy13; } - } - public int Dummy13 { - get { return dummy13_; } - } - - public const int Dummy14FieldNumber = 14; - private bool hasDummy14; - private int dummy14_; - public bool HasDummy14 { - get { return hasDummy14; } - } - public int Dummy14 { - get { return dummy14_; } - } - - public const int Dummy15FieldNumber = 15; - private bool hasDummy15; - private int dummy15_; - public bool HasDummy15 { - get { return hasDummy15; } - } - public int Dummy15 { - get { return dummy15_; } - } - - public const int Dummy16FieldNumber = 16; - private bool hasDummy16; - private int dummy16_; - public bool HasDummy16 { - get { return hasDummy16; } - } - public int Dummy16 { - get { return dummy16_; } - } - - public const int Dummy17FieldNumber = 17; - private bool hasDummy17; - private int dummy17_; - public bool HasDummy17 { - get { return hasDummy17; } - } - public int Dummy17 { - get { return dummy17_; } - } - - public const int Dummy18FieldNumber = 18; - private bool hasDummy18; - private int dummy18_; - public bool HasDummy18 { - get { return hasDummy18; } - } - public int Dummy18 { - get { return dummy18_; } - } - - public const int Dummy19FieldNumber = 19; - private bool hasDummy19; - private int dummy19_; - public bool HasDummy19 { - get { return hasDummy19; } - } - public int Dummy19 { - get { return dummy19_; } - } - - public const int Dummy20FieldNumber = 20; - private bool hasDummy20; - private int dummy20_; - public bool HasDummy20 { - get { return hasDummy20; } - } - public int Dummy20 { - get { return dummy20_; } - } - - public const int Dummy21FieldNumber = 21; - private bool hasDummy21; - private int dummy21_; - public bool HasDummy21 { - get { return hasDummy21; } - } - public int Dummy21 { - get { return dummy21_; } - } - - public const int Dummy22FieldNumber = 22; - private bool hasDummy22; - private int dummy22_; - public bool HasDummy22 { - get { return hasDummy22; } - } - public int Dummy22 { - get { return dummy22_; } - } - - public const int Dummy23FieldNumber = 23; - private bool hasDummy23; - private int dummy23_; - public bool HasDummy23 { - get { return hasDummy23; } - } - public int Dummy23 { - get { return dummy23_; } - } - - public const int Dummy24FieldNumber = 24; - private bool hasDummy24; - private int dummy24_; - public bool HasDummy24 { - get { return hasDummy24; } - } - public int Dummy24 { - get { return dummy24_; } - } - - public const int Dummy25FieldNumber = 25; - private bool hasDummy25; - private int dummy25_; - public bool HasDummy25 { - get { return hasDummy25; } - } - public int Dummy25 { - get { return dummy25_; } - } - - public const int Dummy26FieldNumber = 26; - private bool hasDummy26; - private int dummy26_; - public bool HasDummy26 { - get { return hasDummy26; } - } - public int Dummy26 { - get { return dummy26_; } - } - - public const int Dummy27FieldNumber = 27; - private bool hasDummy27; - private int dummy27_; - public bool HasDummy27 { - get { return hasDummy27; } - } - public int Dummy27 { - get { return dummy27_; } - } - - public const int Dummy28FieldNumber = 28; - private bool hasDummy28; - private int dummy28_; - public bool HasDummy28 { - get { return hasDummy28; } - } - public int Dummy28 { - get { return dummy28_; } - } - - public const int Dummy29FieldNumber = 29; - private bool hasDummy29; - private int dummy29_; - public bool HasDummy29 { - get { return hasDummy29; } - } - public int Dummy29 { - get { return dummy29_; } - } - - public const int Dummy30FieldNumber = 30; - private bool hasDummy30; - private int dummy30_; - public bool HasDummy30 { - get { return hasDummy30; } - } - public int Dummy30 { - get { return dummy30_; } - } - - public const int Dummy31FieldNumber = 31; - private bool hasDummy31; - private int dummy31_; - public bool HasDummy31 { - get { return hasDummy31; } - } - public int Dummy31 { - get { return dummy31_; } - } - - public const int Dummy32FieldNumber = 32; - private bool hasDummy32; - private int dummy32_; - public bool HasDummy32 { - get { return hasDummy32; } - } - public int Dummy32 { - get { return dummy32_; } - } - - public const int CFieldNumber = 33; - private bool hasC; - private int c_; - public bool HasC { - get { return hasC; } - } - public int C { - get { return c_; } - } - - public override bool IsInitialized { - get { - if (!hasA) return false; - if (!hasB) return false; - if (!hasC) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testRequiredFieldNames; - if (hasA) { - output.WriteInt32(1, field_names[0], A); - } - if (hasDummy2) { - output.WriteInt32(2, field_names[13], Dummy2); - } - if (hasB) { - output.WriteInt32(3, field_names[1], B); - } - if (hasDummy4) { - output.WriteInt32(4, field_names[27], Dummy4); - } - if (hasDummy5) { - output.WriteInt32(5, field_names[28], Dummy5); - } - if (hasDummy6) { - output.WriteInt32(6, field_names[29], Dummy6); - } - if (hasDummy7) { - output.WriteInt32(7, field_names[30], Dummy7); - } - if (hasDummy8) { - output.WriteInt32(8, field_names[31], Dummy8); - } - if (hasDummy9) { - output.WriteInt32(9, field_names[32], Dummy9); - } - if (hasDummy10) { - output.WriteInt32(10, field_names[3], Dummy10); - } - if (hasDummy11) { - output.WriteInt32(11, field_names[4], Dummy11); - } - if (hasDummy12) { - output.WriteInt32(12, field_names[5], Dummy12); - } - if (hasDummy13) { - output.WriteInt32(13, field_names[6], Dummy13); - } - if (hasDummy14) { - output.WriteInt32(14, field_names[7], Dummy14); - } - if (hasDummy15) { - output.WriteInt32(15, field_names[8], Dummy15); - } - if (hasDummy16) { - output.WriteInt32(16, field_names[9], Dummy16); - } - if (hasDummy17) { - output.WriteInt32(17, field_names[10], Dummy17); - } - if (hasDummy18) { - output.WriteInt32(18, field_names[11], Dummy18); - } - if (hasDummy19) { - output.WriteInt32(19, field_names[12], Dummy19); - } - if (hasDummy20) { - output.WriteInt32(20, field_names[14], Dummy20); - } - if (hasDummy21) { - output.WriteInt32(21, field_names[15], Dummy21); - } - if (hasDummy22) { - output.WriteInt32(22, field_names[16], Dummy22); - } - if (hasDummy23) { - output.WriteInt32(23, field_names[17], Dummy23); - } - if (hasDummy24) { - output.WriteInt32(24, field_names[18], Dummy24); - } - if (hasDummy25) { - output.WriteInt32(25, field_names[19], Dummy25); - } - if (hasDummy26) { - output.WriteInt32(26, field_names[20], Dummy26); - } - if (hasDummy27) { - output.WriteInt32(27, field_names[21], Dummy27); - } - if (hasDummy28) { - output.WriteInt32(28, field_names[22], Dummy28); - } - if (hasDummy29) { - output.WriteInt32(29, field_names[23], Dummy29); - } - if (hasDummy30) { - output.WriteInt32(30, field_names[24], Dummy30); - } - if (hasDummy31) { - output.WriteInt32(31, field_names[25], Dummy31); - } - if (hasDummy32) { - output.WriteInt32(32, field_names[26], Dummy32); - } - if (hasC) { - output.WriteInt32(33, field_names[2], C); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA) { - size += pb::CodedOutputStream.ComputeInt32Size(1, A); - } - if (hasDummy2) { - size += pb::CodedOutputStream.ComputeInt32Size(2, Dummy2); - } - if (hasB) { - size += pb::CodedOutputStream.ComputeInt32Size(3, B); - } - if (hasDummy4) { - size += pb::CodedOutputStream.ComputeInt32Size(4, Dummy4); - } - if (hasDummy5) { - size += pb::CodedOutputStream.ComputeInt32Size(5, Dummy5); - } - if (hasDummy6) { - size += pb::CodedOutputStream.ComputeInt32Size(6, Dummy6); - } - if (hasDummy7) { - size += pb::CodedOutputStream.ComputeInt32Size(7, Dummy7); - } - if (hasDummy8) { - size += pb::CodedOutputStream.ComputeInt32Size(8, Dummy8); - } - if (hasDummy9) { - size += pb::CodedOutputStream.ComputeInt32Size(9, Dummy9); - } - if (hasDummy10) { - size += pb::CodedOutputStream.ComputeInt32Size(10, Dummy10); - } - if (hasDummy11) { - size += pb::CodedOutputStream.ComputeInt32Size(11, Dummy11); - } - if (hasDummy12) { - size += pb::CodedOutputStream.ComputeInt32Size(12, Dummy12); - } - if (hasDummy13) { - size += pb::CodedOutputStream.ComputeInt32Size(13, Dummy13); - } - if (hasDummy14) { - size += pb::CodedOutputStream.ComputeInt32Size(14, Dummy14); - } - if (hasDummy15) { - size += pb::CodedOutputStream.ComputeInt32Size(15, Dummy15); - } - if (hasDummy16) { - size += pb::CodedOutputStream.ComputeInt32Size(16, Dummy16); - } - if (hasDummy17) { - size += pb::CodedOutputStream.ComputeInt32Size(17, Dummy17); - } - if (hasDummy18) { - size += pb::CodedOutputStream.ComputeInt32Size(18, Dummy18); - } - if (hasDummy19) { - size += pb::CodedOutputStream.ComputeInt32Size(19, Dummy19); - } - if (hasDummy20) { - size += pb::CodedOutputStream.ComputeInt32Size(20, Dummy20); - } - if (hasDummy21) { - size += pb::CodedOutputStream.ComputeInt32Size(21, Dummy21); - } - if (hasDummy22) { - size += pb::CodedOutputStream.ComputeInt32Size(22, Dummy22); - } - if (hasDummy23) { - size += pb::CodedOutputStream.ComputeInt32Size(23, Dummy23); - } - if (hasDummy24) { - size += pb::CodedOutputStream.ComputeInt32Size(24, Dummy24); - } - if (hasDummy25) { - size += pb::CodedOutputStream.ComputeInt32Size(25, Dummy25); - } - if (hasDummy26) { - size += pb::CodedOutputStream.ComputeInt32Size(26, Dummy26); - } - if (hasDummy27) { - size += pb::CodedOutputStream.ComputeInt32Size(27, Dummy27); - } - if (hasDummy28) { - size += pb::CodedOutputStream.ComputeInt32Size(28, Dummy28); - } - if (hasDummy29) { - size += pb::CodedOutputStream.ComputeInt32Size(29, Dummy29); - } - if (hasDummy30) { - size += pb::CodedOutputStream.ComputeInt32Size(30, Dummy30); - } - if (hasDummy31) { - size += pb::CodedOutputStream.ComputeInt32Size(31, Dummy31); - } - if (hasDummy32) { - size += pb::CodedOutputStream.ComputeInt32Size(32, Dummy32); - } - if (hasC) { - size += pb::CodedOutputStream.ComputeInt32Size(33, C); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestRequired ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestRequired ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestRequired ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestRequired ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestRequired ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestRequired ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestRequired ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestRequired ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestRequired ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestRequired ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestRequired MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestRequired prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestRequired cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestRequired result; - - private TestRequired PrepareBuilder() { - if (resultIsReadOnly) { - TestRequired original = result; - result = new TestRequired(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestRequired MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestRequired.Descriptor; } - } - - public override TestRequired DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestRequired.DefaultInstance; } - } - - public override TestRequired BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestRequired) { - return MergeFrom((TestRequired) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestRequired other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestRequired.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA) { - A = other.A; - } - if (other.HasDummy2) { - Dummy2 = other.Dummy2; - } - if (other.HasB) { - B = other.B; - } - if (other.HasDummy4) { - Dummy4 = other.Dummy4; - } - if (other.HasDummy5) { - Dummy5 = other.Dummy5; - } - if (other.HasDummy6) { - Dummy6 = other.Dummy6; - } - if (other.HasDummy7) { - Dummy7 = other.Dummy7; - } - if (other.HasDummy8) { - Dummy8 = other.Dummy8; - } - if (other.HasDummy9) { - Dummy9 = other.Dummy9; - } - if (other.HasDummy10) { - Dummy10 = other.Dummy10; - } - if (other.HasDummy11) { - Dummy11 = other.Dummy11; - } - if (other.HasDummy12) { - Dummy12 = other.Dummy12; - } - if (other.HasDummy13) { - Dummy13 = other.Dummy13; - } - if (other.HasDummy14) { - Dummy14 = other.Dummy14; - } - if (other.HasDummy15) { - Dummy15 = other.Dummy15; - } - if (other.HasDummy16) { - Dummy16 = other.Dummy16; - } - if (other.HasDummy17) { - Dummy17 = other.Dummy17; - } - if (other.HasDummy18) { - Dummy18 = other.Dummy18; - } - if (other.HasDummy19) { - Dummy19 = other.Dummy19; - } - if (other.HasDummy20) { - Dummy20 = other.Dummy20; - } - if (other.HasDummy21) { - Dummy21 = other.Dummy21; - } - if (other.HasDummy22) { - Dummy22 = other.Dummy22; - } - if (other.HasDummy23) { - Dummy23 = other.Dummy23; - } - if (other.HasDummy24) { - Dummy24 = other.Dummy24; - } - if (other.HasDummy25) { - Dummy25 = other.Dummy25; - } - if (other.HasDummy26) { - Dummy26 = other.Dummy26; - } - if (other.HasDummy27) { - Dummy27 = other.Dummy27; - } - if (other.HasDummy28) { - Dummy28 = other.Dummy28; - } - if (other.HasDummy29) { - Dummy29 = other.Dummy29; - } - if (other.HasDummy30) { - Dummy30 = other.Dummy30; - } - if (other.HasDummy31) { - Dummy31 = other.Dummy31; - } - if (other.HasDummy32) { - Dummy32 = other.Dummy32; - } - if (other.HasC) { - C = other.C; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testRequiredFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testRequiredFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasA = input.ReadInt32(ref result.a_); - break; - } - case 16: { - result.hasDummy2 = input.ReadInt32(ref result.dummy2_); - break; - } - case 24: { - result.hasB = input.ReadInt32(ref result.b_); - break; - } - case 32: { - result.hasDummy4 = input.ReadInt32(ref result.dummy4_); - break; - } - case 40: { - result.hasDummy5 = input.ReadInt32(ref result.dummy5_); - break; - } - case 48: { - result.hasDummy6 = input.ReadInt32(ref result.dummy6_); - break; - } - case 56: { - result.hasDummy7 = input.ReadInt32(ref result.dummy7_); - break; - } - case 64: { - result.hasDummy8 = input.ReadInt32(ref result.dummy8_); - break; - } - case 72: { - result.hasDummy9 = input.ReadInt32(ref result.dummy9_); - break; - } - case 80: { - result.hasDummy10 = input.ReadInt32(ref result.dummy10_); - break; - } - case 88: { - result.hasDummy11 = input.ReadInt32(ref result.dummy11_); - break; - } - case 96: { - result.hasDummy12 = input.ReadInt32(ref result.dummy12_); - break; - } - case 104: { - result.hasDummy13 = input.ReadInt32(ref result.dummy13_); - break; - } - case 112: { - result.hasDummy14 = input.ReadInt32(ref result.dummy14_); - break; - } - case 120: { - result.hasDummy15 = input.ReadInt32(ref result.dummy15_); - break; - } - case 128: { - result.hasDummy16 = input.ReadInt32(ref result.dummy16_); - break; - } - case 136: { - result.hasDummy17 = input.ReadInt32(ref result.dummy17_); - break; - } - case 144: { - result.hasDummy18 = input.ReadInt32(ref result.dummy18_); - break; - } - case 152: { - result.hasDummy19 = input.ReadInt32(ref result.dummy19_); - break; - } - case 160: { - result.hasDummy20 = input.ReadInt32(ref result.dummy20_); - break; - } - case 168: { - result.hasDummy21 = input.ReadInt32(ref result.dummy21_); - break; - } - case 176: { - result.hasDummy22 = input.ReadInt32(ref result.dummy22_); - break; - } - case 184: { - result.hasDummy23 = input.ReadInt32(ref result.dummy23_); - break; - } - case 192: { - result.hasDummy24 = input.ReadInt32(ref result.dummy24_); - break; - } - case 200: { - result.hasDummy25 = input.ReadInt32(ref result.dummy25_); - break; - } - case 208: { - result.hasDummy26 = input.ReadInt32(ref result.dummy26_); - break; - } - case 216: { - result.hasDummy27 = input.ReadInt32(ref result.dummy27_); - break; - } - case 224: { - result.hasDummy28 = input.ReadInt32(ref result.dummy28_); - break; - } - case 232: { - result.hasDummy29 = input.ReadInt32(ref result.dummy29_); - break; - } - case 240: { - result.hasDummy30 = input.ReadInt32(ref result.dummy30_); - break; - } - case 248: { - result.hasDummy31 = input.ReadInt32(ref result.dummy31_); - break; - } - case 256: { - result.hasDummy32 = input.ReadInt32(ref result.dummy32_); - break; - } - case 264: { - result.hasC = input.ReadInt32(ref result.c_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasA { - get { return result.hasA; } - } - public int A { - get { return result.A; } - set { SetA(value); } - } - public Builder SetA(int value) { - PrepareBuilder(); - result.hasA = true; - result.a_ = value; - return this; - } - public Builder ClearA() { - PrepareBuilder(); - result.hasA = false; - result.a_ = 0; - return this; - } - - public bool HasDummy2 { - get { return result.hasDummy2; } - } - public int Dummy2 { - get { return result.Dummy2; } - set { SetDummy2(value); } - } - public Builder SetDummy2(int value) { - PrepareBuilder(); - result.hasDummy2 = true; - result.dummy2_ = value; - return this; - } - public Builder ClearDummy2() { - PrepareBuilder(); - result.hasDummy2 = false; - result.dummy2_ = 0; - return this; - } - - public bool HasB { - get { return result.hasB; } - } - public int B { - get { return result.B; } - set { SetB(value); } - } - public Builder SetB(int value) { - PrepareBuilder(); - result.hasB = true; - result.b_ = value; - return this; - } - public Builder ClearB() { - PrepareBuilder(); - result.hasB = false; - result.b_ = 0; - return this; - } - - public bool HasDummy4 { - get { return result.hasDummy4; } - } - public int Dummy4 { - get { return result.Dummy4; } - set { SetDummy4(value); } - } - public Builder SetDummy4(int value) { - PrepareBuilder(); - result.hasDummy4 = true; - result.dummy4_ = value; - return this; - } - public Builder ClearDummy4() { - PrepareBuilder(); - result.hasDummy4 = false; - result.dummy4_ = 0; - return this; - } - - public bool HasDummy5 { - get { return result.hasDummy5; } - } - public int Dummy5 { - get { return result.Dummy5; } - set { SetDummy5(value); } - } - public Builder SetDummy5(int value) { - PrepareBuilder(); - result.hasDummy5 = true; - result.dummy5_ = value; - return this; - } - public Builder ClearDummy5() { - PrepareBuilder(); - result.hasDummy5 = false; - result.dummy5_ = 0; - return this; - } - - public bool HasDummy6 { - get { return result.hasDummy6; } - } - public int Dummy6 { - get { return result.Dummy6; } - set { SetDummy6(value); } - } - public Builder SetDummy6(int value) { - PrepareBuilder(); - result.hasDummy6 = true; - result.dummy6_ = value; - return this; - } - public Builder ClearDummy6() { - PrepareBuilder(); - result.hasDummy6 = false; - result.dummy6_ = 0; - return this; - } - - public bool HasDummy7 { - get { return result.hasDummy7; } - } - public int Dummy7 { - get { return result.Dummy7; } - set { SetDummy7(value); } - } - public Builder SetDummy7(int value) { - PrepareBuilder(); - result.hasDummy7 = true; - result.dummy7_ = value; - return this; - } - public Builder ClearDummy7() { - PrepareBuilder(); - result.hasDummy7 = false; - result.dummy7_ = 0; - return this; - } - - public bool HasDummy8 { - get { return result.hasDummy8; } - } - public int Dummy8 { - get { return result.Dummy8; } - set { SetDummy8(value); } - } - public Builder SetDummy8(int value) { - PrepareBuilder(); - result.hasDummy8 = true; - result.dummy8_ = value; - return this; - } - public Builder ClearDummy8() { - PrepareBuilder(); - result.hasDummy8 = false; - result.dummy8_ = 0; - return this; - } - - public bool HasDummy9 { - get { return result.hasDummy9; } - } - public int Dummy9 { - get { return result.Dummy9; } - set { SetDummy9(value); } - } - public Builder SetDummy9(int value) { - PrepareBuilder(); - result.hasDummy9 = true; - result.dummy9_ = value; - return this; - } - public Builder ClearDummy9() { - PrepareBuilder(); - result.hasDummy9 = false; - result.dummy9_ = 0; - return this; - } - - public bool HasDummy10 { - get { return result.hasDummy10; } - } - public int Dummy10 { - get { return result.Dummy10; } - set { SetDummy10(value); } - } - public Builder SetDummy10(int value) { - PrepareBuilder(); - result.hasDummy10 = true; - result.dummy10_ = value; - return this; - } - public Builder ClearDummy10() { - PrepareBuilder(); - result.hasDummy10 = false; - result.dummy10_ = 0; - return this; - } - - public bool HasDummy11 { - get { return result.hasDummy11; } - } - public int Dummy11 { - get { return result.Dummy11; } - set { SetDummy11(value); } - } - public Builder SetDummy11(int value) { - PrepareBuilder(); - result.hasDummy11 = true; - result.dummy11_ = value; - return this; - } - public Builder ClearDummy11() { - PrepareBuilder(); - result.hasDummy11 = false; - result.dummy11_ = 0; - return this; - } - - public bool HasDummy12 { - get { return result.hasDummy12; } - } - public int Dummy12 { - get { return result.Dummy12; } - set { SetDummy12(value); } - } - public Builder SetDummy12(int value) { - PrepareBuilder(); - result.hasDummy12 = true; - result.dummy12_ = value; - return this; - } - public Builder ClearDummy12() { - PrepareBuilder(); - result.hasDummy12 = false; - result.dummy12_ = 0; - return this; - } - - public bool HasDummy13 { - get { return result.hasDummy13; } - } - public int Dummy13 { - get { return result.Dummy13; } - set { SetDummy13(value); } - } - public Builder SetDummy13(int value) { - PrepareBuilder(); - result.hasDummy13 = true; - result.dummy13_ = value; - return this; - } - public Builder ClearDummy13() { - PrepareBuilder(); - result.hasDummy13 = false; - result.dummy13_ = 0; - return this; - } - - public bool HasDummy14 { - get { return result.hasDummy14; } - } - public int Dummy14 { - get { return result.Dummy14; } - set { SetDummy14(value); } - } - public Builder SetDummy14(int value) { - PrepareBuilder(); - result.hasDummy14 = true; - result.dummy14_ = value; - return this; - } - public Builder ClearDummy14() { - PrepareBuilder(); - result.hasDummy14 = false; - result.dummy14_ = 0; - return this; - } - - public bool HasDummy15 { - get { return result.hasDummy15; } - } - public int Dummy15 { - get { return result.Dummy15; } - set { SetDummy15(value); } - } - public Builder SetDummy15(int value) { - PrepareBuilder(); - result.hasDummy15 = true; - result.dummy15_ = value; - return this; - } - public Builder ClearDummy15() { - PrepareBuilder(); - result.hasDummy15 = false; - result.dummy15_ = 0; - return this; - } - - public bool HasDummy16 { - get { return result.hasDummy16; } - } - public int Dummy16 { - get { return result.Dummy16; } - set { SetDummy16(value); } - } - public Builder SetDummy16(int value) { - PrepareBuilder(); - result.hasDummy16 = true; - result.dummy16_ = value; - return this; - } - public Builder ClearDummy16() { - PrepareBuilder(); - result.hasDummy16 = false; - result.dummy16_ = 0; - return this; - } - - public bool HasDummy17 { - get { return result.hasDummy17; } - } - public int Dummy17 { - get { return result.Dummy17; } - set { SetDummy17(value); } - } - public Builder SetDummy17(int value) { - PrepareBuilder(); - result.hasDummy17 = true; - result.dummy17_ = value; - return this; - } - public Builder ClearDummy17() { - PrepareBuilder(); - result.hasDummy17 = false; - result.dummy17_ = 0; - return this; - } - - public bool HasDummy18 { - get { return result.hasDummy18; } - } - public int Dummy18 { - get { return result.Dummy18; } - set { SetDummy18(value); } - } - public Builder SetDummy18(int value) { - PrepareBuilder(); - result.hasDummy18 = true; - result.dummy18_ = value; - return this; - } - public Builder ClearDummy18() { - PrepareBuilder(); - result.hasDummy18 = false; - result.dummy18_ = 0; - return this; - } - - public bool HasDummy19 { - get { return result.hasDummy19; } - } - public int Dummy19 { - get { return result.Dummy19; } - set { SetDummy19(value); } - } - public Builder SetDummy19(int value) { - PrepareBuilder(); - result.hasDummy19 = true; - result.dummy19_ = value; - return this; - } - public Builder ClearDummy19() { - PrepareBuilder(); - result.hasDummy19 = false; - result.dummy19_ = 0; - return this; - } - - public bool HasDummy20 { - get { return result.hasDummy20; } - } - public int Dummy20 { - get { return result.Dummy20; } - set { SetDummy20(value); } - } - public Builder SetDummy20(int value) { - PrepareBuilder(); - result.hasDummy20 = true; - result.dummy20_ = value; - return this; - } - public Builder ClearDummy20() { - PrepareBuilder(); - result.hasDummy20 = false; - result.dummy20_ = 0; - return this; - } - - public bool HasDummy21 { - get { return result.hasDummy21; } - } - public int Dummy21 { - get { return result.Dummy21; } - set { SetDummy21(value); } - } - public Builder SetDummy21(int value) { - PrepareBuilder(); - result.hasDummy21 = true; - result.dummy21_ = value; - return this; - } - public Builder ClearDummy21() { - PrepareBuilder(); - result.hasDummy21 = false; - result.dummy21_ = 0; - return this; - } - - public bool HasDummy22 { - get { return result.hasDummy22; } - } - public int Dummy22 { - get { return result.Dummy22; } - set { SetDummy22(value); } - } - public Builder SetDummy22(int value) { - PrepareBuilder(); - result.hasDummy22 = true; - result.dummy22_ = value; - return this; - } - public Builder ClearDummy22() { - PrepareBuilder(); - result.hasDummy22 = false; - result.dummy22_ = 0; - return this; - } - - public bool HasDummy23 { - get { return result.hasDummy23; } - } - public int Dummy23 { - get { return result.Dummy23; } - set { SetDummy23(value); } - } - public Builder SetDummy23(int value) { - PrepareBuilder(); - result.hasDummy23 = true; - result.dummy23_ = value; - return this; - } - public Builder ClearDummy23() { - PrepareBuilder(); - result.hasDummy23 = false; - result.dummy23_ = 0; - return this; - } - - public bool HasDummy24 { - get { return result.hasDummy24; } - } - public int Dummy24 { - get { return result.Dummy24; } - set { SetDummy24(value); } - } - public Builder SetDummy24(int value) { - PrepareBuilder(); - result.hasDummy24 = true; - result.dummy24_ = value; - return this; - } - public Builder ClearDummy24() { - PrepareBuilder(); - result.hasDummy24 = false; - result.dummy24_ = 0; - return this; - } - - public bool HasDummy25 { - get { return result.hasDummy25; } - } - public int Dummy25 { - get { return result.Dummy25; } - set { SetDummy25(value); } - } - public Builder SetDummy25(int value) { - PrepareBuilder(); - result.hasDummy25 = true; - result.dummy25_ = value; - return this; - } - public Builder ClearDummy25() { - PrepareBuilder(); - result.hasDummy25 = false; - result.dummy25_ = 0; - return this; - } - - public bool HasDummy26 { - get { return result.hasDummy26; } - } - public int Dummy26 { - get { return result.Dummy26; } - set { SetDummy26(value); } - } - public Builder SetDummy26(int value) { - PrepareBuilder(); - result.hasDummy26 = true; - result.dummy26_ = value; - return this; - } - public Builder ClearDummy26() { - PrepareBuilder(); - result.hasDummy26 = false; - result.dummy26_ = 0; - return this; - } - - public bool HasDummy27 { - get { return result.hasDummy27; } - } - public int Dummy27 { - get { return result.Dummy27; } - set { SetDummy27(value); } - } - public Builder SetDummy27(int value) { - PrepareBuilder(); - result.hasDummy27 = true; - result.dummy27_ = value; - return this; - } - public Builder ClearDummy27() { - PrepareBuilder(); - result.hasDummy27 = false; - result.dummy27_ = 0; - return this; - } - - public bool HasDummy28 { - get { return result.hasDummy28; } - } - public int Dummy28 { - get { return result.Dummy28; } - set { SetDummy28(value); } - } - public Builder SetDummy28(int value) { - PrepareBuilder(); - result.hasDummy28 = true; - result.dummy28_ = value; - return this; - } - public Builder ClearDummy28() { - PrepareBuilder(); - result.hasDummy28 = false; - result.dummy28_ = 0; - return this; - } - - public bool HasDummy29 { - get { return result.hasDummy29; } - } - public int Dummy29 { - get { return result.Dummy29; } - set { SetDummy29(value); } - } - public Builder SetDummy29(int value) { - PrepareBuilder(); - result.hasDummy29 = true; - result.dummy29_ = value; - return this; - } - public Builder ClearDummy29() { - PrepareBuilder(); - result.hasDummy29 = false; - result.dummy29_ = 0; - return this; - } - - public bool HasDummy30 { - get { return result.hasDummy30; } - } - public int Dummy30 { - get { return result.Dummy30; } - set { SetDummy30(value); } - } - public Builder SetDummy30(int value) { - PrepareBuilder(); - result.hasDummy30 = true; - result.dummy30_ = value; - return this; - } - public Builder ClearDummy30() { - PrepareBuilder(); - result.hasDummy30 = false; - result.dummy30_ = 0; - return this; - } - - public bool HasDummy31 { - get { return result.hasDummy31; } - } - public int Dummy31 { - get { return result.Dummy31; } - set { SetDummy31(value); } - } - public Builder SetDummy31(int value) { - PrepareBuilder(); - result.hasDummy31 = true; - result.dummy31_ = value; - return this; - } - public Builder ClearDummy31() { - PrepareBuilder(); - result.hasDummy31 = false; - result.dummy31_ = 0; - return this; - } - - public bool HasDummy32 { - get { return result.hasDummy32; } - } - public int Dummy32 { - get { return result.Dummy32; } - set { SetDummy32(value); } - } - public Builder SetDummy32(int value) { - PrepareBuilder(); - result.hasDummy32 = true; - result.dummy32_ = value; - return this; - } - public Builder ClearDummy32() { - PrepareBuilder(); - result.hasDummy32 = false; - result.dummy32_ = 0; - return this; - } - - public bool HasC { - get { return result.hasC; } - } - public int C { - get { return result.C; } - set { SetC(value); } - } - public Builder SetC(int value) { - PrepareBuilder(); - result.hasC = true; - result.c_ = value; - return this; - } - public Builder ClearC() { - PrepareBuilder(); - result.hasC = false; - result.c_ = 0; - return this; - } - } - static TestRequired() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestRequiredForeign : pb::GeneratedMessage { - private TestRequiredForeign() { } - private static readonly TestRequiredForeign defaultInstance = new TestRequiredForeign().MakeReadOnly(); - private static readonly string[] _testRequiredForeignFieldNames = new string[] { "dummy", "optional_message", "repeated_message" }; - private static readonly uint[] _testRequiredForeignFieldTags = new uint[] { 24, 10, 18 }; - public static TestRequiredForeign DefaultInstance { - get { return defaultInstance; } - } - - public override TestRequiredForeign DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestRequiredForeign ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestRequiredForeign__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestRequiredForeign__FieldAccessorTable; } - } - - public const int OptionalMessageFieldNumber = 1; - private bool hasOptionalMessage; - private global::Google.ProtocolBuffers.TestProtos.TestRequired optionalMessage_; - public bool HasOptionalMessage { - get { return hasOptionalMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.TestRequired OptionalMessage { - get { return optionalMessage_ ?? global::Google.ProtocolBuffers.TestProtos.TestRequired.DefaultInstance; } - } - - public const int RepeatedMessageFieldNumber = 2; - private pbc::PopsicleList repeatedMessage_ = new pbc::PopsicleList(); - public scg::IList RepeatedMessageList { - get { return repeatedMessage_; } - } - public int RepeatedMessageCount { - get { return repeatedMessage_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.TestRequired GetRepeatedMessage(int index) { - return repeatedMessage_[index]; - } - - public const int DummyFieldNumber = 3; - private bool hasDummy; - private int dummy_; - public bool HasDummy { - get { return hasDummy; } - } - public int Dummy { - get { return dummy_; } - } - - public override bool IsInitialized { - get { - if (HasOptionalMessage) { - if (!OptionalMessage.IsInitialized) return false; - } - foreach (global::Google.ProtocolBuffers.TestProtos.TestRequired element in RepeatedMessageList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testRequiredForeignFieldNames; - if (hasOptionalMessage) { - output.WriteMessage(1, field_names[1], OptionalMessage); - } - if (repeatedMessage_.Count > 0) { - output.WriteMessageArray(2, field_names[2], repeatedMessage_); - } - if (hasDummy) { - output.WriteInt32(3, field_names[0], Dummy); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasOptionalMessage) { - size += pb::CodedOutputStream.ComputeMessageSize(1, OptionalMessage); - } - foreach (global::Google.ProtocolBuffers.TestProtos.TestRequired element in RepeatedMessageList) { - size += pb::CodedOutputStream.ComputeMessageSize(2, element); - } - if (hasDummy) { - size += pb::CodedOutputStream.ComputeInt32Size(3, Dummy); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestRequiredForeign ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestRequiredForeign ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestRequiredForeign ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestRequiredForeign ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestRequiredForeign ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestRequiredForeign ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestRequiredForeign ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestRequiredForeign ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestRequiredForeign ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestRequiredForeign ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestRequiredForeign MakeReadOnly() { - repeatedMessage_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestRequiredForeign prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestRequiredForeign cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestRequiredForeign result; - - private TestRequiredForeign PrepareBuilder() { - if (resultIsReadOnly) { - TestRequiredForeign original = result; - result = new TestRequiredForeign(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestRequiredForeign MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestRequiredForeign.Descriptor; } - } - - public override TestRequiredForeign DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestRequiredForeign.DefaultInstance; } - } - - public override TestRequiredForeign BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestRequiredForeign) { - return MergeFrom((TestRequiredForeign) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestRequiredForeign other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestRequiredForeign.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasOptionalMessage) { - MergeOptionalMessage(other.OptionalMessage); - } - if (other.repeatedMessage_.Count != 0) { - result.repeatedMessage_.Add(other.repeatedMessage_); - } - if (other.HasDummy) { - Dummy = other.Dummy; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testRequiredForeignFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testRequiredForeignFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - global::Google.ProtocolBuffers.TestProtos.TestRequired.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestRequired.CreateBuilder(); - if (result.hasOptionalMessage) { - subBuilder.MergeFrom(OptionalMessage); - } - input.ReadMessage(subBuilder, extensionRegistry); - OptionalMessage = subBuilder.BuildPartial(); - break; - } - case 18: { - input.ReadMessageArray(tag, field_name, result.repeatedMessage_, global::Google.ProtocolBuffers.TestProtos.TestRequired.DefaultInstance, extensionRegistry); - break; - } - case 24: { - result.hasDummy = input.ReadInt32(ref result.dummy_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasOptionalMessage { - get { return result.hasOptionalMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.TestRequired OptionalMessage { - get { return result.OptionalMessage; } - set { SetOptionalMessage(value); } - } - public Builder SetOptionalMessage(global::Google.ProtocolBuffers.TestProtos.TestRequired value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalMessage = true; - result.optionalMessage_ = value; - return this; - } - public Builder SetOptionalMessage(global::Google.ProtocolBuffers.TestProtos.TestRequired.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptionalMessage = true; - result.optionalMessage_ = builderForValue.Build(); - return this; - } - public Builder MergeOptionalMessage(global::Google.ProtocolBuffers.TestProtos.TestRequired value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptionalMessage && - result.optionalMessage_ != global::Google.ProtocolBuffers.TestProtos.TestRequired.DefaultInstance) { - result.optionalMessage_ = global::Google.ProtocolBuffers.TestProtos.TestRequired.CreateBuilder(result.optionalMessage_).MergeFrom(value).BuildPartial(); - } else { - result.optionalMessage_ = value; - } - result.hasOptionalMessage = true; - return this; - } - public Builder ClearOptionalMessage() { - PrepareBuilder(); - result.hasOptionalMessage = false; - result.optionalMessage_ = null; - return this; - } - - public pbc::IPopsicleList RepeatedMessageList { - get { return PrepareBuilder().repeatedMessage_; } - } - public int RepeatedMessageCount { - get { return result.RepeatedMessageCount; } - } - public global::Google.ProtocolBuffers.TestProtos.TestRequired GetRepeatedMessage(int index) { - return result.GetRepeatedMessage(index); - } - public Builder SetRepeatedMessage(int index, global::Google.ProtocolBuffers.TestProtos.TestRequired value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedMessage_[index] = value; - return this; - } - public Builder SetRepeatedMessage(int index, global::Google.ProtocolBuffers.TestProtos.TestRequired.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedMessage_[index] = builderForValue.Build(); - return this; - } - public Builder AddRepeatedMessage(global::Google.ProtocolBuffers.TestProtos.TestRequired value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedMessage_.Add(value); - return this; - } - public Builder AddRepeatedMessage(global::Google.ProtocolBuffers.TestProtos.TestRequired.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedMessage_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeRepeatedMessage(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedMessage_.Add(values); - return this; - } - public Builder ClearRepeatedMessage() { - PrepareBuilder(); - result.repeatedMessage_.Clear(); - return this; - } - - public bool HasDummy { - get { return result.hasDummy; } - } - public int Dummy { - get { return result.Dummy; } - set { SetDummy(value); } - } - public Builder SetDummy(int value) { - PrepareBuilder(); - result.hasDummy = true; - result.dummy_ = value; - return this; - } - public Builder ClearDummy() { - PrepareBuilder(); - result.hasDummy = false; - result.dummy_ = 0; - return this; - } - } - static TestRequiredForeign() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestForeignNested : pb::GeneratedMessage { - private TestForeignNested() { } - private static readonly TestForeignNested defaultInstance = new TestForeignNested().MakeReadOnly(); - private static readonly string[] _testForeignNestedFieldNames = new string[] { "foreign_nested" }; - private static readonly uint[] _testForeignNestedFieldTags = new uint[] { 10 }; - public static TestForeignNested DefaultInstance { - get { return defaultInstance; } - } - - public override TestForeignNested DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestForeignNested ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestForeignNested__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestForeignNested__FieldAccessorTable; } - } - - public const int ForeignNestedFieldNumber = 1; - private bool hasForeignNested; - private global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage foreignNested_; - public bool HasForeignNested { - get { return hasForeignNested; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage ForeignNested { - get { return foreignNested_ ?? global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.DefaultInstance; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testForeignNestedFieldNames; - if (hasForeignNested) { - output.WriteMessage(1, field_names[0], ForeignNested); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasForeignNested) { - size += pb::CodedOutputStream.ComputeMessageSize(1, ForeignNested); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestForeignNested ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestForeignNested ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestForeignNested ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestForeignNested ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestForeignNested ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestForeignNested ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestForeignNested ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestForeignNested ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestForeignNested ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestForeignNested ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestForeignNested MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestForeignNested prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestForeignNested cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestForeignNested result; - - private TestForeignNested PrepareBuilder() { - if (resultIsReadOnly) { - TestForeignNested original = result; - result = new TestForeignNested(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestForeignNested MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestForeignNested.Descriptor; } - } - - public override TestForeignNested DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestForeignNested.DefaultInstance; } - } - - public override TestForeignNested BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestForeignNested) { - return MergeFrom((TestForeignNested) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestForeignNested other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestForeignNested.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasForeignNested) { - MergeForeignNested(other.ForeignNested); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testForeignNestedFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testForeignNestedFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.CreateBuilder(); - if (result.hasForeignNested) { - subBuilder.MergeFrom(ForeignNested); - } - input.ReadMessage(subBuilder, extensionRegistry); - ForeignNested = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasForeignNested { - get { return result.hasForeignNested; } - } - public global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage ForeignNested { - get { return result.ForeignNested; } - set { SetForeignNested(value); } - } - public Builder SetForeignNested(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasForeignNested = true; - result.foreignNested_ = value; - return this; - } - public Builder SetForeignNested(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasForeignNested = true; - result.foreignNested_ = builderForValue.Build(); - return this; - } - public Builder MergeForeignNested(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasForeignNested && - result.foreignNested_ != global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.DefaultInstance) { - result.foreignNested_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage.CreateBuilder(result.foreignNested_).MergeFrom(value).BuildPartial(); - } else { - result.foreignNested_ = value; - } - result.hasForeignNested = true; - return this; - } - public Builder ClearForeignNested() { - PrepareBuilder(); - result.hasForeignNested = false; - result.foreignNested_ = null; - return this; - } - } - static TestForeignNested() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestEmptyMessage : pb::GeneratedMessage { - private TestEmptyMessage() { } - private static readonly TestEmptyMessage defaultInstance = new TestEmptyMessage().MakeReadOnly(); - private static readonly string[] _testEmptyMessageFieldNames = new string[] { }; - private static readonly uint[] _testEmptyMessageFieldTags = new uint[] { }; - public static TestEmptyMessage DefaultInstance { - get { return defaultInstance; } - } - - public override TestEmptyMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestEmptyMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestEmptyMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestEmptyMessage__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testEmptyMessageFieldNames; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestEmptyMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestEmptyMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestEmptyMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestEmptyMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestEmptyMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestEmptyMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestEmptyMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestEmptyMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestEmptyMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestEmptyMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestEmptyMessage MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestEmptyMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestEmptyMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestEmptyMessage result; - - private TestEmptyMessage PrepareBuilder() { - if (resultIsReadOnly) { - TestEmptyMessage original = result; - result = new TestEmptyMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestEmptyMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestEmptyMessage.Descriptor; } - } - - public override TestEmptyMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestEmptyMessage.DefaultInstance; } - } - - public override TestEmptyMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestEmptyMessage) { - return MergeFrom((TestEmptyMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestEmptyMessage other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestEmptyMessage.DefaultInstance) return this; - PrepareBuilder(); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testEmptyMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testEmptyMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static TestEmptyMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestEmptyMessageWithExtensions : pb::ExtendableMessage { - private TestEmptyMessageWithExtensions() { } - private static readonly TestEmptyMessageWithExtensions defaultInstance = new TestEmptyMessageWithExtensions().MakeReadOnly(); - private static readonly string[] _testEmptyMessageWithExtensionsFieldNames = new string[] { }; - private static readonly uint[] _testEmptyMessageWithExtensionsFieldTags = new uint[] { }; - public static TestEmptyMessageWithExtensions DefaultInstance { - get { return defaultInstance; } - } - - public override TestEmptyMessageWithExtensions DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestEmptyMessageWithExtensions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestEmptyMessageWithExtensions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestEmptyMessageWithExtensions__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testEmptyMessageWithExtensionsFieldNames; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - extensionWriter.WriteUntil(536870912, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestEmptyMessageWithExtensions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestEmptyMessageWithExtensions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestEmptyMessageWithExtensions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestEmptyMessageWithExtensions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestEmptyMessageWithExtensions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestEmptyMessageWithExtensions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestEmptyMessageWithExtensions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestEmptyMessageWithExtensions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestEmptyMessageWithExtensions ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestEmptyMessageWithExtensions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestEmptyMessageWithExtensions MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestEmptyMessageWithExtensions prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestEmptyMessageWithExtensions cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestEmptyMessageWithExtensions result; - - private TestEmptyMessageWithExtensions PrepareBuilder() { - if (resultIsReadOnly) { - TestEmptyMessageWithExtensions original = result; - result = new TestEmptyMessageWithExtensions(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestEmptyMessageWithExtensions MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestEmptyMessageWithExtensions.Descriptor; } - } - - public override TestEmptyMessageWithExtensions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestEmptyMessageWithExtensions.DefaultInstance; } - } - - public override TestEmptyMessageWithExtensions BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestEmptyMessageWithExtensions) { - return MergeFrom((TestEmptyMessageWithExtensions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestEmptyMessageWithExtensions other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestEmptyMessageWithExtensions.DefaultInstance) return this; - PrepareBuilder(); - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testEmptyMessageWithExtensionsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testEmptyMessageWithExtensionsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static TestEmptyMessageWithExtensions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestMultipleExtensionRanges : pb::ExtendableMessage { - private TestMultipleExtensionRanges() { } - private static readonly TestMultipleExtensionRanges defaultInstance = new TestMultipleExtensionRanges().MakeReadOnly(); - private static readonly string[] _testMultipleExtensionRangesFieldNames = new string[] { }; - private static readonly uint[] _testMultipleExtensionRangesFieldTags = new uint[] { }; - public static TestMultipleExtensionRanges DefaultInstance { - get { return defaultInstance; } - } - - public override TestMultipleExtensionRanges DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestMultipleExtensionRanges ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestMultipleExtensionRanges__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestMultipleExtensionRanges__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testMultipleExtensionRangesFieldNames; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - extensionWriter.WriteUntil(43, output); - extensionWriter.WriteUntil(4244, output); - extensionWriter.WriteUntil(536870912, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestMultipleExtensionRanges ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestMultipleExtensionRanges ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestMultipleExtensionRanges ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestMultipleExtensionRanges ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestMultipleExtensionRanges ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestMultipleExtensionRanges ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestMultipleExtensionRanges ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestMultipleExtensionRanges ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestMultipleExtensionRanges ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestMultipleExtensionRanges ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestMultipleExtensionRanges MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestMultipleExtensionRanges prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestMultipleExtensionRanges cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestMultipleExtensionRanges result; - - private TestMultipleExtensionRanges PrepareBuilder() { - if (resultIsReadOnly) { - TestMultipleExtensionRanges original = result; - result = new TestMultipleExtensionRanges(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestMultipleExtensionRanges MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestMultipleExtensionRanges.Descriptor; } - } - - public override TestMultipleExtensionRanges DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestMultipleExtensionRanges.DefaultInstance; } - } - - public override TestMultipleExtensionRanges BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestMultipleExtensionRanges) { - return MergeFrom((TestMultipleExtensionRanges) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestMultipleExtensionRanges other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestMultipleExtensionRanges.DefaultInstance) return this; - PrepareBuilder(); - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testMultipleExtensionRangesFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testMultipleExtensionRangesFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static TestMultipleExtensionRanges() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestReallyLargeTagNumber : pb::GeneratedMessage { - private TestReallyLargeTagNumber() { } - private static readonly TestReallyLargeTagNumber defaultInstance = new TestReallyLargeTagNumber().MakeReadOnly(); - private static readonly string[] _testReallyLargeTagNumberFieldNames = new string[] { "a", "bb" }; - private static readonly uint[] _testReallyLargeTagNumberFieldTags = new uint[] { 8, 2147483640 }; - public static TestReallyLargeTagNumber DefaultInstance { - get { return defaultInstance; } - } - - public override TestReallyLargeTagNumber DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestReallyLargeTagNumber ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestReallyLargeTagNumber__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestReallyLargeTagNumber__FieldAccessorTable; } - } - - public const int AFieldNumber = 1; - private bool hasA; - private int a_; - public bool HasA { - get { return hasA; } - } - public int A { - get { return a_; } - } - - public const int BbFieldNumber = 268435455; - private bool hasBb; - private int bb_; - public bool HasBb { - get { return hasBb; } - } - public int Bb { - get { return bb_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testReallyLargeTagNumberFieldNames; - if (hasA) { - output.WriteInt32(1, field_names[0], A); - } - if (hasBb) { - output.WriteInt32(268435455, field_names[1], Bb); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA) { - size += pb::CodedOutputStream.ComputeInt32Size(1, A); - } - if (hasBb) { - size += pb::CodedOutputStream.ComputeInt32Size(268435455, Bb); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestReallyLargeTagNumber ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestReallyLargeTagNumber ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestReallyLargeTagNumber ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestReallyLargeTagNumber ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestReallyLargeTagNumber ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestReallyLargeTagNumber ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestReallyLargeTagNumber ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestReallyLargeTagNumber ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestReallyLargeTagNumber ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestReallyLargeTagNumber ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestReallyLargeTagNumber MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestReallyLargeTagNumber prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestReallyLargeTagNumber cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestReallyLargeTagNumber result; - - private TestReallyLargeTagNumber PrepareBuilder() { - if (resultIsReadOnly) { - TestReallyLargeTagNumber original = result; - result = new TestReallyLargeTagNumber(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestReallyLargeTagNumber MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestReallyLargeTagNumber.Descriptor; } - } - - public override TestReallyLargeTagNumber DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestReallyLargeTagNumber.DefaultInstance; } - } - - public override TestReallyLargeTagNumber BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestReallyLargeTagNumber) { - return MergeFrom((TestReallyLargeTagNumber) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestReallyLargeTagNumber other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestReallyLargeTagNumber.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA) { - A = other.A; - } - if (other.HasBb) { - Bb = other.Bb; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testReallyLargeTagNumberFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testReallyLargeTagNumberFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasA = input.ReadInt32(ref result.a_); - break; - } - case 2147483640: { - result.hasBb = input.ReadInt32(ref result.bb_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasA { - get { return result.hasA; } - } - public int A { - get { return result.A; } - set { SetA(value); } - } - public Builder SetA(int value) { - PrepareBuilder(); - result.hasA = true; - result.a_ = value; - return this; - } - public Builder ClearA() { - PrepareBuilder(); - result.hasA = false; - result.a_ = 0; - return this; - } - - public bool HasBb { - get { return result.hasBb; } - } - public int Bb { - get { return result.Bb; } - set { SetBb(value); } - } - public Builder SetBb(int value) { - PrepareBuilder(); - result.hasBb = true; - result.bb_ = value; - return this; - } - public Builder ClearBb() { - PrepareBuilder(); - result.hasBb = false; - result.bb_ = 0; - return this; - } - } - static TestReallyLargeTagNumber() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestRecursiveMessage : pb::GeneratedMessage { - private TestRecursiveMessage() { } - private static readonly TestRecursiveMessage defaultInstance = new TestRecursiveMessage().MakeReadOnly(); - private static readonly string[] _testRecursiveMessageFieldNames = new string[] { "a", "i" }; - private static readonly uint[] _testRecursiveMessageFieldTags = new uint[] { 10, 16 }; - public static TestRecursiveMessage DefaultInstance { - get { return defaultInstance; } - } - - public override TestRecursiveMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestRecursiveMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestRecursiveMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestRecursiveMessage__FieldAccessorTable; } - } - - public const int AFieldNumber = 1; - private bool hasA; - private global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage a_; - public bool HasA { - get { return hasA; } - } - public global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage A { - get { return a_ ?? global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.DefaultInstance; } - } - - public const int IFieldNumber = 2; - private bool hasI; - private int i_; - public bool HasI { - get { return hasI; } - } - public int I { - get { return i_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testRecursiveMessageFieldNames; - if (hasA) { - output.WriteMessage(1, field_names[0], A); - } - if (hasI) { - output.WriteInt32(2, field_names[1], I); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA) { - size += pb::CodedOutputStream.ComputeMessageSize(1, A); - } - if (hasI) { - size += pb::CodedOutputStream.ComputeInt32Size(2, I); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestRecursiveMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestRecursiveMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestRecursiveMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestRecursiveMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestRecursiveMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestRecursiveMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestRecursiveMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestRecursiveMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestRecursiveMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestRecursiveMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestRecursiveMessage MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestRecursiveMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestRecursiveMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestRecursiveMessage result; - - private TestRecursiveMessage PrepareBuilder() { - if (resultIsReadOnly) { - TestRecursiveMessage original = result; - result = new TestRecursiveMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestRecursiveMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.Descriptor; } - } - - public override TestRecursiveMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.DefaultInstance; } - } - - public override TestRecursiveMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestRecursiveMessage) { - return MergeFrom((TestRecursiveMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestRecursiveMessage other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA) { - MergeA(other.A); - } - if (other.HasI) { - I = other.I; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testRecursiveMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testRecursiveMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.CreateBuilder(); - if (result.hasA) { - subBuilder.MergeFrom(A); - } - input.ReadMessage(subBuilder, extensionRegistry); - A = subBuilder.BuildPartial(); - break; - } - case 16: { - result.hasI = input.ReadInt32(ref result.i_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasA { - get { return result.hasA; } - } - public global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage A { - get { return result.A; } - set { SetA(value); } - } - public Builder SetA(global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasA = true; - result.a_ = value; - return this; - } - public Builder SetA(global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasA = true; - result.a_ = builderForValue.Build(); - return this; - } - public Builder MergeA(global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasA && - result.a_ != global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.DefaultInstance) { - result.a_ = global::Google.ProtocolBuffers.TestProtos.TestRecursiveMessage.CreateBuilder(result.a_).MergeFrom(value).BuildPartial(); - } else { - result.a_ = value; - } - result.hasA = true; - return this; - } - public Builder ClearA() { - PrepareBuilder(); - result.hasA = false; - result.a_ = null; - return this; - } - - public bool HasI { - get { return result.hasI; } - } - public int I { - get { return result.I; } - set { SetI(value); } - } - public Builder SetI(int value) { - PrepareBuilder(); - result.hasI = true; - result.i_ = value; - return this; - } - public Builder ClearI() { - PrepareBuilder(); - result.hasI = false; - result.i_ = 0; - return this; - } - } - static TestRecursiveMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestMutualRecursionA : pb::GeneratedMessage { - private TestMutualRecursionA() { } - private static readonly TestMutualRecursionA defaultInstance = new TestMutualRecursionA().MakeReadOnly(); - private static readonly string[] _testMutualRecursionAFieldNames = new string[] { "bb" }; - private static readonly uint[] _testMutualRecursionAFieldTags = new uint[] { 10 }; - public static TestMutualRecursionA DefaultInstance { - get { return defaultInstance; } - } - - public override TestMutualRecursionA DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestMutualRecursionA ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestMutualRecursionA__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestMutualRecursionA__FieldAccessorTable; } - } - - public const int BbFieldNumber = 1; - private bool hasBb; - private global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB bb_; - public bool HasBb { - get { return hasBb; } - } - public global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB Bb { - get { return bb_ ?? global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.DefaultInstance; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testMutualRecursionAFieldNames; - if (hasBb) { - output.WriteMessage(1, field_names[0], Bb); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasBb) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Bb); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestMutualRecursionA ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestMutualRecursionA ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestMutualRecursionA ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestMutualRecursionA ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestMutualRecursionA ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestMutualRecursionA ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestMutualRecursionA ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestMutualRecursionA ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestMutualRecursionA ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestMutualRecursionA ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestMutualRecursionA MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestMutualRecursionA prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestMutualRecursionA cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestMutualRecursionA result; - - private TestMutualRecursionA PrepareBuilder() { - if (resultIsReadOnly) { - TestMutualRecursionA original = result; - result = new TestMutualRecursionA(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestMutualRecursionA MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.Descriptor; } - } - - public override TestMutualRecursionA DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.DefaultInstance; } - } - - public override TestMutualRecursionA BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestMutualRecursionA) { - return MergeFrom((TestMutualRecursionA) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestMutualRecursionA other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasBb) { - MergeBb(other.Bb); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testMutualRecursionAFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testMutualRecursionAFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.CreateBuilder(); - if (result.hasBb) { - subBuilder.MergeFrom(Bb); - } - input.ReadMessage(subBuilder, extensionRegistry); - Bb = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasBb { - get { return result.hasBb; } - } - public global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB Bb { - get { return result.Bb; } - set { SetBb(value); } - } - public Builder SetBb(global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasBb = true; - result.bb_ = value; - return this; - } - public Builder SetBb(global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasBb = true; - result.bb_ = builderForValue.Build(); - return this; - } - public Builder MergeBb(global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasBb && - result.bb_ != global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.DefaultInstance) { - result.bb_ = global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.CreateBuilder(result.bb_).MergeFrom(value).BuildPartial(); - } else { - result.bb_ = value; - } - result.hasBb = true; - return this; - } - public Builder ClearBb() { - PrepareBuilder(); - result.hasBb = false; - result.bb_ = null; - return this; - } - } - static TestMutualRecursionA() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestMutualRecursionB : pb::GeneratedMessage { - private TestMutualRecursionB() { } - private static readonly TestMutualRecursionB defaultInstance = new TestMutualRecursionB().MakeReadOnly(); - private static readonly string[] _testMutualRecursionBFieldNames = new string[] { "a", "optional_int32" }; - private static readonly uint[] _testMutualRecursionBFieldTags = new uint[] { 10, 16 }; - public static TestMutualRecursionB DefaultInstance { - get { return defaultInstance; } - } - - public override TestMutualRecursionB DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestMutualRecursionB ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestMutualRecursionB__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestMutualRecursionB__FieldAccessorTable; } - } - - public const int AFieldNumber = 1; - private bool hasA; - private global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA a_; - public bool HasA { - get { return hasA; } - } - public global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA A { - get { return a_ ?? global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.DefaultInstance; } - } - - public const int OptionalInt32FieldNumber = 2; - private bool hasOptionalInt32; - private int optionalInt32_; - public bool HasOptionalInt32 { - get { return hasOptionalInt32; } - } - public int OptionalInt32 { - get { return optionalInt32_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testMutualRecursionBFieldNames; - if (hasA) { - output.WriteMessage(1, field_names[0], A); - } - if (hasOptionalInt32) { - output.WriteInt32(2, field_names[1], OptionalInt32); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA) { - size += pb::CodedOutputStream.ComputeMessageSize(1, A); - } - if (hasOptionalInt32) { - size += pb::CodedOutputStream.ComputeInt32Size(2, OptionalInt32); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestMutualRecursionB ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestMutualRecursionB ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestMutualRecursionB ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestMutualRecursionB ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestMutualRecursionB ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestMutualRecursionB ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestMutualRecursionB ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestMutualRecursionB ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestMutualRecursionB ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestMutualRecursionB ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestMutualRecursionB MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestMutualRecursionB prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestMutualRecursionB cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestMutualRecursionB result; - - private TestMutualRecursionB PrepareBuilder() { - if (resultIsReadOnly) { - TestMutualRecursionB original = result; - result = new TestMutualRecursionB(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestMutualRecursionB MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.Descriptor; } - } - - public override TestMutualRecursionB DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.DefaultInstance; } - } - - public override TestMutualRecursionB BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestMutualRecursionB) { - return MergeFrom((TestMutualRecursionB) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestMutualRecursionB other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionB.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA) { - MergeA(other.A); - } - if (other.HasOptionalInt32) { - OptionalInt32 = other.OptionalInt32; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testMutualRecursionBFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testMutualRecursionBFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.CreateBuilder(); - if (result.hasA) { - subBuilder.MergeFrom(A); - } - input.ReadMessage(subBuilder, extensionRegistry); - A = subBuilder.BuildPartial(); - break; - } - case 16: { - result.hasOptionalInt32 = input.ReadInt32(ref result.optionalInt32_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasA { - get { return result.hasA; } - } - public global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA A { - get { return result.A; } - set { SetA(value); } - } - public Builder SetA(global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasA = true; - result.a_ = value; - return this; - } - public Builder SetA(global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasA = true; - result.a_ = builderForValue.Build(); - return this; - } - public Builder MergeA(global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasA && - result.a_ != global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.DefaultInstance) { - result.a_ = global::Google.ProtocolBuffers.TestProtos.TestMutualRecursionA.CreateBuilder(result.a_).MergeFrom(value).BuildPartial(); - } else { - result.a_ = value; - } - result.hasA = true; - return this; - } - public Builder ClearA() { - PrepareBuilder(); - result.hasA = false; - result.a_ = null; - return this; - } - - public bool HasOptionalInt32 { - get { return result.hasOptionalInt32; } - } - public int OptionalInt32 { - get { return result.OptionalInt32; } - set { SetOptionalInt32(value); } - } - public Builder SetOptionalInt32(int value) { - PrepareBuilder(); - result.hasOptionalInt32 = true; - result.optionalInt32_ = value; - return this; - } - public Builder ClearOptionalInt32() { - PrepareBuilder(); - result.hasOptionalInt32 = false; - result.optionalInt32_ = 0; - return this; - } - } - static TestMutualRecursionB() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestDupFieldNumber : pb::GeneratedMessage { - private TestDupFieldNumber() { } - private static readonly TestDupFieldNumber defaultInstance = new TestDupFieldNumber().MakeReadOnly(); - private static readonly string[] _testDupFieldNumberFieldNames = new string[] { "a", "bar", "foo" }; - private static readonly uint[] _testDupFieldNumberFieldTags = new uint[] { 8, 27, 19 }; - public static TestDupFieldNumber DefaultInstance { - get { return defaultInstance; } - } - - public override TestDupFieldNumber DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestDupFieldNumber ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDupFieldNumber__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDupFieldNumber__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Foo : pb::GeneratedMessage { - private Foo() { } - private static readonly Foo defaultInstance = new Foo().MakeReadOnly(); - private static readonly string[] _fooFieldNames = new string[] { "a" }; - private static readonly uint[] _fooFieldTags = new uint[] { 8 }; - public static Foo DefaultInstance { - get { return defaultInstance; } - } - - public override Foo DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override Foo ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDupFieldNumber_Foo__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDupFieldNumber_Foo__FieldAccessorTable; } - } - - public const int AFieldNumber = 1; - private bool hasA; - private int a_; - public bool HasA { - get { return hasA; } - } - public int A { - get { return a_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _fooFieldNames; - if (hasA) { - output.WriteInt32(1, field_names[0], A); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA) { - size += pb::CodedOutputStream.ComputeInt32Size(1, A); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static Foo ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Foo ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Foo ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Foo ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Foo ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Foo ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Foo ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Foo ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Foo ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Foo ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private Foo MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Foo prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(Foo cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private Foo result; - - private Foo PrepareBuilder() { - if (resultIsReadOnly) { - Foo original = result; - result = new Foo(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override Foo MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.Descriptor; } - } - - public override Foo DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.DefaultInstance; } - } - - public override Foo BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Foo) { - return MergeFrom((Foo) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Foo other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA) { - A = other.A; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_fooFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _fooFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasA = input.ReadInt32(ref result.a_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasA { - get { return result.hasA; } - } - public int A { - get { return result.A; } - set { SetA(value); } - } - public Builder SetA(int value) { - PrepareBuilder(); - result.hasA = true; - result.a_ = value; - return this; - } - public Builder ClearA() { - PrepareBuilder(); - result.hasA = false; - result.a_ = 0; - return this; - } - } - static Foo() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Bar : pb::GeneratedMessage { - private Bar() { } - private static readonly Bar defaultInstance = new Bar().MakeReadOnly(); - private static readonly string[] _barFieldNames = new string[] { "a" }; - private static readonly uint[] _barFieldTags = new uint[] { 8 }; - public static Bar DefaultInstance { - get { return defaultInstance; } - } - - public override Bar DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override Bar ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDupFieldNumber_Bar__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDupFieldNumber_Bar__FieldAccessorTable; } - } - - public const int AFieldNumber = 1; - private bool hasA; - private int a_; - public bool HasA { - get { return hasA; } - } - public int A { - get { return a_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _barFieldNames; - if (hasA) { - output.WriteInt32(1, field_names[0], A); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA) { - size += pb::CodedOutputStream.ComputeInt32Size(1, A); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static Bar ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Bar ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Bar ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Bar ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Bar ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Bar ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Bar ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Bar ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Bar ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Bar ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private Bar MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Bar prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(Bar cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private Bar result; - - private Bar PrepareBuilder() { - if (resultIsReadOnly) { - Bar original = result; - result = new Bar(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override Bar MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.Descriptor; } - } - - public override Bar DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.DefaultInstance; } - } - - public override Bar BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Bar) { - return MergeFrom((Bar) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Bar other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA) { - A = other.A; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_barFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _barFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasA = input.ReadInt32(ref result.a_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasA { - get { return result.hasA; } - } - public int A { - get { return result.A; } - set { SetA(value); } - } - public Builder SetA(int value) { - PrepareBuilder(); - result.hasA = true; - result.a_ = value; - return this; - } - public Builder ClearA() { - PrepareBuilder(); - result.hasA = false; - result.a_ = 0; - return this; - } - } - static Bar() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - } - #endregion - - public const int AFieldNumber = 1; - private bool hasA; - private int a_; - public bool HasA { - get { return hasA; } - } - public int A { - get { return a_; } - } - - public const int FooFieldNumber = 2; - private bool hasFoo; - private global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo foo_; - public bool HasFoo { - get { return hasFoo; } - } - public global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo Foo { - get { return foo_ ?? global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.DefaultInstance; } - } - - public const int BarFieldNumber = 3; - private bool hasBar; - private global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar bar_; - public bool HasBar { - get { return hasBar; } - } - public global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar Bar { - get { return bar_ ?? global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.DefaultInstance; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testDupFieldNumberFieldNames; - if (hasA) { - output.WriteInt32(1, field_names[0], A); - } - if (hasFoo) { - output.WriteGroup(2, field_names[2], Foo); - } - if (hasBar) { - output.WriteGroup(3, field_names[1], Bar); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasA) { - size += pb::CodedOutputStream.ComputeInt32Size(1, A); - } - if (hasFoo) { - size += pb::CodedOutputStream.ComputeGroupSize(2, Foo); - } - if (hasBar) { - size += pb::CodedOutputStream.ComputeGroupSize(3, Bar); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestDupFieldNumber ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestDupFieldNumber ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestDupFieldNumber ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestDupFieldNumber ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestDupFieldNumber ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestDupFieldNumber ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestDupFieldNumber ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestDupFieldNumber ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestDupFieldNumber ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestDupFieldNumber ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestDupFieldNumber MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestDupFieldNumber prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestDupFieldNumber cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestDupFieldNumber result; - - private TestDupFieldNumber PrepareBuilder() { - if (resultIsReadOnly) { - TestDupFieldNumber original = result; - result = new TestDupFieldNumber(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestDupFieldNumber MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Descriptor; } - } - - public override TestDupFieldNumber DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.DefaultInstance; } - } - - public override TestDupFieldNumber BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestDupFieldNumber) { - return MergeFrom((TestDupFieldNumber) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestDupFieldNumber other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasA) { - A = other.A; - } - if (other.HasFoo) { - MergeFoo(other.Foo); - } - if (other.HasBar) { - MergeBar(other.Bar); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testDupFieldNumberFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testDupFieldNumberFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasA = input.ReadInt32(ref result.a_); - break; - } - case 19: { - global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.CreateBuilder(); - if (result.hasFoo) { - subBuilder.MergeFrom(Foo); - } - input.ReadGroup(2, subBuilder, extensionRegistry); - Foo = subBuilder.BuildPartial(); - break; - } - case 27: { - global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.CreateBuilder(); - if (result.hasBar) { - subBuilder.MergeFrom(Bar); - } - input.ReadGroup(3, subBuilder, extensionRegistry); - Bar = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasA { - get { return result.hasA; } - } - public int A { - get { return result.A; } - set { SetA(value); } - } - public Builder SetA(int value) { - PrepareBuilder(); - result.hasA = true; - result.a_ = value; - return this; - } - public Builder ClearA() { - PrepareBuilder(); - result.hasA = false; - result.a_ = 0; - return this; - } - - public bool HasFoo { - get { return result.hasFoo; } - } - public global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo Foo { - get { return result.Foo; } - set { SetFoo(value); } - } - public Builder SetFoo(global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasFoo = true; - result.foo_ = value; - return this; - } - public Builder SetFoo(global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasFoo = true; - result.foo_ = builderForValue.Build(); - return this; - } - public Builder MergeFoo(global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasFoo && - result.foo_ != global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.DefaultInstance) { - result.foo_ = global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Foo.CreateBuilder(result.foo_).MergeFrom(value).BuildPartial(); - } else { - result.foo_ = value; - } - result.hasFoo = true; - return this; - } - public Builder ClearFoo() { - PrepareBuilder(); - result.hasFoo = false; - result.foo_ = null; - return this; - } - - public bool HasBar { - get { return result.hasBar; } - } - public global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar Bar { - get { return result.Bar; } - set { SetBar(value); } - } - public Builder SetBar(global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasBar = true; - result.bar_ = value; - return this; - } - public Builder SetBar(global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasBar = true; - result.bar_ = builderForValue.Build(); - return this; - } - public Builder MergeBar(global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasBar && - result.bar_ != global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.DefaultInstance) { - result.bar_ = global::Google.ProtocolBuffers.TestProtos.TestDupFieldNumber.Types.Bar.CreateBuilder(result.bar_).MergeFrom(value).BuildPartial(); - } else { - result.bar_ = value; - } - result.hasBar = true; - return this; - } - public Builder ClearBar() { - PrepareBuilder(); - result.hasBar = false; - result.bar_ = null; - return this; - } - } - static TestDupFieldNumber() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestNestedMessageHasBits : pb::GeneratedMessage { - private TestNestedMessageHasBits() { } - private static readonly TestNestedMessageHasBits defaultInstance = new TestNestedMessageHasBits().MakeReadOnly(); - private static readonly string[] _testNestedMessageHasBitsFieldNames = new string[] { "optional_nested_message" }; - private static readonly uint[] _testNestedMessageHasBitsFieldTags = new uint[] { 10 }; - public static TestNestedMessageHasBits DefaultInstance { - get { return defaultInstance; } - } - - public override TestNestedMessageHasBits DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestNestedMessageHasBits ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestNestedMessageHasBits__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestNestedMessageHasBits__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class NestedMessage : pb::GeneratedMessage { - private NestedMessage() { } - private static readonly NestedMessage defaultInstance = new NestedMessage().MakeReadOnly(); - private static readonly string[] _nestedMessageFieldNames = new string[] { "nestedmessage_repeated_foreignmessage", "nestedmessage_repeated_int32" }; - private static readonly uint[] _nestedMessageFieldTags = new uint[] { 18, 8 }; - public static NestedMessage DefaultInstance { - get { return defaultInstance; } - } - - public override NestedMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override NestedMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestNestedMessageHasBits_NestedMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestNestedMessageHasBits_NestedMessage__FieldAccessorTable; } - } - - public const int NestedmessageRepeatedInt32FieldNumber = 1; - private pbc::PopsicleList nestedmessageRepeatedInt32_ = new pbc::PopsicleList(); - public scg::IList NestedmessageRepeatedInt32List { - get { return pbc::Lists.AsReadOnly(nestedmessageRepeatedInt32_); } - } - public int NestedmessageRepeatedInt32Count { - get { return nestedmessageRepeatedInt32_.Count; } - } - public int GetNestedmessageRepeatedInt32(int index) { - return nestedmessageRepeatedInt32_[index]; - } - - public const int NestedmessageRepeatedForeignmessageFieldNumber = 2; - private pbc::PopsicleList nestedmessageRepeatedForeignmessage_ = new pbc::PopsicleList(); - public scg::IList NestedmessageRepeatedForeignmessageList { - get { return nestedmessageRepeatedForeignmessage_; } - } - public int NestedmessageRepeatedForeignmessageCount { - get { return nestedmessageRepeatedForeignmessage_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage GetNestedmessageRepeatedForeignmessage(int index) { - return nestedmessageRepeatedForeignmessage_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _nestedMessageFieldNames; - if (nestedmessageRepeatedInt32_.Count > 0) { - output.WriteInt32Array(1, field_names[1], nestedmessageRepeatedInt32_); - } - if (nestedmessageRepeatedForeignmessage_.Count > 0) { - output.WriteMessageArray(2, field_names[0], nestedmessageRepeatedForeignmessage_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - foreach (int element in NestedmessageRepeatedInt32List) { - dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); - } - size += dataSize; - size += 1 * nestedmessageRepeatedInt32_.Count; - } - foreach (global::Google.ProtocolBuffers.TestProtos.ForeignMessage element in NestedmessageRepeatedForeignmessageList) { - size += pb::CodedOutputStream.ComputeMessageSize(2, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static NestedMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NestedMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NestedMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NestedMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NestedMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NestedMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static NestedMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static NestedMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NestedMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private NestedMessage MakeReadOnly() { - nestedmessageRepeatedInt32_.MakeReadOnly(); - nestedmessageRepeatedForeignmessage_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(NestedMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(NestedMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private NestedMessage result; - - private NestedMessage PrepareBuilder() { - if (resultIsReadOnly) { - NestedMessage original = result; - result = new NestedMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override NestedMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.Descriptor; } - } - - public override NestedMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.DefaultInstance; } - } - - public override NestedMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is NestedMessage) { - return MergeFrom((NestedMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(NestedMessage other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.nestedmessageRepeatedInt32_.Count != 0) { - result.nestedmessageRepeatedInt32_.Add(other.nestedmessageRepeatedInt32_); - } - if (other.nestedmessageRepeatedForeignmessage_.Count != 0) { - result.nestedmessageRepeatedForeignmessage_.Add(other.nestedmessageRepeatedForeignmessage_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_nestedMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _nestedMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: - case 8: { - input.ReadInt32Array(tag, field_name, result.nestedmessageRepeatedInt32_); - break; - } - case 18: { - input.ReadMessageArray(tag, field_name, result.nestedmessageRepeatedForeignmessage_, global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance, extensionRegistry); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public pbc::IPopsicleList NestedmessageRepeatedInt32List { - get { return PrepareBuilder().nestedmessageRepeatedInt32_; } - } - public int NestedmessageRepeatedInt32Count { - get { return result.NestedmessageRepeatedInt32Count; } - } - public int GetNestedmessageRepeatedInt32(int index) { - return result.GetNestedmessageRepeatedInt32(index); - } - public Builder SetNestedmessageRepeatedInt32(int index, int value) { - PrepareBuilder(); - result.nestedmessageRepeatedInt32_[index] = value; - return this; - } - public Builder AddNestedmessageRepeatedInt32(int value) { - PrepareBuilder(); - result.nestedmessageRepeatedInt32_.Add(value); - return this; - } - public Builder AddRangeNestedmessageRepeatedInt32(scg::IEnumerable values) { - PrepareBuilder(); - result.nestedmessageRepeatedInt32_.Add(values); - return this; - } - public Builder ClearNestedmessageRepeatedInt32() { - PrepareBuilder(); - result.nestedmessageRepeatedInt32_.Clear(); - return this; - } - - public pbc::IPopsicleList NestedmessageRepeatedForeignmessageList { - get { return PrepareBuilder().nestedmessageRepeatedForeignmessage_; } - } - public int NestedmessageRepeatedForeignmessageCount { - get { return result.NestedmessageRepeatedForeignmessageCount; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage GetNestedmessageRepeatedForeignmessage(int index) { - return result.GetNestedmessageRepeatedForeignmessage(index); - } - public Builder SetNestedmessageRepeatedForeignmessage(int index, global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.nestedmessageRepeatedForeignmessage_[index] = value; - return this; - } - public Builder SetNestedmessageRepeatedForeignmessage(int index, global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.nestedmessageRepeatedForeignmessage_[index] = builderForValue.Build(); - return this; - } - public Builder AddNestedmessageRepeatedForeignmessage(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.nestedmessageRepeatedForeignmessage_.Add(value); - return this; - } - public Builder AddNestedmessageRepeatedForeignmessage(global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.nestedmessageRepeatedForeignmessage_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeNestedmessageRepeatedForeignmessage(scg::IEnumerable values) { - PrepareBuilder(); - result.nestedmessageRepeatedForeignmessage_.Add(values); - return this; - } - public Builder ClearNestedmessageRepeatedForeignmessage() { - PrepareBuilder(); - result.nestedmessageRepeatedForeignmessage_.Clear(); - return this; - } - } - static NestedMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - } - #endregion - - public const int OptionalNestedMessageFieldNumber = 1; - private bool hasOptionalNestedMessage; - private global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage optionalNestedMessage_; - public bool HasOptionalNestedMessage { - get { return hasOptionalNestedMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage OptionalNestedMessage { - get { return optionalNestedMessage_ ?? global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.DefaultInstance; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testNestedMessageHasBitsFieldNames; - if (hasOptionalNestedMessage) { - output.WriteMessage(1, field_names[0], OptionalNestedMessage); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasOptionalNestedMessage) { - size += pb::CodedOutputStream.ComputeMessageSize(1, OptionalNestedMessage); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestNestedMessageHasBits ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestNestedMessageHasBits ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestNestedMessageHasBits ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestNestedMessageHasBits ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestNestedMessageHasBits ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestNestedMessageHasBits ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestNestedMessageHasBits ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestNestedMessageHasBits ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestNestedMessageHasBits ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestNestedMessageHasBits ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestNestedMessageHasBits MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestNestedMessageHasBits prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestNestedMessageHasBits cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestNestedMessageHasBits result; - - private TestNestedMessageHasBits PrepareBuilder() { - if (resultIsReadOnly) { - TestNestedMessageHasBits original = result; - result = new TestNestedMessageHasBits(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestNestedMessageHasBits MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Descriptor; } - } - - public override TestNestedMessageHasBits DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.DefaultInstance; } - } - - public override TestNestedMessageHasBits BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestNestedMessageHasBits) { - return MergeFrom((TestNestedMessageHasBits) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestNestedMessageHasBits other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasOptionalNestedMessage) { - MergeOptionalNestedMessage(other.OptionalNestedMessage); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testNestedMessageHasBitsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testNestedMessageHasBitsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.CreateBuilder(); - if (result.hasOptionalNestedMessage) { - subBuilder.MergeFrom(OptionalNestedMessage); - } - input.ReadMessage(subBuilder, extensionRegistry); - OptionalNestedMessage = subBuilder.BuildPartial(); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasOptionalNestedMessage { - get { return result.hasOptionalNestedMessage; } - } - public global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage OptionalNestedMessage { - get { return result.OptionalNestedMessage; } - set { SetOptionalNestedMessage(value); } - } - public Builder SetOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasOptionalNestedMessage = true; - result.optionalNestedMessage_ = value; - return this; - } - public Builder SetOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasOptionalNestedMessage = true; - result.optionalNestedMessage_ = builderForValue.Build(); - return this; - } - public Builder MergeOptionalNestedMessage(global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasOptionalNestedMessage && - result.optionalNestedMessage_ != global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.DefaultInstance) { - result.optionalNestedMessage_ = global::Google.ProtocolBuffers.TestProtos.TestNestedMessageHasBits.Types.NestedMessage.CreateBuilder(result.optionalNestedMessage_).MergeFrom(value).BuildPartial(); - } else { - result.optionalNestedMessage_ = value; - } - result.hasOptionalNestedMessage = true; - return this; - } - public Builder ClearOptionalNestedMessage() { - PrepareBuilder(); - result.hasOptionalNestedMessage = false; - result.optionalNestedMessage_ = null; - return this; - } - } - static TestNestedMessageHasBits() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestCamelCaseFieldNames : pb::GeneratedMessage { - private TestCamelCaseFieldNames() { } - private static readonly TestCamelCaseFieldNames defaultInstance = new TestCamelCaseFieldNames().MakeReadOnly(); - private static readonly string[] _testCamelCaseFieldNamesFieldNames = new string[] { "CordField", "EnumField", "MessageField", "PrimitiveField", "RepeatedCordField", "RepeatedEnumField", "RepeatedMessageField", "RepeatedPrimitiveField", "RepeatedStringField", "RepeatedStringPieceField", "StringField", "StringPieceField" }; - private static readonly uint[] _testCamelCaseFieldNamesFieldTags = new uint[] { 50, 24, 34, 8, 98, 72, 82, 56, 66, 90, 18, 42 }; - public static TestCamelCaseFieldNames DefaultInstance { - get { return defaultInstance; } - } - - public override TestCamelCaseFieldNames DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestCamelCaseFieldNames ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestCamelCaseFieldNames__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestCamelCaseFieldNames__FieldAccessorTable; } - } - - public const int PrimitiveFieldFieldNumber = 1; - private bool hasPrimitiveField; - private int primitiveField_; - public bool HasPrimitiveField { - get { return hasPrimitiveField; } - } - public int PrimitiveField { - get { return primitiveField_; } - } - - public const int StringFieldFieldNumber = 2; - private bool hasStringField; - private string stringField_ = ""; - public bool HasStringField { - get { return hasStringField; } - } - public string StringField { - get { return stringField_; } - } - - public const int EnumFieldFieldNumber = 3; - private bool hasEnumField; - private global::Google.ProtocolBuffers.TestProtos.ForeignEnum enumField_ = global::Google.ProtocolBuffers.TestProtos.ForeignEnum.FOREIGN_FOO; - public bool HasEnumField { - get { return hasEnumField; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum EnumField { - get { return enumField_; } - } - - public const int MessageFieldFieldNumber = 4; - private bool hasMessageField; - private global::Google.ProtocolBuffers.TestProtos.ForeignMessage messageField_; - public bool HasMessageField { - get { return hasMessageField; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage MessageField { - get { return messageField_ ?? global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance; } - } - - public const int StringPieceFieldFieldNumber = 5; - private bool hasStringPieceField; - private string stringPieceField_ = ""; - public bool HasStringPieceField { - get { return hasStringPieceField; } - } - public string StringPieceField { - get { return stringPieceField_; } - } - - public const int CordFieldFieldNumber = 6; - private bool hasCordField; - private string cordField_ = ""; - public bool HasCordField { - get { return hasCordField; } - } - public string CordField { - get { return cordField_; } - } - - public const int RepeatedPrimitiveFieldFieldNumber = 7; - private pbc::PopsicleList repeatedPrimitiveField_ = new pbc::PopsicleList(); - public scg::IList RepeatedPrimitiveFieldList { - get { return pbc::Lists.AsReadOnly(repeatedPrimitiveField_); } - } - public int RepeatedPrimitiveFieldCount { - get { return repeatedPrimitiveField_.Count; } - } - public int GetRepeatedPrimitiveField(int index) { - return repeatedPrimitiveField_[index]; - } - - public const int RepeatedStringFieldFieldNumber = 8; - private pbc::PopsicleList repeatedStringField_ = new pbc::PopsicleList(); - public scg::IList RepeatedStringFieldList { - get { return pbc::Lists.AsReadOnly(repeatedStringField_); } - } - public int RepeatedStringFieldCount { - get { return repeatedStringField_.Count; } - } - public string GetRepeatedStringField(int index) { - return repeatedStringField_[index]; - } - - public const int RepeatedEnumFieldFieldNumber = 9; - private pbc::PopsicleList repeatedEnumField_ = new pbc::PopsicleList(); - public scg::IList RepeatedEnumFieldList { - get { return pbc::Lists.AsReadOnly(repeatedEnumField_); } - } - public int RepeatedEnumFieldCount { - get { return repeatedEnumField_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum GetRepeatedEnumField(int index) { - return repeatedEnumField_[index]; - } - - public const int RepeatedMessageFieldFieldNumber = 10; - private pbc::PopsicleList repeatedMessageField_ = new pbc::PopsicleList(); - public scg::IList RepeatedMessageFieldList { - get { return repeatedMessageField_; } - } - public int RepeatedMessageFieldCount { - get { return repeatedMessageField_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage GetRepeatedMessageField(int index) { - return repeatedMessageField_[index]; - } - - public const int RepeatedStringPieceFieldFieldNumber = 11; - private pbc::PopsicleList repeatedStringPieceField_ = new pbc::PopsicleList(); - public scg::IList RepeatedStringPieceFieldList { - get { return pbc::Lists.AsReadOnly(repeatedStringPieceField_); } - } - public int RepeatedStringPieceFieldCount { - get { return repeatedStringPieceField_.Count; } - } - public string GetRepeatedStringPieceField(int index) { - return repeatedStringPieceField_[index]; - } - - public const int RepeatedCordFieldFieldNumber = 12; - private pbc::PopsicleList repeatedCordField_ = new pbc::PopsicleList(); - public scg::IList RepeatedCordFieldList { - get { return pbc::Lists.AsReadOnly(repeatedCordField_); } - } - public int RepeatedCordFieldCount { - get { return repeatedCordField_.Count; } - } - public string GetRepeatedCordField(int index) { - return repeatedCordField_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testCamelCaseFieldNamesFieldNames; - if (hasPrimitiveField) { - output.WriteInt32(1, field_names[3], PrimitiveField); - } - if (hasStringField) { - output.WriteString(2, field_names[10], StringField); - } - if (hasEnumField) { - output.WriteEnum(3, field_names[1], (int) EnumField, EnumField); - } - if (hasMessageField) { - output.WriteMessage(4, field_names[2], MessageField); - } - if (hasStringPieceField) { - output.WriteString(5, field_names[11], StringPieceField); - } - if (hasCordField) { - output.WriteString(6, field_names[0], CordField); - } - if (repeatedPrimitiveField_.Count > 0) { - output.WriteInt32Array(7, field_names[7], repeatedPrimitiveField_); - } - if (repeatedStringField_.Count > 0) { - output.WriteStringArray(8, field_names[8], repeatedStringField_); - } - if (repeatedEnumField_.Count > 0) { - output.WriteEnumArray(9, field_names[5], repeatedEnumField_); - } - if (repeatedMessageField_.Count > 0) { - output.WriteMessageArray(10, field_names[6], repeatedMessageField_); - } - if (repeatedStringPieceField_.Count > 0) { - output.WriteStringArray(11, field_names[9], repeatedStringPieceField_); - } - if (repeatedCordField_.Count > 0) { - output.WriteStringArray(12, field_names[4], repeatedCordField_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasPrimitiveField) { - size += pb::CodedOutputStream.ComputeInt32Size(1, PrimitiveField); - } - if (hasStringField) { - size += pb::CodedOutputStream.ComputeStringSize(2, StringField); - } - if (hasEnumField) { - size += pb::CodedOutputStream.ComputeEnumSize(3, (int) EnumField); - } - if (hasMessageField) { - size += pb::CodedOutputStream.ComputeMessageSize(4, MessageField); - } - if (hasStringPieceField) { - size += pb::CodedOutputStream.ComputeStringSize(5, StringPieceField); - } - if (hasCordField) { - size += pb::CodedOutputStream.ComputeStringSize(6, CordField); - } - { - int dataSize = 0; - foreach (int element in RepeatedPrimitiveFieldList) { - dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); - } - size += dataSize; - size += 1 * repeatedPrimitiveField_.Count; - } - { - int dataSize = 0; - foreach (string element in RepeatedStringFieldList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 1 * repeatedStringField_.Count; - } - { - int dataSize = 0; - if (repeatedEnumField_.Count > 0) { - foreach (global::Google.ProtocolBuffers.TestProtos.ForeignEnum element in repeatedEnumField_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 1 * repeatedEnumField_.Count; - } - } - foreach (global::Google.ProtocolBuffers.TestProtos.ForeignMessage element in RepeatedMessageFieldList) { - size += pb::CodedOutputStream.ComputeMessageSize(10, element); - } - { - int dataSize = 0; - foreach (string element in RepeatedStringPieceFieldList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 1 * repeatedStringPieceField_.Count; - } - { - int dataSize = 0; - foreach (string element in RepeatedCordFieldList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 1 * repeatedCordField_.Count; - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestCamelCaseFieldNames ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestCamelCaseFieldNames ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestCamelCaseFieldNames ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestCamelCaseFieldNames ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestCamelCaseFieldNames ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestCamelCaseFieldNames ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestCamelCaseFieldNames ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestCamelCaseFieldNames ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestCamelCaseFieldNames ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestCamelCaseFieldNames ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestCamelCaseFieldNames MakeReadOnly() { - repeatedPrimitiveField_.MakeReadOnly(); - repeatedStringField_.MakeReadOnly(); - repeatedEnumField_.MakeReadOnly(); - repeatedMessageField_.MakeReadOnly(); - repeatedStringPieceField_.MakeReadOnly(); - repeatedCordField_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestCamelCaseFieldNames prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestCamelCaseFieldNames cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestCamelCaseFieldNames result; - - private TestCamelCaseFieldNames PrepareBuilder() { - if (resultIsReadOnly) { - TestCamelCaseFieldNames original = result; - result = new TestCamelCaseFieldNames(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestCamelCaseFieldNames MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestCamelCaseFieldNames.Descriptor; } - } - - public override TestCamelCaseFieldNames DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestCamelCaseFieldNames.DefaultInstance; } - } - - public override TestCamelCaseFieldNames BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestCamelCaseFieldNames) { - return MergeFrom((TestCamelCaseFieldNames) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestCamelCaseFieldNames other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestCamelCaseFieldNames.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasPrimitiveField) { - PrimitiveField = other.PrimitiveField; - } - if (other.HasStringField) { - StringField = other.StringField; - } - if (other.HasEnumField) { - EnumField = other.EnumField; - } - if (other.HasMessageField) { - MergeMessageField(other.MessageField); - } - if (other.HasStringPieceField) { - StringPieceField = other.StringPieceField; - } - if (other.HasCordField) { - CordField = other.CordField; - } - if (other.repeatedPrimitiveField_.Count != 0) { - result.repeatedPrimitiveField_.Add(other.repeatedPrimitiveField_); - } - if (other.repeatedStringField_.Count != 0) { - result.repeatedStringField_.Add(other.repeatedStringField_); - } - if (other.repeatedEnumField_.Count != 0) { - result.repeatedEnumField_.Add(other.repeatedEnumField_); - } - if (other.repeatedMessageField_.Count != 0) { - result.repeatedMessageField_.Add(other.repeatedMessageField_); - } - if (other.repeatedStringPieceField_.Count != 0) { - result.repeatedStringPieceField_.Add(other.repeatedStringPieceField_); - } - if (other.repeatedCordField_.Count != 0) { - result.repeatedCordField_.Add(other.repeatedCordField_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testCamelCaseFieldNamesFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testCamelCaseFieldNamesFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasPrimitiveField = input.ReadInt32(ref result.primitiveField_); - break; - } - case 18: { - result.hasStringField = input.ReadString(ref result.stringField_); - break; - } - case 24: { - object unknown; - if(input.ReadEnum(ref result.enumField_, out unknown)) { - result.hasEnumField = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(3, (ulong)(int)unknown); - } - break; - } - case 34: { - global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.ForeignMessage.CreateBuilder(); - if (result.hasMessageField) { - subBuilder.MergeFrom(MessageField); - } - input.ReadMessage(subBuilder, extensionRegistry); - MessageField = subBuilder.BuildPartial(); - break; - } - case 42: { - result.hasStringPieceField = input.ReadString(ref result.stringPieceField_); - break; - } - case 50: { - result.hasCordField = input.ReadString(ref result.cordField_); - break; - } - case 58: - case 56: { - input.ReadInt32Array(tag, field_name, result.repeatedPrimitiveField_); - break; - } - case 66: { - input.ReadStringArray(tag, field_name, result.repeatedStringField_); - break; - } - case 74: - case 72: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.repeatedEnumField_, out unknownItems); - if (unknownItems != null) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - foreach (object rawValue in unknownItems) - if (rawValue is int) - unknownFields.MergeVarintField(9, (ulong)(int)rawValue); - } - break; - } - case 82: { - input.ReadMessageArray(tag, field_name, result.repeatedMessageField_, global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance, extensionRegistry); - break; - } - case 90: { - input.ReadStringArray(tag, field_name, result.repeatedStringPieceField_); - break; - } - case 98: { - input.ReadStringArray(tag, field_name, result.repeatedCordField_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasPrimitiveField { - get { return result.hasPrimitiveField; } - } - public int PrimitiveField { - get { return result.PrimitiveField; } - set { SetPrimitiveField(value); } - } - public Builder SetPrimitiveField(int value) { - PrepareBuilder(); - result.hasPrimitiveField = true; - result.primitiveField_ = value; - return this; - } - public Builder ClearPrimitiveField() { - PrepareBuilder(); - result.hasPrimitiveField = false; - result.primitiveField_ = 0; - return this; - } - - public bool HasStringField { - get { return result.hasStringField; } - } - public string StringField { - get { return result.StringField; } - set { SetStringField(value); } - } - public Builder SetStringField(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasStringField = true; - result.stringField_ = value; - return this; - } - public Builder ClearStringField() { - PrepareBuilder(); - result.hasStringField = false; - result.stringField_ = ""; - return this; - } - - public bool HasEnumField { - get { return result.hasEnumField; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum EnumField { - get { return result.EnumField; } - set { SetEnumField(value); } - } - public Builder SetEnumField(global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) { - PrepareBuilder(); - result.hasEnumField = true; - result.enumField_ = value; - return this; - } - public Builder ClearEnumField() { - PrepareBuilder(); - result.hasEnumField = false; - result.enumField_ = global::Google.ProtocolBuffers.TestProtos.ForeignEnum.FOREIGN_FOO; - return this; - } - - public bool HasMessageField { - get { return result.hasMessageField; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage MessageField { - get { return result.MessageField; } - set { SetMessageField(value); } - } - public Builder SetMessageField(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasMessageField = true; - result.messageField_ = value; - return this; - } - public Builder SetMessageField(global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasMessageField = true; - result.messageField_ = builderForValue.Build(); - return this; - } - public Builder MergeMessageField(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasMessageField && - result.messageField_ != global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance) { - result.messageField_ = global::Google.ProtocolBuffers.TestProtos.ForeignMessage.CreateBuilder(result.messageField_).MergeFrom(value).BuildPartial(); - } else { - result.messageField_ = value; - } - result.hasMessageField = true; - return this; - } - public Builder ClearMessageField() { - PrepareBuilder(); - result.hasMessageField = false; - result.messageField_ = null; - return this; - } - - public bool HasStringPieceField { - get { return result.hasStringPieceField; } - } - public string StringPieceField { - get { return result.StringPieceField; } - set { SetStringPieceField(value); } - } - public Builder SetStringPieceField(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasStringPieceField = true; - result.stringPieceField_ = value; - return this; - } - public Builder ClearStringPieceField() { - PrepareBuilder(); - result.hasStringPieceField = false; - result.stringPieceField_ = ""; - return this; - } - - public bool HasCordField { - get { return result.hasCordField; } - } - public string CordField { - get { return result.CordField; } - set { SetCordField(value); } - } - public Builder SetCordField(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasCordField = true; - result.cordField_ = value; - return this; - } - public Builder ClearCordField() { - PrepareBuilder(); - result.hasCordField = false; - result.cordField_ = ""; - return this; - } - - public pbc::IPopsicleList RepeatedPrimitiveFieldList { - get { return PrepareBuilder().repeatedPrimitiveField_; } - } - public int RepeatedPrimitiveFieldCount { - get { return result.RepeatedPrimitiveFieldCount; } - } - public int GetRepeatedPrimitiveField(int index) { - return result.GetRepeatedPrimitiveField(index); - } - public Builder SetRepeatedPrimitiveField(int index, int value) { - PrepareBuilder(); - result.repeatedPrimitiveField_[index] = value; - return this; - } - public Builder AddRepeatedPrimitiveField(int value) { - PrepareBuilder(); - result.repeatedPrimitiveField_.Add(value); - return this; - } - public Builder AddRangeRepeatedPrimitiveField(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedPrimitiveField_.Add(values); - return this; - } - public Builder ClearRepeatedPrimitiveField() { - PrepareBuilder(); - result.repeatedPrimitiveField_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedStringFieldList { - get { return PrepareBuilder().repeatedStringField_; } - } - public int RepeatedStringFieldCount { - get { return result.RepeatedStringFieldCount; } - } - public string GetRepeatedStringField(int index) { - return result.GetRepeatedStringField(index); - } - public Builder SetRepeatedStringField(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedStringField_[index] = value; - return this; - } - public Builder AddRepeatedStringField(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedStringField_.Add(value); - return this; - } - public Builder AddRangeRepeatedStringField(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedStringField_.Add(values); - return this; - } - public Builder ClearRepeatedStringField() { - PrepareBuilder(); - result.repeatedStringField_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedEnumFieldList { - get { return PrepareBuilder().repeatedEnumField_; } - } - public int RepeatedEnumFieldCount { - get { return result.RepeatedEnumFieldCount; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum GetRepeatedEnumField(int index) { - return result.GetRepeatedEnumField(index); - } - public Builder SetRepeatedEnumField(int index, global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) { - PrepareBuilder(); - result.repeatedEnumField_[index] = value; - return this; - } - public Builder AddRepeatedEnumField(global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) { - PrepareBuilder(); - result.repeatedEnumField_.Add(value); - return this; - } - public Builder AddRangeRepeatedEnumField(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedEnumField_.Add(values); - return this; - } - public Builder ClearRepeatedEnumField() { - PrepareBuilder(); - result.repeatedEnumField_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedMessageFieldList { - get { return PrepareBuilder().repeatedMessageField_; } - } - public int RepeatedMessageFieldCount { - get { return result.RepeatedMessageFieldCount; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage GetRepeatedMessageField(int index) { - return result.GetRepeatedMessageField(index); - } - public Builder SetRepeatedMessageField(int index, global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedMessageField_[index] = value; - return this; - } - public Builder SetRepeatedMessageField(int index, global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedMessageField_[index] = builderForValue.Build(); - return this; - } - public Builder AddRepeatedMessageField(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedMessageField_.Add(value); - return this; - } - public Builder AddRepeatedMessageField(global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.repeatedMessageField_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeRepeatedMessageField(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedMessageField_.Add(values); - return this; - } - public Builder ClearRepeatedMessageField() { - PrepareBuilder(); - result.repeatedMessageField_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedStringPieceFieldList { - get { return PrepareBuilder().repeatedStringPieceField_; } - } - public int RepeatedStringPieceFieldCount { - get { return result.RepeatedStringPieceFieldCount; } - } - public string GetRepeatedStringPieceField(int index) { - return result.GetRepeatedStringPieceField(index); - } - public Builder SetRepeatedStringPieceField(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedStringPieceField_[index] = value; - return this; - } - public Builder AddRepeatedStringPieceField(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedStringPieceField_.Add(value); - return this; - } - public Builder AddRangeRepeatedStringPieceField(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedStringPieceField_.Add(values); - return this; - } - public Builder ClearRepeatedStringPieceField() { - PrepareBuilder(); - result.repeatedStringPieceField_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedCordFieldList { - get { return PrepareBuilder().repeatedCordField_; } - } - public int RepeatedCordFieldCount { - get { return result.RepeatedCordFieldCount; } - } - public string GetRepeatedCordField(int index) { - return result.GetRepeatedCordField(index); - } - public Builder SetRepeatedCordField(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedCordField_[index] = value; - return this; - } - public Builder AddRepeatedCordField(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedCordField_.Add(value); - return this; - } - public Builder AddRangeRepeatedCordField(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedCordField_.Add(values); - return this; - } - public Builder ClearRepeatedCordField() { - PrepareBuilder(); - result.repeatedCordField_.Clear(); - return this; - } - } - static TestCamelCaseFieldNames() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestFieldOrderings : pb::ExtendableMessage { - private TestFieldOrderings() { } - private static readonly TestFieldOrderings defaultInstance = new TestFieldOrderings().MakeReadOnly(); - private static readonly string[] _testFieldOrderingsFieldNames = new string[] { "my_float", "my_int", "my_string" }; - private static readonly uint[] _testFieldOrderingsFieldTags = new uint[] { 813, 8, 90 }; - public static TestFieldOrderings DefaultInstance { - get { return defaultInstance; } - } - - public override TestFieldOrderings DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestFieldOrderings ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestFieldOrderings__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestFieldOrderings__FieldAccessorTable; } - } - - public const int MyStringFieldNumber = 11; - private bool hasMyString; - private string myString_ = ""; - public bool HasMyString { - get { return hasMyString; } - } - public string MyString { - get { return myString_; } - } - - public const int MyIntFieldNumber = 1; - private bool hasMyInt; - private long myInt_; - public bool HasMyInt { - get { return hasMyInt; } - } - public long MyInt { - get { return myInt_; } - } - - public const int MyFloatFieldNumber = 101; - private bool hasMyFloat; - private float myFloat_; - public bool HasMyFloat { - get { return hasMyFloat; } - } - public float MyFloat { - get { return myFloat_; } - } - - public override bool IsInitialized { - get { - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testFieldOrderingsFieldNames; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - if (hasMyInt) { - output.WriteInt64(1, field_names[1], MyInt); - } - extensionWriter.WriteUntil(11, output); - if (hasMyString) { - output.WriteString(11, field_names[2], MyString); - } - extensionWriter.WriteUntil(101, output); - if (hasMyFloat) { - output.WriteFloat(101, field_names[0], MyFloat); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasMyString) { - size += pb::CodedOutputStream.ComputeStringSize(11, MyString); - } - if (hasMyInt) { - size += pb::CodedOutputStream.ComputeInt64Size(1, MyInt); - } - if (hasMyFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(101, MyFloat); - } - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestFieldOrderings ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestFieldOrderings ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestFieldOrderings ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestFieldOrderings ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestFieldOrderings ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestFieldOrderings ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestFieldOrderings ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestFieldOrderings ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestFieldOrderings ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestFieldOrderings ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestFieldOrderings MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestFieldOrderings prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestFieldOrderings cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestFieldOrderings result; - - private TestFieldOrderings PrepareBuilder() { - if (resultIsReadOnly) { - TestFieldOrderings original = result; - result = new TestFieldOrderings(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestFieldOrderings MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestFieldOrderings.Descriptor; } - } - - public override TestFieldOrderings DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestFieldOrderings.DefaultInstance; } - } - - public override TestFieldOrderings BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestFieldOrderings) { - return MergeFrom((TestFieldOrderings) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestFieldOrderings other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestFieldOrderings.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasMyString) { - MyString = other.MyString; - } - if (other.HasMyInt) { - MyInt = other.MyInt; - } - if (other.HasMyFloat) { - MyFloat = other.MyFloat; - } - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testFieldOrderingsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testFieldOrderingsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - result.hasMyInt = input.ReadInt64(ref result.myInt_); - break; - } - case 90: { - result.hasMyString = input.ReadString(ref result.myString_); - break; - } - case 813: { - result.hasMyFloat = input.ReadFloat(ref result.myFloat_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasMyString { - get { return result.hasMyString; } - } - public string MyString { - get { return result.MyString; } - set { SetMyString(value); } - } - public Builder SetMyString(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasMyString = true; - result.myString_ = value; - return this; - } - public Builder ClearMyString() { - PrepareBuilder(); - result.hasMyString = false; - result.myString_ = ""; - return this; - } - - public bool HasMyInt { - get { return result.hasMyInt; } - } - public long MyInt { - get { return result.MyInt; } - set { SetMyInt(value); } - } - public Builder SetMyInt(long value) { - PrepareBuilder(); - result.hasMyInt = true; - result.myInt_ = value; - return this; - } - public Builder ClearMyInt() { - PrepareBuilder(); - result.hasMyInt = false; - result.myInt_ = 0L; - return this; - } - - public bool HasMyFloat { - get { return result.hasMyFloat; } - } - public float MyFloat { - get { return result.MyFloat; } - set { SetMyFloat(value); } - } - public Builder SetMyFloat(float value) { - PrepareBuilder(); - result.hasMyFloat = true; - result.myFloat_ = value; - return this; - } - public Builder ClearMyFloat() { - PrepareBuilder(); - result.hasMyFloat = false; - result.myFloat_ = 0F; - return this; - } - } - static TestFieldOrderings() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestExtremeDefaultValues : pb::GeneratedMessage { - private TestExtremeDefaultValues() { } - private static readonly TestExtremeDefaultValues defaultInstance = new TestExtremeDefaultValues().MakeReadOnly(); - private static readonly string[] _testExtremeDefaultValuesFieldNames = new string[] { "cpp_trigraph", "escaped_bytes", "inf_double", "inf_float", "large_float", "large_uint32", "large_uint64", "nan_double", "nan_float", "neg_inf_double", "neg_inf_float", "negative_float", "negative_one_float", "one_float", "small_float", "small_int32", "small_int64", "small_negative_float", "utf8_string", "zero_float" }; - private static readonly uint[] _testExtremeDefaultValuesFieldTags = new uint[] { 162, 10, 113, 141, 101, 16, 24, 129, 157, 121, 149, 93, 85, 69, 77, 32, 40, 109, 50, 61 }; - public static TestExtremeDefaultValues DefaultInstance { - get { return defaultInstance; } - } - - public override TestExtremeDefaultValues DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestExtremeDefaultValues ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestExtremeDefaultValues__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestExtremeDefaultValues__FieldAccessorTable; } - } - - public const int EscapedBytesFieldNumber = 1; - private bool hasEscapedBytes; - private pb::ByteString escapedBytes_ = (pb::ByteString) global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues.Descriptor.Fields[0].DefaultValue; - public bool HasEscapedBytes { - get { return hasEscapedBytes; } - } - public pb::ByteString EscapedBytes { - get { return escapedBytes_; } - } - - public const int LargeUint32FieldNumber = 2; - private bool hasLargeUint32; - private uint largeUint32_ = 4294967295; - public bool HasLargeUint32 { - get { return hasLargeUint32; } - } - [global::System.CLSCompliant(false)] - public uint LargeUint32 { - get { return largeUint32_; } - } - - public const int LargeUint64FieldNumber = 3; - private bool hasLargeUint64; - private ulong largeUint64_ = 18446744073709551615UL; - public bool HasLargeUint64 { - get { return hasLargeUint64; } - } - [global::System.CLSCompliant(false)] - public ulong LargeUint64 { - get { return largeUint64_; } - } - - public const int SmallInt32FieldNumber = 4; - private bool hasSmallInt32; - private int smallInt32_ = -2147483647; - public bool HasSmallInt32 { - get { return hasSmallInt32; } - } - public int SmallInt32 { - get { return smallInt32_; } - } - - public const int SmallInt64FieldNumber = 5; - private bool hasSmallInt64; - private long smallInt64_ = -9223372036854775807L; - public bool HasSmallInt64 { - get { return hasSmallInt64; } - } - public long SmallInt64 { - get { return smallInt64_; } - } - - public const int Utf8StringFieldNumber = 6; - private bool hasUtf8String; - private string utf8String_ = (string) global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues.Descriptor.Fields[5].DefaultValue; - public bool HasUtf8String { - get { return hasUtf8String; } - } - public string Utf8String { - get { return utf8String_; } - } - - public const int ZeroFloatFieldNumber = 7; - private bool hasZeroFloat; - private float zeroFloat_; - public bool HasZeroFloat { - get { return hasZeroFloat; } - } - public float ZeroFloat { - get { return zeroFloat_; } - } - - public const int OneFloatFieldNumber = 8; - private bool hasOneFloat; - private float oneFloat_ = 1F; - public bool HasOneFloat { - get { return hasOneFloat; } - } - public float OneFloat { - get { return oneFloat_; } - } - - public const int SmallFloatFieldNumber = 9; - private bool hasSmallFloat; - private float smallFloat_ = 1.5F; - public bool HasSmallFloat { - get { return hasSmallFloat; } - } - public float SmallFloat { - get { return smallFloat_; } - } - - public const int NegativeOneFloatFieldNumber = 10; - private bool hasNegativeOneFloat; - private float negativeOneFloat_ = -1F; - public bool HasNegativeOneFloat { - get { return hasNegativeOneFloat; } - } - public float NegativeOneFloat { - get { return negativeOneFloat_; } - } - - public const int NegativeFloatFieldNumber = 11; - private bool hasNegativeFloat; - private float negativeFloat_ = -1.5F; - public bool HasNegativeFloat { - get { return hasNegativeFloat; } - } - public float NegativeFloat { - get { return negativeFloat_; } - } - - public const int LargeFloatFieldNumber = 12; - private bool hasLargeFloat; - private float largeFloat_ = 2E+08F; - public bool HasLargeFloat { - get { return hasLargeFloat; } - } - public float LargeFloat { - get { return largeFloat_; } - } - - public const int SmallNegativeFloatFieldNumber = 13; - private bool hasSmallNegativeFloat; - private float smallNegativeFloat_ = -8E-28F; - public bool HasSmallNegativeFloat { - get { return hasSmallNegativeFloat; } - } - public float SmallNegativeFloat { - get { return smallNegativeFloat_; } - } - - public const int InfDoubleFieldNumber = 14; - private bool hasInfDouble; - private double infDouble_ = double.PositiveInfinity; - public bool HasInfDouble { - get { return hasInfDouble; } - } - public double InfDouble { - get { return infDouble_; } - } - - public const int NegInfDoubleFieldNumber = 15; - private bool hasNegInfDouble; - private double negInfDouble_ = double.NegativeInfinity; - public bool HasNegInfDouble { - get { return hasNegInfDouble; } - } - public double NegInfDouble { - get { return negInfDouble_; } - } - - public const int NanDoubleFieldNumber = 16; - private bool hasNanDouble; - private double nanDouble_ = double.NaN; - public bool HasNanDouble { - get { return hasNanDouble; } - } - public double NanDouble { - get { return nanDouble_; } - } - - public const int InfFloatFieldNumber = 17; - private bool hasInfFloat; - private float infFloat_ = float.PositiveInfinity; - public bool HasInfFloat { - get { return hasInfFloat; } - } - public float InfFloat { - get { return infFloat_; } - } - - public const int NegInfFloatFieldNumber = 18; - private bool hasNegInfFloat; - private float negInfFloat_ = float.NegativeInfinity; - public bool HasNegInfFloat { - get { return hasNegInfFloat; } - } - public float NegInfFloat { - get { return negInfFloat_; } - } - - public const int NanFloatFieldNumber = 19; - private bool hasNanFloat; - private float nanFloat_ = float.NaN; - public bool HasNanFloat { - get { return hasNanFloat; } - } - public float NanFloat { - get { return nanFloat_; } - } - - public const int CppTrigraphFieldNumber = 20; - private bool hasCppTrigraph; - private string cppTrigraph_ = "? ? ?? ?? ??? ??/ ??-"; - public bool HasCppTrigraph { - get { return hasCppTrigraph; } - } - public string CppTrigraph { - get { return cppTrigraph_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testExtremeDefaultValuesFieldNames; - if (hasEscapedBytes) { - output.WriteBytes(1, field_names[1], EscapedBytes); - } - if (hasLargeUint32) { - output.WriteUInt32(2, field_names[5], LargeUint32); - } - if (hasLargeUint64) { - output.WriteUInt64(3, field_names[6], LargeUint64); - } - if (hasSmallInt32) { - output.WriteInt32(4, field_names[15], SmallInt32); - } - if (hasSmallInt64) { - output.WriteInt64(5, field_names[16], SmallInt64); - } - if (hasUtf8String) { - output.WriteString(6, field_names[18], Utf8String); - } - if (hasZeroFloat) { - output.WriteFloat(7, field_names[19], ZeroFloat); - } - if (hasOneFloat) { - output.WriteFloat(8, field_names[13], OneFloat); - } - if (hasSmallFloat) { - output.WriteFloat(9, field_names[14], SmallFloat); - } - if (hasNegativeOneFloat) { - output.WriteFloat(10, field_names[12], NegativeOneFloat); - } - if (hasNegativeFloat) { - output.WriteFloat(11, field_names[11], NegativeFloat); - } - if (hasLargeFloat) { - output.WriteFloat(12, field_names[4], LargeFloat); - } - if (hasSmallNegativeFloat) { - output.WriteFloat(13, field_names[17], SmallNegativeFloat); - } - if (hasInfDouble) { - output.WriteDouble(14, field_names[2], InfDouble); - } - if (hasNegInfDouble) { - output.WriteDouble(15, field_names[9], NegInfDouble); - } - if (hasNanDouble) { - output.WriteDouble(16, field_names[7], NanDouble); - } - if (hasInfFloat) { - output.WriteFloat(17, field_names[3], InfFloat); - } - if (hasNegInfFloat) { - output.WriteFloat(18, field_names[10], NegInfFloat); - } - if (hasNanFloat) { - output.WriteFloat(19, field_names[8], NanFloat); - } - if (hasCppTrigraph) { - output.WriteString(20, field_names[0], CppTrigraph); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasEscapedBytes) { - size += pb::CodedOutputStream.ComputeBytesSize(1, EscapedBytes); - } - if (hasLargeUint32) { - size += pb::CodedOutputStream.ComputeUInt32Size(2, LargeUint32); - } - if (hasLargeUint64) { - size += pb::CodedOutputStream.ComputeUInt64Size(3, LargeUint64); - } - if (hasSmallInt32) { - size += pb::CodedOutputStream.ComputeInt32Size(4, SmallInt32); - } - if (hasSmallInt64) { - size += pb::CodedOutputStream.ComputeInt64Size(5, SmallInt64); - } - if (hasUtf8String) { - size += pb::CodedOutputStream.ComputeStringSize(6, Utf8String); - } - if (hasZeroFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(7, ZeroFloat); - } - if (hasOneFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(8, OneFloat); - } - if (hasSmallFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(9, SmallFloat); - } - if (hasNegativeOneFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(10, NegativeOneFloat); - } - if (hasNegativeFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(11, NegativeFloat); - } - if (hasLargeFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(12, LargeFloat); - } - if (hasSmallNegativeFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(13, SmallNegativeFloat); - } - if (hasInfDouble) { - size += pb::CodedOutputStream.ComputeDoubleSize(14, InfDouble); - } - if (hasNegInfDouble) { - size += pb::CodedOutputStream.ComputeDoubleSize(15, NegInfDouble); - } - if (hasNanDouble) { - size += pb::CodedOutputStream.ComputeDoubleSize(16, NanDouble); - } - if (hasInfFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(17, InfFloat); - } - if (hasNegInfFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(18, NegInfFloat); - } - if (hasNanFloat) { - size += pb::CodedOutputStream.ComputeFloatSize(19, NanFloat); - } - if (hasCppTrigraph) { - size += pb::CodedOutputStream.ComputeStringSize(20, CppTrigraph); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestExtremeDefaultValues ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestExtremeDefaultValues ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestExtremeDefaultValues ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestExtremeDefaultValues ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestExtremeDefaultValues ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestExtremeDefaultValues ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestExtremeDefaultValues ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestExtremeDefaultValues ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestExtremeDefaultValues ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestExtremeDefaultValues ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestExtremeDefaultValues MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestExtremeDefaultValues prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestExtremeDefaultValues cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestExtremeDefaultValues result; - - private TestExtremeDefaultValues PrepareBuilder() { - if (resultIsReadOnly) { - TestExtremeDefaultValues original = result; - result = new TestExtremeDefaultValues(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestExtremeDefaultValues MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues.Descriptor; } - } - - public override TestExtremeDefaultValues DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues.DefaultInstance; } - } - - public override TestExtremeDefaultValues BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestExtremeDefaultValues) { - return MergeFrom((TestExtremeDefaultValues) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestExtremeDefaultValues other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasEscapedBytes) { - EscapedBytes = other.EscapedBytes; - } - if (other.HasLargeUint32) { - LargeUint32 = other.LargeUint32; - } - if (other.HasLargeUint64) { - LargeUint64 = other.LargeUint64; - } - if (other.HasSmallInt32) { - SmallInt32 = other.SmallInt32; - } - if (other.HasSmallInt64) { - SmallInt64 = other.SmallInt64; - } - if (other.HasUtf8String) { - Utf8String = other.Utf8String; - } - if (other.HasZeroFloat) { - ZeroFloat = other.ZeroFloat; - } - if (other.HasOneFloat) { - OneFloat = other.OneFloat; - } - if (other.HasSmallFloat) { - SmallFloat = other.SmallFloat; - } - if (other.HasNegativeOneFloat) { - NegativeOneFloat = other.NegativeOneFloat; - } - if (other.HasNegativeFloat) { - NegativeFloat = other.NegativeFloat; - } - if (other.HasLargeFloat) { - LargeFloat = other.LargeFloat; - } - if (other.HasSmallNegativeFloat) { - SmallNegativeFloat = other.SmallNegativeFloat; - } - if (other.HasInfDouble) { - InfDouble = other.InfDouble; - } - if (other.HasNegInfDouble) { - NegInfDouble = other.NegInfDouble; - } - if (other.HasNanDouble) { - NanDouble = other.NanDouble; - } - if (other.HasInfFloat) { - InfFloat = other.InfFloat; - } - if (other.HasNegInfFloat) { - NegInfFloat = other.NegInfFloat; - } - if (other.HasNanFloat) { - NanFloat = other.NanFloat; - } - if (other.HasCppTrigraph) { - CppTrigraph = other.CppTrigraph; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testExtremeDefaultValuesFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testExtremeDefaultValuesFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasEscapedBytes = input.ReadBytes(ref result.escapedBytes_); - break; - } - case 16: { - result.hasLargeUint32 = input.ReadUInt32(ref result.largeUint32_); - break; - } - case 24: { - result.hasLargeUint64 = input.ReadUInt64(ref result.largeUint64_); - break; - } - case 32: { - result.hasSmallInt32 = input.ReadInt32(ref result.smallInt32_); - break; - } - case 40: { - result.hasSmallInt64 = input.ReadInt64(ref result.smallInt64_); - break; - } - case 50: { - result.hasUtf8String = input.ReadString(ref result.utf8String_); - break; - } - case 61: { - result.hasZeroFloat = input.ReadFloat(ref result.zeroFloat_); - break; - } - case 69: { - result.hasOneFloat = input.ReadFloat(ref result.oneFloat_); - break; - } - case 77: { - result.hasSmallFloat = input.ReadFloat(ref result.smallFloat_); - break; - } - case 85: { - result.hasNegativeOneFloat = input.ReadFloat(ref result.negativeOneFloat_); - break; - } - case 93: { - result.hasNegativeFloat = input.ReadFloat(ref result.negativeFloat_); - break; - } - case 101: { - result.hasLargeFloat = input.ReadFloat(ref result.largeFloat_); - break; - } - case 109: { - result.hasSmallNegativeFloat = input.ReadFloat(ref result.smallNegativeFloat_); - break; - } - case 113: { - result.hasInfDouble = input.ReadDouble(ref result.infDouble_); - break; - } - case 121: { - result.hasNegInfDouble = input.ReadDouble(ref result.negInfDouble_); - break; - } - case 129: { - result.hasNanDouble = input.ReadDouble(ref result.nanDouble_); - break; - } - case 141: { - result.hasInfFloat = input.ReadFloat(ref result.infFloat_); - break; - } - case 149: { - result.hasNegInfFloat = input.ReadFloat(ref result.negInfFloat_); - break; - } - case 157: { - result.hasNanFloat = input.ReadFloat(ref result.nanFloat_); - break; - } - case 162: { - result.hasCppTrigraph = input.ReadString(ref result.cppTrigraph_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasEscapedBytes { - get { return result.hasEscapedBytes; } - } - public pb::ByteString EscapedBytes { - get { return result.EscapedBytes; } - set { SetEscapedBytes(value); } - } - public Builder SetEscapedBytes(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasEscapedBytes = true; - result.escapedBytes_ = value; - return this; - } - public Builder ClearEscapedBytes() { - PrepareBuilder(); - result.hasEscapedBytes = false; - result.escapedBytes_ = (pb::ByteString) global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues.Descriptor.Fields[0].DefaultValue; - return this; - } - - public bool HasLargeUint32 { - get { return result.hasLargeUint32; } - } - [global::System.CLSCompliant(false)] - public uint LargeUint32 { - get { return result.LargeUint32; } - set { SetLargeUint32(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetLargeUint32(uint value) { - PrepareBuilder(); - result.hasLargeUint32 = true; - result.largeUint32_ = value; - return this; - } - public Builder ClearLargeUint32() { - PrepareBuilder(); - result.hasLargeUint32 = false; - result.largeUint32_ = 4294967295; - return this; - } - - public bool HasLargeUint64 { - get { return result.hasLargeUint64; } - } - [global::System.CLSCompliant(false)] - public ulong LargeUint64 { - get { return result.LargeUint64; } - set { SetLargeUint64(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetLargeUint64(ulong value) { - PrepareBuilder(); - result.hasLargeUint64 = true; - result.largeUint64_ = value; - return this; - } - public Builder ClearLargeUint64() { - PrepareBuilder(); - result.hasLargeUint64 = false; - result.largeUint64_ = 18446744073709551615UL; - return this; - } - - public bool HasSmallInt32 { - get { return result.hasSmallInt32; } - } - public int SmallInt32 { - get { return result.SmallInt32; } - set { SetSmallInt32(value); } - } - public Builder SetSmallInt32(int value) { - PrepareBuilder(); - result.hasSmallInt32 = true; - result.smallInt32_ = value; - return this; - } - public Builder ClearSmallInt32() { - PrepareBuilder(); - result.hasSmallInt32 = false; - result.smallInt32_ = -2147483647; - return this; - } - - public bool HasSmallInt64 { - get { return result.hasSmallInt64; } - } - public long SmallInt64 { - get { return result.SmallInt64; } - set { SetSmallInt64(value); } - } - public Builder SetSmallInt64(long value) { - PrepareBuilder(); - result.hasSmallInt64 = true; - result.smallInt64_ = value; - return this; - } - public Builder ClearSmallInt64() { - PrepareBuilder(); - result.hasSmallInt64 = false; - result.smallInt64_ = -9223372036854775807L; - return this; - } - - public bool HasUtf8String { - get { return result.hasUtf8String; } - } - public string Utf8String { - get { return result.Utf8String; } - set { SetUtf8String(value); } - } - public Builder SetUtf8String(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasUtf8String = true; - result.utf8String_ = value; - return this; - } - public Builder ClearUtf8String() { - PrepareBuilder(); - result.hasUtf8String = false; - result.utf8String_ = (string) global::Google.ProtocolBuffers.TestProtos.TestExtremeDefaultValues.Descriptor.Fields[5].DefaultValue; - return this; - } - - public bool HasZeroFloat { - get { return result.hasZeroFloat; } - } - public float ZeroFloat { - get { return result.ZeroFloat; } - set { SetZeroFloat(value); } - } - public Builder SetZeroFloat(float value) { - PrepareBuilder(); - result.hasZeroFloat = true; - result.zeroFloat_ = value; - return this; - } - public Builder ClearZeroFloat() { - PrepareBuilder(); - result.hasZeroFloat = false; - result.zeroFloat_ = 0F; - return this; - } - - public bool HasOneFloat { - get { return result.hasOneFloat; } - } - public float OneFloat { - get { return result.OneFloat; } - set { SetOneFloat(value); } - } - public Builder SetOneFloat(float value) { - PrepareBuilder(); - result.hasOneFloat = true; - result.oneFloat_ = value; - return this; - } - public Builder ClearOneFloat() { - PrepareBuilder(); - result.hasOneFloat = false; - result.oneFloat_ = 1F; - return this; - } - - public bool HasSmallFloat { - get { return result.hasSmallFloat; } - } - public float SmallFloat { - get { return result.SmallFloat; } - set { SetSmallFloat(value); } - } - public Builder SetSmallFloat(float value) { - PrepareBuilder(); - result.hasSmallFloat = true; - result.smallFloat_ = value; - return this; - } - public Builder ClearSmallFloat() { - PrepareBuilder(); - result.hasSmallFloat = false; - result.smallFloat_ = 1.5F; - return this; - } - - public bool HasNegativeOneFloat { - get { return result.hasNegativeOneFloat; } - } - public float NegativeOneFloat { - get { return result.NegativeOneFloat; } - set { SetNegativeOneFloat(value); } - } - public Builder SetNegativeOneFloat(float value) { - PrepareBuilder(); - result.hasNegativeOneFloat = true; - result.negativeOneFloat_ = value; - return this; - } - public Builder ClearNegativeOneFloat() { - PrepareBuilder(); - result.hasNegativeOneFloat = false; - result.negativeOneFloat_ = -1F; - return this; - } - - public bool HasNegativeFloat { - get { return result.hasNegativeFloat; } - } - public float NegativeFloat { - get { return result.NegativeFloat; } - set { SetNegativeFloat(value); } - } - public Builder SetNegativeFloat(float value) { - PrepareBuilder(); - result.hasNegativeFloat = true; - result.negativeFloat_ = value; - return this; - } - public Builder ClearNegativeFloat() { - PrepareBuilder(); - result.hasNegativeFloat = false; - result.negativeFloat_ = -1.5F; - return this; - } - - public bool HasLargeFloat { - get { return result.hasLargeFloat; } - } - public float LargeFloat { - get { return result.LargeFloat; } - set { SetLargeFloat(value); } - } - public Builder SetLargeFloat(float value) { - PrepareBuilder(); - result.hasLargeFloat = true; - result.largeFloat_ = value; - return this; - } - public Builder ClearLargeFloat() { - PrepareBuilder(); - result.hasLargeFloat = false; - result.largeFloat_ = 2E+08F; - return this; - } - - public bool HasSmallNegativeFloat { - get { return result.hasSmallNegativeFloat; } - } - public float SmallNegativeFloat { - get { return result.SmallNegativeFloat; } - set { SetSmallNegativeFloat(value); } - } - public Builder SetSmallNegativeFloat(float value) { - PrepareBuilder(); - result.hasSmallNegativeFloat = true; - result.smallNegativeFloat_ = value; - return this; - } - public Builder ClearSmallNegativeFloat() { - PrepareBuilder(); - result.hasSmallNegativeFloat = false; - result.smallNegativeFloat_ = -8E-28F; - return this; - } - - public bool HasInfDouble { - get { return result.hasInfDouble; } - } - public double InfDouble { - get { return result.InfDouble; } - set { SetInfDouble(value); } - } - public Builder SetInfDouble(double value) { - PrepareBuilder(); - result.hasInfDouble = true; - result.infDouble_ = value; - return this; - } - public Builder ClearInfDouble() { - PrepareBuilder(); - result.hasInfDouble = false; - result.infDouble_ = double.PositiveInfinity; - return this; - } - - public bool HasNegInfDouble { - get { return result.hasNegInfDouble; } - } - public double NegInfDouble { - get { return result.NegInfDouble; } - set { SetNegInfDouble(value); } - } - public Builder SetNegInfDouble(double value) { - PrepareBuilder(); - result.hasNegInfDouble = true; - result.negInfDouble_ = value; - return this; - } - public Builder ClearNegInfDouble() { - PrepareBuilder(); - result.hasNegInfDouble = false; - result.negInfDouble_ = double.NegativeInfinity; - return this; - } - - public bool HasNanDouble { - get { return result.hasNanDouble; } - } - public double NanDouble { - get { return result.NanDouble; } - set { SetNanDouble(value); } - } - public Builder SetNanDouble(double value) { - PrepareBuilder(); - result.hasNanDouble = true; - result.nanDouble_ = value; - return this; - } - public Builder ClearNanDouble() { - PrepareBuilder(); - result.hasNanDouble = false; - result.nanDouble_ = double.NaN; - return this; - } - - public bool HasInfFloat { - get { return result.hasInfFloat; } - } - public float InfFloat { - get { return result.InfFloat; } - set { SetInfFloat(value); } - } - public Builder SetInfFloat(float value) { - PrepareBuilder(); - result.hasInfFloat = true; - result.infFloat_ = value; - return this; - } - public Builder ClearInfFloat() { - PrepareBuilder(); - result.hasInfFloat = false; - result.infFloat_ = float.PositiveInfinity; - return this; - } - - public bool HasNegInfFloat { - get { return result.hasNegInfFloat; } - } - public float NegInfFloat { - get { return result.NegInfFloat; } - set { SetNegInfFloat(value); } - } - public Builder SetNegInfFloat(float value) { - PrepareBuilder(); - result.hasNegInfFloat = true; - result.negInfFloat_ = value; - return this; - } - public Builder ClearNegInfFloat() { - PrepareBuilder(); - result.hasNegInfFloat = false; - result.negInfFloat_ = float.NegativeInfinity; - return this; - } - - public bool HasNanFloat { - get { return result.hasNanFloat; } - } - public float NanFloat { - get { return result.NanFloat; } - set { SetNanFloat(value); } - } - public Builder SetNanFloat(float value) { - PrepareBuilder(); - result.hasNanFloat = true; - result.nanFloat_ = value; - return this; - } - public Builder ClearNanFloat() { - PrepareBuilder(); - result.hasNanFloat = false; - result.nanFloat_ = float.NaN; - return this; - } - - public bool HasCppTrigraph { - get { return result.hasCppTrigraph; } - } - public string CppTrigraph { - get { return result.CppTrigraph; } - set { SetCppTrigraph(value); } - } - public Builder SetCppTrigraph(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasCppTrigraph = true; - result.cppTrigraph_ = value; - return this; - } - public Builder ClearCppTrigraph() { - PrepareBuilder(); - result.hasCppTrigraph = false; - result.cppTrigraph_ = "? ? ?? ?? ??? ??/ ??-"; - return this; - } - } - static TestExtremeDefaultValues() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class SparseEnumMessage : pb::GeneratedMessage { - private SparseEnumMessage() { } - private static readonly SparseEnumMessage defaultInstance = new SparseEnumMessage().MakeReadOnly(); - private static readonly string[] _sparseEnumMessageFieldNames = new string[] { "sparse_enum" }; - private static readonly uint[] _sparseEnumMessageFieldTags = new uint[] { 8 }; - public static SparseEnumMessage DefaultInstance { - get { return defaultInstance; } - } - - public override SparseEnumMessage DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override SparseEnumMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_SparseEnumMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_SparseEnumMessage__FieldAccessorTable; } - } - - public const int SparseEnumFieldNumber = 1; - private bool hasSparseEnum; - private global::Google.ProtocolBuffers.TestProtos.TestSparseEnum sparseEnum_ = global::Google.ProtocolBuffers.TestProtos.TestSparseEnum.SPARSE_A; - public bool HasSparseEnum { - get { return hasSparseEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.TestSparseEnum SparseEnum { - get { return sparseEnum_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _sparseEnumMessageFieldNames; - if (hasSparseEnum) { - output.WriteEnum(1, field_names[0], (int) SparseEnum, SparseEnum); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasSparseEnum) { - size += pb::CodedOutputStream.ComputeEnumSize(1, (int) SparseEnum); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static SparseEnumMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SparseEnumMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SparseEnumMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SparseEnumMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SparseEnumMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SparseEnumMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SparseEnumMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SparseEnumMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SparseEnumMessage ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SparseEnumMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private SparseEnumMessage MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SparseEnumMessage prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(SparseEnumMessage cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private SparseEnumMessage result; - - private SparseEnumMessage PrepareBuilder() { - if (resultIsReadOnly) { - SparseEnumMessage original = result; - result = new SparseEnumMessage(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override SparseEnumMessage MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.SparseEnumMessage.Descriptor; } - } - - public override SparseEnumMessage DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.SparseEnumMessage.DefaultInstance; } - } - - public override SparseEnumMessage BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SparseEnumMessage) { - return MergeFrom((SparseEnumMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SparseEnumMessage other) { - if (other == global::Google.ProtocolBuffers.TestProtos.SparseEnumMessage.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasSparseEnum) { - SparseEnum = other.SparseEnum; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_sparseEnumMessageFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _sparseEnumMessageFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 8: { - object unknown; - if(input.ReadEnum(ref result.sparseEnum_, out unknown)) { - result.hasSparseEnum = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(1, (ulong)(int)unknown); - } - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasSparseEnum { - get { return result.hasSparseEnum; } - } - public global::Google.ProtocolBuffers.TestProtos.TestSparseEnum SparseEnum { - get { return result.SparseEnum; } - set { SetSparseEnum(value); } - } - public Builder SetSparseEnum(global::Google.ProtocolBuffers.TestProtos.TestSparseEnum value) { - PrepareBuilder(); - result.hasSparseEnum = true; - result.sparseEnum_ = value; - return this; - } - public Builder ClearSparseEnum() { - PrepareBuilder(); - result.hasSparseEnum = false; - result.sparseEnum_ = global::Google.ProtocolBuffers.TestProtos.TestSparseEnum.SPARSE_A; - return this; - } - } - static SparseEnumMessage() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class OneString : pb::GeneratedMessage { - private OneString() { } - private static readonly OneString defaultInstance = new OneString().MakeReadOnly(); - private static readonly string[] _oneStringFieldNames = new string[] { "data" }; - private static readonly uint[] _oneStringFieldTags = new uint[] { 10 }; - public static OneString DefaultInstance { - get { return defaultInstance; } - } - - public override OneString DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override OneString ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_OneString__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_OneString__FieldAccessorTable; } - } - - public const int DataFieldNumber = 1; - private bool hasData; - private string data_ = ""; - public bool HasData { - get { return hasData; } - } - public string Data { - get { return data_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _oneStringFieldNames; - if (hasData) { - output.WriteString(1, field_names[0], Data); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasData) { - size += pb::CodedOutputStream.ComputeStringSize(1, Data); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static OneString ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OneString ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OneString ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OneString ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OneString ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OneString ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static OneString ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static OneString ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static OneString ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OneString ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private OneString MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(OneString prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(OneString cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private OneString result; - - private OneString PrepareBuilder() { - if (resultIsReadOnly) { - OneString original = result; - result = new OneString(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override OneString MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.OneString.Descriptor; } - } - - public override OneString DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.OneString.DefaultInstance; } - } - - public override OneString BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is OneString) { - return MergeFrom((OneString) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(OneString other) { - if (other == global::Google.ProtocolBuffers.TestProtos.OneString.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasData) { - Data = other.Data; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_oneStringFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _oneStringFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasData = input.ReadString(ref result.data_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasData { - get { return result.hasData; } - } - public string Data { - get { return result.Data; } - set { SetData(value); } - } - public Builder SetData(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasData = true; - result.data_ = value; - return this; - } - public Builder ClearData() { - PrepareBuilder(); - result.hasData = false; - result.data_ = ""; - return this; - } - } - static OneString() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class OneBytes : pb::GeneratedMessage { - private OneBytes() { } - private static readonly OneBytes defaultInstance = new OneBytes().MakeReadOnly(); - private static readonly string[] _oneBytesFieldNames = new string[] { "data" }; - private static readonly uint[] _oneBytesFieldTags = new uint[] { 10 }; - public static OneBytes DefaultInstance { - get { return defaultInstance; } - } - - public override OneBytes DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override OneBytes ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_OneBytes__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_OneBytes__FieldAccessorTable; } - } - - public const int DataFieldNumber = 1; - private bool hasData; - private pb::ByteString data_ = pb::ByteString.Empty; - public bool HasData { - get { return hasData; } - } - public pb::ByteString Data { - get { return data_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _oneBytesFieldNames; - if (hasData) { - output.WriteBytes(1, field_names[0], Data); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasData) { - size += pb::CodedOutputStream.ComputeBytesSize(1, Data); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static OneBytes ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OneBytes ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OneBytes ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OneBytes ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OneBytes ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OneBytes ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static OneBytes ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static OneBytes ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static OneBytes ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OneBytes ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private OneBytes MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(OneBytes prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(OneBytes cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private OneBytes result; - - private OneBytes PrepareBuilder() { - if (resultIsReadOnly) { - OneBytes original = result; - result = new OneBytes(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override OneBytes MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.OneBytes.Descriptor; } - } - - public override OneBytes DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.OneBytes.DefaultInstance; } - } - - public override OneBytes BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is OneBytes) { - return MergeFrom((OneBytes) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(OneBytes other) { - if (other == global::Google.ProtocolBuffers.TestProtos.OneBytes.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasData) { - Data = other.Data; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_oneBytesFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _oneBytesFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasData = input.ReadBytes(ref result.data_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasData { - get { return result.hasData; } - } - public pb::ByteString Data { - get { return result.Data; } - set { SetData(value); } - } - public Builder SetData(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasData = true; - result.data_ = value; - return this; - } - public Builder ClearData() { - PrepareBuilder(); - result.hasData = false; - result.data_ = pb::ByteString.Empty; - return this; - } - } - static OneBytes() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestPackedTypes : pb::GeneratedMessage { - private TestPackedTypes() { } - private static readonly TestPackedTypes defaultInstance = new TestPackedTypes().MakeReadOnly(); - private static readonly string[] _testPackedTypesFieldNames = new string[] { "packed_bool", "packed_double", "packed_enum", "packed_fixed32", "packed_fixed64", "packed_float", "packed_int32", "packed_int64", "packed_sfixed32", "packed_sfixed64", "packed_sint32", "packed_sint64", "packed_uint32", "packed_uint64" }; - private static readonly uint[] _testPackedTypesFieldTags = new uint[] { 818, 810, 826, 770, 778, 802, 722, 730, 786, 794, 754, 762, 738, 746 }; - public static TestPackedTypes DefaultInstance { - get { return defaultInstance; } - } - - public override TestPackedTypes DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestPackedTypes ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestPackedTypes__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestPackedTypes__FieldAccessorTable; } - } - - public const int PackedInt32FieldNumber = 90; - private int packedInt32MemoizedSerializedSize; - private pbc::PopsicleList packedInt32_ = new pbc::PopsicleList(); - public scg::IList PackedInt32List { - get { return pbc::Lists.AsReadOnly(packedInt32_); } - } - public int PackedInt32Count { - get { return packedInt32_.Count; } - } - public int GetPackedInt32(int index) { - return packedInt32_[index]; - } - - public const int PackedInt64FieldNumber = 91; - private int packedInt64MemoizedSerializedSize; - private pbc::PopsicleList packedInt64_ = new pbc::PopsicleList(); - public scg::IList PackedInt64List { - get { return pbc::Lists.AsReadOnly(packedInt64_); } - } - public int PackedInt64Count { - get { return packedInt64_.Count; } - } - public long GetPackedInt64(int index) { - return packedInt64_[index]; - } - - public const int PackedUint32FieldNumber = 92; - private int packedUint32MemoizedSerializedSize; - private pbc::PopsicleList packedUint32_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList PackedUint32List { - get { return pbc::Lists.AsReadOnly(packedUint32_); } - } - public int PackedUint32Count { - get { return packedUint32_.Count; } - } - [global::System.CLSCompliant(false)] - public uint GetPackedUint32(int index) { - return packedUint32_[index]; - } - - public const int PackedUint64FieldNumber = 93; - private int packedUint64MemoizedSerializedSize; - private pbc::PopsicleList packedUint64_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList PackedUint64List { - get { return pbc::Lists.AsReadOnly(packedUint64_); } - } - public int PackedUint64Count { - get { return packedUint64_.Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetPackedUint64(int index) { - return packedUint64_[index]; - } - - public const int PackedSint32FieldNumber = 94; - private int packedSint32MemoizedSerializedSize; - private pbc::PopsicleList packedSint32_ = new pbc::PopsicleList(); - public scg::IList PackedSint32List { - get { return pbc::Lists.AsReadOnly(packedSint32_); } - } - public int PackedSint32Count { - get { return packedSint32_.Count; } - } - public int GetPackedSint32(int index) { - return packedSint32_[index]; - } - - public const int PackedSint64FieldNumber = 95; - private int packedSint64MemoizedSerializedSize; - private pbc::PopsicleList packedSint64_ = new pbc::PopsicleList(); - public scg::IList PackedSint64List { - get { return pbc::Lists.AsReadOnly(packedSint64_); } - } - public int PackedSint64Count { - get { return packedSint64_.Count; } - } - public long GetPackedSint64(int index) { - return packedSint64_[index]; - } - - public const int PackedFixed32FieldNumber = 96; - private int packedFixed32MemoizedSerializedSize; - private pbc::PopsicleList packedFixed32_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList PackedFixed32List { - get { return pbc::Lists.AsReadOnly(packedFixed32_); } - } - public int PackedFixed32Count { - get { return packedFixed32_.Count; } - } - [global::System.CLSCompliant(false)] - public uint GetPackedFixed32(int index) { - return packedFixed32_[index]; - } - - public const int PackedFixed64FieldNumber = 97; - private int packedFixed64MemoizedSerializedSize; - private pbc::PopsicleList packedFixed64_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList PackedFixed64List { - get { return pbc::Lists.AsReadOnly(packedFixed64_); } - } - public int PackedFixed64Count { - get { return packedFixed64_.Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetPackedFixed64(int index) { - return packedFixed64_[index]; - } - - public const int PackedSfixed32FieldNumber = 98; - private int packedSfixed32MemoizedSerializedSize; - private pbc::PopsicleList packedSfixed32_ = new pbc::PopsicleList(); - public scg::IList PackedSfixed32List { - get { return pbc::Lists.AsReadOnly(packedSfixed32_); } - } - public int PackedSfixed32Count { - get { return packedSfixed32_.Count; } - } - public int GetPackedSfixed32(int index) { - return packedSfixed32_[index]; - } - - public const int PackedSfixed64FieldNumber = 99; - private int packedSfixed64MemoizedSerializedSize; - private pbc::PopsicleList packedSfixed64_ = new pbc::PopsicleList(); - public scg::IList PackedSfixed64List { - get { return pbc::Lists.AsReadOnly(packedSfixed64_); } - } - public int PackedSfixed64Count { - get { return packedSfixed64_.Count; } - } - public long GetPackedSfixed64(int index) { - return packedSfixed64_[index]; - } - - public const int PackedFloatFieldNumber = 100; - private int packedFloatMemoizedSerializedSize; - private pbc::PopsicleList packedFloat_ = new pbc::PopsicleList(); - public scg::IList PackedFloatList { - get { return pbc::Lists.AsReadOnly(packedFloat_); } - } - public int PackedFloatCount { - get { return packedFloat_.Count; } - } - public float GetPackedFloat(int index) { - return packedFloat_[index]; - } - - public const int PackedDoubleFieldNumber = 101; - private int packedDoubleMemoizedSerializedSize; - private pbc::PopsicleList packedDouble_ = new pbc::PopsicleList(); - public scg::IList PackedDoubleList { - get { return pbc::Lists.AsReadOnly(packedDouble_); } - } - public int PackedDoubleCount { - get { return packedDouble_.Count; } - } - public double GetPackedDouble(int index) { - return packedDouble_[index]; - } - - public const int PackedBoolFieldNumber = 102; - private int packedBoolMemoizedSerializedSize; - private pbc::PopsicleList packedBool_ = new pbc::PopsicleList(); - public scg::IList PackedBoolList { - get { return pbc::Lists.AsReadOnly(packedBool_); } - } - public int PackedBoolCount { - get { return packedBool_.Count; } - } - public bool GetPackedBool(int index) { - return packedBool_[index]; - } - - public const int PackedEnumFieldNumber = 103; - private int packedEnumMemoizedSerializedSize; - private pbc::PopsicleList packedEnum_ = new pbc::PopsicleList(); - public scg::IList PackedEnumList { - get { return pbc::Lists.AsReadOnly(packedEnum_); } - } - public int PackedEnumCount { - get { return packedEnum_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum GetPackedEnum(int index) { - return packedEnum_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testPackedTypesFieldNames; - if (packedInt32_.Count > 0) { - output.WritePackedInt32Array(90, field_names[6], packedInt32MemoizedSerializedSize, packedInt32_); - } - if (packedInt64_.Count > 0) { - output.WritePackedInt64Array(91, field_names[7], packedInt64MemoizedSerializedSize, packedInt64_); - } - if (packedUint32_.Count > 0) { - output.WritePackedUInt32Array(92, field_names[12], packedUint32MemoizedSerializedSize, packedUint32_); - } - if (packedUint64_.Count > 0) { - output.WritePackedUInt64Array(93, field_names[13], packedUint64MemoizedSerializedSize, packedUint64_); - } - if (packedSint32_.Count > 0) { - output.WritePackedSInt32Array(94, field_names[10], packedSint32MemoizedSerializedSize, packedSint32_); - } - if (packedSint64_.Count > 0) { - output.WritePackedSInt64Array(95, field_names[11], packedSint64MemoizedSerializedSize, packedSint64_); - } - if (packedFixed32_.Count > 0) { - output.WritePackedFixed32Array(96, field_names[3], packedFixed32MemoizedSerializedSize, packedFixed32_); - } - if (packedFixed64_.Count > 0) { - output.WritePackedFixed64Array(97, field_names[4], packedFixed64MemoizedSerializedSize, packedFixed64_); - } - if (packedSfixed32_.Count > 0) { - output.WritePackedSFixed32Array(98, field_names[8], packedSfixed32MemoizedSerializedSize, packedSfixed32_); - } - if (packedSfixed64_.Count > 0) { - output.WritePackedSFixed64Array(99, field_names[9], packedSfixed64MemoizedSerializedSize, packedSfixed64_); - } - if (packedFloat_.Count > 0) { - output.WritePackedFloatArray(100, field_names[5], packedFloatMemoizedSerializedSize, packedFloat_); - } - if (packedDouble_.Count > 0) { - output.WritePackedDoubleArray(101, field_names[1], packedDoubleMemoizedSerializedSize, packedDouble_); - } - if (packedBool_.Count > 0) { - output.WritePackedBoolArray(102, field_names[0], packedBoolMemoizedSerializedSize, packedBool_); - } - if (packedEnum_.Count > 0) { - output.WritePackedEnumArray(103, field_names[2], packedEnumMemoizedSerializedSize, packedEnum_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - foreach (int element in PackedInt32List) { - dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); - } - size += dataSize; - if (packedInt32_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedInt32MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - foreach (long element in PackedInt64List) { - dataSize += pb::CodedOutputStream.ComputeInt64SizeNoTag(element); - } - size += dataSize; - if (packedInt64_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedInt64MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - foreach (uint element in PackedUint32List) { - dataSize += pb::CodedOutputStream.ComputeUInt32SizeNoTag(element); - } - size += dataSize; - if (packedUint32_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedUint32MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - foreach (ulong element in PackedUint64List) { - dataSize += pb::CodedOutputStream.ComputeUInt64SizeNoTag(element); - } - size += dataSize; - if (packedUint64_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedUint64MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - foreach (int element in PackedSint32List) { - dataSize += pb::CodedOutputStream.ComputeSInt32SizeNoTag(element); - } - size += dataSize; - if (packedSint32_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedSint32MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - foreach (long element in PackedSint64List) { - dataSize += pb::CodedOutputStream.ComputeSInt64SizeNoTag(element); - } - size += dataSize; - if (packedSint64_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedSint64MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 4 * packedFixed32_.Count; - size += dataSize; - if (packedFixed32_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedFixed32MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 8 * packedFixed64_.Count; - size += dataSize; - if (packedFixed64_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedFixed64MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 4 * packedSfixed32_.Count; - size += dataSize; - if (packedSfixed32_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedSfixed32MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 8 * packedSfixed64_.Count; - size += dataSize; - if (packedSfixed64_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedSfixed64MemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 4 * packedFloat_.Count; - size += dataSize; - if (packedFloat_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedFloatMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 8 * packedDouble_.Count; - size += dataSize; - if (packedDouble_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedDoubleMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 1 * packedBool_.Count; - size += dataSize; - if (packedBool_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedBoolMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - if (packedEnum_.Count > 0) { - foreach (global::Google.ProtocolBuffers.TestProtos.ForeignEnum element in packedEnum_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 2; - size += pb::CodedOutputStream.ComputeRawVarint32Size((uint) dataSize); - } - packedEnumMemoizedSerializedSize = dataSize; - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestPackedTypes ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestPackedTypes ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestPackedTypes ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestPackedTypes ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestPackedTypes ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestPackedTypes ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestPackedTypes ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestPackedTypes ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestPackedTypes ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestPackedTypes ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestPackedTypes MakeReadOnly() { - packedInt32_.MakeReadOnly(); - packedInt64_.MakeReadOnly(); - packedUint32_.MakeReadOnly(); - packedUint64_.MakeReadOnly(); - packedSint32_.MakeReadOnly(); - packedSint64_.MakeReadOnly(); - packedFixed32_.MakeReadOnly(); - packedFixed64_.MakeReadOnly(); - packedSfixed32_.MakeReadOnly(); - packedSfixed64_.MakeReadOnly(); - packedFloat_.MakeReadOnly(); - packedDouble_.MakeReadOnly(); - packedBool_.MakeReadOnly(); - packedEnum_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestPackedTypes prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestPackedTypes cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestPackedTypes result; - - private TestPackedTypes PrepareBuilder() { - if (resultIsReadOnly) { - TestPackedTypes original = result; - result = new TestPackedTypes(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestPackedTypes MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestPackedTypes.Descriptor; } - } - - public override TestPackedTypes DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestPackedTypes.DefaultInstance; } - } - - public override TestPackedTypes BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestPackedTypes) { - return MergeFrom((TestPackedTypes) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestPackedTypes other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestPackedTypes.DefaultInstance) return this; - PrepareBuilder(); - if (other.packedInt32_.Count != 0) { - result.packedInt32_.Add(other.packedInt32_); - } - if (other.packedInt64_.Count != 0) { - result.packedInt64_.Add(other.packedInt64_); - } - if (other.packedUint32_.Count != 0) { - result.packedUint32_.Add(other.packedUint32_); - } - if (other.packedUint64_.Count != 0) { - result.packedUint64_.Add(other.packedUint64_); - } - if (other.packedSint32_.Count != 0) { - result.packedSint32_.Add(other.packedSint32_); - } - if (other.packedSint64_.Count != 0) { - result.packedSint64_.Add(other.packedSint64_); - } - if (other.packedFixed32_.Count != 0) { - result.packedFixed32_.Add(other.packedFixed32_); - } - if (other.packedFixed64_.Count != 0) { - result.packedFixed64_.Add(other.packedFixed64_); - } - if (other.packedSfixed32_.Count != 0) { - result.packedSfixed32_.Add(other.packedSfixed32_); - } - if (other.packedSfixed64_.Count != 0) { - result.packedSfixed64_.Add(other.packedSfixed64_); - } - if (other.packedFloat_.Count != 0) { - result.packedFloat_.Add(other.packedFloat_); - } - if (other.packedDouble_.Count != 0) { - result.packedDouble_.Add(other.packedDouble_); - } - if (other.packedBool_.Count != 0) { - result.packedBool_.Add(other.packedBool_); - } - if (other.packedEnum_.Count != 0) { - result.packedEnum_.Add(other.packedEnum_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testPackedTypesFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testPackedTypesFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 722: - case 720: { - input.ReadInt32Array(tag, field_name, result.packedInt32_); - break; - } - case 730: - case 728: { - input.ReadInt64Array(tag, field_name, result.packedInt64_); - break; - } - case 738: - case 736: { - input.ReadUInt32Array(tag, field_name, result.packedUint32_); - break; - } - case 746: - case 744: { - input.ReadUInt64Array(tag, field_name, result.packedUint64_); - break; - } - case 754: - case 752: { - input.ReadSInt32Array(tag, field_name, result.packedSint32_); - break; - } - case 762: - case 760: { - input.ReadSInt64Array(tag, field_name, result.packedSint64_); - break; - } - case 770: - case 773: { - input.ReadFixed32Array(tag, field_name, result.packedFixed32_); - break; - } - case 778: - case 777: { - input.ReadFixed64Array(tag, field_name, result.packedFixed64_); - break; - } - case 786: - case 789: { - input.ReadSFixed32Array(tag, field_name, result.packedSfixed32_); - break; - } - case 794: - case 793: { - input.ReadSFixed64Array(tag, field_name, result.packedSfixed64_); - break; - } - case 802: - case 805: { - input.ReadFloatArray(tag, field_name, result.packedFloat_); - break; - } - case 810: - case 809: { - input.ReadDoubleArray(tag, field_name, result.packedDouble_); - break; - } - case 818: - case 816: { - input.ReadBoolArray(tag, field_name, result.packedBool_); - break; - } - case 826: - case 824: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.packedEnum_, out unknownItems); - if (unknownItems != null) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - foreach (object rawValue in unknownItems) - if (rawValue is int) - unknownFields.MergeVarintField(103, (ulong)(int)rawValue); - } - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public pbc::IPopsicleList PackedInt32List { - get { return PrepareBuilder().packedInt32_; } - } - public int PackedInt32Count { - get { return result.PackedInt32Count; } - } - public int GetPackedInt32(int index) { - return result.GetPackedInt32(index); - } - public Builder SetPackedInt32(int index, int value) { - PrepareBuilder(); - result.packedInt32_[index] = value; - return this; - } - public Builder AddPackedInt32(int value) { - PrepareBuilder(); - result.packedInt32_.Add(value); - return this; - } - public Builder AddRangePackedInt32(scg::IEnumerable values) { - PrepareBuilder(); - result.packedInt32_.Add(values); - return this; - } - public Builder ClearPackedInt32() { - PrepareBuilder(); - result.packedInt32_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedInt64List { - get { return PrepareBuilder().packedInt64_; } - } - public int PackedInt64Count { - get { return result.PackedInt64Count; } - } - public long GetPackedInt64(int index) { - return result.GetPackedInt64(index); - } - public Builder SetPackedInt64(int index, long value) { - PrepareBuilder(); - result.packedInt64_[index] = value; - return this; - } - public Builder AddPackedInt64(long value) { - PrepareBuilder(); - result.packedInt64_.Add(value); - return this; - } - public Builder AddRangePackedInt64(scg::IEnumerable values) { - PrepareBuilder(); - result.packedInt64_.Add(values); - return this; - } - public Builder ClearPackedInt64() { - PrepareBuilder(); - result.packedInt64_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList PackedUint32List { - get { return PrepareBuilder().packedUint32_; } - } - public int PackedUint32Count { - get { return result.PackedUint32Count; } - } - [global::System.CLSCompliant(false)] - public uint GetPackedUint32(int index) { - return result.GetPackedUint32(index); - } - [global::System.CLSCompliant(false)] - public Builder SetPackedUint32(int index, uint value) { - PrepareBuilder(); - result.packedUint32_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddPackedUint32(uint value) { - PrepareBuilder(); - result.packedUint32_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangePackedUint32(scg::IEnumerable values) { - PrepareBuilder(); - result.packedUint32_.Add(values); - return this; - } - public Builder ClearPackedUint32() { - PrepareBuilder(); - result.packedUint32_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList PackedUint64List { - get { return PrepareBuilder().packedUint64_; } - } - public int PackedUint64Count { - get { return result.PackedUint64Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetPackedUint64(int index) { - return result.GetPackedUint64(index); - } - [global::System.CLSCompliant(false)] - public Builder SetPackedUint64(int index, ulong value) { - PrepareBuilder(); - result.packedUint64_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddPackedUint64(ulong value) { - PrepareBuilder(); - result.packedUint64_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangePackedUint64(scg::IEnumerable values) { - PrepareBuilder(); - result.packedUint64_.Add(values); - return this; - } - public Builder ClearPackedUint64() { - PrepareBuilder(); - result.packedUint64_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedSint32List { - get { return PrepareBuilder().packedSint32_; } - } - public int PackedSint32Count { - get { return result.PackedSint32Count; } - } - public int GetPackedSint32(int index) { - return result.GetPackedSint32(index); - } - public Builder SetPackedSint32(int index, int value) { - PrepareBuilder(); - result.packedSint32_[index] = value; - return this; - } - public Builder AddPackedSint32(int value) { - PrepareBuilder(); - result.packedSint32_.Add(value); - return this; - } - public Builder AddRangePackedSint32(scg::IEnumerable values) { - PrepareBuilder(); - result.packedSint32_.Add(values); - return this; - } - public Builder ClearPackedSint32() { - PrepareBuilder(); - result.packedSint32_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedSint64List { - get { return PrepareBuilder().packedSint64_; } - } - public int PackedSint64Count { - get { return result.PackedSint64Count; } - } - public long GetPackedSint64(int index) { - return result.GetPackedSint64(index); - } - public Builder SetPackedSint64(int index, long value) { - PrepareBuilder(); - result.packedSint64_[index] = value; - return this; - } - public Builder AddPackedSint64(long value) { - PrepareBuilder(); - result.packedSint64_.Add(value); - return this; - } - public Builder AddRangePackedSint64(scg::IEnumerable values) { - PrepareBuilder(); - result.packedSint64_.Add(values); - return this; - } - public Builder ClearPackedSint64() { - PrepareBuilder(); - result.packedSint64_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList PackedFixed32List { - get { return PrepareBuilder().packedFixed32_; } - } - public int PackedFixed32Count { - get { return result.PackedFixed32Count; } - } - [global::System.CLSCompliant(false)] - public uint GetPackedFixed32(int index) { - return result.GetPackedFixed32(index); - } - [global::System.CLSCompliant(false)] - public Builder SetPackedFixed32(int index, uint value) { - PrepareBuilder(); - result.packedFixed32_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddPackedFixed32(uint value) { - PrepareBuilder(); - result.packedFixed32_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangePackedFixed32(scg::IEnumerable values) { - PrepareBuilder(); - result.packedFixed32_.Add(values); - return this; - } - public Builder ClearPackedFixed32() { - PrepareBuilder(); - result.packedFixed32_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList PackedFixed64List { - get { return PrepareBuilder().packedFixed64_; } - } - public int PackedFixed64Count { - get { return result.PackedFixed64Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetPackedFixed64(int index) { - return result.GetPackedFixed64(index); - } - [global::System.CLSCompliant(false)] - public Builder SetPackedFixed64(int index, ulong value) { - PrepareBuilder(); - result.packedFixed64_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddPackedFixed64(ulong value) { - PrepareBuilder(); - result.packedFixed64_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangePackedFixed64(scg::IEnumerable values) { - PrepareBuilder(); - result.packedFixed64_.Add(values); - return this; - } - public Builder ClearPackedFixed64() { - PrepareBuilder(); - result.packedFixed64_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedSfixed32List { - get { return PrepareBuilder().packedSfixed32_; } - } - public int PackedSfixed32Count { - get { return result.PackedSfixed32Count; } - } - public int GetPackedSfixed32(int index) { - return result.GetPackedSfixed32(index); - } - public Builder SetPackedSfixed32(int index, int value) { - PrepareBuilder(); - result.packedSfixed32_[index] = value; - return this; - } - public Builder AddPackedSfixed32(int value) { - PrepareBuilder(); - result.packedSfixed32_.Add(value); - return this; - } - public Builder AddRangePackedSfixed32(scg::IEnumerable values) { - PrepareBuilder(); - result.packedSfixed32_.Add(values); - return this; - } - public Builder ClearPackedSfixed32() { - PrepareBuilder(); - result.packedSfixed32_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedSfixed64List { - get { return PrepareBuilder().packedSfixed64_; } - } - public int PackedSfixed64Count { - get { return result.PackedSfixed64Count; } - } - public long GetPackedSfixed64(int index) { - return result.GetPackedSfixed64(index); - } - public Builder SetPackedSfixed64(int index, long value) { - PrepareBuilder(); - result.packedSfixed64_[index] = value; - return this; - } - public Builder AddPackedSfixed64(long value) { - PrepareBuilder(); - result.packedSfixed64_.Add(value); - return this; - } - public Builder AddRangePackedSfixed64(scg::IEnumerable values) { - PrepareBuilder(); - result.packedSfixed64_.Add(values); - return this; - } - public Builder ClearPackedSfixed64() { - PrepareBuilder(); - result.packedSfixed64_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedFloatList { - get { return PrepareBuilder().packedFloat_; } - } - public int PackedFloatCount { - get { return result.PackedFloatCount; } - } - public float GetPackedFloat(int index) { - return result.GetPackedFloat(index); - } - public Builder SetPackedFloat(int index, float value) { - PrepareBuilder(); - result.packedFloat_[index] = value; - return this; - } - public Builder AddPackedFloat(float value) { - PrepareBuilder(); - result.packedFloat_.Add(value); - return this; - } - public Builder AddRangePackedFloat(scg::IEnumerable values) { - PrepareBuilder(); - result.packedFloat_.Add(values); - return this; - } - public Builder ClearPackedFloat() { - PrepareBuilder(); - result.packedFloat_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedDoubleList { - get { return PrepareBuilder().packedDouble_; } - } - public int PackedDoubleCount { - get { return result.PackedDoubleCount; } - } - public double GetPackedDouble(int index) { - return result.GetPackedDouble(index); - } - public Builder SetPackedDouble(int index, double value) { - PrepareBuilder(); - result.packedDouble_[index] = value; - return this; - } - public Builder AddPackedDouble(double value) { - PrepareBuilder(); - result.packedDouble_.Add(value); - return this; - } - public Builder AddRangePackedDouble(scg::IEnumerable values) { - PrepareBuilder(); - result.packedDouble_.Add(values); - return this; - } - public Builder ClearPackedDouble() { - PrepareBuilder(); - result.packedDouble_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedBoolList { - get { return PrepareBuilder().packedBool_; } - } - public int PackedBoolCount { - get { return result.PackedBoolCount; } - } - public bool GetPackedBool(int index) { - return result.GetPackedBool(index); - } - public Builder SetPackedBool(int index, bool value) { - PrepareBuilder(); - result.packedBool_[index] = value; - return this; - } - public Builder AddPackedBool(bool value) { - PrepareBuilder(); - result.packedBool_.Add(value); - return this; - } - public Builder AddRangePackedBool(scg::IEnumerable values) { - PrepareBuilder(); - result.packedBool_.Add(values); - return this; - } - public Builder ClearPackedBool() { - PrepareBuilder(); - result.packedBool_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedEnumList { - get { return PrepareBuilder().packedEnum_; } - } - public int PackedEnumCount { - get { return result.PackedEnumCount; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum GetPackedEnum(int index) { - return result.GetPackedEnum(index); - } - public Builder SetPackedEnum(int index, global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) { - PrepareBuilder(); - result.packedEnum_[index] = value; - return this; - } - public Builder AddPackedEnum(global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) { - PrepareBuilder(); - result.packedEnum_.Add(value); - return this; - } - public Builder AddRangePackedEnum(scg::IEnumerable values) { - PrepareBuilder(); - result.packedEnum_.Add(values); - return this; - } - public Builder ClearPackedEnum() { - PrepareBuilder(); - result.packedEnum_.Clear(); - return this; - } - } - static TestPackedTypes() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestUnpackedTypes : pb::GeneratedMessage { - private TestUnpackedTypes() { } - private static readonly TestUnpackedTypes defaultInstance = new TestUnpackedTypes().MakeReadOnly(); - private static readonly string[] _testUnpackedTypesFieldNames = new string[] { "unpacked_bool", "unpacked_double", "unpacked_enum", "unpacked_fixed32", "unpacked_fixed64", "unpacked_float", "unpacked_int32", "unpacked_int64", "unpacked_sfixed32", "unpacked_sfixed64", "unpacked_sint32", "unpacked_sint64", "unpacked_uint32", "unpacked_uint64" }; - private static readonly uint[] _testUnpackedTypesFieldTags = new uint[] { 816, 809, 824, 773, 777, 805, 720, 728, 789, 793, 752, 760, 736, 744 }; - public static TestUnpackedTypes DefaultInstance { - get { return defaultInstance; } - } - - public override TestUnpackedTypes DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestUnpackedTypes ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestUnpackedTypes__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestUnpackedTypes__FieldAccessorTable; } - } - - public const int UnpackedInt32FieldNumber = 90; - private pbc::PopsicleList unpackedInt32_ = new pbc::PopsicleList(); - public scg::IList UnpackedInt32List { - get { return pbc::Lists.AsReadOnly(unpackedInt32_); } - } - public int UnpackedInt32Count { - get { return unpackedInt32_.Count; } - } - public int GetUnpackedInt32(int index) { - return unpackedInt32_[index]; - } - - public const int UnpackedInt64FieldNumber = 91; - private pbc::PopsicleList unpackedInt64_ = new pbc::PopsicleList(); - public scg::IList UnpackedInt64List { - get { return pbc::Lists.AsReadOnly(unpackedInt64_); } - } - public int UnpackedInt64Count { - get { return unpackedInt64_.Count; } - } - public long GetUnpackedInt64(int index) { - return unpackedInt64_[index]; - } - - public const int UnpackedUint32FieldNumber = 92; - private pbc::PopsicleList unpackedUint32_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList UnpackedUint32List { - get { return pbc::Lists.AsReadOnly(unpackedUint32_); } - } - public int UnpackedUint32Count { - get { return unpackedUint32_.Count; } - } - [global::System.CLSCompliant(false)] - public uint GetUnpackedUint32(int index) { - return unpackedUint32_[index]; - } - - public const int UnpackedUint64FieldNumber = 93; - private pbc::PopsicleList unpackedUint64_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList UnpackedUint64List { - get { return pbc::Lists.AsReadOnly(unpackedUint64_); } - } - public int UnpackedUint64Count { - get { return unpackedUint64_.Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetUnpackedUint64(int index) { - return unpackedUint64_[index]; - } - - public const int UnpackedSint32FieldNumber = 94; - private pbc::PopsicleList unpackedSint32_ = new pbc::PopsicleList(); - public scg::IList UnpackedSint32List { - get { return pbc::Lists.AsReadOnly(unpackedSint32_); } - } - public int UnpackedSint32Count { - get { return unpackedSint32_.Count; } - } - public int GetUnpackedSint32(int index) { - return unpackedSint32_[index]; - } - - public const int UnpackedSint64FieldNumber = 95; - private pbc::PopsicleList unpackedSint64_ = new pbc::PopsicleList(); - public scg::IList UnpackedSint64List { - get { return pbc::Lists.AsReadOnly(unpackedSint64_); } - } - public int UnpackedSint64Count { - get { return unpackedSint64_.Count; } - } - public long GetUnpackedSint64(int index) { - return unpackedSint64_[index]; - } - - public const int UnpackedFixed32FieldNumber = 96; - private pbc::PopsicleList unpackedFixed32_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList UnpackedFixed32List { - get { return pbc::Lists.AsReadOnly(unpackedFixed32_); } - } - public int UnpackedFixed32Count { - get { return unpackedFixed32_.Count; } - } - [global::System.CLSCompliant(false)] - public uint GetUnpackedFixed32(int index) { - return unpackedFixed32_[index]; - } - - public const int UnpackedFixed64FieldNumber = 97; - private pbc::PopsicleList unpackedFixed64_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList UnpackedFixed64List { - get { return pbc::Lists.AsReadOnly(unpackedFixed64_); } - } - public int UnpackedFixed64Count { - get { return unpackedFixed64_.Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetUnpackedFixed64(int index) { - return unpackedFixed64_[index]; - } - - public const int UnpackedSfixed32FieldNumber = 98; - private pbc::PopsicleList unpackedSfixed32_ = new pbc::PopsicleList(); - public scg::IList UnpackedSfixed32List { - get { return pbc::Lists.AsReadOnly(unpackedSfixed32_); } - } - public int UnpackedSfixed32Count { - get { return unpackedSfixed32_.Count; } - } - public int GetUnpackedSfixed32(int index) { - return unpackedSfixed32_[index]; - } - - public const int UnpackedSfixed64FieldNumber = 99; - private pbc::PopsicleList unpackedSfixed64_ = new pbc::PopsicleList(); - public scg::IList UnpackedSfixed64List { - get { return pbc::Lists.AsReadOnly(unpackedSfixed64_); } - } - public int UnpackedSfixed64Count { - get { return unpackedSfixed64_.Count; } - } - public long GetUnpackedSfixed64(int index) { - return unpackedSfixed64_[index]; - } - - public const int UnpackedFloatFieldNumber = 100; - private pbc::PopsicleList unpackedFloat_ = new pbc::PopsicleList(); - public scg::IList UnpackedFloatList { - get { return pbc::Lists.AsReadOnly(unpackedFloat_); } - } - public int UnpackedFloatCount { - get { return unpackedFloat_.Count; } - } - public float GetUnpackedFloat(int index) { - return unpackedFloat_[index]; - } - - public const int UnpackedDoubleFieldNumber = 101; - private pbc::PopsicleList unpackedDouble_ = new pbc::PopsicleList(); - public scg::IList UnpackedDoubleList { - get { return pbc::Lists.AsReadOnly(unpackedDouble_); } - } - public int UnpackedDoubleCount { - get { return unpackedDouble_.Count; } - } - public double GetUnpackedDouble(int index) { - return unpackedDouble_[index]; - } - - public const int UnpackedBoolFieldNumber = 102; - private pbc::PopsicleList unpackedBool_ = new pbc::PopsicleList(); - public scg::IList UnpackedBoolList { - get { return pbc::Lists.AsReadOnly(unpackedBool_); } - } - public int UnpackedBoolCount { - get { return unpackedBool_.Count; } - } - public bool GetUnpackedBool(int index) { - return unpackedBool_[index]; - } - - public const int UnpackedEnumFieldNumber = 103; - private pbc::PopsicleList unpackedEnum_ = new pbc::PopsicleList(); - public scg::IList UnpackedEnumList { - get { return pbc::Lists.AsReadOnly(unpackedEnum_); } - } - public int UnpackedEnumCount { - get { return unpackedEnum_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum GetUnpackedEnum(int index) { - return unpackedEnum_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testUnpackedTypesFieldNames; - if (unpackedInt32_.Count > 0) { - output.WriteInt32Array(90, field_names[6], unpackedInt32_); - } - if (unpackedInt64_.Count > 0) { - output.WriteInt64Array(91, field_names[7], unpackedInt64_); - } - if (unpackedUint32_.Count > 0) { - output.WriteUInt32Array(92, field_names[12], unpackedUint32_); - } - if (unpackedUint64_.Count > 0) { - output.WriteUInt64Array(93, field_names[13], unpackedUint64_); - } - if (unpackedSint32_.Count > 0) { - output.WriteSInt32Array(94, field_names[10], unpackedSint32_); - } - if (unpackedSint64_.Count > 0) { - output.WriteSInt64Array(95, field_names[11], unpackedSint64_); - } - if (unpackedFixed32_.Count > 0) { - output.WriteFixed32Array(96, field_names[3], unpackedFixed32_); - } - if (unpackedFixed64_.Count > 0) { - output.WriteFixed64Array(97, field_names[4], unpackedFixed64_); - } - if (unpackedSfixed32_.Count > 0) { - output.WriteSFixed32Array(98, field_names[8], unpackedSfixed32_); - } - if (unpackedSfixed64_.Count > 0) { - output.WriteSFixed64Array(99, field_names[9], unpackedSfixed64_); - } - if (unpackedFloat_.Count > 0) { - output.WriteFloatArray(100, field_names[5], unpackedFloat_); - } - if (unpackedDouble_.Count > 0) { - output.WriteDoubleArray(101, field_names[1], unpackedDouble_); - } - if (unpackedBool_.Count > 0) { - output.WriteBoolArray(102, field_names[0], unpackedBool_); - } - if (unpackedEnum_.Count > 0) { - output.WriteEnumArray(103, field_names[2], unpackedEnum_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - foreach (int element in UnpackedInt32List) { - dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); - } - size += dataSize; - size += 2 * unpackedInt32_.Count; - } - { - int dataSize = 0; - foreach (long element in UnpackedInt64List) { - dataSize += pb::CodedOutputStream.ComputeInt64SizeNoTag(element); - } - size += dataSize; - size += 2 * unpackedInt64_.Count; - } - { - int dataSize = 0; - foreach (uint element in UnpackedUint32List) { - dataSize += pb::CodedOutputStream.ComputeUInt32SizeNoTag(element); - } - size += dataSize; - size += 2 * unpackedUint32_.Count; - } - { - int dataSize = 0; - foreach (ulong element in UnpackedUint64List) { - dataSize += pb::CodedOutputStream.ComputeUInt64SizeNoTag(element); - } - size += dataSize; - size += 2 * unpackedUint64_.Count; - } - { - int dataSize = 0; - foreach (int element in UnpackedSint32List) { - dataSize += pb::CodedOutputStream.ComputeSInt32SizeNoTag(element); - } - size += dataSize; - size += 2 * unpackedSint32_.Count; - } - { - int dataSize = 0; - foreach (long element in UnpackedSint64List) { - dataSize += pb::CodedOutputStream.ComputeSInt64SizeNoTag(element); - } - size += dataSize; - size += 2 * unpackedSint64_.Count; - } - { - int dataSize = 0; - dataSize = 4 * unpackedFixed32_.Count; - size += dataSize; - size += 2 * unpackedFixed32_.Count; - } - { - int dataSize = 0; - dataSize = 8 * unpackedFixed64_.Count; - size += dataSize; - size += 2 * unpackedFixed64_.Count; - } - { - int dataSize = 0; - dataSize = 4 * unpackedSfixed32_.Count; - size += dataSize; - size += 2 * unpackedSfixed32_.Count; - } - { - int dataSize = 0; - dataSize = 8 * unpackedSfixed64_.Count; - size += dataSize; - size += 2 * unpackedSfixed64_.Count; - } - { - int dataSize = 0; - dataSize = 4 * unpackedFloat_.Count; - size += dataSize; - size += 2 * unpackedFloat_.Count; - } - { - int dataSize = 0; - dataSize = 8 * unpackedDouble_.Count; - size += dataSize; - size += 2 * unpackedDouble_.Count; - } - { - int dataSize = 0; - dataSize = 1 * unpackedBool_.Count; - size += dataSize; - size += 2 * unpackedBool_.Count; - } - { - int dataSize = 0; - if (unpackedEnum_.Count > 0) { - foreach (global::Google.ProtocolBuffers.TestProtos.ForeignEnum element in unpackedEnum_) { - dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); - } - size += dataSize; - size += 2 * unpackedEnum_.Count; - } - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestUnpackedTypes ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestUnpackedTypes ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestUnpackedTypes ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestUnpackedTypes ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestUnpackedTypes ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestUnpackedTypes ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestUnpackedTypes ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestUnpackedTypes ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestUnpackedTypes ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestUnpackedTypes ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestUnpackedTypes MakeReadOnly() { - unpackedInt32_.MakeReadOnly(); - unpackedInt64_.MakeReadOnly(); - unpackedUint32_.MakeReadOnly(); - unpackedUint64_.MakeReadOnly(); - unpackedSint32_.MakeReadOnly(); - unpackedSint64_.MakeReadOnly(); - unpackedFixed32_.MakeReadOnly(); - unpackedFixed64_.MakeReadOnly(); - unpackedSfixed32_.MakeReadOnly(); - unpackedSfixed64_.MakeReadOnly(); - unpackedFloat_.MakeReadOnly(); - unpackedDouble_.MakeReadOnly(); - unpackedBool_.MakeReadOnly(); - unpackedEnum_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestUnpackedTypes prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestUnpackedTypes cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestUnpackedTypes result; - - private TestUnpackedTypes PrepareBuilder() { - if (resultIsReadOnly) { - TestUnpackedTypes original = result; - result = new TestUnpackedTypes(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestUnpackedTypes MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestUnpackedTypes.Descriptor; } - } - - public override TestUnpackedTypes DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestUnpackedTypes.DefaultInstance; } - } - - public override TestUnpackedTypes BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestUnpackedTypes) { - return MergeFrom((TestUnpackedTypes) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestUnpackedTypes other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestUnpackedTypes.DefaultInstance) return this; - PrepareBuilder(); - if (other.unpackedInt32_.Count != 0) { - result.unpackedInt32_.Add(other.unpackedInt32_); - } - if (other.unpackedInt64_.Count != 0) { - result.unpackedInt64_.Add(other.unpackedInt64_); - } - if (other.unpackedUint32_.Count != 0) { - result.unpackedUint32_.Add(other.unpackedUint32_); - } - if (other.unpackedUint64_.Count != 0) { - result.unpackedUint64_.Add(other.unpackedUint64_); - } - if (other.unpackedSint32_.Count != 0) { - result.unpackedSint32_.Add(other.unpackedSint32_); - } - if (other.unpackedSint64_.Count != 0) { - result.unpackedSint64_.Add(other.unpackedSint64_); - } - if (other.unpackedFixed32_.Count != 0) { - result.unpackedFixed32_.Add(other.unpackedFixed32_); - } - if (other.unpackedFixed64_.Count != 0) { - result.unpackedFixed64_.Add(other.unpackedFixed64_); - } - if (other.unpackedSfixed32_.Count != 0) { - result.unpackedSfixed32_.Add(other.unpackedSfixed32_); - } - if (other.unpackedSfixed64_.Count != 0) { - result.unpackedSfixed64_.Add(other.unpackedSfixed64_); - } - if (other.unpackedFloat_.Count != 0) { - result.unpackedFloat_.Add(other.unpackedFloat_); - } - if (other.unpackedDouble_.Count != 0) { - result.unpackedDouble_.Add(other.unpackedDouble_); - } - if (other.unpackedBool_.Count != 0) { - result.unpackedBool_.Add(other.unpackedBool_); - } - if (other.unpackedEnum_.Count != 0) { - result.unpackedEnum_.Add(other.unpackedEnum_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testUnpackedTypesFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testUnpackedTypesFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 722: - case 720: { - input.ReadInt32Array(tag, field_name, result.unpackedInt32_); - break; - } - case 730: - case 728: { - input.ReadInt64Array(tag, field_name, result.unpackedInt64_); - break; - } - case 738: - case 736: { - input.ReadUInt32Array(tag, field_name, result.unpackedUint32_); - break; - } - case 746: - case 744: { - input.ReadUInt64Array(tag, field_name, result.unpackedUint64_); - break; - } - case 754: - case 752: { - input.ReadSInt32Array(tag, field_name, result.unpackedSint32_); - break; - } - case 762: - case 760: { - input.ReadSInt64Array(tag, field_name, result.unpackedSint64_); - break; - } - case 770: - case 773: { - input.ReadFixed32Array(tag, field_name, result.unpackedFixed32_); - break; - } - case 778: - case 777: { - input.ReadFixed64Array(tag, field_name, result.unpackedFixed64_); - break; - } - case 786: - case 789: { - input.ReadSFixed32Array(tag, field_name, result.unpackedSfixed32_); - break; - } - case 794: - case 793: { - input.ReadSFixed64Array(tag, field_name, result.unpackedSfixed64_); - break; - } - case 802: - case 805: { - input.ReadFloatArray(tag, field_name, result.unpackedFloat_); - break; - } - case 810: - case 809: { - input.ReadDoubleArray(tag, field_name, result.unpackedDouble_); - break; - } - case 818: - case 816: { - input.ReadBoolArray(tag, field_name, result.unpackedBool_); - break; - } - case 826: - case 824: { - scg::ICollection unknownItems; - input.ReadEnumArray(tag, field_name, result.unpackedEnum_, out unknownItems); - if (unknownItems != null) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - foreach (object rawValue in unknownItems) - if (rawValue is int) - unknownFields.MergeVarintField(103, (ulong)(int)rawValue); - } - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public pbc::IPopsicleList UnpackedInt32List { - get { return PrepareBuilder().unpackedInt32_; } - } - public int UnpackedInt32Count { - get { return result.UnpackedInt32Count; } - } - public int GetUnpackedInt32(int index) { - return result.GetUnpackedInt32(index); - } - public Builder SetUnpackedInt32(int index, int value) { - PrepareBuilder(); - result.unpackedInt32_[index] = value; - return this; - } - public Builder AddUnpackedInt32(int value) { - PrepareBuilder(); - result.unpackedInt32_.Add(value); - return this; - } - public Builder AddRangeUnpackedInt32(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedInt32_.Add(values); - return this; - } - public Builder ClearUnpackedInt32() { - PrepareBuilder(); - result.unpackedInt32_.Clear(); - return this; - } - - public pbc::IPopsicleList UnpackedInt64List { - get { return PrepareBuilder().unpackedInt64_; } - } - public int UnpackedInt64Count { - get { return result.UnpackedInt64Count; } - } - public long GetUnpackedInt64(int index) { - return result.GetUnpackedInt64(index); - } - public Builder SetUnpackedInt64(int index, long value) { - PrepareBuilder(); - result.unpackedInt64_[index] = value; - return this; - } - public Builder AddUnpackedInt64(long value) { - PrepareBuilder(); - result.unpackedInt64_.Add(value); - return this; - } - public Builder AddRangeUnpackedInt64(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedInt64_.Add(values); - return this; - } - public Builder ClearUnpackedInt64() { - PrepareBuilder(); - result.unpackedInt64_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList UnpackedUint32List { - get { return PrepareBuilder().unpackedUint32_; } - } - public int UnpackedUint32Count { - get { return result.UnpackedUint32Count; } - } - [global::System.CLSCompliant(false)] - public uint GetUnpackedUint32(int index) { - return result.GetUnpackedUint32(index); - } - [global::System.CLSCompliant(false)] - public Builder SetUnpackedUint32(int index, uint value) { - PrepareBuilder(); - result.unpackedUint32_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddUnpackedUint32(uint value) { - PrepareBuilder(); - result.unpackedUint32_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeUnpackedUint32(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedUint32_.Add(values); - return this; - } - public Builder ClearUnpackedUint32() { - PrepareBuilder(); - result.unpackedUint32_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList UnpackedUint64List { - get { return PrepareBuilder().unpackedUint64_; } - } - public int UnpackedUint64Count { - get { return result.UnpackedUint64Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetUnpackedUint64(int index) { - return result.GetUnpackedUint64(index); - } - [global::System.CLSCompliant(false)] - public Builder SetUnpackedUint64(int index, ulong value) { - PrepareBuilder(); - result.unpackedUint64_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddUnpackedUint64(ulong value) { - PrepareBuilder(); - result.unpackedUint64_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeUnpackedUint64(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedUint64_.Add(values); - return this; - } - public Builder ClearUnpackedUint64() { - PrepareBuilder(); - result.unpackedUint64_.Clear(); - return this; - } - - public pbc::IPopsicleList UnpackedSint32List { - get { return PrepareBuilder().unpackedSint32_; } - } - public int UnpackedSint32Count { - get { return result.UnpackedSint32Count; } - } - public int GetUnpackedSint32(int index) { - return result.GetUnpackedSint32(index); - } - public Builder SetUnpackedSint32(int index, int value) { - PrepareBuilder(); - result.unpackedSint32_[index] = value; - return this; - } - public Builder AddUnpackedSint32(int value) { - PrepareBuilder(); - result.unpackedSint32_.Add(value); - return this; - } - public Builder AddRangeUnpackedSint32(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedSint32_.Add(values); - return this; - } - public Builder ClearUnpackedSint32() { - PrepareBuilder(); - result.unpackedSint32_.Clear(); - return this; - } - - public pbc::IPopsicleList UnpackedSint64List { - get { return PrepareBuilder().unpackedSint64_; } - } - public int UnpackedSint64Count { - get { return result.UnpackedSint64Count; } - } - public long GetUnpackedSint64(int index) { - return result.GetUnpackedSint64(index); - } - public Builder SetUnpackedSint64(int index, long value) { - PrepareBuilder(); - result.unpackedSint64_[index] = value; - return this; - } - public Builder AddUnpackedSint64(long value) { - PrepareBuilder(); - result.unpackedSint64_.Add(value); - return this; - } - public Builder AddRangeUnpackedSint64(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedSint64_.Add(values); - return this; - } - public Builder ClearUnpackedSint64() { - PrepareBuilder(); - result.unpackedSint64_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList UnpackedFixed32List { - get { return PrepareBuilder().unpackedFixed32_; } - } - public int UnpackedFixed32Count { - get { return result.UnpackedFixed32Count; } - } - [global::System.CLSCompliant(false)] - public uint GetUnpackedFixed32(int index) { - return result.GetUnpackedFixed32(index); - } - [global::System.CLSCompliant(false)] - public Builder SetUnpackedFixed32(int index, uint value) { - PrepareBuilder(); - result.unpackedFixed32_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddUnpackedFixed32(uint value) { - PrepareBuilder(); - result.unpackedFixed32_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeUnpackedFixed32(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedFixed32_.Add(values); - return this; - } - public Builder ClearUnpackedFixed32() { - PrepareBuilder(); - result.unpackedFixed32_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList UnpackedFixed64List { - get { return PrepareBuilder().unpackedFixed64_; } - } - public int UnpackedFixed64Count { - get { return result.UnpackedFixed64Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetUnpackedFixed64(int index) { - return result.GetUnpackedFixed64(index); - } - [global::System.CLSCompliant(false)] - public Builder SetUnpackedFixed64(int index, ulong value) { - PrepareBuilder(); - result.unpackedFixed64_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddUnpackedFixed64(ulong value) { - PrepareBuilder(); - result.unpackedFixed64_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeUnpackedFixed64(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedFixed64_.Add(values); - return this; - } - public Builder ClearUnpackedFixed64() { - PrepareBuilder(); - result.unpackedFixed64_.Clear(); - return this; - } - - public pbc::IPopsicleList UnpackedSfixed32List { - get { return PrepareBuilder().unpackedSfixed32_; } - } - public int UnpackedSfixed32Count { - get { return result.UnpackedSfixed32Count; } - } - public int GetUnpackedSfixed32(int index) { - return result.GetUnpackedSfixed32(index); - } - public Builder SetUnpackedSfixed32(int index, int value) { - PrepareBuilder(); - result.unpackedSfixed32_[index] = value; - return this; - } - public Builder AddUnpackedSfixed32(int value) { - PrepareBuilder(); - result.unpackedSfixed32_.Add(value); - return this; - } - public Builder AddRangeUnpackedSfixed32(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedSfixed32_.Add(values); - return this; - } - public Builder ClearUnpackedSfixed32() { - PrepareBuilder(); - result.unpackedSfixed32_.Clear(); - return this; - } - - public pbc::IPopsicleList UnpackedSfixed64List { - get { return PrepareBuilder().unpackedSfixed64_; } - } - public int UnpackedSfixed64Count { - get { return result.UnpackedSfixed64Count; } - } - public long GetUnpackedSfixed64(int index) { - return result.GetUnpackedSfixed64(index); - } - public Builder SetUnpackedSfixed64(int index, long value) { - PrepareBuilder(); - result.unpackedSfixed64_[index] = value; - return this; - } - public Builder AddUnpackedSfixed64(long value) { - PrepareBuilder(); - result.unpackedSfixed64_.Add(value); - return this; - } - public Builder AddRangeUnpackedSfixed64(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedSfixed64_.Add(values); - return this; - } - public Builder ClearUnpackedSfixed64() { - PrepareBuilder(); - result.unpackedSfixed64_.Clear(); - return this; - } - - public pbc::IPopsicleList UnpackedFloatList { - get { return PrepareBuilder().unpackedFloat_; } - } - public int UnpackedFloatCount { - get { return result.UnpackedFloatCount; } - } - public float GetUnpackedFloat(int index) { - return result.GetUnpackedFloat(index); - } - public Builder SetUnpackedFloat(int index, float value) { - PrepareBuilder(); - result.unpackedFloat_[index] = value; - return this; - } - public Builder AddUnpackedFloat(float value) { - PrepareBuilder(); - result.unpackedFloat_.Add(value); - return this; - } - public Builder AddRangeUnpackedFloat(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedFloat_.Add(values); - return this; - } - public Builder ClearUnpackedFloat() { - PrepareBuilder(); - result.unpackedFloat_.Clear(); - return this; - } - - public pbc::IPopsicleList UnpackedDoubleList { - get { return PrepareBuilder().unpackedDouble_; } - } - public int UnpackedDoubleCount { - get { return result.UnpackedDoubleCount; } - } - public double GetUnpackedDouble(int index) { - return result.GetUnpackedDouble(index); - } - public Builder SetUnpackedDouble(int index, double value) { - PrepareBuilder(); - result.unpackedDouble_[index] = value; - return this; - } - public Builder AddUnpackedDouble(double value) { - PrepareBuilder(); - result.unpackedDouble_.Add(value); - return this; - } - public Builder AddRangeUnpackedDouble(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedDouble_.Add(values); - return this; - } - public Builder ClearUnpackedDouble() { - PrepareBuilder(); - result.unpackedDouble_.Clear(); - return this; - } - - public pbc::IPopsicleList UnpackedBoolList { - get { return PrepareBuilder().unpackedBool_; } - } - public int UnpackedBoolCount { - get { return result.UnpackedBoolCount; } - } - public bool GetUnpackedBool(int index) { - return result.GetUnpackedBool(index); - } - public Builder SetUnpackedBool(int index, bool value) { - PrepareBuilder(); - result.unpackedBool_[index] = value; - return this; - } - public Builder AddUnpackedBool(bool value) { - PrepareBuilder(); - result.unpackedBool_.Add(value); - return this; - } - public Builder AddRangeUnpackedBool(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedBool_.Add(values); - return this; - } - public Builder ClearUnpackedBool() { - PrepareBuilder(); - result.unpackedBool_.Clear(); - return this; - } - - public pbc::IPopsicleList UnpackedEnumList { - get { return PrepareBuilder().unpackedEnum_; } - } - public int UnpackedEnumCount { - get { return result.UnpackedEnumCount; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum GetUnpackedEnum(int index) { - return result.GetUnpackedEnum(index); - } - public Builder SetUnpackedEnum(int index, global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) { - PrepareBuilder(); - result.unpackedEnum_[index] = value; - return this; - } - public Builder AddUnpackedEnum(global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) { - PrepareBuilder(); - result.unpackedEnum_.Add(value); - return this; - } - public Builder AddRangeUnpackedEnum(scg::IEnumerable values) { - PrepareBuilder(); - result.unpackedEnum_.Add(values); - return this; - } - public Builder ClearUnpackedEnum() { - PrepareBuilder(); - result.unpackedEnum_.Clear(); - return this; - } - } - static TestUnpackedTypes() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestPackedExtensions : pb::ExtendableMessage { - private TestPackedExtensions() { } - private static readonly TestPackedExtensions defaultInstance = new TestPackedExtensions().MakeReadOnly(); - private static readonly string[] _testPackedExtensionsFieldNames = new string[] { }; - private static readonly uint[] _testPackedExtensionsFieldTags = new uint[] { }; - public static TestPackedExtensions DefaultInstance { - get { return defaultInstance; } - } - - public override TestPackedExtensions DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestPackedExtensions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestPackedExtensions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestPackedExtensions__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testPackedExtensionsFieldNames; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - extensionWriter.WriteUntil(536870912, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestPackedExtensions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestPackedExtensions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestPackedExtensions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestPackedExtensions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestPackedExtensions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestPackedExtensions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestPackedExtensions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestPackedExtensions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestPackedExtensions ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestPackedExtensions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestPackedExtensions MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestPackedExtensions prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestPackedExtensions cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestPackedExtensions result; - - private TestPackedExtensions PrepareBuilder() { - if (resultIsReadOnly) { - TestPackedExtensions original = result; - result = new TestPackedExtensions(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestPackedExtensions MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestPackedExtensions.Descriptor; } - } - - public override TestPackedExtensions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestPackedExtensions.DefaultInstance; } - } - - public override TestPackedExtensions BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestPackedExtensions) { - return MergeFrom((TestPackedExtensions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestPackedExtensions other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestPackedExtensions.DefaultInstance) return this; - PrepareBuilder(); - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testPackedExtensionsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testPackedExtensionsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static TestPackedExtensions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestDynamicExtensions : pb::GeneratedMessage { - private TestDynamicExtensions() { } - private static readonly TestDynamicExtensions defaultInstance = new TestDynamicExtensions().MakeReadOnly(); - private static readonly string[] _testDynamicExtensionsFieldNames = new string[] { "dynamic_enum_extension", "dynamic_message_extension", "enum_extension", "message_extension", "packed_extension", "repeated_extension", "scalar_extension" }; - private static readonly uint[] _testDynamicExtensionsFieldTags = new uint[] { 16016, 16034, 16008, 16026, 16050, 16042, 16005 }; - public static TestDynamicExtensions DefaultInstance { - get { return defaultInstance; } - } - - public override TestDynamicExtensions DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestDynamicExtensions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDynamicExtensions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDynamicExtensions__FieldAccessorTable; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - public enum DynamicEnumType { - DYNAMIC_FOO = 2200, - DYNAMIC_BAR = 2201, - DYNAMIC_BAZ = 2202, - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class DynamicMessageType : pb::GeneratedMessage { - private DynamicMessageType() { } - private static readonly DynamicMessageType defaultInstance = new DynamicMessageType().MakeReadOnly(); - private static readonly string[] _dynamicMessageTypeFieldNames = new string[] { "dynamic_field" }; - private static readonly uint[] _dynamicMessageTypeFieldTags = new uint[] { 16800 }; - public static DynamicMessageType DefaultInstance { - get { return defaultInstance; } - } - - public override DynamicMessageType DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override DynamicMessageType ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDynamicExtensions_DynamicMessageType__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestDynamicExtensions_DynamicMessageType__FieldAccessorTable; } - } - - public const int DynamicFieldFieldNumber = 2100; - private bool hasDynamicField; - private int dynamicField_; - public bool HasDynamicField { - get { return hasDynamicField; } - } - public int DynamicField { - get { return dynamicField_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _dynamicMessageTypeFieldNames; - if (hasDynamicField) { - output.WriteInt32(2100, field_names[0], DynamicField); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasDynamicField) { - size += pb::CodedOutputStream.ComputeInt32Size(2100, DynamicField); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static DynamicMessageType ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static DynamicMessageType ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static DynamicMessageType ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static DynamicMessageType ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static DynamicMessageType ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static DynamicMessageType ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static DynamicMessageType ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static DynamicMessageType ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static DynamicMessageType ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static DynamicMessageType ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private DynamicMessageType MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(DynamicMessageType prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(DynamicMessageType cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private DynamicMessageType result; - - private DynamicMessageType PrepareBuilder() { - if (resultIsReadOnly) { - DynamicMessageType original = result; - result = new DynamicMessageType(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override DynamicMessageType MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType.Descriptor; } - } - - public override DynamicMessageType DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType.DefaultInstance; } - } - - public override DynamicMessageType BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is DynamicMessageType) { - return MergeFrom((DynamicMessageType) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(DynamicMessageType other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasDynamicField) { - DynamicField = other.DynamicField; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_dynamicMessageTypeFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _dynamicMessageTypeFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 16800: { - result.hasDynamicField = input.ReadInt32(ref result.dynamicField_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasDynamicField { - get { return result.hasDynamicField; } - } - public int DynamicField { - get { return result.DynamicField; } - set { SetDynamicField(value); } - } - public Builder SetDynamicField(int value) { - PrepareBuilder(); - result.hasDynamicField = true; - result.dynamicField_ = value; - return this; - } - public Builder ClearDynamicField() { - PrepareBuilder(); - result.hasDynamicField = false; - result.dynamicField_ = 0; - return this; - } - } - static DynamicMessageType() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - } - #endregion - - public const int ScalarExtensionFieldNumber = 2000; - private bool hasScalarExtension; - private uint scalarExtension_; - public bool HasScalarExtension { - get { return hasScalarExtension; } - } - [global::System.CLSCompliant(false)] - public uint ScalarExtension { - get { return scalarExtension_; } - } - - public const int EnumExtensionFieldNumber = 2001; - private bool hasEnumExtension; - private global::Google.ProtocolBuffers.TestProtos.ForeignEnum enumExtension_ = global::Google.ProtocolBuffers.TestProtos.ForeignEnum.FOREIGN_FOO; - public bool HasEnumExtension { - get { return hasEnumExtension; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum EnumExtension { - get { return enumExtension_; } - } - - public const int DynamicEnumExtensionFieldNumber = 2002; - private bool hasDynamicEnumExtension; - private global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicEnumType dynamicEnumExtension_ = global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicEnumType.DYNAMIC_FOO; - public bool HasDynamicEnumExtension { - get { return hasDynamicEnumExtension; } - } - public global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicEnumType DynamicEnumExtension { - get { return dynamicEnumExtension_; } - } - - public const int MessageExtensionFieldNumber = 2003; - private bool hasMessageExtension; - private global::Google.ProtocolBuffers.TestProtos.ForeignMessage messageExtension_; - public bool HasMessageExtension { - get { return hasMessageExtension; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage MessageExtension { - get { return messageExtension_ ?? global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance; } - } - - public const int DynamicMessageExtensionFieldNumber = 2004; - private bool hasDynamicMessageExtension; - private global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType dynamicMessageExtension_; - public bool HasDynamicMessageExtension { - get { return hasDynamicMessageExtension; } - } - public global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType DynamicMessageExtension { - get { return dynamicMessageExtension_ ?? global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType.DefaultInstance; } - } - - public const int RepeatedExtensionFieldNumber = 2005; - private pbc::PopsicleList repeatedExtension_ = new pbc::PopsicleList(); - public scg::IList RepeatedExtensionList { - get { return pbc::Lists.AsReadOnly(repeatedExtension_); } - } - public int RepeatedExtensionCount { - get { return repeatedExtension_.Count; } - } - public string GetRepeatedExtension(int index) { - return repeatedExtension_[index]; - } - - public const int PackedExtensionFieldNumber = 2006; - private int packedExtensionMemoizedSerializedSize; - private pbc::PopsicleList packedExtension_ = new pbc::PopsicleList(); - public scg::IList PackedExtensionList { - get { return pbc::Lists.AsReadOnly(packedExtension_); } - } - public int PackedExtensionCount { - get { return packedExtension_.Count; } - } - public int GetPackedExtension(int index) { - return packedExtension_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testDynamicExtensionsFieldNames; - if (hasScalarExtension) { - output.WriteFixed32(2000, field_names[6], ScalarExtension); - } - if (hasEnumExtension) { - output.WriteEnum(2001, field_names[2], (int) EnumExtension, EnumExtension); - } - if (hasDynamicEnumExtension) { - output.WriteEnum(2002, field_names[0], (int) DynamicEnumExtension, DynamicEnumExtension); - } - if (hasMessageExtension) { - output.WriteMessage(2003, field_names[3], MessageExtension); - } - if (hasDynamicMessageExtension) { - output.WriteMessage(2004, field_names[1], DynamicMessageExtension); - } - if (repeatedExtension_.Count > 0) { - output.WriteStringArray(2005, field_names[5], repeatedExtension_); - } - if (packedExtension_.Count > 0) { - output.WritePackedSInt32Array(2006, field_names[4], packedExtensionMemoizedSerializedSize, packedExtension_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasScalarExtension) { - size += pb::CodedOutputStream.ComputeFixed32Size(2000, ScalarExtension); - } - if (hasEnumExtension) { - size += pb::CodedOutputStream.ComputeEnumSize(2001, (int) EnumExtension); - } - if (hasDynamicEnumExtension) { - size += pb::CodedOutputStream.ComputeEnumSize(2002, (int) DynamicEnumExtension); - } - if (hasMessageExtension) { - size += pb::CodedOutputStream.ComputeMessageSize(2003, MessageExtension); - } - if (hasDynamicMessageExtension) { - size += pb::CodedOutputStream.ComputeMessageSize(2004, DynamicMessageExtension); - } - { - int dataSize = 0; - foreach (string element in RepeatedExtensionList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedExtension_.Count; - } - { - int dataSize = 0; - foreach (int element in PackedExtensionList) { - dataSize += pb::CodedOutputStream.ComputeSInt32SizeNoTag(element); - } - size += dataSize; - if (packedExtension_.Count != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - } - packedExtensionMemoizedSerializedSize = dataSize; - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestDynamicExtensions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestDynamicExtensions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestDynamicExtensions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestDynamicExtensions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestDynamicExtensions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestDynamicExtensions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestDynamicExtensions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestDynamicExtensions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestDynamicExtensions ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestDynamicExtensions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestDynamicExtensions MakeReadOnly() { - repeatedExtension_.MakeReadOnly(); - packedExtension_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestDynamicExtensions prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestDynamicExtensions cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestDynamicExtensions result; - - private TestDynamicExtensions PrepareBuilder() { - if (resultIsReadOnly) { - TestDynamicExtensions original = result; - result = new TestDynamicExtensions(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestDynamicExtensions MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Descriptor; } - } - - public override TestDynamicExtensions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.DefaultInstance; } - } - - public override TestDynamicExtensions BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestDynamicExtensions) { - return MergeFrom((TestDynamicExtensions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestDynamicExtensions other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasScalarExtension) { - ScalarExtension = other.ScalarExtension; - } - if (other.HasEnumExtension) { - EnumExtension = other.EnumExtension; - } - if (other.HasDynamicEnumExtension) { - DynamicEnumExtension = other.DynamicEnumExtension; - } - if (other.HasMessageExtension) { - MergeMessageExtension(other.MessageExtension); - } - if (other.HasDynamicMessageExtension) { - MergeDynamicMessageExtension(other.DynamicMessageExtension); - } - if (other.repeatedExtension_.Count != 0) { - result.repeatedExtension_.Add(other.repeatedExtension_); - } - if (other.packedExtension_.Count != 0) { - result.packedExtension_.Add(other.packedExtension_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testDynamicExtensionsFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testDynamicExtensionsFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 16005: { - result.hasScalarExtension = input.ReadFixed32(ref result.scalarExtension_); - break; - } - case 16008: { - object unknown; - if(input.ReadEnum(ref result.enumExtension_, out unknown)) { - result.hasEnumExtension = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(2001, (ulong)(int)unknown); - } - break; - } - case 16016: { - object unknown; - if(input.ReadEnum(ref result.dynamicEnumExtension_, out unknown)) { - result.hasDynamicEnumExtension = true; - } else if(unknown is int) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(2002, (ulong)(int)unknown); - } - break; - } - case 16026: { - global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.ForeignMessage.CreateBuilder(); - if (result.hasMessageExtension) { - subBuilder.MergeFrom(MessageExtension); - } - input.ReadMessage(subBuilder, extensionRegistry); - MessageExtension = subBuilder.BuildPartial(); - break; - } - case 16034: { - global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType.CreateBuilder(); - if (result.hasDynamicMessageExtension) { - subBuilder.MergeFrom(DynamicMessageExtension); - } - input.ReadMessage(subBuilder, extensionRegistry); - DynamicMessageExtension = subBuilder.BuildPartial(); - break; - } - case 16042: { - input.ReadStringArray(tag, field_name, result.repeatedExtension_); - break; - } - case 16050: - case 16048: { - input.ReadSInt32Array(tag, field_name, result.packedExtension_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - public bool HasScalarExtension { - get { return result.hasScalarExtension; } - } - [global::System.CLSCompliant(false)] - public uint ScalarExtension { - get { return result.ScalarExtension; } - set { SetScalarExtension(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetScalarExtension(uint value) { - PrepareBuilder(); - result.hasScalarExtension = true; - result.scalarExtension_ = value; - return this; - } - public Builder ClearScalarExtension() { - PrepareBuilder(); - result.hasScalarExtension = false; - result.scalarExtension_ = 0; - return this; - } - - public bool HasEnumExtension { - get { return result.hasEnumExtension; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignEnum EnumExtension { - get { return result.EnumExtension; } - set { SetEnumExtension(value); } - } - public Builder SetEnumExtension(global::Google.ProtocolBuffers.TestProtos.ForeignEnum value) { - PrepareBuilder(); - result.hasEnumExtension = true; - result.enumExtension_ = value; - return this; - } - public Builder ClearEnumExtension() { - PrepareBuilder(); - result.hasEnumExtension = false; - result.enumExtension_ = global::Google.ProtocolBuffers.TestProtos.ForeignEnum.FOREIGN_FOO; - return this; - } - - public bool HasDynamicEnumExtension { - get { return result.hasDynamicEnumExtension; } - } - public global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicEnumType DynamicEnumExtension { - get { return result.DynamicEnumExtension; } - set { SetDynamicEnumExtension(value); } - } - public Builder SetDynamicEnumExtension(global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicEnumType value) { - PrepareBuilder(); - result.hasDynamicEnumExtension = true; - result.dynamicEnumExtension_ = value; - return this; - } - public Builder ClearDynamicEnumExtension() { - PrepareBuilder(); - result.hasDynamicEnumExtension = false; - result.dynamicEnumExtension_ = global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicEnumType.DYNAMIC_FOO; - return this; - } - - public bool HasMessageExtension { - get { return result.hasMessageExtension; } - } - public global::Google.ProtocolBuffers.TestProtos.ForeignMessage MessageExtension { - get { return result.MessageExtension; } - set { SetMessageExtension(value); } - } - public Builder SetMessageExtension(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasMessageExtension = true; - result.messageExtension_ = value; - return this; - } - public Builder SetMessageExtension(global::Google.ProtocolBuffers.TestProtos.ForeignMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasMessageExtension = true; - result.messageExtension_ = builderForValue.Build(); - return this; - } - public Builder MergeMessageExtension(global::Google.ProtocolBuffers.TestProtos.ForeignMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasMessageExtension && - result.messageExtension_ != global::Google.ProtocolBuffers.TestProtos.ForeignMessage.DefaultInstance) { - result.messageExtension_ = global::Google.ProtocolBuffers.TestProtos.ForeignMessage.CreateBuilder(result.messageExtension_).MergeFrom(value).BuildPartial(); - } else { - result.messageExtension_ = value; - } - result.hasMessageExtension = true; - return this; - } - public Builder ClearMessageExtension() { - PrepareBuilder(); - result.hasMessageExtension = false; - result.messageExtension_ = null; - return this; - } - - public bool HasDynamicMessageExtension { - get { return result.hasDynamicMessageExtension; } - } - public global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType DynamicMessageExtension { - get { return result.DynamicMessageExtension; } - set { SetDynamicMessageExtension(value); } - } - public Builder SetDynamicMessageExtension(global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasDynamicMessageExtension = true; - result.dynamicMessageExtension_ = value; - return this; - } - public Builder SetDynamicMessageExtension(global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasDynamicMessageExtension = true; - result.dynamicMessageExtension_ = builderForValue.Build(); - return this; - } - public Builder MergeDynamicMessageExtension(global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasDynamicMessageExtension && - result.dynamicMessageExtension_ != global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType.DefaultInstance) { - result.dynamicMessageExtension_ = global::Google.ProtocolBuffers.TestProtos.TestDynamicExtensions.Types.DynamicMessageType.CreateBuilder(result.dynamicMessageExtension_).MergeFrom(value).BuildPartial(); - } else { - result.dynamicMessageExtension_ = value; - } - result.hasDynamicMessageExtension = true; - return this; - } - public Builder ClearDynamicMessageExtension() { - PrepareBuilder(); - result.hasDynamicMessageExtension = false; - result.dynamicMessageExtension_ = null; - return this; - } - - public pbc::IPopsicleList RepeatedExtensionList { - get { return PrepareBuilder().repeatedExtension_; } - } - public int RepeatedExtensionCount { - get { return result.RepeatedExtensionCount; } - } - public string GetRepeatedExtension(int index) { - return result.GetRepeatedExtension(index); - } - public Builder SetRepeatedExtension(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedExtension_[index] = value; - return this; - } - public Builder AddRepeatedExtension(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.repeatedExtension_.Add(value); - return this; - } - public Builder AddRangeRepeatedExtension(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedExtension_.Add(values); - return this; - } - public Builder ClearRepeatedExtension() { - PrepareBuilder(); - result.repeatedExtension_.Clear(); - return this; - } - - public pbc::IPopsicleList PackedExtensionList { - get { return PrepareBuilder().packedExtension_; } - } - public int PackedExtensionCount { - get { return result.PackedExtensionCount; } - } - public int GetPackedExtension(int index) { - return result.GetPackedExtension(index); - } - public Builder SetPackedExtension(int index, int value) { - PrepareBuilder(); - result.packedExtension_[index] = value; - return this; - } - public Builder AddPackedExtension(int value) { - PrepareBuilder(); - result.packedExtension_.Add(value); - return this; - } - public Builder AddRangePackedExtension(scg::IEnumerable values) { - PrepareBuilder(); - result.packedExtension_.Add(values); - return this; - } - public Builder ClearPackedExtension() { - PrepareBuilder(); - result.packedExtension_.Clear(); - return this; - } - } - static TestDynamicExtensions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestRepeatedScalarDifferentTagSizes : pb::GeneratedMessage { - private TestRepeatedScalarDifferentTagSizes() { } - private static readonly TestRepeatedScalarDifferentTagSizes defaultInstance = new TestRepeatedScalarDifferentTagSizes().MakeReadOnly(); - private static readonly string[] _testRepeatedScalarDifferentTagSizesFieldNames = new string[] { "repeated_fixed32", "repeated_fixed64", "repeated_float", "repeated_int32", "repeated_int64", "repeated_uint64" }; - private static readonly uint[] _testRepeatedScalarDifferentTagSizesFieldTags = new uint[] { 101, 16369, 2097141, 104, 16376, 2097144 }; - public static TestRepeatedScalarDifferentTagSizes DefaultInstance { - get { return defaultInstance; } - } - - public override TestRepeatedScalarDifferentTagSizes DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override TestRepeatedScalarDifferentTagSizes ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestRepeatedScalarDifferentTagSizes__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_TestRepeatedScalarDifferentTagSizes__FieldAccessorTable; } - } - - public const int RepeatedFixed32FieldNumber = 12; - private pbc::PopsicleList repeatedFixed32_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList RepeatedFixed32List { - get { return pbc::Lists.AsReadOnly(repeatedFixed32_); } - } - public int RepeatedFixed32Count { - get { return repeatedFixed32_.Count; } - } - [global::System.CLSCompliant(false)] - public uint GetRepeatedFixed32(int index) { - return repeatedFixed32_[index]; - } - - public const int RepeatedInt32FieldNumber = 13; - private pbc::PopsicleList repeatedInt32_ = new pbc::PopsicleList(); - public scg::IList RepeatedInt32List { - get { return pbc::Lists.AsReadOnly(repeatedInt32_); } - } - public int RepeatedInt32Count { - get { return repeatedInt32_.Count; } - } - public int GetRepeatedInt32(int index) { - return repeatedInt32_[index]; - } - - public const int RepeatedFixed64FieldNumber = 2046; - private pbc::PopsicleList repeatedFixed64_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList RepeatedFixed64List { - get { return pbc::Lists.AsReadOnly(repeatedFixed64_); } - } - public int RepeatedFixed64Count { - get { return repeatedFixed64_.Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetRepeatedFixed64(int index) { - return repeatedFixed64_[index]; - } - - public const int RepeatedInt64FieldNumber = 2047; - private pbc::PopsicleList repeatedInt64_ = new pbc::PopsicleList(); - public scg::IList RepeatedInt64List { - get { return pbc::Lists.AsReadOnly(repeatedInt64_); } - } - public int RepeatedInt64Count { - get { return repeatedInt64_.Count; } - } - public long GetRepeatedInt64(int index) { - return repeatedInt64_[index]; - } - - public const int RepeatedFloatFieldNumber = 262142; - private pbc::PopsicleList repeatedFloat_ = new pbc::PopsicleList(); - public scg::IList RepeatedFloatList { - get { return pbc::Lists.AsReadOnly(repeatedFloat_); } - } - public int RepeatedFloatCount { - get { return repeatedFloat_.Count; } - } - public float GetRepeatedFloat(int index) { - return repeatedFloat_[index]; - } - - public const int RepeatedUint64FieldNumber = 262143; - private pbc::PopsicleList repeatedUint64_ = new pbc::PopsicleList(); - [global::System.CLSCompliant(false)] - public scg::IList RepeatedUint64List { - get { return pbc::Lists.AsReadOnly(repeatedUint64_); } - } - public int RepeatedUint64Count { - get { return repeatedUint64_.Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetRepeatedUint64(int index) { - return repeatedUint64_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _testRepeatedScalarDifferentTagSizesFieldNames; - if (repeatedFixed32_.Count > 0) { - output.WriteFixed32Array(12, field_names[0], repeatedFixed32_); - } - if (repeatedInt32_.Count > 0) { - output.WriteInt32Array(13, field_names[3], repeatedInt32_); - } - if (repeatedFixed64_.Count > 0) { - output.WriteFixed64Array(2046, field_names[1], repeatedFixed64_); - } - if (repeatedInt64_.Count > 0) { - output.WriteInt64Array(2047, field_names[4], repeatedInt64_); - } - if (repeatedFloat_.Count > 0) { - output.WriteFloatArray(262142, field_names[2], repeatedFloat_); - } - if (repeatedUint64_.Count > 0) { - output.WriteUInt64Array(262143, field_names[5], repeatedUint64_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - dataSize = 4 * repeatedFixed32_.Count; - size += dataSize; - size += 1 * repeatedFixed32_.Count; - } - { - int dataSize = 0; - foreach (int element in RepeatedInt32List) { - dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); - } - size += dataSize; - size += 1 * repeatedInt32_.Count; - } - { - int dataSize = 0; - dataSize = 8 * repeatedFixed64_.Count; - size += dataSize; - size += 2 * repeatedFixed64_.Count; - } - { - int dataSize = 0; - foreach (long element in RepeatedInt64List) { - dataSize += pb::CodedOutputStream.ComputeInt64SizeNoTag(element); - } - size += dataSize; - size += 2 * repeatedInt64_.Count; - } - { - int dataSize = 0; - dataSize = 4 * repeatedFloat_.Count; - size += dataSize; - size += 3 * repeatedFloat_.Count; - } - { - int dataSize = 0; - foreach (ulong element in RepeatedUint64List) { - dataSize += pb::CodedOutputStream.ComputeUInt64SizeNoTag(element); - } - size += dataSize; - size += 3 * repeatedUint64_.Count; - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static TestRepeatedScalarDifferentTagSizes ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestRepeatedScalarDifferentTagSizes ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestRepeatedScalarDifferentTagSizes ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestRepeatedScalarDifferentTagSizes ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestRepeatedScalarDifferentTagSizes ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestRepeatedScalarDifferentTagSizes ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestRepeatedScalarDifferentTagSizes ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestRepeatedScalarDifferentTagSizes ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestRepeatedScalarDifferentTagSizes ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestRepeatedScalarDifferentTagSizes ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private TestRepeatedScalarDifferentTagSizes MakeReadOnly() { - repeatedFixed32_.MakeReadOnly(); - repeatedInt32_.MakeReadOnly(); - repeatedFixed64_.MakeReadOnly(); - repeatedInt64_.MakeReadOnly(); - repeatedFloat_.MakeReadOnly(); - repeatedUint64_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestRepeatedScalarDifferentTagSizes prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(TestRepeatedScalarDifferentTagSizes cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private TestRepeatedScalarDifferentTagSizes result; - - private TestRepeatedScalarDifferentTagSizes PrepareBuilder() { - if (resultIsReadOnly) { - TestRepeatedScalarDifferentTagSizes original = result; - result = new TestRepeatedScalarDifferentTagSizes(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override TestRepeatedScalarDifferentTagSizes MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestRepeatedScalarDifferentTagSizes.Descriptor; } - } - - public override TestRepeatedScalarDifferentTagSizes DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.TestRepeatedScalarDifferentTagSizes.DefaultInstance; } - } - - public override TestRepeatedScalarDifferentTagSizes BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestRepeatedScalarDifferentTagSizes) { - return MergeFrom((TestRepeatedScalarDifferentTagSizes) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestRepeatedScalarDifferentTagSizes other) { - if (other == global::Google.ProtocolBuffers.TestProtos.TestRepeatedScalarDifferentTagSizes.DefaultInstance) return this; - PrepareBuilder(); - if (other.repeatedFixed32_.Count != 0) { - result.repeatedFixed32_.Add(other.repeatedFixed32_); - } - if (other.repeatedInt32_.Count != 0) { - result.repeatedInt32_.Add(other.repeatedInt32_); - } - if (other.repeatedFixed64_.Count != 0) { - result.repeatedFixed64_.Add(other.repeatedFixed64_); - } - if (other.repeatedInt64_.Count != 0) { - result.repeatedInt64_.Add(other.repeatedInt64_); - } - if (other.repeatedFloat_.Count != 0) { - result.repeatedFloat_.Add(other.repeatedFloat_); - } - if (other.repeatedUint64_.Count != 0) { - result.repeatedUint64_.Add(other.repeatedUint64_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_testRepeatedScalarDifferentTagSizesFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _testRepeatedScalarDifferentTagSizesFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - case 98: - case 101: { - input.ReadFixed32Array(tag, field_name, result.repeatedFixed32_); - break; - } - case 106: - case 104: { - input.ReadInt32Array(tag, field_name, result.repeatedInt32_); - break; - } - case 16370: - case 16369: { - input.ReadFixed64Array(tag, field_name, result.repeatedFixed64_); - break; - } - case 16378: - case 16376: { - input.ReadInt64Array(tag, field_name, result.repeatedInt64_); - break; - } - case 2097138: - case 2097141: { - input.ReadFloatArray(tag, field_name, result.repeatedFloat_); - break; - } - case 2097146: - case 2097144: { - input.ReadUInt64Array(tag, field_name, result.repeatedUint64_); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList RepeatedFixed32List { - get { return PrepareBuilder().repeatedFixed32_; } - } - public int RepeatedFixed32Count { - get { return result.RepeatedFixed32Count; } - } - [global::System.CLSCompliant(false)] - public uint GetRepeatedFixed32(int index) { - return result.GetRepeatedFixed32(index); - } - [global::System.CLSCompliant(false)] - public Builder SetRepeatedFixed32(int index, uint value) { - PrepareBuilder(); - result.repeatedFixed32_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRepeatedFixed32(uint value) { - PrepareBuilder(); - result.repeatedFixed32_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeRepeatedFixed32(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedFixed32_.Add(values); - return this; - } - public Builder ClearRepeatedFixed32() { - PrepareBuilder(); - result.repeatedFixed32_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedInt32List { - get { return PrepareBuilder().repeatedInt32_; } - } - public int RepeatedInt32Count { - get { return result.RepeatedInt32Count; } - } - public int GetRepeatedInt32(int index) { - return result.GetRepeatedInt32(index); - } - public Builder SetRepeatedInt32(int index, int value) { - PrepareBuilder(); - result.repeatedInt32_[index] = value; - return this; - } - public Builder AddRepeatedInt32(int value) { - PrepareBuilder(); - result.repeatedInt32_.Add(value); - return this; - } - public Builder AddRangeRepeatedInt32(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedInt32_.Add(values); - return this; - } - public Builder ClearRepeatedInt32() { - PrepareBuilder(); - result.repeatedInt32_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList RepeatedFixed64List { - get { return PrepareBuilder().repeatedFixed64_; } - } - public int RepeatedFixed64Count { - get { return result.RepeatedFixed64Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetRepeatedFixed64(int index) { - return result.GetRepeatedFixed64(index); - } - [global::System.CLSCompliant(false)] - public Builder SetRepeatedFixed64(int index, ulong value) { - PrepareBuilder(); - result.repeatedFixed64_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRepeatedFixed64(ulong value) { - PrepareBuilder(); - result.repeatedFixed64_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeRepeatedFixed64(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedFixed64_.Add(values); - return this; - } - public Builder ClearRepeatedFixed64() { - PrepareBuilder(); - result.repeatedFixed64_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedInt64List { - get { return PrepareBuilder().repeatedInt64_; } - } - public int RepeatedInt64Count { - get { return result.RepeatedInt64Count; } - } - public long GetRepeatedInt64(int index) { - return result.GetRepeatedInt64(index); - } - public Builder SetRepeatedInt64(int index, long value) { - PrepareBuilder(); - result.repeatedInt64_[index] = value; - return this; - } - public Builder AddRepeatedInt64(long value) { - PrepareBuilder(); - result.repeatedInt64_.Add(value); - return this; - } - public Builder AddRangeRepeatedInt64(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedInt64_.Add(values); - return this; - } - public Builder ClearRepeatedInt64() { - PrepareBuilder(); - result.repeatedInt64_.Clear(); - return this; - } - - public pbc::IPopsicleList RepeatedFloatList { - get { return PrepareBuilder().repeatedFloat_; } - } - public int RepeatedFloatCount { - get { return result.RepeatedFloatCount; } - } - public float GetRepeatedFloat(int index) { - return result.GetRepeatedFloat(index); - } - public Builder SetRepeatedFloat(int index, float value) { - PrepareBuilder(); - result.repeatedFloat_[index] = value; - return this; - } - public Builder AddRepeatedFloat(float value) { - PrepareBuilder(); - result.repeatedFloat_.Add(value); - return this; - } - public Builder AddRangeRepeatedFloat(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedFloat_.Add(values); - return this; - } - public Builder ClearRepeatedFloat() { - PrepareBuilder(); - result.repeatedFloat_.Clear(); - return this; - } - - [global::System.CLSCompliant(false)] - public pbc::IPopsicleList RepeatedUint64List { - get { return PrepareBuilder().repeatedUint64_; } - } - public int RepeatedUint64Count { - get { return result.RepeatedUint64Count; } - } - [global::System.CLSCompliant(false)] - public ulong GetRepeatedUint64(int index) { - return result.GetRepeatedUint64(index); - } - [global::System.CLSCompliant(false)] - public Builder SetRepeatedUint64(int index, ulong value) { - PrepareBuilder(); - result.repeatedUint64_[index] = value; - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRepeatedUint64(ulong value) { - PrepareBuilder(); - result.repeatedUint64_.Add(value); - return this; - } - [global::System.CLSCompliant(false)] - public Builder AddRangeRepeatedUint64(scg::IEnumerable values) { - PrepareBuilder(); - result.repeatedUint64_.Add(values); - return this; - } - public Builder ClearRepeatedUint64() { - PrepareBuilder(); - result.repeatedUint64_.Clear(); - return this; - } - } - static TestRepeatedScalarDifferentTagSizes() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class FooRequest : pb::GeneratedMessage { - private FooRequest() { } - private static readonly FooRequest defaultInstance = new FooRequest().MakeReadOnly(); - private static readonly string[] _fooRequestFieldNames = new string[] { }; - private static readonly uint[] _fooRequestFieldTags = new uint[] { }; - public static FooRequest DefaultInstance { - get { return defaultInstance; } - } - - public override FooRequest DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override FooRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_FooRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_FooRequest__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _fooRequestFieldNames; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static FooRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FooRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FooRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FooRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FooRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FooRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static FooRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static FooRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static FooRequest ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FooRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private FooRequest MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(FooRequest prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(FooRequest cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private FooRequest result; - - private FooRequest PrepareBuilder() { - if (resultIsReadOnly) { - FooRequest original = result; - result = new FooRequest(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override FooRequest MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.FooRequest.Descriptor; } - } - - public override FooRequest DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.FooRequest.DefaultInstance; } - } - - public override FooRequest BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is FooRequest) { - return MergeFrom((FooRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(FooRequest other) { - if (other == global::Google.ProtocolBuffers.TestProtos.FooRequest.DefaultInstance) return this; - PrepareBuilder(); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_fooRequestFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _fooRequestFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static FooRequest() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class FooResponse : pb::GeneratedMessage { - private FooResponse() { } - private static readonly FooResponse defaultInstance = new FooResponse().MakeReadOnly(); - private static readonly string[] _fooResponseFieldNames = new string[] { }; - private static readonly uint[] _fooResponseFieldTags = new uint[] { }; - public static FooResponse DefaultInstance { - get { return defaultInstance; } - } - - public override FooResponse DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override FooResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_FooResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_FooResponse__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _fooResponseFieldNames; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static FooResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FooResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FooResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FooResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FooResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FooResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static FooResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static FooResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static FooResponse ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FooResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private FooResponse MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(FooResponse prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(FooResponse cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private FooResponse result; - - private FooResponse PrepareBuilder() { - if (resultIsReadOnly) { - FooResponse original = result; - result = new FooResponse(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override FooResponse MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.FooResponse.Descriptor; } - } - - public override FooResponse DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.FooResponse.DefaultInstance; } - } - - public override FooResponse BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is FooResponse) { - return MergeFrom((FooResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(FooResponse other) { - if (other == global::Google.ProtocolBuffers.TestProtos.FooResponse.DefaultInstance) return this; - PrepareBuilder(); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_fooResponseFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _fooResponseFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static FooResponse() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class BarRequest : pb::GeneratedMessage { - private BarRequest() { } - private static readonly BarRequest defaultInstance = new BarRequest().MakeReadOnly(); - private static readonly string[] _barRequestFieldNames = new string[] { }; - private static readonly uint[] _barRequestFieldTags = new uint[] { }; - public static BarRequest DefaultInstance { - get { return defaultInstance; } - } - - public override BarRequest DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override BarRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_BarRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_BarRequest__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _barRequestFieldNames; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static BarRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static BarRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static BarRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static BarRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static BarRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static BarRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static BarRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static BarRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static BarRequest ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static BarRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private BarRequest MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(BarRequest prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(BarRequest cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private BarRequest result; - - private BarRequest PrepareBuilder() { - if (resultIsReadOnly) { - BarRequest original = result; - result = new BarRequest(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override BarRequest MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.BarRequest.Descriptor; } - } - - public override BarRequest DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.BarRequest.DefaultInstance; } - } - - public override BarRequest BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is BarRequest) { - return MergeFrom((BarRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(BarRequest other) { - if (other == global::Google.ProtocolBuffers.TestProtos.BarRequest.DefaultInstance) return this; - PrepareBuilder(); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_barRequestFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _barRequestFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static BarRequest() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class BarResponse : pb::GeneratedMessage { - private BarResponse() { } - private static readonly BarResponse defaultInstance = new BarResponse().MakeReadOnly(); - private static readonly string[] _barResponseFieldNames = new string[] { }; - private static readonly uint[] _barResponseFieldTags = new uint[] { }; - public static BarResponse DefaultInstance { - get { return defaultInstance; } - } - - public override BarResponse DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override BarResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_BarResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.internal__static_protobuf_unittest_BarResponse__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _barResponseFieldNames; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - public static BarResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static BarResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static BarResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static BarResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static BarResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static BarResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static BarResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static BarResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static BarResponse ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static BarResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private BarResponse MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(BarResponse prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(BarResponse cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private BarResponse result; - - private BarResponse PrepareBuilder() { - if (resultIsReadOnly) { - BarResponse original = result; - result = new BarResponse(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override BarResponse MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.TestProtos.BarResponse.Descriptor; } - } - - public override BarResponse DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.BarResponse.DefaultInstance; } - } - - public override BarResponse BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is BarResponse) { - return MergeFrom((BarResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(BarResponse other) { - if (other == global::Google.ProtocolBuffers.TestProtos.BarResponse.DefaultInstance) return this; - PrepareBuilder(); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - pb::UnknownFieldSet.Builder unknownFields = null; - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_barResponseFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _barResponseFieldTags[field_ordinal]; - else { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); - break; - } - } - } - - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - - } - static BarResponse() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, null); - } - } - - #endregion - - #region Services - /* - * Service generation is now disabled by default, use the following option to enable: - * option (google.protobuf.csharp_file_options).service_generator_type = GENERIC; - */ - #endregion - -} - -#endregion Designer generated code diff --git a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestRpcInteropLite.cs b/src/ProtocolBuffersLite.Test/TestProtos/UnitTestRpcInteropLite.cs deleted file mode 100644 index 189ff0d..0000000 --- a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestRpcInteropLite.cs +++ /dev/null @@ -1,1395 +0,0 @@ -// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.TestProtos { - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class UnitTestRpcInteropLite { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - #endregion - #region Extensions - internal static readonly object Descriptor; - static UnitTestRpcInteropLite() { - Descriptor = null; - } - #endregion - - } - #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class SearchRequest : pb::GeneratedMessageLite { - private SearchRequest() { } - private static readonly SearchRequest defaultInstance = new SearchRequest().MakeReadOnly(); - private static readonly string[] _searchRequestFieldNames = new string[] { "Criteria" }; - private static readonly uint[] _searchRequestFieldTags = new uint[] { 10 }; - public static SearchRequest DefaultInstance { - get { return defaultInstance; } - } - - public override SearchRequest DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override SearchRequest ThisMessage { - get { return this; } - } - - public const int CriteriaFieldNumber = 1; - private pbc::PopsicleList criteria_ = new pbc::PopsicleList(); - public scg::IList CriteriaList { - get { return pbc::Lists.AsReadOnly(criteria_); } - } - public int CriteriaCount { - get { return criteria_.Count; } - } - public string GetCriteria(int index) { - return criteria_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _searchRequestFieldNames; - if (criteria_.Count > 0) { - output.WriteStringArray(1, field_names[0], criteria_); - } - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - foreach (string element in CriteriaList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 1 * criteria_.Count; - } - memoizedSerializedSize = size; - return size; - } - #region Lite runtime methods - public override int GetHashCode() { - int hash = GetType().GetHashCode(); - foreach(string i in criteria_) - hash ^= i.GetHashCode(); - return hash; - } - - public override bool Equals(object obj) { - SearchRequest other = obj as SearchRequest; - if (other == null) return false; - if(criteria_.Count != other.criteria_.Count) return false; - for(int ix=0; ix < criteria_.Count; ix++) - if(!criteria_[ix].Equals(other.criteria_[ix])) return false; - return true; - } - - public override void PrintTo(global::System.IO.TextWriter writer) { - PrintField("Criteria", criteria_, writer); - } - #endregion - - public static SearchRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SearchRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SearchRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SearchRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SearchRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SearchRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SearchRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SearchRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SearchRequest ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SearchRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private SearchRequest MakeReadOnly() { - criteria_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SearchRequest prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilderLite { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(SearchRequest cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private SearchRequest result; - - private SearchRequest PrepareBuilder() { - if (resultIsReadOnly) { - SearchRequest original = result; - result = new SearchRequest(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override SearchRequest MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override SearchRequest DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.SearchRequest.DefaultInstance; } - } - - public override SearchRequest BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessageLite other) { - if (other is SearchRequest) { - return MergeFrom((SearchRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SearchRequest other) { - if (other == global::Google.ProtocolBuffers.TestProtos.SearchRequest.DefaultInstance) return this; - PrepareBuilder(); - if (other.criteria_.Count != 0) { - result.criteria_.Add(other.criteria_); - } - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_searchRequestFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _searchRequestFieldTags[field_ordinal]; - else { - ParseUnknownField(input, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - return this; - } - ParseUnknownField(input, extensionRegistry, tag, field_name); - break; - } - case 10: { - input.ReadStringArray(tag, field_name, result.criteria_); - break; - } - } - } - - return this; - } - - - public pbc::IPopsicleList CriteriaList { - get { return PrepareBuilder().criteria_; } - } - public int CriteriaCount { - get { return result.CriteriaCount; } - } - public string GetCriteria(int index) { - return result.GetCriteria(index); - } - public Builder SetCriteria(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.criteria_[index] = value; - return this; - } - public Builder AddCriteria(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.criteria_.Add(value); - return this; - } - public Builder AddRangeCriteria(scg::IEnumerable values) { - PrepareBuilder(); - result.criteria_.Add(values); - return this; - } - public Builder ClearCriteria() { - PrepareBuilder(); - result.criteria_.Clear(); - return this; - } - } - static SearchRequest() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestRpcInteropLite.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class SearchResponse : pb::GeneratedMessageLite { - private SearchResponse() { } - private static readonly SearchResponse defaultInstance = new SearchResponse().MakeReadOnly(); - private static readonly string[] _searchResponseFieldNames = new string[] { "results" }; - private static readonly uint[] _searchResponseFieldTags = new uint[] { 10 }; - public static SearchResponse DefaultInstance { - get { return defaultInstance; } - } - - public override SearchResponse DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override SearchResponse ThisMessage { - get { return this; } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class ResultItem : pb::GeneratedMessageLite { - private ResultItem() { } - private static readonly ResultItem defaultInstance = new ResultItem().MakeReadOnly(); - private static readonly string[] _resultItemFieldNames = new string[] { "name", "url" }; - private static readonly uint[] _resultItemFieldTags = new uint[] { 18, 10 }; - public static ResultItem DefaultInstance { - get { return defaultInstance; } - } - - public override ResultItem DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override ResultItem ThisMessage { - get { return this; } - } - - public const int UrlFieldNumber = 1; - private bool hasUrl; - private string url_ = ""; - public bool HasUrl { - get { return hasUrl; } - } - public string Url { - get { return url_; } - } - - public const int NameFieldNumber = 2; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public override bool IsInitialized { - get { - if (!hasUrl) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _resultItemFieldNames; - if (hasUrl) { - output.WriteString(1, field_names[1], Url); - } - if (hasName) { - output.WriteString(2, field_names[0], Name); - } - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasUrl) { - size += pb::CodedOutputStream.ComputeStringSize(1, Url); - } - if (hasName) { - size += pb::CodedOutputStream.ComputeStringSize(2, Name); - } - memoizedSerializedSize = size; - return size; - } - #region Lite runtime methods - public override int GetHashCode() { - int hash = GetType().GetHashCode(); - if (hasUrl) hash ^= url_.GetHashCode(); - if (hasName) hash ^= name_.GetHashCode(); - return hash; - } - - public override bool Equals(object obj) { - ResultItem other = obj as ResultItem; - if (other == null) return false; - if (hasUrl != other.hasUrl || (hasUrl && !url_.Equals(other.url_))) return false; - if (hasName != other.hasName || (hasName && !name_.Equals(other.name_))) return false; - return true; - } - - public override void PrintTo(global::System.IO.TextWriter writer) { - PrintField("url", hasUrl, url_, writer); - PrintField("name", hasName, name_, writer); - } - #endregion - - public static ResultItem ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ResultItem ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ResultItem ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ResultItem ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ResultItem ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ResultItem ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ResultItem ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ResultItem ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ResultItem ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ResultItem ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private ResultItem MakeReadOnly() { - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ResultItem prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilderLite { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(ResultItem cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private ResultItem result; - - private ResultItem PrepareBuilder() { - if (resultIsReadOnly) { - ResultItem original = result; - result = new ResultItem(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override ResultItem MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override ResultItem DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.SearchResponse.Types.ResultItem.DefaultInstance; } - } - - public override ResultItem BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessageLite other) { - if (other is ResultItem) { - return MergeFrom((ResultItem) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ResultItem other) { - if (other == global::Google.ProtocolBuffers.TestProtos.SearchResponse.Types.ResultItem.DefaultInstance) return this; - PrepareBuilder(); - if (other.HasUrl) { - Url = other.Url; - } - if (other.HasName) { - Name = other.Name; - } - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_resultItemFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _resultItemFieldTags[field_ordinal]; - else { - ParseUnknownField(input, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - return this; - } - ParseUnknownField(input, extensionRegistry, tag, field_name); - break; - } - case 10: { - result.hasUrl = input.ReadString(ref result.url_); - break; - } - case 18: { - result.hasName = input.ReadString(ref result.name_); - break; - } - } - } - - return this; - } - - - public bool HasUrl { - get { return result.hasUrl; } - } - public string Url { - get { return result.Url; } - set { SetUrl(value); } - } - public Builder SetUrl(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasUrl = true; - result.url_ = value; - return this; - } - public Builder ClearUrl() { - PrepareBuilder(); - result.hasUrl = false; - result.url_ = ""; - return this; - } - - public bool HasName { - get { return result.hasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - PrepareBuilder(); - result.hasName = false; - result.name_ = ""; - return this; - } - } - static ResultItem() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestRpcInteropLite.Descriptor, null); - } - } - - } - #endregion - - public const int ResultsFieldNumber = 1; - private pbc::PopsicleList results_ = new pbc::PopsicleList(); - public scg::IList ResultsList { - get { return results_; } - } - public int ResultsCount { - get { return results_.Count; } - } - public global::Google.ProtocolBuffers.TestProtos.SearchResponse.Types.ResultItem GetResults(int index) { - return results_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.TestProtos.SearchResponse.Types.ResultItem element in ResultsList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _searchResponseFieldNames; - if (results_.Count > 0) { - output.WriteMessageArray(1, field_names[0], results_); - } - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::Google.ProtocolBuffers.TestProtos.SearchResponse.Types.ResultItem element in ResultsList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - memoizedSerializedSize = size; - return size; - } - #region Lite runtime methods - public override int GetHashCode() { - int hash = GetType().GetHashCode(); - foreach(global::Google.ProtocolBuffers.TestProtos.SearchResponse.Types.ResultItem i in results_) - hash ^= i.GetHashCode(); - return hash; - } - - public override bool Equals(object obj) { - SearchResponse other = obj as SearchResponse; - if (other == null) return false; - if(results_.Count != other.results_.Count) return false; - for(int ix=0; ix < results_.Count; ix++) - if(!results_[ix].Equals(other.results_[ix])) return false; - return true; - } - - public override void PrintTo(global::System.IO.TextWriter writer) { - PrintField("results", results_, writer); - } - #endregion - - public static SearchResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SearchResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SearchResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SearchResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SearchResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SearchResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SearchResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SearchResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SearchResponse ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SearchResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private SearchResponse MakeReadOnly() { - results_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SearchResponse prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilderLite { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(SearchResponse cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private SearchResponse result; - - private SearchResponse PrepareBuilder() { - if (resultIsReadOnly) { - SearchResponse original = result; - result = new SearchResponse(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override SearchResponse MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override SearchResponse DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.SearchResponse.DefaultInstance; } - } - - public override SearchResponse BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessageLite other) { - if (other is SearchResponse) { - return MergeFrom((SearchResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SearchResponse other) { - if (other == global::Google.ProtocolBuffers.TestProtos.SearchResponse.DefaultInstance) return this; - PrepareBuilder(); - if (other.results_.Count != 0) { - result.results_.Add(other.results_); - } - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_searchResponseFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _searchResponseFieldTags[field_ordinal]; - else { - ParseUnknownField(input, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - return this; - } - ParseUnknownField(input, extensionRegistry, tag, field_name); - break; - } - case 10: { - input.ReadMessageArray(tag, field_name, result.results_, global::Google.ProtocolBuffers.TestProtos.SearchResponse.Types.ResultItem.DefaultInstance, extensionRegistry); - break; - } - } - } - - return this; - } - - - public pbc::IPopsicleList ResultsList { - get { return PrepareBuilder().results_; } - } - public int ResultsCount { - get { return result.ResultsCount; } - } - public global::Google.ProtocolBuffers.TestProtos.SearchResponse.Types.ResultItem GetResults(int index) { - return result.GetResults(index); - } - public Builder SetResults(int index, global::Google.ProtocolBuffers.TestProtos.SearchResponse.Types.ResultItem value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.results_[index] = value; - return this; - } - public Builder SetResults(int index, global::Google.ProtocolBuffers.TestProtos.SearchResponse.Types.ResultItem.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.results_[index] = builderForValue.Build(); - return this; - } - public Builder AddResults(global::Google.ProtocolBuffers.TestProtos.SearchResponse.Types.ResultItem value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.results_.Add(value); - return this; - } - public Builder AddResults(global::Google.ProtocolBuffers.TestProtos.SearchResponse.Types.ResultItem.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.results_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeResults(scg::IEnumerable values) { - PrepareBuilder(); - result.results_.Add(values); - return this; - } - public Builder ClearResults() { - PrepareBuilder(); - result.results_.Clear(); - return this; - } - } - static SearchResponse() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestRpcInteropLite.Descriptor, null); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class RefineSearchRequest : pb::GeneratedMessageLite { - private RefineSearchRequest() { } - private static readonly RefineSearchRequest defaultInstance = new RefineSearchRequest().MakeReadOnly(); - private static readonly string[] _refineSearchRequestFieldNames = new string[] { "Criteria", "previous_results" }; - private static readonly uint[] _refineSearchRequestFieldTags = new uint[] { 10, 18 }; - public static RefineSearchRequest DefaultInstance { - get { return defaultInstance; } - } - - public override RefineSearchRequest DefaultInstanceForType { - get { return DefaultInstance; } - } - - protected override RefineSearchRequest ThisMessage { - get { return this; } - } - - public const int CriteriaFieldNumber = 1; - private pbc::PopsicleList criteria_ = new pbc::PopsicleList(); - public scg::IList CriteriaList { - get { return pbc::Lists.AsReadOnly(criteria_); } - } - public int CriteriaCount { - get { return criteria_.Count; } - } - public string GetCriteria(int index) { - return criteria_[index]; - } - - public const int PreviousResultsFieldNumber = 2; - private bool hasPreviousResults; - private global::Google.ProtocolBuffers.TestProtos.SearchResponse previousResults_; - public bool HasPreviousResults { - get { return hasPreviousResults; } - } - public global::Google.ProtocolBuffers.TestProtos.SearchResponse PreviousResults { - get { return previousResults_ ?? global::Google.ProtocolBuffers.TestProtos.SearchResponse.DefaultInstance; } - } - - public override bool IsInitialized { - get { - if (!hasPreviousResults) return false; - if (!PreviousResults.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::ICodedOutputStream output) { - CalcSerializedSize(); - string[] field_names = _refineSearchRequestFieldNames; - if (criteria_.Count > 0) { - output.WriteStringArray(1, field_names[0], criteria_); - } - if (hasPreviousResults) { - output.WriteMessage(2, field_names[1], PreviousResults); - } - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - return CalcSerializedSize(); - } - } - - private int CalcSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - foreach (string element in CriteriaList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 1 * criteria_.Count; - } - if (hasPreviousResults) { - size += pb::CodedOutputStream.ComputeMessageSize(2, PreviousResults); - } - memoizedSerializedSize = size; - return size; - } - #region Lite runtime methods - public override int GetHashCode() { - int hash = GetType().GetHashCode(); - foreach(string i in criteria_) - hash ^= i.GetHashCode(); - if (hasPreviousResults) hash ^= previousResults_.GetHashCode(); - return hash; - } - - public override bool Equals(object obj) { - RefineSearchRequest other = obj as RefineSearchRequest; - if (other == null) return false; - if(criteria_.Count != other.criteria_.Count) return false; - for(int ix=0; ix < criteria_.Count; ix++) - if(!criteria_[ix].Equals(other.criteria_[ix])) return false; - if (hasPreviousResults != other.hasPreviousResults || (hasPreviousResults && !previousResults_.Equals(other.previousResults_))) return false; - return true; - } - - public override void PrintTo(global::System.IO.TextWriter writer) { - PrintField("Criteria", criteria_, writer); - PrintField("previous_results", hasPreviousResults, previousResults_, writer); - } - #endregion - - public static RefineSearchRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RefineSearchRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RefineSearchRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RefineSearchRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RefineSearchRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RefineSearchRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static RefineSearchRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static RefineSearchRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static RefineSearchRequest ParseFrom(pb::ICodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RefineSearchRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - private RefineSearchRequest MakeReadOnly() { - criteria_.MakeReadOnly(); - return this; - } - - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(RefineSearchRequest prototype) { - return new Builder(prototype); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Builder : pb::GeneratedBuilderLite { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() { - result = DefaultInstance; - resultIsReadOnly = true; - } - internal Builder(RefineSearchRequest cloneFrom) { - result = cloneFrom; - resultIsReadOnly = true; - } - - private bool resultIsReadOnly; - private RefineSearchRequest result; - - private RefineSearchRequest PrepareBuilder() { - if (resultIsReadOnly) { - RefineSearchRequest original = result; - result = new RefineSearchRequest(); - resultIsReadOnly = false; - MergeFrom(original); - } - return result; - } - - public override bool IsInitialized { - get { return result.IsInitialized; } - } - - protected override RefineSearchRequest MessageBeingBuilt { - get { return PrepareBuilder(); } - } - - public override Builder Clear() { - result = DefaultInstance; - resultIsReadOnly = true; - return this; - } - - public override Builder Clone() { - if (resultIsReadOnly) { - return new Builder(result); - } else { - return new Builder().MergeFrom(result); - } - } - - public override RefineSearchRequest DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.TestProtos.RefineSearchRequest.DefaultInstance; } - } - - public override RefineSearchRequest BuildPartial() { - if (resultIsReadOnly) { - return result; - } - resultIsReadOnly = true; - return result.MakeReadOnly(); - } - - public override Builder MergeFrom(pb::IMessageLite other) { - if (other is RefineSearchRequest) { - return MergeFrom((RefineSearchRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(RefineSearchRequest other) { - if (other == global::Google.ProtocolBuffers.TestProtos.RefineSearchRequest.DefaultInstance) return this; - PrepareBuilder(); - if (other.criteria_.Count != 0) { - result.criteria_.Add(other.criteria_); - } - if (other.HasPreviousResults) { - MergePreviousResults(other.PreviousResults); - } - return this; - } - - public override Builder MergeFrom(pb::ICodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - PrepareBuilder(); - uint tag; - string field_name; - while (input.ReadTag(out tag, out field_name)) { - if(tag == 0 && field_name != null) { - int field_ordinal = global::System.Array.BinarySearch(_refineSearchRequestFieldNames, field_name, global::System.StringComparer.Ordinal); - if(field_ordinal >= 0) - tag = _refineSearchRequestFieldTags[field_ordinal]; - else { - ParseUnknownField(input, extensionRegistry, tag, field_name); - continue; - } - } - switch (tag) { - case 0: { - throw pb::InvalidProtocolBufferException.InvalidTag(); - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - return this; - } - ParseUnknownField(input, extensionRegistry, tag, field_name); - break; - } - case 10: { - input.ReadStringArray(tag, field_name, result.criteria_); - break; - } - case 18: { - global::Google.ProtocolBuffers.TestProtos.SearchResponse.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.SearchResponse.CreateBuilder(); - if (result.hasPreviousResults) { - subBuilder.MergeFrom(PreviousResults); - } - input.ReadMessage(subBuilder, extensionRegistry); - PreviousResults = subBuilder.BuildPartial(); - break; - } - } - } - - return this; - } - - - public pbc::IPopsicleList CriteriaList { - get { return PrepareBuilder().criteria_; } - } - public int CriteriaCount { - get { return result.CriteriaCount; } - } - public string GetCriteria(int index) { - return result.GetCriteria(index); - } - public Builder SetCriteria(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.criteria_[index] = value; - return this; - } - public Builder AddCriteria(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.criteria_.Add(value); - return this; - } - public Builder AddRangeCriteria(scg::IEnumerable values) { - PrepareBuilder(); - result.criteria_.Add(values); - return this; - } - public Builder ClearCriteria() { - PrepareBuilder(); - result.criteria_.Clear(); - return this; - } - - public bool HasPreviousResults { - get { return result.hasPreviousResults; } - } - public global::Google.ProtocolBuffers.TestProtos.SearchResponse PreviousResults { - get { return result.PreviousResults; } - set { SetPreviousResults(value); } - } - public Builder SetPreviousResults(global::Google.ProtocolBuffers.TestProtos.SearchResponse value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - result.hasPreviousResults = true; - result.previousResults_ = value; - return this; - } - public Builder SetPreviousResults(global::Google.ProtocolBuffers.TestProtos.SearchResponse.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - PrepareBuilder(); - result.hasPreviousResults = true; - result.previousResults_ = builderForValue.Build(); - return this; - } - public Builder MergePreviousResults(global::Google.ProtocolBuffers.TestProtos.SearchResponse value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - PrepareBuilder(); - if (result.hasPreviousResults && - result.previousResults_ != global::Google.ProtocolBuffers.TestProtos.SearchResponse.DefaultInstance) { - result.previousResults_ = global::Google.ProtocolBuffers.TestProtos.SearchResponse.CreateBuilder(result.previousResults_).MergeFrom(value).BuildPartial(); - } else { - result.previousResults_ = value; - } - result.hasPreviousResults = true; - return this; - } - public Builder ClearPreviousResults() { - PrepareBuilder(); - result.hasPreviousResults = false; - result.previousResults_ = null; - return this; - } - } - static RefineSearchRequest() { - object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestRpcInteropLite.Descriptor, null); - } - } - - #endregion - - #region Services - public partial interface ISearchService { - global::Google.ProtocolBuffers.TestProtos.SearchResponse Search(global::Google.ProtocolBuffers.TestProtos.SearchRequest searchRequest); - global::Google.ProtocolBuffers.TestProtos.SearchResponse RefineSearch(global::Google.ProtocolBuffers.TestProtos.RefineSearchRequest refineSearchRequest); - } - - [global::System.CLSCompliant(false)] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public partial class SearchService : ISearchService, pb::IRpcDispatch, global::System.IDisposable { - private readonly bool dispose; - private readonly pb::IRpcDispatch dispatch; - public SearchService(pb::IRpcDispatch dispatch) : this(dispatch, true) { - } - public SearchService(pb::IRpcDispatch dispatch, bool dispose) { - pb::ThrowHelper.ThrowIfNull(this.dispatch = dispatch, "dispatch"); - this.dispose = dispose && dispatch is global::System.IDisposable; - } - - public void Dispose() { - if (dispose) ((global::System.IDisposable)dispatch).Dispose(); - } - - TMessage pb::IRpcDispatch.CallMethod(string method, pb::IMessageLite request, pb::IBuilderLite response) { - return dispatch.CallMethod(method, request, response); - } - - public global::Google.ProtocolBuffers.TestProtos.SearchResponse Search(global::Google.ProtocolBuffers.TestProtos.SearchRequest searchRequest) { - return dispatch.CallMethod("Search", searchRequest, global::Google.ProtocolBuffers.TestProtos.SearchResponse.CreateBuilder()); - } - - public global::Google.ProtocolBuffers.TestProtos.SearchResponse RefineSearch(global::Google.ProtocolBuffers.TestProtos.RefineSearchRequest refineSearchRequest) { - return dispatch.CallMethod("RefineSearch", refineSearchRequest, global::Google.ProtocolBuffers.TestProtos.SearchResponse.CreateBuilder()); - } - - [global::System.CLSCompliant(false)] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public partial class Dispatch : pb::IRpcDispatch, global::System.IDisposable { - private readonly bool dispose; - private readonly ISearchService implementation; - public Dispatch(ISearchService implementation) : this(implementation, true) { - } - public Dispatch(ISearchService implementation, bool dispose) { - pb::ThrowHelper.ThrowIfNull(this.implementation = implementation, "implementation"); - this.dispose = dispose && implementation is global::System.IDisposable; - } - - public void Dispose() { - if (dispose) ((global::System.IDisposable)implementation).Dispose(); - } - - public TMessage CallMethod(string methodName, pb::IMessageLite request, pb::IBuilderLite response) - where TMessage : pb::IMessageLite - where TBuilder : pb::IBuilderLite { - switch(methodName) { - case "Search": return response.MergeFrom(implementation.Search((global::Google.ProtocolBuffers.TestProtos.SearchRequest)request)).Build(); - case "RefineSearch": return response.MergeFrom(implementation.RefineSearch((global::Google.ProtocolBuffers.TestProtos.RefineSearchRequest)request)).Build(); - default: throw pb::ThrowHelper.CreateMissingMethod(typeof(ISearchService), methodName); - } - } - } - [global::System.CLSCompliant(false)] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public partial class ServerStub : pb::IRpcServerStub, global::System.IDisposable { - private readonly bool dispose; - private readonly pb::IRpcDispatch implementation; - public ServerStub(ISearchService implementation) : this(implementation, true) { - } - public ServerStub(ISearchService implementation, bool dispose) : this(new Dispatch(implementation, dispose), dispose) { - } - public ServerStub(pb::IRpcDispatch implementation) : this(implementation, true) { - } - public ServerStub(pb::IRpcDispatch implementation, bool dispose) { - pb::ThrowHelper.ThrowIfNull(this.implementation = implementation, "implementation"); - this.dispose = dispose && implementation is global::System.IDisposable; - } - - public void Dispose() { - if (dispose) ((global::System.IDisposable)implementation).Dispose(); - } - - public pb::IMessageLite CallMethod(string methodName, pb::ICodedInputStream input, pb::ExtensionRegistry registry) { - switch(methodName) { - case "Search": return implementation.CallMethod(methodName, global::Google.ProtocolBuffers.TestProtos.SearchRequest.ParseFrom(input, registry), global::Google.ProtocolBuffers.TestProtos.SearchResponse.CreateBuilder()); - case "RefineSearch": return implementation.CallMethod(methodName, global::Google.ProtocolBuffers.TestProtos.RefineSearchRequest.ParseFrom(input, registry), global::Google.ProtocolBuffers.TestProtos.SearchResponse.CreateBuilder()); - default: throw pb::ThrowHelper.CreateMissingMethod(typeof(ISearchService), methodName); - } - } - } - } - #endregion - -} - -#endregion Designer generated code diff --git a/src/ProtocolBuffersLite.Test/TestUtil.cs b/src/ProtocolBuffersLite.Test/TestUtil.cs deleted file mode 100644 index 44c09b9..0000000 --- a/src/ProtocolBuffersLite.Test/TestUtil.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Google.ProtocolBuffers -{ - class TestUtil - { - internal static void AssertBytesEqual(byte[] a, byte[] b) - { - if (a == null || b == null) - { - Assert.AreEqual(a, b); - } - else - { - Assert.AreEqual(a.Length, b.Length, "The byte[] is not of the expected length."); - - for (int i = 0; i < a.Length; i++) - { - if (a[i] != b[i]) - { - Assert.AreEqual(a[i], b[i], "Byte[] differs at index " + i); - } - } - } - } - - } -} diff --git a/src/UseVS2008.bat b/src/UseVS2008.bat deleted file mode 100644 index 4cf9738..0000000 --- a/src/UseVS2008.bat +++ /dev/null @@ -1,8 +0,0 @@ -@ECHO OFF -REM ---- Converts the solution to Visual Studio 2008 ---- -PUSHD %~dp0 -ECHO Microsoft Visual Studio Solution File, Format Version 10.00> Temp.sln -ECHO # Visual Studio 2008>> Temp.sln -type ProtocolBuffers.sln | FIND /V " Visual Studio " >> Temp.sln -move /Y Temp.sln ProtocolBuffers.sln -POPD diff --git a/src/UseVS2010.bat b/src/UseVS2010.bat deleted file mode 100644 index 376a08f..0000000 --- a/src/UseVS2010.bat +++ /dev/null @@ -1,8 +0,0 @@ -@ECHO OFF -REM ---- Converts the solution to Visual Studio 2010 ---- -PUSHD %~dp0 -ECHO Microsoft Visual Studio Solution File, Format Version 11.00> Temp.sln -ECHO # Visual Studio 2010>> Temp.sln -type ProtocolBuffers.sln | FIND /V " Visual Studio " >> Temp.sln -move /Y Temp.sln ProtocolBuffers.sln -POPD diff --git a/testdata/golden_message b/testdata/golden_message deleted file mode 100644 index 94898e4..0000000 Binary files a/testdata/golden_message and /dev/null differ diff --git a/testdata/golden_packed_fields_message b/testdata/golden_packed_fields_message deleted file mode 100644 index ee28d38..0000000 Binary files a/testdata/golden_packed_fields_message and /dev/null differ diff --git a/testdata/text_format_unittest_data.txt b/testdata/text_format_unittest_data.txt deleted file mode 100644 index d3e27b7..0000000 --- a/testdata/text_format_unittest_data.txt +++ /dev/null @@ -1,116 +0,0 @@ -optional_int32: 101 -optional_int64: 102 -optional_uint32: 103 -optional_uint64: 104 -optional_sint32: 105 -optional_sint64: 106 -optional_fixed32: 107 -optional_fixed64: 108 -optional_sfixed32: 109 -optional_sfixed64: 110 -optional_float: 111 -optional_double: 112 -optional_bool: true -optional_string: "115" -optional_bytes: "116" -OptionalGroup { - a: 117 -} -optional_nested_message { - bb: 118 -} -optional_foreign_message { - c: 119 -} -optional_import_message { - d: 120 -} -optional_nested_enum: BAZ -optional_foreign_enum: FOREIGN_BAZ -optional_import_enum: IMPORT_BAZ -optional_string_piece: "124" -optional_cord: "125" -repeated_int32: 201 -repeated_int32: 301 -repeated_int64: 202 -repeated_int64: 302 -repeated_uint32: 203 -repeated_uint32: 303 -repeated_uint64: 204 -repeated_uint64: 304 -repeated_sint32: 205 -repeated_sint32: 305 -repeated_sint64: 206 -repeated_sint64: 306 -repeated_fixed32: 207 -repeated_fixed32: 307 -repeated_fixed64: 208 -repeated_fixed64: 308 -repeated_sfixed32: 209 -repeated_sfixed32: 309 -repeated_sfixed64: 210 -repeated_sfixed64: 310 -repeated_float: 211 -repeated_float: 311 -repeated_double: 212 -repeated_double: 312 -repeated_bool: true -repeated_bool: false -repeated_string: "215" -repeated_string: "315" -repeated_bytes: "216" -repeated_bytes: "316" -RepeatedGroup { - a: 217 -} -RepeatedGroup { - a: 317 -} -repeated_nested_message { - bb: 218 -} -repeated_nested_message { - bb: 318 -} -repeated_foreign_message { - c: 219 -} -repeated_foreign_message { - c: 319 -} -repeated_import_message { - d: 220 -} -repeated_import_message { - d: 320 -} -repeated_nested_enum: BAR -repeated_nested_enum: BAZ -repeated_foreign_enum: FOREIGN_BAR -repeated_foreign_enum: FOREIGN_BAZ -repeated_import_enum: IMPORT_BAR -repeated_import_enum: IMPORT_BAZ -repeated_string_piece: "224" -repeated_string_piece: "324" -repeated_cord: "225" -repeated_cord: "325" -default_int32: 401 -default_int64: 402 -default_uint32: 403 -default_uint64: 404 -default_sint32: 405 -default_sint64: 406 -default_fixed32: 407 -default_fixed64: 408 -default_sfixed32: 409 -default_sfixed64: 410 -default_float: 411 -default_double: 412 -default_bool: false -default_string: "415" -default_bytes: "416" -default_nested_enum: FOO -default_foreign_enum: FOREIGN_FOO -default_import_enum: IMPORT_FOO -default_string_piece: "424" -default_cord: "425" diff --git a/testdata/text_format_unittest_extensions_data.txt b/testdata/text_format_unittest_extensions_data.txt deleted file mode 100644 index 4fc282c..0000000 --- a/testdata/text_format_unittest_extensions_data.txt +++ /dev/null @@ -1,116 +0,0 @@ -[protobuf_unittest.optional_int32_extension]: 101 -[protobuf_unittest.optional_int64_extension]: 102 -[protobuf_unittest.optional_uint32_extension]: 103 -[protobuf_unittest.optional_uint64_extension]: 104 -[protobuf_unittest.optional_sint32_extension]: 105 -[protobuf_unittest.optional_sint64_extension]: 106 -[protobuf_unittest.optional_fixed32_extension]: 107 -[protobuf_unittest.optional_fixed64_extension]: 108 -[protobuf_unittest.optional_sfixed32_extension]: 109 -[protobuf_unittest.optional_sfixed64_extension]: 110 -[protobuf_unittest.optional_float_extension]: 111 -[protobuf_unittest.optional_double_extension]: 112 -[protobuf_unittest.optional_bool_extension]: true -[protobuf_unittest.optional_string_extension]: "115" -[protobuf_unittest.optional_bytes_extension]: "116" -[protobuf_unittest.optionalgroup_extension] { - a: 117 -} -[protobuf_unittest.optional_nested_message_extension] { - bb: 118 -} -[protobuf_unittest.optional_foreign_message_extension] { - c: 119 -} -[protobuf_unittest.optional_import_message_extension] { - d: 120 -} -[protobuf_unittest.optional_nested_enum_extension]: BAZ -[protobuf_unittest.optional_foreign_enum_extension]: FOREIGN_BAZ -[protobuf_unittest.optional_import_enum_extension]: IMPORT_BAZ -[protobuf_unittest.optional_string_piece_extension]: "124" -[protobuf_unittest.optional_cord_extension]: "125" -[protobuf_unittest.repeated_int32_extension]: 201 -[protobuf_unittest.repeated_int32_extension]: 301 -[protobuf_unittest.repeated_int64_extension]: 202 -[protobuf_unittest.repeated_int64_extension]: 302 -[protobuf_unittest.repeated_uint32_extension]: 203 -[protobuf_unittest.repeated_uint32_extension]: 303 -[protobuf_unittest.repeated_uint64_extension]: 204 -[protobuf_unittest.repeated_uint64_extension]: 304 -[protobuf_unittest.repeated_sint32_extension]: 205 -[protobuf_unittest.repeated_sint32_extension]: 305 -[protobuf_unittest.repeated_sint64_extension]: 206 -[protobuf_unittest.repeated_sint64_extension]: 306 -[protobuf_unittest.repeated_fixed32_extension]: 207 -[protobuf_unittest.repeated_fixed32_extension]: 307 -[protobuf_unittest.repeated_fixed64_extension]: 208 -[protobuf_unittest.repeated_fixed64_extension]: 308 -[protobuf_unittest.repeated_sfixed32_extension]: 209 -[protobuf_unittest.repeated_sfixed32_extension]: 309 -[protobuf_unittest.repeated_sfixed64_extension]: 210 -[protobuf_unittest.repeated_sfixed64_extension]: 310 -[protobuf_unittest.repeated_float_extension]: 211 -[protobuf_unittest.repeated_float_extension]: 311 -[protobuf_unittest.repeated_double_extension]: 212 -[protobuf_unittest.repeated_double_extension]: 312 -[protobuf_unittest.repeated_bool_extension]: true -[protobuf_unittest.repeated_bool_extension]: false -[protobuf_unittest.repeated_string_extension]: "215" -[protobuf_unittest.repeated_string_extension]: "315" -[protobuf_unittest.repeated_bytes_extension]: "216" -[protobuf_unittest.repeated_bytes_extension]: "316" -[protobuf_unittest.repeatedgroup_extension] { - a: 217 -} -[protobuf_unittest.repeatedgroup_extension] { - a: 317 -} -[protobuf_unittest.repeated_nested_message_extension] { - bb: 218 -} -[protobuf_unittest.repeated_nested_message_extension] { - bb: 318 -} -[protobuf_unittest.repeated_foreign_message_extension] { - c: 219 -} -[protobuf_unittest.repeated_foreign_message_extension] { - c: 319 -} -[protobuf_unittest.repeated_import_message_extension] { - d: 220 -} -[protobuf_unittest.repeated_import_message_extension] { - d: 320 -} -[protobuf_unittest.repeated_nested_enum_extension]: BAR -[protobuf_unittest.repeated_nested_enum_extension]: BAZ -[protobuf_unittest.repeated_foreign_enum_extension]: FOREIGN_BAR -[protobuf_unittest.repeated_foreign_enum_extension]: FOREIGN_BAZ -[protobuf_unittest.repeated_import_enum_extension]: IMPORT_BAR -[protobuf_unittest.repeated_import_enum_extension]: IMPORT_BAZ -[protobuf_unittest.repeated_string_piece_extension]: "224" -[protobuf_unittest.repeated_string_piece_extension]: "324" -[protobuf_unittest.repeated_cord_extension]: "225" -[protobuf_unittest.repeated_cord_extension]: "325" -[protobuf_unittest.default_int32_extension]: 401 -[protobuf_unittest.default_int64_extension]: 402 -[protobuf_unittest.default_uint32_extension]: 403 -[protobuf_unittest.default_uint64_extension]: 404 -[protobuf_unittest.default_sint32_extension]: 405 -[protobuf_unittest.default_sint64_extension]: 406 -[protobuf_unittest.default_fixed32_extension]: 407 -[protobuf_unittest.default_fixed64_extension]: 408 -[protobuf_unittest.default_sfixed32_extension]: 409 -[protobuf_unittest.default_sfixed64_extension]: 410 -[protobuf_unittest.default_float_extension]: 411 -[protobuf_unittest.default_double_extension]: 412 -[protobuf_unittest.default_bool_extension]: false -[protobuf_unittest.default_string_extension]: "415" -[protobuf_unittest.default_bytes_extension]: "416" -[protobuf_unittest.default_nested_enum_extension]: FOO -[protobuf_unittest.default_foreign_enum_extension]: FOREIGN_FOO -[protobuf_unittest.default_import_enum_extension]: IMPORT_FOO -[protobuf_unittest.default_string_piece_extension]: "424" -[protobuf_unittest.default_cord_extension]: "425"